/* ==========================================================================
   Emm JS - nightly build 09-07-2024
   ========================================================================== */

/* License
   ========================================================================== */

/**
 * EMM License to be added
 *
 **/



/* Libraries
   ========================================================================== */

/**
 * jQuery JavaScript Library v3.5.1
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * (c) 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Licensed under MIT (http://jquery.org/license)
 *
 * http://jquery.com
 **/

/**
 * Lo-Dash 4.17.21 (Custom Build)
 *
 * Build: `lodash -o ./dist/lodash.compat.js`
 *
 * Based on Underscore.js 1.8.3
 * Licensed under MIT (http://underscorejs.org/LICENSE)
 * (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 *
 * (c) 2012-2013 The Dojo Foundation http://dojofoundation.org/
 * Licensed under MIT (http://lodash.com/license)
 *
 * https://lodash.com/
 **/

 /**
 * D3.js 3.5.5
 *
 * Licensed under MIT (https://github.com/mbostock/d3/blob/master/LICENSE)
 * (c) 2010-2015, Michael Bostock
 *
 * http://d3js.org/
 **/

  /**
 * C3.js 0.4.10
 *
 * Licensed under MIT (https://github.com/masayuki0812/c3/blob/master/LICENSE)
 * (c) 2013 Masayuki Tanaka
 *
 * http://c3js.org/
 **/

/**
 * jQuery Plugins
 *
 * jquery-i18n v1.1.1
 * Licensed under MIT
 * (c) 2010 Dave Perrett
 * https://github.com/recurser/jquery-i18n
 *
 * jquery-migrate v3.3.2
 * Licensed under MIT
 * (c) 2005, 2013 jQuery Foundation, Inc. and other contributors
 * https://github.com/jquery/jquery-migrate
 *
 * jquery-select2 v3.5.2
 * Licensed under Apache License, Version 2.0 & GNU General Public License version 2
 * (c) 2012 Igor Vaynberg
 * https://ivaynberg.github.io/select2/
 *
 * jquery-mousewheel v3.1.9
 * Licensed under MIT
 * (c) 2013 Brandon Aaron
 * http://brandon.aaron.sh
 *
 * jquery-perfect-scrollbar v0.5.7
 * Licensed under MIT
 * (c) 2012, 2014 Hyunje Alex Jun and other contributors
 * https://noraesae.github.io/perfect-scrollbar/
 *
 * jquery DoubleScroll v0.4
 * Dual licensed under the MIT and GPL licenses
 * (c) Pawel Suwala, Antoine Vianey
 * https://github.com/avianey/jqDoubleScroll
 *
 * jquery Endless Scroll
 * Dual licensed under the MIT and GPL licenses
 * (c) 2008-2012 Fred Wu
 * https://github.com/fredwu/jquery-endless-scroll
 *
 * jQuery File Upload Plugin
 * Licensed under the MIT license
 * (c) 2010, Sebastian Tschan
 * https://github.com/blueimp/jQuery-File-Upload
 **/

/**
 * Bootstrap Components v3.4.1
 *
 * dropdown.js
 * modal.js
 * popover.js
 * tooltip.js
 *
 * (c) 2011-2019 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 *
 * http://getbootstrap.com/
 **/

/**
 * Bootstrap Extensions
 *
 * bootstrap-slider v4.8.1
 * Licensed under MIT
 * (c) 2015 Kyle Kemp, Rohit Kalkur, and contributors
 *
 * bootstrap-colorpicker v2.5.2
 * Licensed under Apache License v2.0
 * (c) 2012 Stefan Petre
 *
 **/

/**
 * jQuery UI v1.13.1
 *
 * core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
 *
 * (c) 2014 jQuery Foundation and other contributors
 * Licensed under MIT
 *
 * http://jqueryui.com
 **/

/**
 * Pickadate v3.5.6
 *
 * date.js
 * time.js
 * legacy.js
 *
 * (c) 2014 Amsul, http://amsul.ca
 * Licensed under https://github.com/amsul/pickadate.js/blob/3.5.6/LICENSE.md
 *
 * https://amsul.github.io/pickadate.js
 **/

/**
 * Ace Editor
 *
 * Distributed under the BSD license:

 * Copyright (c) 2010, Ajax.org B.V.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Ajax.org B.V. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * http://ace.c9.io/
 **/

/**
 * iFrame Resizer v4.3.2
 *
 * (c) 2014 David J. Bradshaw - dave@bradshaw.net
 * Licensed under MIT
 *
 * https://davidjbradshaw.github.io/iframe-resizer/
 **/

/**
 * Toastr (modified version)
 *
 * (c) 2012-2014 John Papa and Hans Fjällemark
 * Licensed under MIT
 *
 * https://github.com/CodeSeven/toastr
 **/

/**
 * EmojiOne Area v v3.4.1
 *
 * EmojiOneArea is released under the MIT license.
 *
 * Copyright (c) 2015-2017 Andrey Izman <izmanw@gmail.com>
 *
 * 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(e,t){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=e.document?t(e,true):function(e){if(!e.document){throw new Error("jQuery requires a window with a document")}return t(e)}}else{t(e)}})(typeof window!=="undefined"?window:this,function(A,L){"use strict";var t=[];var F=Object.getPrototypeOf;var s=t.slice;var G=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)};var $=t.push;var W=t.indexOf;var H={};var j=H.toString;var B=H.hasOwnProperty;var V=B.toString;var z=V.call(Object);var g={};var v=function e(t){return typeof t==="function"&&typeof t.nodeType!=="number"&&typeof t.item!=="function"};var m=function e(t){return t!=null&&t===t.window};var E=A.document;var U={type:true,src:true,nonce:true,noModule:true};function Y(e,t,i){i=i||E;var n,r,o=i.createElement("script");o.text=e;if(t){for(n in U){r=t[n]||t.getAttribute&&t.getAttribute(n);if(r){o.setAttribute(n,r)}}}i.head.appendChild(o).parentNode.removeChild(o)}function y(e){if(e==null){return e+""}return typeof e==="object"||typeof e==="function"?H[j.call(e)]||"object":typeof e}var q="3.5.1",x=function(e,t){return new x.fn.init(e,t)};x.fn=x.prototype={jquery:q,constructor:x,length:0,toArray:function(){return s.call(this)},get:function(e){if(e==null){return s.call(this)}return e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);t.prevObject=this;return t},each:function(e){return x.each(this,e)},map:function(i){return this.pushStack(x.map(this,function(e,t){return i.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(x.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:$,sort:t.sort,splice:t.splice};x.extend=x.fn.extend=function(){var e,t,i,n,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=false;if(typeof a==="boolean"){u=a;a=arguments[s]||{};s++}if(typeof a!=="object"&&!v(a)){a={}}if(s===l){a=this;s--}for(;s<l;s++){if((e=arguments[s])!=null){for(t in e){n=e[t];if(t==="__proto__"||a===n){continue}if(u&&n&&(x.isPlainObject(n)||(r=Array.isArray(n)))){i=a[t];if(r&&!Array.isArray(i)){o=[]}else if(!r&&!x.isPlainObject(i)){o={}}else{o=i}r=false;a[t]=x.extend(u,o,n)}else if(n!==undefined){a[t]=n}}}}return a};x.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:true,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,i;if(!e||j.call(e)!=="[object Object]"){return false}t=F(e);if(!t){return true}i=B.call(t,"constructor")&&t.constructor;return typeof i==="function"&&V.call(i)===z},isEmptyObject:function(e){var t;for(t in e){return false}return true},globalEval:function(e,t,i){Y(e,{nonce:t&&t.nonce},i)},each:function(e,t){var i,n=0;if(X(e)){i=e.length;for(;n<i;n++){if(t.call(e[n],n,e[n])===false){break}}}else{for(n in e){if(t.call(e[n],n,e[n])===false){break}}}return e},makeArray:function(e,t){var i=t||[];if(e!=null){if(X(Object(e))){x.merge(i,typeof e==="string"?[e]:e)}else{$.call(i,e)}}return i},inArray:function(e,t,i){return t==null?-1:W.call(t,e,i)},merge:function(e,t){var i=+t.length,n=0,r=e.length;for(;n<i;n++){e[r++]=t[n]}e.length=r;return e},grep:function(e,t,i){var n,r=[],o=0,a=e.length,s=!i;for(;o<a;o++){n=!t(e[o],o);if(n!==s){r.push(e[o])}}return r},map:function(e,t,i){var n,r,o=0,a=[];if(X(e)){n=e.length;for(;o<n;o++){r=t(e[o],o,i);if(r!=null){a.push(r)}}}else{for(o in e){r=t(e[o],o,i);if(r!=null){a.push(r)}}}return G(a)},guid:1,support:g});if(typeof Symbol==="function"){x.fn[Symbol.iterator]=t[Symbol.iterator]}x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){H["[object "+t+"]"]=t.toLowerCase()});function X(e){var t=!!e&&"length"in e&&e.length,i=y(e);if(v(e)||m(e)){return false}return i==="array"||t===0||typeof t==="number"&&t>0&&t-1 in e}var e=function(L){var e,p,_,o,F,h,G,$,w,l,u,C,A,r,E,g,a,s,v,x="sizzle"+1*new Date,c=L.document,T=0,W=0,H=n(),j=n(),B=n(),m=n(),V=function(e,t){if(e===t){u=true}return 0},z={}.hasOwnProperty,t=[],U=t.pop,Y=t.push,S=t.push,q=t.slice,y=function(e,t){var i=0,n=e.length;for(;i<n;i++){if(e[i]===t){return i}}return-1},X="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|"+"ismap|loop|multiple|open|readonly|required|scoped",d="[\\x20\\t\\r\\n\\f]",i="(?:\\\\[\\da-fA-F]{1,6}"+d+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",K="\\["+d+"*("+i+")(?:"+d+"*([*^$|!~]?=)"+d+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+i+"))|)"+d+"*\\]",Q=":("+i+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+K+")*)|"+".*"+")\\)|)",Z=new RegExp(d+"+","g"),b=new RegExp("^"+d+"+|((?:^|[^\\\\])(?:\\\\.)*)"+d+"+$","g"),J=new RegExp("^"+d+"*,"+d+"*"),ee=new RegExp("^"+d+"*([>+~]|"+d+")"+d+"*"),te=new RegExp(d+"|>"),ie=new RegExp(Q),ne=new RegExp("^"+i+"$"),f={ID:new RegExp("^#("+i+")"),CLASS:new RegExp("^\\.("+i+")"),TAG:new RegExp("^("+i+"|[*])"),ATTR:new RegExp("^"+K),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+d+"*(even|odd|(([+-]|)(\\d*)n|)"+d+"*(?:([+-]|)"+d+"*(\\d+)|))"+d+"*\\)|)","i"),bool:new RegExp("^(?:"+X+")$","i"),needsContext:new RegExp("^"+d+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+d+"*((?:-\\d)?\\d*)"+d+"*\\)|)(?=[^-]|$)","i")},re=/HTML$/i,oe=/^(?:input|select|textarea|button)$/i,ae=/^h\d$/i,D=/^[^{]+\{\s*\[native \w/,se=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,le=/[+~]/,k=new RegExp("\\\\[\\da-fA-F]{1,6}"+d+"?|\\\\([^\\r\\n\\f])","g"),O=function(e,t){var i="0x"+e.slice(1)-65536;return t?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320)},ue=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ce=function(e,t){if(t){if(e==="\0"){return""}return e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" "}return"\\"+e},de=function(){C()},fe=_e(function(e){return e.disabled===true&&e.nodeName.toLowerCase()==="fieldset"},{dir:"parentNode",next:"legend"});try{S.apply(t=q.call(c.childNodes),c.childNodes);t[c.childNodes.length].nodeType}catch(e){S={apply:t.length?function(e,t){Y.apply(e,q.call(t))}:function(e,t){var i=e.length,n=0;while(e[i++]=t[n++]){}e.length=i-1}}}function R(t,e,i,n){var r,o,a,s,l,u,c,d=e&&e.ownerDocument,f=e?e.nodeType:9;i=i||[];if(typeof t!=="string"||!t||f!==1&&f!==9&&f!==11){return i}if(!n){C(e);e=e||A;if(E){if(f!==11&&(l=se.exec(t))){if(r=l[1]){if(f===9){if(a=e.getElementById(r)){if(a.id===r){i.push(a);return i}}else{return i}}else{if(d&&(a=d.getElementById(r))&&v(e,a)&&a.id===r){i.push(a);return i}}}else if(l[2]){S.apply(i,e.getElementsByTagName(t));return i}else if((r=l[3])&&p.getElementsByClassName&&e.getElementsByClassName){S.apply(i,e.getElementsByClassName(r));return i}}if(p.qsa&&!m[t+" "]&&(!g||!g.test(t))&&(f!==1||e.nodeName.toLowerCase()!=="object")){c=t;d=e;if(f===1&&(te.test(t)||ee.test(t))){d=le.test(t)&&ye(e.parentNode)||e;if(d!==e||!p.scope){if(s=e.getAttribute("id")){s=s.replace(ue,ce)}else{e.setAttribute("id",s=x)}}u=h(t);o=u.length;while(o--){u[o]=(s?"#"+s:":scope")+" "+M(u[o])}c=u.join(",")}try{S.apply(i,d.querySelectorAll(c));return i}catch(e){m(t,true)}finally{if(s===x){e.removeAttribute("id")}}}}}return $(t.replace(b,"$1"),e,i,n)}function n(){var i=[];function n(e,t){if(i.push(e+" ")>_.cacheLength){delete n[i.shift()]}return n[e+" "]=t}return n}function N(e){e[x]=true;return e}function I(e){var t=A.createElement("fieldset");try{return!!e(t)}catch(e){return false}finally{if(t.parentNode){t.parentNode.removeChild(t)}t=null}}function pe(e,t){var i=e.split("|"),n=i.length;while(n--){_.attrHandle[i[n]]=t}}function he(e,t){var i=t&&e,n=i&&e.nodeType===1&&t.nodeType===1&&e.sourceIndex-t.sourceIndex;if(n){return n}if(i){while(i=i.nextSibling){if(i===t){return-1}}}return e?1:-1}function ge(i){return function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type===i}}function ve(i){return function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&e.type===i}}function me(t){return function(e){if("form"in e){if(e.parentNode&&e.disabled===false){if("label"in e){if("label"in e.parentNode){return e.parentNode.disabled===t}else{return e.disabled===t}}return e.isDisabled===t||e.isDisabled!==!t&&fe(e)===t}return e.disabled===t}else if("label"in e){return e.disabled===t}return false}}function P(a){return N(function(o){o=+o;return N(function(e,t){var i,n=a([],e.length,o),r=n.length;while(r--){if(e[i=n[r]]){e[i]=!(t[i]=e[i])}}})})}function ye(e){return e&&typeof e.getElementsByTagName!=="undefined"&&e}p=R.support={};F=R.isXML=function(e){var t=e.namespaceURI,i=(e.ownerDocument||e).documentElement;return!re.test(t||i&&i.nodeName||"HTML")};C=R.setDocument=function(e){var t,i,n=e?e.ownerDocument||e:c;if(n==A||n.nodeType!==9||!n.documentElement){return A}A=n;r=A.documentElement;E=!F(A);if(c!=A&&(i=A.defaultView)&&i.top!==i){if(i.addEventListener){i.addEventListener("unload",de,false)}else if(i.attachEvent){i.attachEvent("onunload",de)}}p.scope=I(function(e){r.appendChild(e).appendChild(A.createElement("div"));return typeof e.querySelectorAll!=="undefined"&&!e.querySelectorAll(":scope fieldset div").length});p.attributes=I(function(e){e.className="i";return!e.getAttribute("className")});p.getElementsByTagName=I(function(e){e.appendChild(A.createComment(""));return!e.getElementsByTagName("*").length});p.getElementsByClassName=D.test(A.getElementsByClassName);p.getById=I(function(e){r.appendChild(e).id=x;return!A.getElementsByName||!A.getElementsByName(x).length});if(p.getById){_.filter["ID"]=function(e){var t=e.replace(k,O);return function(e){return e.getAttribute("id")===t}};_.find["ID"]=function(e,t){if(typeof t.getElementById!=="undefined"&&E){var i=t.getElementById(e);return i?[i]:[]}}}else{_.filter["ID"]=function(e){var i=e.replace(k,O);return function(e){var t=typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id");return t&&t.value===i}};_.find["ID"]=function(e,t){if(typeof t.getElementById!=="undefined"&&E){var i,n,r,o=t.getElementById(e);if(o){i=o.getAttributeNode("id");if(i&&i.value===e){return[o]}r=t.getElementsByName(e);n=0;while(o=r[n++]){i=o.getAttributeNode("id");if(i&&i.value===e){return[o]}}}return[]}}}_.find["TAG"]=p.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!=="undefined"){return t.getElementsByTagName(e)}else if(p.qsa){return t.querySelectorAll(e)}}:function(e,t){var i,n=[],r=0,o=t.getElementsByTagName(e);if(e==="*"){while(i=o[r++]){if(i.nodeType===1){n.push(i)}}return n}return o};_.find["CLASS"]=p.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!=="undefined"&&E){return t.getElementsByClassName(e)}};a=[];g=[];if(p.qsa=D.test(A.querySelectorAll)){I(function(e){var t;r.appendChild(e).innerHTML="<a id='"+x+"'></a>"+"<select id='"+x+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(e.querySelectorAll("[msallowcapture^='']").length){g.push("[*^$]="+d+"*(?:''|\"\")")}if(!e.querySelectorAll("[selected]").length){g.push("\\["+d+"*(?:value|"+X+")")}if(!e.querySelectorAll("[id~="+x+"-]").length){g.push("~=")}t=A.createElement("input");t.setAttribute("name","");e.appendChild(t);if(!e.querySelectorAll("[name='']").length){g.push("\\["+d+"*name"+d+"*="+d+"*(?:''|\"\")")}if(!e.querySelectorAll(":checked").length){g.push(":checked")}if(!e.querySelectorAll("a#"+x+"+*").length){g.push(".#.+[+~]")}e.querySelectorAll("\\\f");g.push("[\\r\\n\\f]")});I(function(e){e.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";var t=A.createElement("input");t.setAttribute("type","hidden");e.appendChild(t).setAttribute("name","D");if(e.querySelectorAll("[name=d]").length){g.push("name"+d+"*[*^$|!~]?=")}if(e.querySelectorAll(":enabled").length!==2){g.push(":enabled",":disabled")}r.appendChild(e).disabled=true;if(e.querySelectorAll(":disabled").length!==2){g.push(":enabled",":disabled")}e.querySelectorAll("*,:x");g.push(",.*:")})}if(p.matchesSelector=D.test(s=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.oMatchesSelector||r.msMatchesSelector)){I(function(e){p.disconnectedMatch=s.call(e,"*");s.call(e,"[s!='']:x");a.push("!=",Q)})}g=g.length&&new RegExp(g.join("|"));a=a.length&&new RegExp(a.join("|"));t=D.test(r.compareDocumentPosition);v=t||D.test(r.contains)?function(e,t){var i=e.nodeType===9?e.documentElement:e,n=t&&t.parentNode;return e===n||!!(n&&n.nodeType===1&&(i.contains?i.contains(n):e.compareDocumentPosition&&e.compareDocumentPosition(n)&16))}:function(e,t){if(t){while(t=t.parentNode){if(t===e){return true}}}return false};V=t?function(e,t){if(e===t){u=true;return 0}var i=!e.compareDocumentPosition-!t.compareDocumentPosition;if(i){return i}i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1;if(i&1||!p.sortDetached&&t.compareDocumentPosition(e)===i){if(e==A||e.ownerDocument==c&&v(c,e)){return-1}if(t==A||t.ownerDocument==c&&v(c,t)){return 1}return l?y(l,e)-y(l,t):0}return i&4?-1:1}:function(e,t){if(e===t){u=true;return 0}var i,n=0,r=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!r||!o){return e==A?-1:t==A?1:r?-1:o?1:l?y(l,e)-y(l,t):0}else if(r===o){return he(e,t)}i=e;while(i=i.parentNode){a.unshift(i)}i=t;while(i=i.parentNode){s.unshift(i)}while(a[n]===s[n]){n++}return n?he(a[n],s[n]):a[n]==c?-1:s[n]==c?1:0};return A};R.matches=function(e,t){return R(e,null,null,t)};R.matchesSelector=function(e,t){C(e);if(p.matchesSelector&&E&&!m[t+" "]&&(!a||!a.test(t))&&(!g||!g.test(t))){try{var i=s.call(e,t);if(i||p.disconnectedMatch||e.document&&e.document.nodeType!==11){return i}}catch(e){m(t,true)}}return R(t,A,null,[e]).length>0};R.contains=function(e,t){if((e.ownerDocument||e)!=A){C(e)}return v(e,t)};R.attr=function(e,t){if((e.ownerDocument||e)!=A){C(e)}var i=_.attrHandle[t.toLowerCase()],n=i&&z.call(_.attrHandle,t.toLowerCase())?i(e,t,!E):undefined;return n!==undefined?n:p.attributes||!E?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null};R.escape=function(e){return(e+"").replace(ue,ce)};R.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};R.uniqueSort=function(e){var t,i=[],n=0,r=0;u=!p.detectDuplicates;l=!p.sortStable&&e.slice(0);e.sort(V);if(u){while(t=e[r++]){if(t===e[r]){n=i.push(r)}}while(n--){e.splice(i[n],1)}}l=null;return e};o=R.getText=function(e){var t,i="",n=0,r=e.nodeType;if(!r){while(t=e[n++]){i+=o(t)}}else if(r===1||r===9||r===11){if(typeof e.textContent==="string"){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){i+=o(e)}}}else if(r===3||r===4){return e.nodeValue}return i};_=R.selectors={cacheLength:50,createPseudo:N,match:f,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(k,O);e[3]=(e[3]||e[4]||e[5]||"").replace(k,O);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){R.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+(e[7]+e[8]||e[3]==="odd")}else if(e[3]){R.error(e[0])}return e},PSEUDO:function(e){var t,i=!e[6]&&e[2];if(f["CHILD"].test(e[0])){return null}if(e[3]){e[2]=e[4]||e[5]||""}else if(i&&ie.test(i)&&(t=h(i,true))&&(t=i.indexOf(")",i.length-t)-i.length)){e[0]=e[0].slice(0,t);e[2]=i.slice(0,t)}return e.slice(0,3)}},filter:{TAG:function(e){var t=e.replace(k,O).toLowerCase();return e==="*"?function(){return true}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=H[e+" "];return t||(t=new RegExp("(^|"+d+")"+e+"("+d+"|$)"))&&H(e,function(e){return t.test(typeof e.className==="string"&&e.className||typeof e.getAttribute!=="undefined"&&e.getAttribute("class")||"")})},ATTR:function(i,n,r){return function(e){var t=R.attr(e,i);if(t==null){return n==="!="}if(!n){return true}t+="";return n==="="?t===r:n==="!="?t!==r:n==="^="?r&&t.indexOf(r)===0:n==="*="?r&&t.indexOf(r)>-1:n==="$="?r&&t.slice(-r.length)===r:n==="~="?(" "+t.replace(Z," ")+" ").indexOf(r)>-1:n==="|="?t===r||t.slice(0,r.length+1)===r+"-":false}},CHILD:function(h,e,t,g,v){var m=h.slice(0,3)!=="nth",y=h.slice(-4)!=="last",b=e==="of-type";return g===1&&v===0?function(e){return!!e.parentNode}:function(e,t,i){var n,r,o,a,s,l,u=m!==y?"nextSibling":"previousSibling",c=e.parentNode,d=b&&e.nodeName.toLowerCase(),f=!i&&!b,p=false;if(c){if(m){while(u){a=e;while(a=a[u]){if(b?a.nodeName.toLowerCase()===d:a.nodeType===1){return false}}l=u=h==="only"&&!l&&"nextSibling"}return true}l=[y?c.firstChild:c.lastChild];if(y&&f){a=c;o=a[x]||(a[x]={});r=o[a.uniqueID]||(o[a.uniqueID]={});n=r[h]||[];s=n[0]===T&&n[1];p=s&&n[2];a=s&&c.childNodes[s];while(a=++s&&a&&a[u]||(p=s=0)||l.pop()){if(a.nodeType===1&&++p&&a===e){r[h]=[T,s,p];break}}}else{if(f){a=e;o=a[x]||(a[x]={});r=o[a.uniqueID]||(o[a.uniqueID]={});n=r[h]||[];s=n[0]===T&&n[1];p=s}if(p===false){while(a=++s&&a&&a[u]||(p=s=0)||l.pop()){if((b?a.nodeName.toLowerCase()===d:a.nodeType===1)&&++p){if(f){o=a[x]||(a[x]={});r=o[a.uniqueID]||(o[a.uniqueID]={});r[h]=[T,p]}if(a===e){break}}}}}p-=v;return p===g||p%g===0&&p/g>=0}}},PSEUDO:function(e,o){var t,a=_.pseudos[e]||_.setFilters[e.toLowerCase()]||R.error("unsupported pseudo: "+e);if(a[x]){return a(o)}if(a.length>1){t=[e,e,"",o];return _.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,t){var i,n=a(e,o),r=n.length;while(r--){i=y(e,n[r]);e[i]=!(t[i]=n[r])}}):function(e){return a(e,0,t)}}return a}},pseudos:{not:N(function(e){var n=[],r=[],s=G(e.replace(b,"$1"));return s[x]?N(function(e,t,i,n){var r,o=s(e,null,n,[]),a=e.length;while(a--){if(r=o[a]){e[a]=!(t[a]=r)}}}):function(e,t,i){n[0]=e;s(n,null,i,r);n[0]=null;return!r.pop()}}),has:N(function(t){return function(e){return R(t,e).length>0}}),contains:N(function(t){t=t.replace(k,O);return function(e){return(e.textContent||o(e)).indexOf(t)>-1}}),lang:N(function(i){if(!ne.test(i||"")){R.error("unsupported lang: "+i)}i=i.replace(k,O).toLowerCase();return function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){t=t.toLowerCase();return t===i||t.indexOf(i+"-")===0}}while((e=e.parentNode)&&e.nodeType===1);return false}}),target:function(e){var t=L.location&&L.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(false),disabled:me(true),checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeType<6){return false}}return true},parent:function(e){return!_.pseudos["empty"](e)},header:function(e){return ae.test(e.nodeName)},input:function(e){return oe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:P(function(){return[0]}),last:P(function(e,t){return[t-1]}),eq:P(function(e,t,i){return[i<0?i+t:i]}),even:P(function(e,t){var i=0;for(;i<t;i+=2){e.push(i)}return e}),odd:P(function(e,t){var i=1;for(;i<t;i+=2){e.push(i)}return e}),lt:P(function(e,t,i){var n=i<0?i+t:i>t?t:i;for(;--n>=0;){e.push(n)}return e}),gt:P(function(e,t,i){var n=i<0?i+t:i;for(;++n<t;){e.push(n)}return e})}};_.pseudos["nth"]=_.pseudos["eq"];for(e in{radio:true,checkbox:true,file:true,password:true,image:true}){_.pseudos[e]=ge(e)}for(e in{submit:true,reset:true}){_.pseudos[e]=ve(e)}function be(){}be.prototype=_.filters=_.pseudos;_.setFilters=new be;h=R.tokenize=function(e,t){var i,n,r,o,a,s,l,u=j[e+" "];if(u){return t?0:u.slice(0)}a=e;s=[];l=_.preFilter;while(a){if(!i||(n=J.exec(a))){if(n){a=a.slice(n[0].length)||a}s.push(r=[])}i=false;if(n=ee.exec(a)){i=n.shift();r.push({value:i,type:n[0].replace(b," ")});a=a.slice(i.length)}for(o in _.filter){if((n=f[o].exec(a))&&(!l[o]||(n=l[o](n)))){i=n.shift();r.push({value:i,type:o,matches:n});a=a.slice(i.length)}}if(!i){break}}return t?a.length:a?R.error(e):j(e,s).slice(0)};function M(e){var t=0,i=e.length,n="";for(;t<i;t++){n+=e[t].value}return n}function _e(s,e,t){var l=e.dir,u=e.next,c=u||l,d=t&&c==="parentNode",f=W++;return e.first?function(e,t,i){while(e=e[l]){if(e.nodeType===1||d){return s(e,t,i)}}return false}:function(e,t,i){var n,r,o,a=[T,f];if(i){while(e=e[l]){if(e.nodeType===1||d){if(s(e,t,i)){return true}}}}else{while(e=e[l]){if(e.nodeType===1||d){o=e[x]||(e[x]={});r=o[e.uniqueID]||(o[e.uniqueID]={});if(u&&u===e.nodeName.toLowerCase()){e=e[l]||e}else if((n=r[c])&&n[0]===T&&n[1]===f){return a[2]=n[2]}else{r[c]=a;if(a[2]=s(e,t,i)){return true}}}}}return false}}function we(r){return r.length>1?function(e,t,i){var n=r.length;while(n--){if(!r[n](e,t,i)){return false}}return true}:r[0]}function Ce(e,t,i){var n=0,r=t.length;for(;n<r;n++){R(e,t[n],i)}return i}function Ae(e,t,i,n,r){var o,a=[],s=0,l=e.length,u=t!=null;for(;s<l;s++){if(o=e[s]){if(!i||i(o,n,r)){a.push(o);if(u){t.push(s)}}}}return a}function Ee(p,h,g,v,m,e){if(v&&!v[x]){v=Ee(v)}if(m&&!m[x]){m=Ee(m,e)}return N(function(e,t,i,n){var r,o,a,s=[],l=[],u=t.length,c=e||Ce(h||"*",i.nodeType?[i]:i,[]),d=p&&(e||!h)?Ae(c,s,p,i,n):c,f=g?m||(e?p:u||v)?[]:t:d;if(g){g(d,f,i,n)}if(v){r=Ae(f,l);v(r,[],i,n);o=r.length;while(o--){if(a=r[o]){f[l[o]]=!(d[l[o]]=a)}}}if(e){if(m||p){if(m){r=[];o=f.length;while(o--){if(a=f[o]){r.push(d[o]=a)}}m(null,f=[],r,n)}o=f.length;while(o--){if((a=f[o])&&(r=m?y(e,a):s[o])>-1){e[r]=!(t[r]=a)}}}}else{f=Ae(f===t?f.splice(u,f.length):f);if(m){m(null,t,f,n)}else{S.apply(t,f)}}})}function xe(e){var r,t,i,n=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=_e(function(e){return e===r},a,true),u=_e(function(e){return y(r,e)>-1},a,true),c=[function(e,t,i){var n=!o&&(i||t!==w)||((r=t).nodeType?l(e,t,i):u(e,t,i));r=null;return n}];for(;s<n;s++){if(t=_.relative[e[s].type]){c=[_e(we(c),t)]}else{t=_.filter[e[s].type].apply(null,e[s].matches);if(t[x]){i=++s;for(;i<n;i++){if(_.relative[e[i].type]){break}}return Ee(s>1&&we(c),s>1&&M(e.slice(0,s-1).concat({value:e[s-2].type===" "?"*":""})).replace(b,"$1"),t,s<i&&xe(e.slice(s,i)),i<n&&xe(e=e.slice(i)),i<n&&M(e))}c.push(t)}}return we(c)}function Te(v,m){var y=m.length>0,b=v.length>0,e=function(e,t,i,n,r){var o,a,s,l=0,u="0",c=e&&[],d=[],f=w,p=e||b&&_.find["TAG"]("*",r),h=T+=f==null?1:Math.random()||.1,g=p.length;if(r){w=t==A||t||r}for(;u!==g&&(o=p[u])!=null;u++){if(b&&o){a=0;if(!t&&o.ownerDocument!=A){C(o);i=!E}while(s=v[a++]){if(s(o,t||A,i)){n.push(o);break}}if(r){T=h}}if(y){if(o=!s&&o){l--}if(e){c.push(o)}}}l+=u;if(y&&u!==l){a=0;while(s=m[a++]){s(c,d,t,i)}if(e){if(l>0){while(u--){if(!(c[u]||d[u])){d[u]=U.call(n)}}}d=Ae(d)}S.apply(n,d);if(r&&!e&&d.length>0&&l+m.length>1){R.uniqueSort(n)}}if(r){T=h;w=f}return c};return y?N(e):e}G=R.compile=function(e,t){var i,n=[],r=[],o=B[e+" "];if(!o){if(!t){t=h(e)}i=t.length;while(i--){o=xe(t[i]);if(o[x]){n.push(o)}else{r.push(o)}}o=B(e,Te(r,n));o.selector=e}return o};$=R.select=function(e,t,i,n){var r,o,a,s,l,u=typeof e==="function"&&e,c=!n&&h(e=u.selector||e);i=i||[];if(c.length===1){o=c[0]=c[0].slice(0);if(o.length>2&&(a=o[0]).type==="ID"&&t.nodeType===9&&E&&_.relative[o[1].type]){t=(_.find["ID"](a.matches[0].replace(k,O),t)||[])[0];if(!t){return i}else if(u){t=t.parentNode}e=e.slice(o.shift().value.length)}r=f["needsContext"].test(e)?0:o.length;while(r--){a=o[r];if(_.relative[s=a.type]){break}if(l=_.find[s]){if(n=l(a.matches[0].replace(k,O),le.test(o[0].type)&&ye(t.parentNode)||t)){o.splice(r,1);e=n.length&&M(o);if(!e){S.apply(i,n);return i}break}}}}(u||G(e,c))(n,t,!E,i,!t||le.test(e)&&ye(t.parentNode)||t);return i};p.sortStable=x.split("").sort(V).join("")===x;p.detectDuplicates=!!u;C();p.sortDetached=I(function(e){return e.compareDocumentPosition(A.createElement("fieldset"))&1});if(!I(function(e){e.innerHTML="<a href='#'></a>";return e.firstChild.getAttribute("href")==="#"})){pe("type|href|height|width",function(e,t,i){if(!i){return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}})}if(!p.attributes||!I(function(e){e.innerHTML="<input/>";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){pe("value",function(e,t,i){if(!i&&e.nodeName.toLowerCase()==="input"){return e.defaultValue}})}if(!I(function(e){return e.getAttribute("disabled")==null})){pe(X,function(e,t,i){var n;if(!i){return e[t]===true?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}})}return R}(A);x.find=e;x.expr=e.selectors;x.expr[":"]=x.expr.pseudos;x.uniqueSort=x.unique=e.uniqueSort;x.text=e.getText;x.isXMLDoc=e.isXML;x.contains=e.contains;x.escapeSelector=e.escape;var n=function(e,t,i){var n=[],r=i!==undefined;while((e=e[t])&&e.nodeType!==9){if(e.nodeType===1){if(r&&x(e).is(i)){break}n.push(e)}}return n};var K=function(e,t){var i=[];for(;e;e=e.nextSibling){if(e.nodeType===1&&e!==t){i.push(e)}}return i};var Q=x.expr.match.needsContext;function u(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var Z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function J(e,i,n){if(v(i)){return x.grep(e,function(e,t){return!!i.call(e,t,e)!==n})}if(i.nodeType){return x.grep(e,function(e){return e===i!==n})}if(typeof i!=="string"){return x.grep(e,function(e){return W.call(i,e)>-1!==n})}return x.filter(i,e,n)}x.filter=function(e,t,i){var n=t[0];if(i){e=":not("+e+")"}if(t.length===1&&n.nodeType===1){return x.find.matchesSelector(n,e)?[n]:[]}return x.find.matches(e,x.grep(t,function(e){return e.nodeType===1}))};x.fn.extend({find:function(e){var t,i,n=this.length,r=this;if(typeof e!=="string"){return this.pushStack(x(e).filter(function(){for(t=0;t<n;t++){if(x.contains(r[t],this)){return true}}}))}i=this.pushStack([]);for(t=0;t<n;t++){x.find(e,r[t],i)}return n>1?x.uniqueSort(i):i},filter:function(e){return this.pushStack(J(this,e||[],false))},not:function(e){return this.pushStack(J(this,e||[],true))},is:function(e){return!!J(this,typeof e==="string"&&Q.test(e)?x(e):e||[],false).length}});var ee,te=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,ie=x.fn.init=function(e,t,i){var n,r;if(!e){return this}i=i||ee;if(typeof e==="string"){if(e[0]==="<"&&e[e.length-1]===">"&&e.length>=3){n=[null,e,null]}else{n=te.exec(e)}if(n&&(n[1]||!t)){if(n[1]){t=t instanceof x?t[0]:t;x.merge(this,x.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:E,true));if(Z.test(n[1])&&x.isPlainObject(t)){for(n in t){if(v(this[n])){this[n](t[n])}else{this.attr(n,t[n])}}}return this}else{r=E.getElementById(n[2]);if(r){this[0]=r;this.length=1}return this}}else if(!t||t.jquery){return(t||i).find(e)}else{return this.constructor(t).find(e)}}else if(e.nodeType){this[0]=e;this.length=1;return this}else if(v(e)){return i.ready!==undefined?i.ready(e):e(x)}return x.makeArray(e,this)};ie.prototype=x.fn;ee=x(E);var ne=/^(?:parents|prev(?:Until|All))/,re={children:true,contents:true,next:true,prev:true};x.fn.extend({has:function(e){var t=x(e,this),i=t.length;return this.filter(function(){var e=0;for(;e<i;e++){if(x.contains(this,t[e])){return true}}})},closest:function(e,t){var i,n=0,r=this.length,o=[],a=typeof e!=="string"&&x(e);if(!Q.test(e)){for(;n<r;n++){for(i=this[n];i&&i!==t;i=i.parentNode){if(i.nodeType<11&&(a?a.index(i)>-1:i.nodeType===1&&x.find.matchesSelector(i,e))){o.push(i);break}}}}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(e){if(!e){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof e==="string"){return W.call(x(e),this[0])}return W.call(this,e.jquery?e[0]:e)},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});function oe(e,t){while((e=e[t])&&e.nodeType!==1){}return e}x.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return n(e,"parentNode")},parentsUntil:function(e,t,i){return n(e,"parentNode",i)},next:function(e){return oe(e,"nextSibling")},prev:function(e){return oe(e,"previousSibling")},nextAll:function(e){return n(e,"nextSibling")},prevAll:function(e){return n(e,"previousSibling")},nextUntil:function(e,t,i){return n(e,"nextSibling",i)},prevUntil:function(e,t,i){return n(e,"previousSibling",i)},siblings:function(e){return K((e.parentNode||{}).firstChild,e)},children:function(e){return K(e.firstChild)},contents:function(e){if(e.contentDocument!=null&&F(e.contentDocument)){return e.contentDocument}if(u(e,"template")){e=e.content||e}return x.merge([],e.childNodes)}},function(n,r){x.fn[n]=function(e,t){var i=x.map(this,r,e);if(n.slice(-5)!=="Until"){t=e}if(t&&typeof t==="string"){i=x.filter(t,i)}if(this.length>1){if(!re[n]){x.uniqueSort(i)}if(ne.test(n)){i.reverse()}}return this.pushStack(i)}});var T=/[^\x20\t\r\n\f]+/g;function ae(e){var i={};x.each(e.match(T)||[],function(e,t){i[t]=true});return i}x.Callbacks=function(n){n=typeof n==="string"?ae(n):x.extend({},n);var i,e,t,r,o=[],a=[],s=-1,l=function(){r=r||n.once;t=i=true;for(;a.length;s=-1){e=a.shift();while(++s<o.length){if(o[s].apply(e[0],e[1])===false&&n.stopOnFalse){s=o.length;e=false}}}if(!n.memory){e=false}i=false;if(r){if(e){o=[]}else{o=""}}},u={add:function(){if(o){if(e&&!i){s=o.length-1;a.push(e)}(function i(e){x.each(e,function(e,t){if(v(t)){if(!n.unique||!u.has(t)){o.push(t)}}else if(t&&t.length&&y(t)!=="string"){i(t)}})})(arguments);if(e&&!i){l()}}return this},remove:function(){x.each(arguments,function(e,t){var i;while((i=x.inArray(t,o,i))>-1){o.splice(i,1);if(i<=s){s--}}});return this},has:function(e){return e?x.inArray(e,o)>-1:o.length>0},empty:function(){if(o){o=[]}return this},disable:function(){r=a=[];o=e="";return this},disabled:function(){return!o},lock:function(){r=a=[];if(!e&&!i){o=e=""}return this},locked:function(){return!!r},fireWith:function(e,t){if(!r){t=t||[];t=[e,t.slice?t.slice():t];a.push(t);if(!i){l()}}return this},fire:function(){u.fireWith(this,arguments);return this},fired:function(){return!!t}};return u};function c(e){return e}function se(e){throw e}function le(e,t,i,n){var r;try{if(e&&v(r=e.promise)){r.call(e).done(t).fail(i)}else if(e&&v(r=e.then)){r.call(e,t,i)}else{t.apply(undefined,[e].slice(n))}}catch(e){i.apply(undefined,[e])}}x.extend({Deferred:function(e){var o=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",a={state:function(){return r},always:function(){s.done(arguments).fail(arguments);return this},catch:function(e){return a.then(null,e)},pipe:function(){var r=arguments;return x.Deferred(function(n){x.each(o,function(e,t){var i=v(r[t[4]])&&r[t[4]];s[t[1]](function(){var e=i&&i.apply(this,arguments);if(e&&v(e.promise)){e.promise().progress(n.notify).done(n.resolve).fail(n.reject)}else{n[t[0]+"With"](this,i?[e]:arguments)}})});r=null}).promise()},then:function(t,i,n){var l=0;function u(r,o,a,s){return function(){var i=this,n=arguments,e=function(){var e,t;if(r<l){return}e=a.apply(i,n);if(e===o.promise()){throw new TypeError("Thenable self-resolution")}t=e&&(typeof e==="object"||typeof e==="function")&&e.then;if(v(t)){if(s){t.call(e,u(l,o,c,s),u(l,o,se,s))}else{l++;t.call(e,u(l,o,c,s),u(l,o,se,s),u(l,o,c,o.notifyWith))}}else{if(a!==c){i=undefined;n=[e]}(s||o.resolveWith)(i,n)}},t=s?e:function(){try{e()}catch(e){if(x.Deferred.exceptionHook){x.Deferred.exceptionHook(e,t.stackTrace)}if(r+1>=l){if(a!==se){i=undefined;n=[e]}o.rejectWith(i,n)}}};if(r){t()}else{if(x.Deferred.getStackHook){t.stackTrace=x.Deferred.getStackHook()}A.setTimeout(t)}}}return x.Deferred(function(e){o[0][3].add(u(0,e,v(n)?n:c,e.notifyWith));o[1][3].add(u(0,e,v(t)?t:c));o[2][3].add(u(0,e,v(i)?i:se))}).promise()},promise:function(e){return e!=null?x.extend(e,a):a}},s={};x.each(o,function(e,t){var i=t[2],n=t[5];a[t[1]]=i.add;if(n){i.add(function(){r=n},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock)}i.add(t[3].fire);s[t[0]]=function(){s[t[0]+"With"](this===s?undefined:this,arguments);return this};s[t[0]+"With"]=i.fireWith});a.promise(s);if(e){e.call(s,s)}return s},when:function(e){var i=arguments.length,t=i,n=Array(t),r=s.call(arguments),o=x.Deferred(),a=function(t){return function(e){n[t]=this;r[t]=arguments.length>1?s.call(arguments):e;if(!--i){o.resolveWith(n,r)}}};if(i<=1){le(e,o.done(a(t)).resolve,o.reject,!i);if(o.state()==="pending"||v(r[t]&&r[t].then)){return o.then()}}while(t--){le(r[t],a(t),o.reject)}return o.promise()}});var ue=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,t){if(A.console&&A.console.warn&&e&&ue.test(e.name)){A.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)}};x.readyException=function(e){A.setTimeout(function(){throw e})};var ce=x.Deferred();x.fn.ready=function(e){ce.then(e).catch(function(e){x.readyException(e)});return this};x.extend({isReady:false,readyWait:1,ready:function(e){if(e===true?--x.readyWait:x.isReady){return}x.isReady=true;if(e!==true&&--x.readyWait>0){return}ce.resolveWith(E,[x])}});x.ready.then=ce.then;function de(){E.removeEventListener("DOMContentLoaded",de);A.removeEventListener("load",de);x.ready()}if(E.readyState==="complete"||E.readyState!=="loading"&&!E.documentElement.doScroll){A.setTimeout(x.ready)}else{E.addEventListener("DOMContentLoaded",de);A.addEventListener("load",de)}var d=function(e,t,i,n,r,o,a){var s=0,l=e.length,u=i==null;if(y(i)==="object"){r=true;for(s in i){d(e,t,s,i[s],true,o,a)}}else if(n!==undefined){r=true;if(!v(n)){a=true}if(u){if(a){t.call(e,n);t=null}else{u=t;t=function(e,t,i){return u.call(x(e),i)}}}if(t){for(;s<l;s++){t(e[s],i,a?n:n.call(e[s],s,t(e[s],i)))}}}if(r){return e}if(u){return t.call(e)}return l?t(e[0],i):o};var fe=/^-ms-/,pe=/-([a-z])/g;function he(e,t){return t.toUpperCase()}function f(e){return e.replace(fe,"ms-").replace(pe,he)}var b=function(e){return e.nodeType===1||e.nodeType===9||!+e.nodeType};function i(){this.expando=x.expando+i.uid++}i.uid=1;i.prototype={cache:function(e){var t=e[this.expando];if(!t){t={};if(b(e)){if(e.nodeType){e[this.expando]=t}else{Object.defineProperty(e,this.expando,{value:t,configurable:true})}}}return t},set:function(e,t,i){var n,r=this.cache(e);if(typeof t==="string"){r[f(t)]=i}else{for(n in t){r[f(n)]=t[n]}}return r},get:function(e,t){return t===undefined?this.cache(e):e[this.expando]&&e[this.expando][f(t)]},access:function(e,t,i){if(t===undefined||t&&typeof t==="string"&&i===undefined){return this.get(e,t)}this.set(e,t,i);return i!==undefined?i:t},remove:function(e,t){var i,n=e[this.expando];if(n===undefined){return}if(t!==undefined){if(Array.isArray(t)){t=t.map(f)}else{t=f(t);t=t in n?[t]:t.match(T)||[]}i=t.length;while(i--){delete n[t[i]]}}if(t===undefined||x.isEmptyObject(n)){if(e.nodeType){e[this.expando]=undefined}else{delete e[this.expando]}}},hasData:function(e){var t=e[this.expando];return t!==undefined&&!x.isEmptyObject(t)}};var _=new i;var p=new i;var ge=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ve=/[A-Z]/g;function me(e){if(e==="true"){return true}if(e==="false"){return false}if(e==="null"){return null}if(e===+e+""){return+e}if(ge.test(e)){return JSON.parse(e)}return e}function ye(e,t,i){var n;if(i===undefined&&e.nodeType===1){n="data-"+t.replace(ve,"-$&").toLowerCase();i=e.getAttribute(n);if(typeof i==="string"){try{i=me(i)}catch(e){}p.set(e,t,i)}else{i=undefined}}return i}x.extend({hasData:function(e){return p.hasData(e)||_.hasData(e)},data:function(e,t,i){return p.access(e,t,i)},removeData:function(e,t){p.remove(e,t)},_data:function(e,t,i){return _.access(e,t,i)},_removeData:function(e,t){_.remove(e,t)}});x.fn.extend({data:function(i,e){var t,n,r,o=this[0],a=o&&o.attributes;if(i===undefined){if(this.length){r=p.get(o);if(o.nodeType===1&&!_.get(o,"hasDataAttrs")){t=a.length;while(t--){if(a[t]){n=a[t].name;if(n.indexOf("data-")===0){n=f(n.slice(5));ye(o,n,r[n])}}}_.set(o,"hasDataAttrs",true)}}return r}if(typeof i==="object"){return this.each(function(){p.set(this,i)})}return d(this,function(e){var t;if(o&&e===undefined){t=p.get(o,i);if(t!==undefined){return t}t=ye(o,i);if(t!==undefined){return t}return}this.each(function(){p.set(this,i,e)})},null,e,arguments.length>1,null,true)},removeData:function(e){return this.each(function(){p.remove(this,e)})}});x.extend({queue:function(e,t,i){var n;if(e){t=(t||"fx")+"queue";n=_.get(e,t);if(i){if(!n||Array.isArray(i)){n=_.access(e,t,x.makeArray(i))}else{n.push(i)}}return n||[]}},dequeue:function(e,t){t=t||"fx";var i=x.queue(e,t),n=i.length,r=i.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};if(r==="inprogress"){r=i.shift();n--}if(r){if(t==="fx"){i.unshift("inprogress")}delete o.stop;r.call(e,a,o)}if(!n&&o){o.empty.fire()}},_queueHooks:function(e,t){var i=t+"queueHooks";return _.get(e,i)||_.access(e,i,{empty:x.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",i])})})}});x.fn.extend({queue:function(t,i){var e=2;if(typeof t!=="string"){i=t;t="fx";e--}if(arguments.length<e){return x.queue(this[0],t)}return i===undefined?this:this.each(function(){var e=x.queue(this,t,i);x._queueHooks(this,t);if(t==="fx"&&e[0]!=="inprogress"){x.dequeue(this,t)}})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,r=x.Deferred(),o=this,a=this.length,s=function(){if(!--n){r.resolveWith(o,[o])}};if(typeof e!=="string"){t=e;e=undefined}e=e||"fx";while(a--){i=_.get(o[a],e+"queueHooks");if(i&&i.empty){n++;i.empty.add(s)}}s();return r.promise(t)}});var be=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;var h=new RegExp("^(?:([+-])=|)("+be+")([a-z%]*)$","i");var w=["Top","Right","Bottom","Left"];var C=E.documentElement;var S=function(e){return x.contains(e.ownerDocument,e)},_e={composed:true};if(C.getRootNode){S=function(e){return x.contains(e.ownerDocument,e)||e.getRootNode(_e)===e.ownerDocument}}var we=function(e,t){e=t||e;return e.style.display==="none"||e.style.display===""&&S(e)&&x.css(e,"display")==="none"};function Ce(e,t,i,n){var r,o,a=20,s=n?function(){return n.cur()}:function(){return x.css(e,t,"")},l=s(),u=i&&i[3]||(x.cssNumber[t]?"":"px"),c=e.nodeType&&(x.cssNumber[t]||u!=="px"&&+l)&&h.exec(x.css(e,t));if(c&&c[3]!==u){l=l/2;u=u||c[3];c=+l||1;while(a--){x.style(e,t,c+u);if((1-o)*(1-(o=s()/l||.5))<=0){a=0}c=c/o}c=c*2;x.style(e,t,c+u);i=i||[]}if(i){c=+c||+l||0;r=i[1]?c+(i[1]+1)*i[2]:+i[2];if(n){n.unit=u;n.start=c;n.end=r}}return r}var Ae={};function Ee(e){var t,i=e.ownerDocument,n=e.nodeName,r=Ae[n];if(r){return r}t=i.body.appendChild(i.createElement(n));r=x.css(t,"display");t.parentNode.removeChild(t);if(r==="none"){r="block"}Ae[n]=r;return r}function D(e,t){var i,n,r=[],o=0,a=e.length;for(;o<a;o++){n=e[o];if(!n.style){continue}i=n.style.display;if(t){if(i==="none"){r[o]=_.get(n,"display")||null;if(!r[o]){n.style.display=""}}if(n.style.display===""&&we(n)){r[o]=Ee(n)}}else{if(i!=="none"){r[o]="none";_.set(n,"display",i)}}}for(o=0;o<a;o++){if(r[o]!=null){e[o].style.display=r[o]}}return e}x.fn.extend({show:function(){return D(this,true)},hide:function(){return D(this)},toggle:function(e){if(typeof e==="boolean"){return e?this.show():this.hide()}return this.each(function(){if(we(this)){x(this).show()}else{x(this).hide()}})}});var r=/^(?:checkbox|radio)$/i;var xe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var Te=/^$|^module$|\/(?:java|ecma)script/i;(function(){var e=E.createDocumentFragment(),t=e.appendChild(E.createElement("div")),i=E.createElement("input");i.setAttribute("type","radio");i.setAttribute("checked","checked");i.setAttribute("name","t");t.appendChild(i);g.checkClone=t.cloneNode(true).cloneNode(true).lastChild.checked;t.innerHTML="<textarea>x</textarea>";g.noCloneChecked=!!t.cloneNode(true).lastChild.defaultValue;t.innerHTML="<option></option>";g.option=!!t.lastChild})();var k={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};k.tbody=k.tfoot=k.colgroup=k.caption=k.thead;k.th=k.td;if(!g.option){k.optgroup=k.option=[1,"<select multiple='multiple'>","</select>"]}function O(e,t){var i;if(typeof e.getElementsByTagName!=="undefined"){i=e.getElementsByTagName(t||"*")}else if(typeof e.querySelectorAll!=="undefined"){i=e.querySelectorAll(t||"*")}else{i=[]}if(t===undefined||t&&u(e,t)){return x.merge([e],i)}return i}function Se(e,t){var i=0,n=e.length;for(;i<n;i++){_.set(e[i],"globalEval",!t||_.get(t[i],"globalEval"))}}var De=/<|&#?\w+;/;function ke(e,t,i,n,r){var o,a,s,l,u,c,d=t.createDocumentFragment(),f=[],p=0,h=e.length;for(;p<h;p++){o=e[p];if(o||o===0){if(y(o)==="object"){x.merge(f,o.nodeType?[o]:o)}else if(!De.test(o)){f.push(t.createTextNode(o))}else{a=a||d.appendChild(t.createElement("div"));s=(xe.exec(o)||["",""])[1].toLowerCase();l=k[s]||k._default;a.innerHTML=l[1]+x.htmlPrefilter(o)+l[2];c=l[0];while(c--){a=a.lastChild}x.merge(f,a.childNodes);a=d.firstChild;a.textContent=""}}}d.textContent="";p=0;while(o=f[p++]){if(n&&x.inArray(o,n)>-1){if(r){r.push(o)}continue}u=S(o);a=O(d.appendChild(o),"script");if(u){Se(a)}if(i){c=0;while(o=a[c++]){if(Te.test(o.type||"")){i.push(o)}}}}return d}var Oe=/^key/,Re=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ne=/^([^.]*)(?:\.(.+)|)/;function a(){return true}function l(){return false}function Ie(e,t){return e===Pe()===(t==="focus")}function Pe(){try{return E.activeElement}catch(e){}}function Me(e,t,i,n,r,o){var a,s;if(typeof t==="object"){if(typeof i!=="string"){n=n||i;i=undefined}for(s in t){Me(e,s,i,n,t[s],o)}return e}if(n==null&&r==null){r=i;n=i=undefined}else if(r==null){if(typeof i==="string"){r=n;n=undefined}else{r=n;n=i;i=undefined}}if(r===false){r=l}else if(!r){return e}if(o===1){a=r;r=function(e){x().off(e);return a.apply(this,arguments)};r.guid=a.guid||(a.guid=x.guid++)}return e.each(function(){x.event.add(this,t,r,n,i)})}x.event={global:{},add:function(t,e,i,n,r){var o,a,s,l,u,c,d,f,p,h,g,v=_.get(t);if(!b(t)){return}if(i.handler){o=i;i=o.handler;r=o.selector}if(r){x.find.matchesSelector(C,r)}if(!i.guid){i.guid=x.guid++}if(!(l=v.events)){l=v.events=Object.create(null)}if(!(a=v.handle)){a=v.handle=function(e){return typeof x!=="undefined"&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):undefined}}e=(e||"").match(T)||[""];u=e.length;while(u--){s=Ne.exec(e[u])||[];p=g=s[1];h=(s[2]||"").split(".").sort();if(!p){continue}d=x.event.special[p]||{};p=(r?d.delegateType:d.bindType)||p;d=x.event.special[p]||{};c=x.extend({type:p,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&x.expr.match.needsContext.test(r),namespace:h.join(".")},o);if(!(f=l[p])){f=l[p]=[];f.delegateCount=0;if(!d.setup||d.setup.call(t,n,h,a)===false){if(t.addEventListener){t.addEventListener(p,a)}}}if(d.add){d.add.call(t,c);if(!c.handler.guid){c.handler.guid=i.guid}}if(r){f.splice(f.delegateCount++,0,c)}else{f.push(c)}x.event.global[p]=true}},remove:function(e,t,i,n,r){var o,a,s,l,u,c,d,f,p,h,g,v=_.hasData(e)&&_.get(e);if(!v||!(l=v.events)){return}t=(t||"").match(T)||[""];u=t.length;while(u--){s=Ne.exec(t[u])||[];p=g=s[1];h=(s[2]||"").split(".").sort();if(!p){for(p in l){x.event.remove(e,p+t[u],i,n,true)}continue}d=x.event.special[p]||{};p=(n?d.delegateType:d.bindType)||p;f=l[p]||[];s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)");a=o=f.length;while(o--){c=f[o];if((r||g===c.origType)&&(!i||i.guid===c.guid)&&(!s||s.test(c.namespace))&&(!n||n===c.selector||n==="**"&&c.selector)){f.splice(o,1);if(c.selector){f.delegateCount--}if(d.remove){d.remove.call(e,c)}}}if(a&&!f.length){if(!d.teardown||d.teardown.call(e,h,v.handle)===false){x.removeEvent(e,p,v.handle)}delete l[p]}}if(x.isEmptyObject(l)){_.remove(e,"handle events")}},dispatch:function(e){var t,i,n,r,o,a,s=new Array(arguments.length),l=x.event.fix(e),u=(_.get(this,"events")||Object.create(null))[l.type]||[],c=x.event.special[l.type]||{};s[0]=l;for(t=1;t<arguments.length;t++){s[t]=arguments[t]}l.delegateTarget=this;if(c.preDispatch&&c.preDispatch.call(this,l)===false){return}a=x.event.handlers.call(this,l,u);t=0;while((r=a[t++])&&!l.isPropagationStopped()){l.currentTarget=r.elem;i=0;while((o=r.handlers[i++])&&!l.isImmediatePropagationStopped()){if(!l.rnamespace||o.namespace===false||l.rnamespace.test(o.namespace)){l.handleObj=o;l.data=o.data;n=((x.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,s);if(n!==undefined){if((l.result=n)===false){l.preventDefault();l.stopPropagation()}}}}}if(c.postDispatch){c.postDispatch.call(this,l)}return l.result},handlers:function(e,t){var i,n,r,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!(e.type==="click"&&e.button>=1)){for(;u!==this;u=u.parentNode||this){if(u.nodeType===1&&!(e.type==="click"&&u.disabled===true)){o=[];a={};for(i=0;i<l;i++){n=t[i];r=n.selector+" ";if(a[r]===undefined){a[r]=n.needsContext?x(r,this).index(u)>-1:x.find(r,this,null,[u]).length}if(a[r]){o.push(n)}}if(o.length){s.push({elem:u,handlers:o})}}}}u=this;if(l<t.length){s.push({elem:u,handlers:t.slice(l)})}return s},addProp:function(t,e){Object.defineProperty(x.Event.prototype,t,{enumerable:true,configurable:true,get:v(e)?function(){if(this.originalEvent){return e(this.originalEvent)}}:function(){if(this.originalEvent){return this.originalEvent[t]}},set:function(e){Object.defineProperty(this,t,{enumerable:true,configurable:true,writable:true,value:e})}})},fix:function(e){return e[x.expando]?e:new x.Event(e)},special:{load:{noBubble:true},click:{setup:function(e){var t=this||e;if(r.test(t.type)&&t.click&&u(t,"input")){Le(t,"click",a)}return false},trigger:function(e){var t=this||e;if(r.test(t.type)&&t.click&&u(t,"input")){Le(t,"click")}return true},_default:function(e){var t=e.target;return r.test(t.type)&&t.click&&u(t,"input")&&_.get(t,"click")||u(t,"a")}},beforeunload:{postDispatch:function(e){if(e.result!==undefined&&e.originalEvent){e.originalEvent.returnValue=e.result}}}}};function Le(e,r,o){if(!o){if(_.get(e,r)===undefined){x.event.add(e,r,a)}return}_.set(e,r,false);x.event.add(e,r,{namespace:false,handler:function(e){var t,i,n=_.get(this,r);if(e.isTrigger&1&&this[r]){if(!n.length){n=s.call(arguments);_.set(this,r,n);t=o(this,r);this[r]();i=_.get(this,r);if(n!==i||t){_.set(this,r,false)}else{i={}}if(n!==i){e.stopImmediatePropagation();e.preventDefault();return i.value}}else if((x.event.special[r]||{}).delegateType){e.stopPropagation()}}else if(n.length){_.set(this,r,{value:x.event.trigger(x.extend(n[0],x.Event.prototype),n.slice(1),this)});e.stopImmediatePropagation()}}})}x.removeEvent=function(e,t,i){if(e.removeEventListener){e.removeEventListener(t,i)}};x.Event=function(e,t){if(!(this instanceof x.Event)){return new x.Event(e,t)}if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===undefined&&e.returnValue===false?a:l;this.target=e.target&&e.target.nodeType===3?e.target.parentNode:e.target;this.currentTarget=e.currentTarget;this.relatedTarget=e.relatedTarget}else{this.type=e}if(t){x.extend(this,t)}this.timeStamp=e&&e.timeStamp||Date.now();this[x.expando]=true};x.Event.prototype={constructor:x.Event,isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,isSimulated:false,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=a;if(e&&!this.isSimulated){e.preventDefault()}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=a;if(e&&!this.isSimulated){e.stopPropagation()}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=a;if(e&&!this.isSimulated){e.stopImmediatePropagation()}this.stopPropagation()}};x.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,char:true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:function(e){var t=e.button;if(e.which==null&&Oe.test(e.type)){return e.charCode!=null?e.charCode:e.keyCode}if(!e.which&&t!==undefined&&Re.test(e.type)){if(t&1){return 1}if(t&2){return 3}if(t&4){return 2}return 0}return e.which}},x.event.addProp);x.each({focus:"focusin",blur:"focusout"},function(e,t){x.event.special[e]={setup:function(){Le(this,e,Ie);return false},trigger:function(){Le(this,e);return true},delegateType:t}});x.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,o){x.event.special[e]={delegateType:o,bindType:o,handle:function(e){var t,i=this,n=e.relatedTarget,r=e.handleObj;if(!n||n!==i&&!x.contains(i,n)){e.type=r.origType;t=r.handler.apply(this,arguments);e.type=o}return t}}});x.fn.extend({on:function(e,t,i,n){return Me(this,e,t,i,n)},one:function(e,t,i,n){return Me(this,e,t,i,n,1)},off:function(e,t,i){var n,r;if(e&&e.preventDefault&&e.handleObj){n=e.handleObj;x(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler);return this}if(typeof e==="object"){for(r in e){this.off(r,t,e[r])}return this}if(t===false||typeof t==="function"){i=t;t=undefined}if(i===false){i=l}return this.each(function(){x.event.remove(this,e,i,t)})}});var Fe=/<script|<style|<link/i,Ge=/checked\s*(?:[^=]|=\s*.checked.)/i,$e=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function We(e,t){if(u(e,"table")&&u(t.nodeType!==11?t:t.firstChild,"tr")){return x(e).children("tbody")[0]||e}return e}function He(e){e.type=(e.getAttribute("type")!==null)+"/"+e.type;return e}function je(e){if((e.type||"").slice(0,5)==="true/"){e.type=e.type.slice(5)}else{e.removeAttribute("type")}return e}function Be(e,t){var i,n,r,o,a,s,l;if(t.nodeType!==1){return}if(_.hasData(e)){o=_.get(e);l=o.events;if(l){_.remove(t,"handle events");for(r in l){for(i=0,n=l[r].length;i<n;i++){x.event.add(t,r,l[r][i])}}}}if(p.hasData(e)){a=p.access(e);s=x.extend({},a);p.set(t,s)}}function Ve(e,t){var i=t.nodeName.toLowerCase();if(i==="input"&&r.test(e.type)){t.checked=e.checked}else if(i==="input"||i==="textarea"){t.defaultValue=e.defaultValue}}function R(i,n,r,o){n=G(n);var e,t,a,s,l,u,c=0,d=i.length,f=d-1,p=n[0],h=v(p);if(h||d>1&&typeof p==="string"&&!g.checkClone&&Ge.test(p)){return i.each(function(e){var t=i.eq(e);if(h){n[0]=p.call(this,e,t.html())}R(t,n,r,o)})}if(d){e=ke(n,i[0].ownerDocument,false,i,o);t=e.firstChild;if(e.childNodes.length===1){e=t}if(t||o){a=x.map(O(e,"script"),He);s=a.length;for(;c<d;c++){l=e;if(c!==f){l=x.clone(l,true,true);if(s){x.merge(a,O(l,"script"))}}r.call(i[c],l,c)}if(s){u=a[a.length-1].ownerDocument;x.map(a,je);for(c=0;c<s;c++){l=a[c];if(Te.test(l.type||"")&&!_.access(l,"globalEval")&&x.contains(u,l)){if(l.src&&(l.type||"").toLowerCase()!=="module"){if(x._evalUrl&&!l.noModule){x._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},u)}}else{Y(l.textContent.replace($e,""),l,u)}}}}}}return i}function ze(e,t,i){var n,r=t?x.filter(t,e):e,o=0;for(;(n=r[o])!=null;o++){if(!i&&n.nodeType===1){x.cleanData(O(n))}if(n.parentNode){if(i&&S(n)){Se(O(n,"script"))}n.parentNode.removeChild(n)}}return e}x.extend({htmlPrefilter:function(e){return e},clone:function(e,t,i){var n,r,o,a,s=e.cloneNode(true),l=S(e);if(!g.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!x.isXMLDoc(e)){a=O(s);o=O(e);for(n=0,r=o.length;n<r;n++){Ve(o[n],a[n])}}if(t){if(i){o=o||O(e);a=a||O(s);for(n=0,r=o.length;n<r;n++){Be(o[n],a[n])}}else{Be(e,s)}}a=O(s,"script");if(a.length>0){Se(a,!l&&O(e,"script"))}return s},cleanData:function(e){var t,i,n,r=x.event.special,o=0;for(;(i=e[o])!==undefined;o++){if(b(i)){if(t=i[_.expando]){if(t.events){for(n in t.events){if(r[n]){x.event.remove(i,n)}else{x.removeEvent(i,n,t.handle)}}}i[_.expando]=undefined}if(i[p.expando]){i[p.expando]=undefined}}}}});x.fn.extend({detach:function(e){return ze(this,e,true)},remove:function(e){return ze(this,e)},text:function(e){return d(this,function(e){return e===undefined?x.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=e}})},null,e,arguments.length)},append:function(){return R(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=We(this,e);t.appendChild(e)}})},prepend:function(){return R(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=We(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return R(this,arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this)}})},after:function(){return R(this,arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this.nextSibling)}})},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){if(e.nodeType===1){x.cleanData(O(e,false));e.textContent=""}}return this},clone:function(e,t){e=e==null?false:e;t=t==null?e:t;return this.map(function(){return x.clone(this,e,t)})},html:function(e){return d(this,function(e){var t=this[0]||{},i=0,n=this.length;if(e===undefined&&t.nodeType===1){return t.innerHTML}if(typeof e==="string"&&!Fe.test(e)&&!k[(xe.exec(e)||["",""])[1].toLowerCase()]){e=x.htmlPrefilter(e);try{for(;i<n;i++){t=this[i]||{};if(t.nodeType===1){x.cleanData(O(t,false));t.innerHTML=e}}t=0}catch(e){}}if(t){this.empty().append(e)}},null,e,arguments.length)},replaceWith:function(){var i=[];return R(this,arguments,function(e){var t=this.parentNode;if(x.inArray(this,i)<0){x.cleanData(O(this));if(t){t.replaceChild(e,this)}}},i)}});x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){x.fn[e]=function(e){var t,i=[],n=x(e),r=n.length-1,o=0;for(;o<=r;o++){t=o===r?this:this.clone(true);x(n[o])[a](t);$.apply(i,t.get())}return this.pushStack(i)}});var Ue=new RegExp("^("+be+")(?!px)[a-z%]+$","i");var Ye=function(e){var t=e.ownerDocument.defaultView;if(!t||!t.opener){t=A}return t.getComputedStyle(e)};var qe=function(e,t,i){var n,r,o={};for(r in t){o[r]=e.style[r];e.style[r]=t[r]}n=i.call(e);for(r in t){e.style[r]=o[r]}return n};var Xe=new RegExp(w.join("|"),"i");(function(){function e(){if(!u){return}l.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";C.appendChild(l).appendChild(u);var e=A.getComputedStyle(u);i=e.top!=="1%";s=t(e.marginLeft)===12;u.style.right="60%";o=t(e.right)===36;n=t(e.width)===36;u.style.position="absolute";r=t(u.offsetWidth/3)===12;C.removeChild(l);u=null}function t(e){return Math.round(parseFloat(e))}var i,n,r,o,a,s,l=E.createElement("div"),u=E.createElement("div");if(!u.style){return}u.style.backgroundClip="content-box";u.cloneNode(true).style.backgroundClip="";g.clearCloneStyle=u.style.backgroundClip==="content-box";x.extend(g,{boxSizingReliable:function(){e();return n},pixelBoxStyles:function(){e();return o},pixelPosition:function(){e();return i},reliableMarginLeft:function(){e();return s},scrollboxSize:function(){e();return r},reliableTrDimensions:function(){var e,t,i,n;if(a==null){e=E.createElement("table");t=E.createElement("tr");i=E.createElement("div");e.style.cssText="position:absolute;left:-11111px";t.style.height="1px";i.style.height="9px";C.appendChild(e).appendChild(t).appendChild(i);n=A.getComputedStyle(t);a=parseInt(n.height)>3;C.removeChild(e)}return a}})})();function Ke(e,t,i){var n,r,o,a,s=e.style;i=i||Ye(e);if(i){a=i.getPropertyValue(t)||i[t];if(a===""&&!S(e)){a=x.style(e,t)}if(!g.pixelBoxStyles()&&Ue.test(a)&&Xe.test(t)){n=s.width;r=s.minWidth;o=s.maxWidth;s.minWidth=s.maxWidth=s.width=a;a=i.width;s.width=n;s.minWidth=r;s.maxWidth=o}}return a!==undefined?a+"":a}function Qe(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}var Ze=["Webkit","Moz","ms"],Je=E.createElement("div").style,et={};function tt(e){var t=e[0].toUpperCase()+e.slice(1),i=Ze.length;while(i--){e=Ze[i]+t;if(e in Je){return e}}}function it(e){var t=x.cssProps[e]||et[e];if(t){return t}if(e in Je){return e}return et[e]=tt(e)||e}var nt=/^(none|table(?!-c[ea]).+)/,rt=/^--/,ot={position:"absolute",visibility:"hidden",display:"block"},at={letterSpacing:"0",fontWeight:"400"};function st(e,t,i){var n=h.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function lt(e,t,i,n,r,o){var a=t==="width"?1:0,s=0,l=0;if(i===(n?"border":"content")){return 0}for(;a<4;a+=2){if(i==="margin"){l+=x.css(e,i+w[a],true,r)}if(!n){l+=x.css(e,"padding"+w[a],true,r);if(i!=="padding"){l+=x.css(e,"border"+w[a]+"Width",true,r)}else{s+=x.css(e,"border"+w[a]+"Width",true,r)}}else{if(i==="content"){l-=x.css(e,"padding"+w[a],true,r)}if(i!=="margin"){l-=x.css(e,"border"+w[a]+"Width",true,r)}}}if(!n&&o>=0){l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0}return l}function ut(e,t,i){var n=Ye(e),r=!g.boxSizingReliable()||i,o=r&&x.css(e,"boxSizing",false,n)==="border-box",a=o,s=Ke(e,t,n),l="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(s)){if(!i){return s}s="auto"}if((!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&u(e,"tr")||s==="auto"||!parseFloat(s)&&x.css(e,"display",false,n)==="inline")&&e.getClientRects().length){o=x.css(e,"boxSizing",false,n)==="border-box";a=l in e;if(a){s=e[l]}}s=parseFloat(s)||0;return s+lt(e,t,i||(o?"border":"content"),a,n,s)+"px"}x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Ke(e,"opacity");return i===""?"1":i}}}},cssNumber:{animationIterationCount:true,columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,fontWeight:true,gridArea:true,gridColumn:true,gridColumnEnd:true,gridColumnStart:true,gridRow:true,gridRowEnd:true,gridRowStart:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{},style:function(e,t,i,n){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return}var r,o,a,s=f(t),l=rt.test(t),u=e.style;if(!l){t=it(s)}a=x.cssHooks[t]||x.cssHooks[s];if(i!==undefined){o=typeof i;if(o==="string"&&(r=h.exec(i))&&r[1]){i=Ce(e,t,r);o="number"}if(i==null||i!==i){return}if(o==="number"&&!l){i+=r&&r[3]||(x.cssNumber[s]?"":"px")}if(!g.clearCloneStyle&&i===""&&t.indexOf("background")===0){u[t]="inherit"}if(!a||!("set"in a)||(i=a.set(e,i,n))!==undefined){if(l){u.setProperty(t,i)}else{u[t]=i}}}else{if(a&&"get"in a&&(r=a.get(e,false,n))!==undefined){return r}return u[t]}},css:function(e,t,i,n){var r,o,a,s=f(t),l=rt.test(t);if(!l){t=it(s)}a=x.cssHooks[t]||x.cssHooks[s];if(a&&"get"in a){r=a.get(e,true,i)}if(r===undefined){r=Ke(e,t,n)}if(r==="normal"&&t in at){r=at[t]}if(i===""||i){o=parseFloat(r);return i===true||isFinite(o)?o||0:r}return r}});x.each(["height","width"],function(e,u){x.cssHooks[u]={get:function(e,t,i){if(t){return nt.test(x.css(e,"display"))&&(!e.getClientRects().length||!e.getBoundingClientRect().width)?qe(e,ot,function(){return ut(e,u,i)}):ut(e,u,i)}},set:function(e,t,i){var n,r=Ye(e),o=!g.scrollboxSize()&&r.position==="absolute",a=o||i,s=a&&x.css(e,"boxSizing",false,r)==="border-box",l=i?lt(e,u,i,s,r):0;if(s&&o){l-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(r[u])-lt(e,u,"border",false,r)-.5)}if(l&&(n=h.exec(t))&&(n[3]||"px")!=="px"){e.style[u]=t;t=x.css(e,u)}return st(e,t,l)}}});x.cssHooks.marginLeft=Qe(g.reliableMarginLeft,function(e,t){if(t){return(parseFloat(Ke(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}});x.each({margin:"",padding:"",border:"Width"},function(r,o){x.cssHooks[r+o]={expand:function(e){var t=0,i={},n=typeof e==="string"?e.split(" "):[e];for(;t<4;t++){i[r+w[t]+o]=n[t]||n[t-2]||n[0]}return i}};if(r!=="margin"){x.cssHooks[r+o].set=st}});x.fn.extend({css:function(e,t){return d(this,function(e,t,i){var n,r,o={},a=0;if(Array.isArray(t)){n=Ye(e);r=t.length;for(;a<r;a++){o[t[a]]=x.css(e,t[a],false,n)}return o}return i!==undefined?x.style(e,t,i):x.css(e,t)},e,t,arguments.length>1)}});function o(e,t,i,n,r){return new o.prototype.init(e,t,i,n,r)}x.Tween=o;o.prototype={constructor:o,init:function(e,t,i,n,r,o){this.elem=e;this.prop=i;this.easing=r||x.easing._default;this.options=t;this.start=this.now=this.cur();this.end=n;this.unit=o||(x.cssNumber[i]?"":"px")},cur:function(){var e=o.propHooks[this.prop];return e&&e.get?e.get(this):o.propHooks._default.get(this)},run:function(e){var t,i=o.propHooks[this.prop];if(this.options.duration){this.pos=t=x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration)}else{this.pos=t=e}this.now=(this.end-this.start)*t+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(i&&i.set){i.set(this)}else{o.propHooks._default.set(this)}return this}};o.prototype.init.prototype=o.prototype;o.propHooks={_default:{get:function(e){var t;if(e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null){return e.elem[e.prop]}t=x.css(e.elem,e.prop,"");return!t||t==="auto"?0:t},set:function(e){if(x.fx.step[e.prop]){x.fx.step[e.prop](e)}else if(e.elem.nodeType===1&&(x.cssHooks[e.prop]||e.elem.style[it(e.prop)]!=null)){x.style(e.elem,e.prop,e.now+e.unit)}else{e.elem[e.prop]=e.now}}}};o.propHooks.scrollTop=o.propHooks.scrollLeft={set:function(e){if(e.elem.nodeType&&e.elem.parentNode){e.elem[e.prop]=e.now}}};x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"};x.fx=o.prototype.init;x.fx.step={};var N,ct,dt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function pt(){if(ct){if(E.hidden===false&&A.requestAnimationFrame){A.requestAnimationFrame(pt)}else{A.setTimeout(pt,x.fx.interval)}x.fx.tick()}}function ht(){A.setTimeout(function(){N=undefined});return N=Date.now()}function gt(e,t){var i,n=0,r={height:e};t=t?1:0;for(;n<4;n+=2-t){i=w[n];r["margin"+i]=r["padding"+i]=e}if(t){r.opacity=r.width=e}return r}function vt(e,t,i){var n,r=(I.tweeners[t]||[]).concat(I.tweeners["*"]),o=0,a=r.length;for(;o<a;o++){if(n=r[o].call(i,t,e)){return n}}}function mt(e,t,i){var n,r,o,a,s,l,u,c,d="width"in t||"height"in t,f=this,p={},h=e.style,g=e.nodeType&&we(e),v=_.get(e,"fxshow");if(!i.queue){a=x._queueHooks(e,"fx");if(a.unqueued==null){a.unqueued=0;s=a.empty.fire;a.empty.fire=function(){if(!a.unqueued){s()}}}a.unqueued++;f.always(function(){f.always(function(){a.unqueued--;if(!x.queue(e,"fx").length){a.empty.fire()}})})}for(n in t){r=t[n];if(dt.test(r)){delete t[n];o=o||r==="toggle";if(r===(g?"hide":"show")){if(r==="show"&&v&&v[n]!==undefined){g=true}else{continue}}p[n]=v&&v[n]||x.style(e,n)}}l=!x.isEmptyObject(t);if(!l&&x.isEmptyObject(p)){return}if(d&&e.nodeType===1){i.overflow=[h.overflow,h.overflowX,h.overflowY];u=v&&v.display;if(u==null){u=_.get(e,"display")}c=x.css(e,"display");if(c==="none"){if(u){c=u}else{D([e],true);u=e.style.display||u;c=x.css(e,"display");D([e])}}if(c==="inline"||c==="inline-block"&&u!=null){if(x.css(e,"float")==="none"){if(!l){f.done(function(){h.display=u});if(u==null){c=h.display;u=c==="none"?"":c}}h.display="inline-block"}}}if(i.overflow){h.overflow="hidden";f.always(function(){h.overflow=i.overflow[0];h.overflowX=i.overflow[1];h.overflowY=i.overflow[2]})}l=false;for(n in p){if(!l){if(v){if("hidden"in v){g=v.hidden}}else{v=_.access(e,"fxshow",{display:u})}if(o){v.hidden=!g}if(g){D([e],true)}f.done(function(){if(!g){D([e])}_.remove(e,"fxshow");for(n in p){x.style(e,n,p[n])}})}l=vt(g?v[n]:0,n,f);if(!(n in v)){v[n]=l.start;if(g){l.end=l.start;l.start=0}}}}function yt(e,t){var i,n,r,o,a;for(i in e){n=f(i);r=t[n];o=e[i];if(Array.isArray(o)){r=o[1];o=e[i]=o[0]}if(i!==n){e[n]=o;delete e[i]}a=x.cssHooks[n];if(a&&"expand"in a){o=a.expand(o);delete e[n];for(i in o){if(!(i in e)){e[i]=o[i];t[i]=r}}}else{t[n]=r}}}function I(a,e,t){var i,s,n=0,r=I.prefilters.length,l=x.Deferred().always(function(){delete o.elem}),o=function(){if(s){return false}var e=N||ht(),t=Math.max(0,u.startTime+u.duration-e),i=t/u.duration||0,n=1-i,r=0,o=u.tweens.length;for(;r<o;r++){u.tweens[r].run(n)}l.notifyWith(a,[u,n,t]);if(n<1&&o){return t}if(!o){l.notifyWith(a,[u,1,0])}l.resolveWith(a,[u]);return false},u=l.promise({elem:a,props:x.extend({},e),opts:x.extend(true,{specialEasing:{},easing:x.easing._default},t),originalProperties:e,originalOptions:t,startTime:N||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var i=x.Tween(a,u.opts,e,t,u.opts.specialEasing[e]||u.opts.easing);u.tweens.push(i);return i},stop:function(e){var t=0,i=e?u.tweens.length:0;if(s){return this}s=true;for(;t<i;t++){u.tweens[t].run(1)}if(e){l.notifyWith(a,[u,1,0]);l.resolveWith(a,[u,e])}else{l.rejectWith(a,[u,e])}return this}}),c=u.props;yt(c,u.opts.specialEasing);for(;n<r;n++){i=I.prefilters[n].call(u,a,c,u.opts);if(i){if(v(i.stop)){x._queueHooks(u.elem,u.opts.queue).stop=i.stop.bind(i)}return i}}x.map(c,vt,u);if(v(u.opts.start)){u.opts.start.call(a,u)}u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always);x.fx.timer(x.extend(o,{elem:a,anim:u,queue:u.opts.queue}));return u}x.Animation=x.extend(I,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);Ce(i.elem,e,h.exec(t),i);return i}]},tweener:function(e,t){if(v(e)){t=e;e=["*"]}else{e=e.match(T)}var i,n=0,r=e.length;for(;n<r;n++){i=e[n];I.tweeners[i]=I.tweeners[i]||[];I.tweeners[i].unshift(t)}},prefilters:[mt],prefilter:function(e,t){if(t){I.prefilters.unshift(e)}else{I.prefilters.push(e)}}});x.speed=function(e,t,i){var n=e&&typeof e==="object"?x.extend({},e):{complete:i||!i&&t||v(e)&&e,duration:e,easing:i&&t||t&&!v(t)&&t};if(x.fx.off){n.duration=0}else{if(typeof n.duration!=="number"){if(n.duration in x.fx.speeds){n.duration=x.fx.speeds[n.duration]}else{n.duration=x.fx.speeds._default}}}if(n.queue==null||n.queue===true){n.queue="fx"}n.old=n.complete;n.complete=function(){if(v(n.old)){n.old.call(this)}if(n.queue){x.dequeue(this,n.queue)}};return n};x.fn.extend({fadeTo:function(e,t,i,n){return this.filter(we).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(t,e,i,n){var r=x.isEmptyObject(t),o=x.speed(e,i,n),a=function(){var e=I(this,x.extend({},t),o);if(r||_.get(this,"finish")){e.stop(true)}};a.finish=a;return r||o.queue===false?this.each(a):this.queue(o.queue,a)},stop:function(r,e,o){var a=function(e){var t=e.stop;delete e.stop;t(o)};if(typeof r!=="string"){o=e;e=r;r=undefined}if(e){this.queue(r||"fx",[])}return this.each(function(){var e=true,t=r!=null&&r+"queueHooks",i=x.timers,n=_.get(this);if(t){if(n[t]&&n[t].stop){a(n[t])}}else{for(t in n){if(n[t]&&n[t].stop&&ft.test(t)){a(n[t])}}}for(t=i.length;t--;){if(i[t].elem===this&&(r==null||i[t].queue===r)){i[t].anim.stop(o);e=false;i.splice(t,1)}}if(e||!o){x.dequeue(this,r)}})},finish:function(a){if(a!==false){a=a||"fx"}return this.each(function(){var e,t=_.get(this),i=t[a+"queue"],n=t[a+"queueHooks"],r=x.timers,o=i?i.length:0;t.finish=true;x.queue(this,a,[]);if(n&&n.stop){n.stop.call(this,true)}for(e=r.length;e--;){if(r[e].elem===this&&r[e].queue===a){r[e].anim.stop(true);r.splice(e,1)}}for(e=0;e<o;e++){if(i[e]&&i[e].finish){i[e].finish.call(this)}}delete t.finish})}});x.each(["toggle","show","hide"],function(e,n){var r=x.fn[n];x.fn[n]=function(e,t,i){return e==null||typeof e==="boolean"?r.apply(this,arguments):this.animate(gt(n,true),e,t,i)}});x.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,n){x.fn[e]=function(e,t,i){return this.animate(n,e,t,i)}});x.timers=[];x.fx.tick=function(){var e,t=0,i=x.timers;N=Date.now();for(;t<i.length;t++){e=i[t];if(!e()&&i[t]===e){i.splice(t--,1)}}if(!i.length){x.fx.stop()}N=undefined};x.fx.timer=function(e){x.timers.push(e);x.fx.start()};x.fx.interval=13;x.fx.start=function(){if(ct){return}ct=true;pt()};x.fx.stop=function(){ct=null};x.fx.speeds={slow:600,fast:200,_default:400};x.fn.delay=function(n,e){n=x.fx?x.fx.speeds[n]||n:n;e=e||"fx";return this.queue(e,function(e,t){var i=A.setTimeout(e,n);t.stop=function(){A.clearTimeout(i)}})};(function(){var e=E.createElement("input"),t=E.createElement("select"),i=t.appendChild(E.createElement("option"));e.type="checkbox";g.checkOn=e.value!=="";g.optSelected=i.selected;e=E.createElement("input");e.value="t";e.type="radio";g.radioValue=e.value==="t"})();var bt,_t=x.expr.attrHandle;x.fn.extend({attr:function(e,t){return d(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})}});x.extend({attr:function(e,t,i){var n,r,o=e.nodeType;if(o===3||o===8||o===2){return}if(typeof e.getAttribute==="undefined"){return x.prop(e,t,i)}if(o!==1||!x.isXMLDoc(e)){r=x.attrHooks[t.toLowerCase()]||(x.expr.match.bool.test(t)?bt:undefined)}if(i!==undefined){if(i===null){x.removeAttr(e,t);return}if(r&&"set"in r&&(n=r.set(e,i,t))!==undefined){return n}e.setAttribute(t,i+"");return i}if(r&&"get"in r&&(n=r.get(e,t))!==null){return n}n=x.find.attr(e,t);return n==null?undefined:n},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&t==="radio"&&u(e,"input")){var i=e.value;e.setAttribute("type",t);if(i){e.value=i}return t}}}},removeAttr:function(e,t){var i,n=0,r=t&&t.match(T);if(r&&e.nodeType===1){while(i=r[n++]){e.removeAttribute(i)}}}});bt={set:function(e,t,i){if(t===false){x.removeAttr(e,i)}else{e.setAttribute(i,i)}return i}};x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var a=_t[t]||x.find.attr;_t[t]=function(e,t,i){var n,r,o=t.toLowerCase();if(!i){r=_t[o];_t[o]=n;n=a(e,t,i)!=null?o:null;_t[o]=r}return n}});var wt=/^(?:input|select|textarea|button)$/i,Ct=/^(?:a|area)$/i;x.fn.extend({prop:function(e,t){return d(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})}});x.extend({prop:function(e,t,i){var n,r,o=e.nodeType;if(o===3||o===8||o===2){return}if(o!==1||!x.isXMLDoc(e)){t=x.propFix[t]||t;r=x.propHooks[t]}if(i!==undefined){if(r&&"set"in r&&(n=r.set(e,i,t))!==undefined){return n}return e[t]=i}if(r&&"get"in r&&(n=r.get(e,t))!==null){return n}return e[t]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");if(t){return parseInt(t,10)}if(wt.test(e.nodeName)||Ct.test(e.nodeName)&&e.href){return 0}return-1}}},propFix:{for:"htmlFor",class:"className"}});if(!g.optSelected){x.propHooks.selected={get:function(e){var t=e.parentNode;if(t&&t.parentNode){t.parentNode.selectedIndex}return null},set:function(e){var t=e.parentNode;if(t){t.selectedIndex;if(t.parentNode){t.parentNode.selectedIndex}}}}}x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this});function P(e){var t=e.match(T)||[];return t.join(" ")}function M(e){return e.getAttribute&&e.getAttribute("class")||""}function At(e){if(Array.isArray(e)){return e}if(typeof e==="string"){return e.match(T)||[]}return[]}x.fn.extend({addClass:function(t){var e,i,n,r,o,a,s,l=0;if(v(t)){return this.each(function(e){x(this).addClass(t.call(this,e,M(this)))})}e=At(t);if(e.length){while(i=this[l++]){r=M(i);n=i.nodeType===1&&" "+P(r)+" ";if(n){a=0;while(o=e[a++]){if(n.indexOf(" "+o+" ")<0){n+=o+" "}}s=P(n);if(r!==s){i.setAttribute("class",s)}}}}return this},removeClass:function(t){var e,i,n,r,o,a,s,l=0;if(v(t)){return this.each(function(e){x(this).removeClass(t.call(this,e,M(this)))})}if(!arguments.length){return this.attr("class","")}e=At(t);if(e.length){while(i=this[l++]){r=M(i);n=i.nodeType===1&&" "+P(r)+" ";if(n){a=0;while(o=e[a++]){while(n.indexOf(" "+o+" ")>-1){n=n.replace(" "+o+" "," ")}}s=P(n);if(r!==s){i.setAttribute("class",s)}}}}return this},toggleClass:function(r,t){var o=typeof r,a=o==="string"||Array.isArray(r);if(typeof t==="boolean"&&a){return t?this.addClass(r):this.removeClass(r)}if(v(r)){return this.each(function(e){x(this).toggleClass(r.call(this,e,M(this),t),t)})}return this.each(function(){var e,t,i,n;if(a){t=0;i=x(this);n=At(r);while(e=n[t++]){if(i.hasClass(e)){i.removeClass(e)}else{i.addClass(e)}}}else if(r===undefined||o==="boolean"){e=M(this);if(e){_.set(this,"__className__",e)}if(this.setAttribute){this.setAttribute("class",e||r===false?"":_.get(this,"__className__")||"")}}})},hasClass:function(e){var t,i,n=0;t=" "+e+" ";while(i=this[n++]){if(i.nodeType===1&&(" "+P(M(i))+" ").indexOf(t)>-1){return true}}return false}});var Et=/\r/g;x.fn.extend({val:function(i){var n,e,r,t=this[0];if(!arguments.length){if(t){n=x.valHooks[t.type]||x.valHooks[t.nodeName.toLowerCase()];if(n&&"get"in n&&(e=n.get(t,"value"))!==undefined){return e}e=t.value;if(typeof e==="string"){return e.replace(Et,"")}return e==null?"":e}return}r=v(i);return this.each(function(e){var t;if(this.nodeType!==1){return}if(r){t=i.call(this,e,x(this).val())}else{t=i}if(t==null){t=""}else if(typeof t==="number"){t+=""}else if(Array.isArray(t)){t=x.map(t,function(e){return e==null?"":e+""})}n=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,t,"value")===undefined){this.value=t}})}});x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return t!=null?t:P(x.text(e))}},select:{get:function(e){var t,i,n,r=e.options,o=e.selectedIndex,a=e.type==="select-one",s=a?null:[],l=a?o+1:r.length;if(o<0){n=l}else{n=a?o:0}for(;n<l;n++){i=r[n];if((i.selected||n===o)&&!i.disabled&&(!i.parentNode.disabled||!u(i.parentNode,"optgroup"))){t=x(i).val();if(a){return t}s.push(t)}}return s},set:function(e,t){var i,n,r=e.options,o=x.makeArray(t),a=r.length;while(a--){n=r[a];if(n.selected=x.inArray(x.valHooks.option.get(n),o)>-1){i=true}}if(!i){e.selectedIndex=-1}return o}}}});x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){if(Array.isArray(t)){return e.checked=x.inArray(x(e).val(),t)>-1}}};if(!g.checkOn){x.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value}}});g.focusin="onfocusin"in A;var xt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};x.extend(x.event,{trigger:function(e,t,i,n){var r,o,a,s,l,u,c,d,f=[i||E],p=B.call(e,"type")?e.type:e,h=B.call(e,"namespace")?e.namespace.split("."):[];o=d=a=i=i||E;if(i.nodeType===3||i.nodeType===8){return}if(xt.test(p+x.event.triggered)){return}if(p.indexOf(".")>-1){h=p.split(".");p=h.shift();h.sort()}l=p.indexOf(":")<0&&"on"+p;e=e[x.expando]?e:new x.Event(p,typeof e==="object"&&e);e.isTrigger=n?2:3;e.namespace=h.join(".");e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;e.result=undefined;if(!e.target){e.target=i}t=t==null?[e]:x.makeArray(t,[e]);c=x.event.special[p]||{};if(!n&&c.trigger&&c.trigger.apply(i,t)===false){return}if(!n&&!c.noBubble&&!m(i)){s=c.delegateType||p;if(!xt.test(s+p)){o=o.parentNode}for(;o;o=o.parentNode){f.push(o);a=o}if(a===(i.ownerDocument||E)){f.push(a.defaultView||a.parentWindow||A)}}r=0;while((o=f[r++])&&!e.isPropagationStopped()){d=o;e.type=r>1?s:c.bindType||p;u=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle");if(u){u.apply(o,t)}u=l&&o[l];if(u&&u.apply&&b(o)){e.result=u.apply(o,t);if(e.result===false){e.preventDefault()}}}e.type=p;if(!n&&!e.isDefaultPrevented()){if((!c._default||c._default.apply(f.pop(),t)===false)&&b(i)){if(l&&v(i[p])&&!m(i)){a=i[l];if(a){i[l]=null}x.event.triggered=p;if(e.isPropagationStopped()){d.addEventListener(p,Tt)}i[p]();if(e.isPropagationStopped()){d.removeEventListener(p,Tt)}x.event.triggered=undefined;if(a){i[l]=a}}}}return e.result},simulate:function(e,t,i){var n=x.extend(new x.Event,i,{type:e,isSimulated:true});x.event.trigger(n,null,t)}});x.fn.extend({trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i){return x.event.trigger(e,t,i,true)}}});if(!g.focusin){x.each({focus:"focusin",blur:"focusout"},function(i,n){var r=function(e){x.event.simulate(n,e.target,x.event.fix(e))};x.event.special[n]={setup:function(){var e=this.ownerDocument||this.document||this,t=_.access(e,n);if(!t){e.addEventListener(i,r,true)}_.access(e,n,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=_.access(e,n)-1;if(!t){e.removeEventListener(i,r,true);_.remove(e,n)}else{_.access(e,n,t)}}}})}var St=A.location;var Dt={guid:Date.now()};var kt=/\?/;x.parseXML=function(e){var t;if(!e||typeof e!=="string"){return null}try{t=(new A.DOMParser).parseFromString(e,"text/xml")}catch(e){t=undefined}if(!t||t.getElementsByTagName("parsererror").length){x.error("Invalid XML: "+e)}return t};var Ot=/\[\]$/,Rt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;function Pt(i,e,n,r){var t;if(Array.isArray(e)){x.each(e,function(e,t){if(n||Ot.test(i)){r(i,t)}else{Pt(i+"["+(typeof t==="object"&&t!=null?e:"")+"]",t,n,r)}})}else if(!n&&y(e)==="object"){for(t in e){Pt(i+"["+t+"]",e[t],n,r)}}else{r(i,e)}}x.param=function(e,t){var i,n=[],r=function(e,t){var i=v(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(i==null?"":i)};if(e==null){return""}if(Array.isArray(e)||e.jquery&&!x.isPlainObject(e)){x.each(e,function(){r(this.name,this.value)})}else{for(i in e){Pt(i,e[i],t,r)}}return n.join("&")};x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&It.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!r.test(e))}).map(function(e,t){var i=x(this).val();if(i==null){return null}if(Array.isArray(i)){return x.map(i,function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}})}return{name:t.name,value:i.replace(Rt,"\r\n")}}).get()}});var Mt=/%20/g,Lt=/#.*$/,Ft=/([?&])_=[^&]*/,Gt=/^(.*?):[ \t]*([^\r\n]*)$/gm,$t=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Wt=/^(?:GET|HEAD)$/,Ht=/^\/\//,jt={},Bt={},Vt="*/".concat("*"),zt=E.createElement("a");zt.href=St.href;function Ut(o){return function(e,t){if(typeof e!=="string"){t=e;e="*"}var i,n=0,r=e.toLowerCase().match(T)||[];if(v(t)){while(i=r[n++]){if(i[0]==="+"){i=i.slice(1)||"*";(o[i]=o[i]||[]).unshift(t)}else{(o[i]=o[i]||[]).push(t)}}}}}function Yt(t,r,o,a){var s={},l=t===Bt;function u(e){var n;s[e]=true;x.each(t[e]||[],function(e,t){var i=t(r,o,a);if(typeof i==="string"&&!l&&!s[i]){r.dataTypes.unshift(i);u(i);return false}else if(l){return!(n=i)}});return n}return u(r.dataTypes[0])||!s["*"]&&u("*")}function qt(e,t){var i,n,r=x.ajaxSettings.flatOptions||{};for(i in t){if(t[i]!==undefined){(r[i]?e:n||(n={}))[i]=t[i]}}if(n){x.extend(true,e,n)}return e}function Xt(e,t,i){var n,r,o,a,s=e.contents,l=e.dataTypes;while(l[0]==="*"){l.shift();if(n===undefined){n=e.mimeType||t.getResponseHeader("Content-Type")}}if(n){for(r in s){if(s[r]&&s[r].test(n)){l.unshift(r);break}}}if(l[0]in i){o=l[0]}else{for(r in i){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}if(!a){a=r}}o=o||a}if(o){if(o!==l[0]){l.unshift(o)}return i[o]}}function Kt(e,t,i,n){var r,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1]){for(a in e.converters){u[a.toLowerCase()]=e.converters[a]}}o=c.shift();while(o){if(e.responseFields[o]){i[e.responseFields[o]]=t}if(!l&&n&&e.dataFilter){t=e.dataFilter(t,e.dataType)}l=o;o=c.shift();if(o){if(o==="*"){o=l}else if(l!=="*"&&l!==o){a=u[l+" "+o]||u["* "+o];if(!a){for(r in u){s=r.split(" ");if(s[1]===o){a=u[l+" "+s[0]]||u["* "+s[0]];if(a){if(a===true){a=u[r]}else if(u[r]!==true){o=s[0];c.unshift(s[1])}break}}}}if(a!==true){if(a&&e.throws){t=a(t)}else{try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}}}}}return{state:"success",data:t}}x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:St.href,type:"GET",isLocal:$t.test(St.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Vt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(e,t){return t?qt(qt(e,x.ajaxSettings),t):qt(x.ajaxSettings,e)},ajaxPrefilter:Ut(jt),ajaxTransport:Ut(Bt),ajax:function(e,t){if(typeof e==="object"){t=e;e=undefined}t=t||{};var c,d,f,i,p,n,h,g,r,o,v=x.ajaxSetup({},t),m=v.context||v,y=v.context&&(m.nodeType||m.jquery)?x(m):x.event,b=x.Deferred(),_=x.Callbacks("once memory"),w=v.statusCode||{},a={},s={},l="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(h){if(!i){i={};while(t=Gt.exec(f)){i[t[1].toLowerCase()+" "]=(i[t[1].toLowerCase()+" "]||[]).concat(t[2])}}t=i[e.toLowerCase()+" "]}return t==null?null:t.join(", ")},getAllResponseHeaders:function(){return h?f:null},setRequestHeader:function(e,t){if(h==null){e=s[e.toLowerCase()]=s[e.toLowerCase()]||e;a[e]=t}return this},overrideMimeType:function(e){if(h==null){v.mimeType=e}return this},statusCode:function(e){var t;if(e){if(h){C.always(e[C.status])}else{for(t in e){w[t]=[w[t],e[t]]}}}return this},abort:function(e){var t=e||l;if(c){c.abort(t)}u(0,t);return this}};b.promise(C);v.url=((e||v.url||St.href)+"").replace(Ht,St.protocol+"//");v.type=t.method||t.type||v.method||v.type;v.dataTypes=(v.dataType||"*").toLowerCase().match(T)||[""];if(v.crossDomain==null){n=E.createElement("a");try{n.href=v.url;n.href=n.href;v.crossDomain=zt.protocol+"//"+zt.host!==n.protocol+"//"+n.host}catch(e){v.crossDomain=true}}if(v.data&&v.processData&&typeof v.data!=="string"){v.data=x.param(v.data,v.traditional)}Yt(jt,v,t,C);if(h){return C}g=x.event&&v.global;if(g&&x.active++===0){x.event.trigger("ajaxStart")}v.type=v.type.toUpperCase();v.hasContent=!Wt.test(v.type);d=v.url.replace(Lt,"");if(!v.hasContent){o=v.url.slice(d.length);if(v.data&&(v.processData||typeof v.data==="string")){d+=(kt.test(d)?"&":"?")+v.data;delete v.data}if(v.cache===false){d=d.replace(Ft,"$1");o=(kt.test(d)?"&":"?")+"_="+Dt.guid+++o}v.url=d+o}else if(v.data&&v.processData&&(v.contentType||"").indexOf("application/x-www-form-urlencoded")===0){v.data=v.data.replace(Mt,"+")}if(v.ifModified){if(x.lastModified[d]){C.setRequestHeader("If-Modified-Since",x.lastModified[d])}if(x.etag[d]){C.setRequestHeader("If-None-Match",x.etag[d])}}if(v.data&&v.hasContent&&v.contentType!==false||t.contentType){C.setRequestHeader("Content-Type",v.contentType)}C.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+(v.dataTypes[0]!=="*"?", "+Vt+"; q=0.01":""):v.accepts["*"]);for(r in v.headers){C.setRequestHeader(r,v.headers[r])}if(v.beforeSend&&(v.beforeSend.call(m,C,v)===false||h)){return C.abort()}l="abort";_.add(v.complete);C.done(v.success);C.fail(v.error);c=Yt(Bt,v,t,C);if(!c){u(-1,"No Transport")}else{C.readyState=1;if(g){y.trigger("ajaxSend",[C,v])}if(h){return C}if(v.async&&v.timeout>0){p=A.setTimeout(function(){C.abort("timeout")},v.timeout)}try{h=false;c.send(a,u)}catch(e){if(h){throw e}u(-1,e)}}function u(e,t,i,n){var r,o,a,s,l,u=t;if(h){return}h=true;if(p){A.clearTimeout(p)}c=undefined;f=n||"";C.readyState=e>0?4:0;r=e>=200&&e<300||e===304;if(i){s=Xt(v,C,i)}if(!r&&x.inArray("script",v.dataTypes)>-1){v.converters["text script"]=function(){}}s=Kt(v,s,C,r);if(r){if(v.ifModified){l=C.getResponseHeader("Last-Modified");if(l){x.lastModified[d]=l}l=C.getResponseHeader("etag");if(l){x.etag[d]=l}}if(e===204||v.type==="HEAD"){u="nocontent"}else if(e===304){u="notmodified"}else{u=s.state;o=s.data;a=s.error;r=!a}}else{a=u;if(e||!u){u="error";if(e<0){e=0}}}C.status=e;C.statusText=(t||u)+"";if(r){b.resolveWith(m,[o,u,C])}else{b.rejectWith(m,[C,u,a])}C.statusCode(w);w=undefined;if(g){y.trigger(r?"ajaxSuccess":"ajaxError",[C,v,r?o:a])}_.fireWith(m,[C,u]);if(g){y.trigger("ajaxComplete",[C,v]);if(!--x.active){x.event.trigger("ajaxStop")}}}return C},getJSON:function(e,t,i){return x.get(e,t,i,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}});x.each(["get","post"],function(e,r){x[r]=function(e,t,i,n){if(v(t)){n=n||i;i=t;t=undefined}return x.ajax(x.extend({url:e,type:r,dataType:n,data:t,success:i},x.isPlainObject(e)&&e))}});x.ajaxPrefilter(function(e){var t;for(t in e.headers){if(t.toLowerCase()==="content-type"){e.contentType=e.headers[t]||""}}});x._evalUrl=function(e,t,i){return x.ajax({url:e,type:"GET",dataType:"script",cache:true,async:false,global:false,converters:{"text script":function(){}},dataFilter:function(e){x.globalEval(e,t,i)}})};x.fn.extend({wrapAll:function(e){var t;if(this[0]){if(v(e)){e=e.call(this[0])}t=x(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){t.insertBefore(this[0])}t.map(function(){var e=this;while(e.firstElementChild){e=e.firstElementChild}return e}).append(this)}return this},wrapInner:function(i){if(v(i)){return this.each(function(e){x(this).wrapInner(i.call(this,e))})}return this.each(function(){var e=x(this),t=e.contents();if(t.length){t.wrapAll(i)}else{e.append(i)}})},wrap:function(t){var i=v(t);return this.each(function(e){x(this).wrapAll(i?t.call(this,e):t)})},unwrap:function(e){this.parent(e).not("body").each(function(){x(this).replaceWith(this.childNodes)});return this}});x.expr.pseudos.hidden=function(e){return!x.expr.pseudos.visible(e)};x.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};x.ajaxSettings.xhr=function(){try{return new A.XMLHttpRequest}catch(e){}};var Qt={0:200,1223:204},Zt=x.ajaxSettings.xhr();g.cors=!!Zt&&"withCredentials"in Zt;g.ajax=Zt=!!Zt;x.ajaxTransport(function(r){var o,a;if(g.cors||Zt&&!r.crossDomain){return{send:function(e,t){var i,n=r.xhr();n.open(r.type,r.url,r.async,r.username,r.password);if(r.xhrFields){for(i in r.xhrFields){n[i]=r.xhrFields[i]}}if(r.mimeType&&n.overrideMimeType){n.overrideMimeType(r.mimeType)}if(!r.crossDomain&&!e["X-Requested-With"]){e["X-Requested-With"]="XMLHttpRequest"}for(i in e){n.setRequestHeader(i,e[i])}o=function(e){return function(){if(o){o=a=n.onload=n.onerror=n.onabort=n.ontimeout=n.onreadystatechange=null;if(e==="abort"){n.abort()}else if(e==="error"){if(typeof n.status!=="number"){t(0,"error")}else{t(n.status,n.statusText)}}else{t(Qt[n.status]||n.status,n.statusText,(n.responseType||"text")!=="text"||typeof n.responseText!=="string"?{binary:n.response}:{text:n.responseText},n.getAllResponseHeaders())}}}};n.onload=o();a=n.onerror=n.ontimeout=o("error");if(n.onabort!==undefined){n.onabort=a}else{n.onreadystatechange=function(){if(n.readyState===4){A.setTimeout(function(){if(o){a()}})}}}o=o("abort");try{n.send(r.hasContent&&r.data||null)}catch(e){if(o){throw e}}},abort:function(){if(o){o()}}}}});x.ajaxPrefilter(function(e){if(e.crossDomain){e.contents.script=false}});x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){x.globalEval(e);return e}}});x.ajaxPrefilter("script",function(e){if(e.cache===undefined){e.cache=false}if(e.crossDomain){e.type="GET"}});x.ajaxTransport("script",function(i){if(i.crossDomain||i.scriptAttrs){var n,r;return{send:function(e,t){n=x("<script>").attr(i.scriptAttrs||{}).prop({charset:i.scriptCharset,src:i.url}).on("load error",r=function(e){n.remove();r=null;if(e){t(e.type==="error"?404:200,e.type)}});E.head.appendChild(n[0])},abort:function(){if(r){r()}}}}});var Jt=[],ei=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Jt.pop()||x.expando+"_"+Dt.guid++;this[e]=true;return e}});x.ajaxPrefilter("json jsonp",function(e,t,i){var n,r,o,a=e.jsonp!==false&&(ei.test(e.url)?"url":typeof e.data==="string"&&(e.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&ei.test(e.data)&&"data");if(a||e.dataTypes[0]==="jsonp"){n=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback;if(a){e[a]=e[a].replace(ei,"$1"+n)}else if(e.jsonp!==false){e.url+=(kt.test(e.url)?"&":"?")+e.jsonp+"="+n}e.converters["script json"]=function(){if(!o){x.error(n+" was not called")}return o[0]};e.dataTypes[0]="json";r=A[n];A[n]=function(){o=arguments};i.always(function(){if(r===undefined){x(A).removeProp(n)}else{A[n]=r}if(e[n]){e.jsonpCallback=t.jsonpCallback;Jt.push(n)}if(o&&v(r)){r(o[0])}o=r=undefined});return"script"}});g.createHTMLDocument=function(){var e=E.implementation.createHTMLDocument("").body;e.innerHTML="<form></form><form></form>";return e.childNodes.length===2}();x.parseHTML=function(e,t,i){if(typeof e!=="string"){return[]}if(typeof t==="boolean"){i=t;t=false}var n,r,o;if(!t){if(g.createHTMLDocument){t=E.implementation.createHTMLDocument("");n=t.createElement("base");n.href=E.location.href;t.head.appendChild(n)}else{t=E}}r=Z.exec(e);o=!i&&[];if(r){return[t.createElement(r[1])]}r=ke([e],t,o);if(o&&o.length){x(o).remove()}return x.merge([],r.childNodes)};x.fn.load=function(e,t,i){var n,r,o,a=this,s=e.indexOf(" ");if(s>-1){n=P(e.slice(s));e=e.slice(0,s)}if(v(t)){i=t;t=undefined}else if(t&&typeof t==="object"){r="POST"}if(a.length>0){x.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){o=arguments;a.html(n?x("<div>").append(x.parseHTML(e)).find(n):e)}).always(i&&function(e,t){a.each(function(){i.apply(this,o||[e.responseText,t,e])})})}return this};x.expr.pseudos.animated=function(t){return x.grep(x.timers,function(e){return t===e.elem}).length};x.offset={setOffset:function(e,t,i){var n,r,o,a,s,l,u,c=x.css(e,"position"),d=x(e),f={};if(c==="static"){e.style.position="relative"}s=d.offset();o=x.css(e,"top");l=x.css(e,"left");u=(c==="absolute"||c==="fixed")&&(o+l).indexOf("auto")>-1;if(u){n=d.position();a=n.top;r=n.left}else{a=parseFloat(o)||0;r=parseFloat(l)||0}if(v(t)){t=t.call(e,i,x.extend({},s))}if(t.top!=null){f.top=t.top-s.top+a}if(t.left!=null){f.left=t.left-s.left+r}if("using"in t){t.using.call(e,f)}else{if(typeof f.top==="number"){f.top+="px"}if(typeof f.left==="number"){f.left+="px"}d.css(f)}}};x.fn.extend({offset:function(t){if(arguments.length){return t===undefined?this:this.each(function(e){x.offset.setOffset(this,t,e)})}var e,i,n=this[0];if(!n){return}if(!n.getClientRects().length){return{top:0,left:0}}e=n.getBoundingClientRect();i=n.ownerDocument.defaultView;return{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}},position:function(){if(!this[0]){return}var e,t,i,n=this[0],r={top:0,left:0};if(x.css(n,"position")==="fixed"){t=n.getBoundingClientRect()}else{t=this.offset();i=n.ownerDocument;e=n.offsetParent||i.documentElement;while(e&&(e===i.body||e===i.documentElement)&&x.css(e,"position")==="static"){e=e.parentNode}if(e&&e!==n&&e.nodeType===1){r=x(e).offset();r.top+=x.css(e,"borderTopWidth",true);r.left+=x.css(e,"borderLeftWidth",true)}}return{top:t.top-r.top-x.css(n,"marginTop",true),left:t.left-r.left-x.css(n,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&x.css(e,"position")==="static"){e=e.offsetParent}return e||C})}});x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var o="pageYOffset"===r;x.fn[t]=function(e){return d(this,function(e,t,i){var n;if(m(e)){n=e}else if(e.nodeType===9){n=e.defaultView}if(i===undefined){return n?n[r]:e[t]}if(n){n.scrollTo(!o?i:n.pageXOffset,o?i:n.pageYOffset)}else{e[t]=i}},t,e,arguments.length)}});x.each(["top","left"],function(e,i){x.cssHooks[i]=Qe(g.pixelPosition,function(e,t){if(t){t=Ke(e,i);return Ue.test(t)?x(e).position()[i]+"px":t}})});x.each({Height:"height",Width:"width"},function(a,s){x.each({padding:"inner"+a,content:s,"":"outer"+a},function(n,o){x.fn[o]=function(e,t){var i=arguments.length&&(n||typeof e!=="boolean"),r=n||(e===true||t===true?"margin":"border");return d(this,function(e,t,i){var n;if(m(e)){return o.indexOf("outer")===0?e["inner"+a]:e.document.documentElement["client"+a]}if(e.nodeType===9){n=e.documentElement;return Math.max(e.body["scroll"+a],n["scroll"+a],e.body["offset"+a],n["offset"+a],n["client"+a])}return i===undefined?x.css(e,t,r):x.style(e,t,i,r)},s,i?e:undefined,i)}})});x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}});x.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});x.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(e,i){x.fn[i]=function(e,t){return arguments.length>0?this.on(i,null,e,t):this.trigger(i)}});var ti=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;x.proxy=function(e,t){var i,n,r;if(typeof t==="string"){i=e[t];t=e;e=i}if(!v(e)){return undefined}n=s.call(arguments,2);r=function(){return e.apply(t||this,n.concat(s.call(arguments)))};r.guid=e.guid=e.guid||x.guid++;return r};x.holdReady=function(e){if(e){x.readyWait++}else{x.ready(true)}};x.isArray=Array.isArray;x.parseJSON=JSON.parse;x.nodeName=u;x.isFunction=v;x.isWindow=m;x.camelCase=f;x.type=y;x.now=Date.now;x.isNumeric=function(e){var t=x.type(e);return(t==="number"||t==="string")&&!isNaN(e-parseFloat(e))};x.trim=function(e){return e==null?"":(e+"").replace(ti,"")};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return x})}var ii=A.jQuery,ni=A.$;x.noConflict=function(e){if(A.$===x){A.$=ni}if(e&&A.jQuery===x){A.jQuery=ii}return x};if(typeof L==="undefined"){A.jQuery=A.$=x}return x});(function(e){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(te){"use strict";te.ui=te.ui||{};var M=te.ui.version="1.13.1";var i=0;var a=Array.prototype.hasOwnProperty;var s=Array.prototype.slice;te.cleanData=function(r){return function(e){var t,i,n;for(n=0;(i=e[n])!=null;n++){t=te._data(i,"events");if(t&&t.remove){te(i).triggerHandler("remove")}}r(e)}}(te.cleanData);te.widget=function(e,i,t){var n,r,o;var a={};var s=e.split(".")[0];e=e.split(".")[1];var l=s+"-"+e;if(!t){t=i;i=te.Widget}if(Array.isArray(t)){t=te.extend.apply(null,[{}].concat(t))}te.expr.pseudos[l.toLowerCase()]=function(e){return!!te.data(e,l)};te[s]=te[s]||{};n=te[s][e];r=te[s][e]=function(e,t){if(!this||!this._createWidget){return new r(e,t)}if(arguments.length){this._createWidget(e,t)}};te.extend(r,n,{version:t.version,_proto:te.extend({},t),_childConstructors:[]});o=new i;o.options=te.widget.extend({},o.options);te.each(t,function(t,o){if(typeof o!=="function"){a[t]=o;return}a[t]=function(){function n(){return i.prototype[t].apply(this,arguments)}function r(e){return i.prototype[t].apply(this,e)}return function(){var e=this._super;var t=this._superApply;var i;this._super=n;this._superApply=r;i=o.apply(this,arguments);this._super=e;this._superApply=t;return i}}()});r.prototype=te.widget.extend(o,{widgetEventPrefix:n?o.widgetEventPrefix||e:e},a,{constructor:r,namespace:s,widgetName:e,widgetFullName:l});if(n){te.each(n._childConstructors,function(e,t){var i=t.prototype;te.widget(i.namespace+"."+i.widgetName,r,t._proto)});delete n._childConstructors}else{i._childConstructors.push(r)}te.widget.bridge(e,r);return r};te.widget.extend=function(e){var t=s.call(arguments,1);var i=0;var n=t.length;var r;var o;for(;i<n;i++){for(r in t[i]){o=t[i][r];if(a.call(t[i],r)&&o!==undefined){if(te.isPlainObject(o)){e[r]=te.isPlainObject(e[r])?te.widget.extend({},e[r],o):te.widget.extend({},o)}else{e[r]=o}}}}return e};te.widget.bridge=function(o,t){var a=t.prototype.widgetFullName||o;te.fn[o]=function(i){var e=typeof i==="string";var n=s.call(arguments,1);var r=this;if(e){if(!this.length&&i==="instance"){r=undefined}else{this.each(function(){var e;var t=te.data(this,a);if(i==="instance"){r=t;return false}if(!t){return te.error("cannot call methods on "+o+" prior to initialization; "+"attempted to call method '"+i+"'")}if(typeof t[i]!=="function"||i.charAt(0)==="_"){return te.error("no such method '"+i+"' for "+o+" widget instance")}e=t[i].apply(t,n);if(e!==t&&e!==undefined){r=e&&e.jquery?r.pushStack(e.get()):e;return false}})}}else{if(n.length){i=te.widget.extend.apply(null,[i].concat(n))}this.each(function(){var e=te.data(this,a);if(e){e.option(i||{});if(e._init){e._init()}}else{te.data(this,a,new t(i,this))}})}return r}};te.Widget=function(){};te.Widget._childConstructors=[];te.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(e,t){t=te(t||this.defaultElement||this)[0];this.element=te(t);this.uuid=i++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=te();this.hoverable=te();this.focusable=te();this.classesElementLookup={};if(t!==this){te.data(t,this.widgetFullName,this);this._on(true,this.element,{remove:function(e){if(e.target===t){this.destroy()}}});this.document=te(t.style?t.ownerDocument:t.document||t);this.window=te(this.document[0].defaultView||this.document[0].parentWindow)}this.options=te.widget.extend({},this.options,this._getCreateOptions(),e);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:te.noop,_create:te.noop,_init:te.noop,destroy:function(){var i=this;this._destroy();te.each(this.classesElementLookup,function(e,t){i._removeClass(t,e)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:te.noop,widget:function(){return this.element},option:function(e,t){var i=e;var n;var r;var o;if(arguments.length===0){return te.widget.extend({},this.options)}if(typeof e==="string"){i={};n=e.split(".");e=n.shift();if(n.length){r=i[e]=te.widget.extend({},this.options[e]);for(o=0;o<n.length-1;o++){r[n[o]]=r[n[o]]||{};r=r[n[o]]}e=n.pop();if(arguments.length===1){return r[e]===undefined?null:r[e]}r[e]=t}else{if(arguments.length===1){return this.options[e]===undefined?null:this.options[e]}i[e]=t}}this._setOptions(i);return this},_setOptions:function(e){var t;for(t in e){this._setOption(t,e[t])}return this},_setOption:function(e,t){if(e==="classes"){this._setOptionClasses(t)}this.options[e]=t;if(e==="disabled"){this._setOptionDisabled(t)}return this},_setOptionClasses:function(e){var t,i,n;for(t in e){n=this.classesElementLookup[t];if(e[t]===this.options.classes[t]||!n||!n.length){continue}i=te(n.get());this._removeClass(n,t);i.addClass(this._classes({element:i,keys:t,classes:e,add:true}))}},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e);if(e){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(r){var o=[];var a=this;r=te.extend({element:this.element,classes:this.options.classes||{}},r);function s(){var n=[];r.element.each(function(e,t){var i=te.map(a.classesElementLookup,function(e){return e}).some(function(e){return e.is(t)});if(!i){n.push(t)}});a._on(te(n),{remove:"_untrackClassesElement"})}function e(e,t){var i,n;for(n=0;n<e.length;n++){i=a.classesElementLookup[e[n]]||te();if(r.add){s();i=te(te.uniqueSort(i.get().concat(r.element.get())))}else{i=te(i.not(r.element).get())}a.classesElementLookup[e[n]]=i;o.push(e[n]);if(t&&r.classes[e[n]]){o.push(r.classes[e[n]])}}}if(r.keys){e(r.keys.match(/\S+/g)||[],true)}if(r.extra){e(r.extra.match(/\S+/g)||[])}return o.join(" ")},_untrackClassesElement:function(i){var n=this;te.each(n.classesElementLookup,function(e,t){if(te.inArray(i.target,t)!==-1){n.classesElementLookup[e]=te(t.not(i.target).get())}});this._off(te(i.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,false)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,true)},_toggleClass:function(e,t,i,n){n=typeof n==="boolean"?n:i;var r=typeof e==="string"||e===null,o={extra:r?t:i,keys:r?e:t,element:r?this.element:e,add:n};o.element.toggleClass(this._classes(o),n);return this},_on:function(a,s,e){var l;var u=this;if(typeof a!=="boolean"){e=s;s=a;a=false}if(!e){e=s;s=this.element;l=this.widget()}else{s=l=te(s);this.bindings=this.bindings.add(s)}te.each(e,function(e,t){function i(){if(!a&&(u.options.disabled===true||te(this).hasClass("ui-state-disabled"))){return}return(typeof t==="string"?u[t]:t).apply(u,arguments)}if(typeof t!=="string"){i.guid=t.guid=t.guid||i.guid||te.guid++}var n=e.match(/^([\w:-]*)\s*(.*)$/);var r=n[1]+u.eventNamespace;var o=n[2];if(o){l.on(r,o,i)}else{s.on(r,i)}})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.off(t);this.bindings=te(this.bindings.not(e).get());this.focusable=te(this.focusable.not(e).get());this.hoverable=te(this.hoverable.not(e).get())},_delay:function(e,t){function i(){return(typeof e==="string"?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){this._addClass(te(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(te(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){this._addClass(te(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(te(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,t,i){var n,r;var o=this.options[e];i=i||{};t=te.Event(t);t.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();t.target=this.element[0];r=t.originalEvent;if(r){for(n in r){if(!(n in t)){t[n]=r[n]}}}this.element.trigger(t,i);return!(typeof o==="function"&&o.apply(this.element[0],[t].concat(i))===false||t.isDefaultPrevented())}};te.each({show:"fadeIn",hide:"fadeOut"},function(o,a){te.Widget.prototype["_"+o]=function(t,e,i){if(typeof e==="string"){e={effect:e}}var n;var r=!e?o:e===true||typeof e==="number"?a:e.effect||a;e=e||{};if(typeof e==="number"){e={duration:e}}else if(e===true){e={}}n=!te.isEmptyObject(e);e.complete=i;if(e.delay){t.delay(e.delay)}if(n&&te.effects&&te.effects.effect[r]){t[o](e)}else if(r!==o&&t[r]){t[r](e.duration,e.easing,i)}else{t.queue(function(e){te(this)[o]();if(i){i.call(t[0])}e()})}}});var L=te.widget;(function(){var r,C=Math.max,A=Math.abs,n=/left|center|right/,o=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,s=/^\w+/,l=/%$/,t=te.fn.position;function E(e,t,i){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?i/100:1)]}function x(e,t){return parseInt(te.css(e,t),10)||0}function u(e){return e!=null&&e===e.window}function i(e){var t=e[0];if(t.nodeType===9){return{width:e.width(),height:e.height(),offset:{top:0,left:0}}}if(u(t)){return{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}}if(t.preventDefault){return{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}}return{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}te.position={scrollbarWidth:function(){if(r!==undefined){return r}var e,t,i=te("<div style="+"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>"+"<div style='height:300px;width:auto;'></div></div>"),n=i.children()[0];te("body").append(i);e=n.offsetWidth;i.css("overflow","scroll");t=n.offsetWidth;if(e===t){t=i[0].clientWidth}i.remove();return r=e-t},getScrollInfo:function(e){var t=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),i=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n=t==="scroll"||t==="auto"&&e.width<e.element[0].scrollWidth,r=i==="scroll"||i==="auto"&&e.height<e.element[0].scrollHeight;return{width:r?te.position.scrollbarWidth():0,height:n?te.position.scrollbarWidth():0}},getWithinInfo:function(e){var t=te(e||window),i=u(t[0]),n=!!t[0]&&t[0].nodeType===9,r=!i&&!n;return{element:t,isWindow:i,isDocument:n,offset:r?te(e).offset():{left:0,top:0},scrollLeft:t.scrollLeft(),scrollTop:t.scrollTop(),width:t.outerWidth(),height:t.outerHeight()}}};te.fn.position=function(d){if(!d||!d.of){return t.apply(this,arguments)}d=te.extend({},d);var f,p,h,g,v,e,m=typeof d.of==="string"?te(document).find(d.of):te(d.of),y=te.position.getWithinInfo(d.within),b=te.position.getScrollInfo(y),_=(d.collision||"flip").split(" "),w={};e=i(m);if(m[0].preventDefault){d.at="left top"}p=e.width;h=e.height;g=e.offset;v=te.extend({},g);te.each(["my","at"],function(){var e=(d[this]||"").split(" "),t,i;if(e.length===1){e=n.test(e[0])?e.concat(["center"]):o.test(e[0])?["center"].concat(e):["center","center"]}e[0]=n.test(e[0])?e[0]:"center";e[1]=o.test(e[1])?e[1]:"center";t=a.exec(e[0]);i=a.exec(e[1]);w[this]=[t?t[0]:0,i?i[0]:0];d[this]=[s.exec(e[0])[0],s.exec(e[1])[0]]});if(_.length===1){_[1]=_[0]}if(d.at[0]==="right"){v.left+=p}else if(d.at[0]==="center"){v.left+=p/2}if(d.at[1]==="bottom"){v.top+=h}else if(d.at[1]==="center"){v.top+=h/2}f=E(w.at,p,h);v.left+=f[0];v.top+=f[1];return this.each(function(){var i,e,a=te(this),s=a.outerWidth(),l=a.outerHeight(),t=x(this,"marginLeft"),n=x(this,"marginTop"),r=s+t+x(this,"marginRight")+b.width,o=l+n+x(this,"marginBottom")+b.height,u=te.extend({},v),c=E(w.my,a.outerWidth(),a.outerHeight());if(d.my[0]==="right"){u.left-=s}else if(d.my[0]==="center"){u.left-=s/2}if(d.my[1]==="bottom"){u.top-=l}else if(d.my[1]==="center"){u.top-=l/2}u.left+=c[0];u.top+=c[1];i={marginLeft:t,marginTop:n};te.each(["left","top"],function(e,t){if(te.ui.position[_[e]]){te.ui.position[_[e]][t](u,{targetWidth:p,targetHeight:h,elemWidth:s,elemHeight:l,collisionPosition:i,collisionWidth:r,collisionHeight:o,offset:[f[0]+c[0],f[1]+c[1]],my:d.my,at:d.at,within:y,elem:a})}});if(d.using){e=function(e){var t=g.left-u.left,i=t+p-s,n=g.top-u.top,r=n+h-l,o={target:{element:m,left:g.left,top:g.top,width:p,height:h},element:{element:a,left:u.left,top:u.top,width:s,height:l},horizontal:i<0?"left":t>0?"right":"center",vertical:r<0?"top":n>0?"bottom":"middle"};if(p<s&&A(t+i)<p){o.horizontal="center"}if(h<l&&A(n+r)<h){o.vertical="middle"}if(C(A(t),A(i))>C(A(n),A(r))){o.important="horizontal"}else{o.important="vertical"}d.using.call(this,e,o)}}a.offset(te.extend(u,{using:e}))})};te.ui.position={fit:{left:function(e,t){var i=t.within,n=i.isWindow?i.scrollLeft:i.offset.left,r=i.width,o=e.left-t.collisionPosition.marginLeft,a=n-o,s=o+t.collisionWidth-r-n,l;if(t.collisionWidth>r){if(a>0&&s<=0){l=e.left+a+t.collisionWidth-r-n;e.left+=a-l}else if(s>0&&a<=0){e.left=n}else{if(a>s){e.left=n+r-t.collisionWidth}else{e.left=n}}}else if(a>0){e.left+=a}else if(s>0){e.left-=s}else{e.left=C(e.left-o,e.left)}},top:function(e,t){var i=t.within,n=i.isWindow?i.scrollTop:i.offset.top,r=t.within.height,o=e.top-t.collisionPosition.marginTop,a=n-o,s=o+t.collisionHeight-r-n,l;if(t.collisionHeight>r){if(a>0&&s<=0){l=e.top+a+t.collisionHeight-r-n;e.top+=a-l}else if(s>0&&a<=0){e.top=n}else{if(a>s){e.top=n+r-t.collisionHeight}else{e.top=n}}}else if(a>0){e.top+=a}else if(s>0){e.top-=s}else{e.top=C(e.top-o,e.top)}}},flip:{left:function(e,t){var i=t.within,n=i.offset.left+i.scrollLeft,r=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=e.left-t.collisionPosition.marginLeft,s=a-o,l=a+t.collisionWidth-r-o,u=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,d=-2*t.offset[0],f,p;if(s<0){f=e.left+u+c+d+t.collisionWidth-r-n;if(f<0||f<A(s)){e.left+=u+c+d}}else if(l>0){p=e.left-t.collisionPosition.marginLeft+u+c+d-o;if(p>0||A(p)<l){e.left+=u+c+d}}},top:function(e,t){var i=t.within,n=i.offset.top+i.scrollTop,r=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=e.top-t.collisionPosition.marginTop,s=a-o,l=a+t.collisionHeight-r-o,u=t.my[1]==="top",c=u?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,d=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,f=-2*t.offset[1],p,h;if(s<0){h=e.top+c+d+f+t.collisionHeight-r-n;if(h<0||h<A(s)){e.top+=c+d+f}}else if(l>0){p=e.top-t.collisionPosition.marginTop+c+d+f-o;if(p>0||A(p)<l){e.top+=c+d+f}}}},flipfit:{left:function(){te.ui.position.flip.left.apply(this,arguments);te.ui.position.fit.left.apply(this,arguments)},top:function(){te.ui.position.flip.top.apply(this,arguments);te.ui.position.fit.top.apply(this,arguments)}}}})();var F=te.ui.position;var G=te.extend(te.expr.pseudos,{data:te.expr.createPseudo?te.expr.createPseudo(function(t){return function(e){return!!te.data(e,t)}}):function(e,t,i){return!!te.data(e,i[3])}});var $=te.fn.extend({disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c=te;var e="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",n={},t=n.toString,d=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),e[4]?(parseInt(e[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),e[4]?(parseInt(e[4]+e[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],f=c.Color=function(e,t,i,n){return new c.Color.fn.parse(e,t,i,n)},p={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={byte:{floor:true,max:255},percent:{max:1},degrees:{mod:360,floor:true}},l=f.support={},o=c("<p>")[0],u,g=c.each;o.style.cssText="background-color:rgba(1,1,1,.5)";l.rgba=o.style.backgroundColor.indexOf("rgba")>-1;g(p,function(e,t){t.cache="_"+e;t.props.alpha={idx:3,type:"percent",def:1}});c.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});function v(e){if(e==null){return e+""}return typeof e==="object"?n[t.call(e)]||"object":typeof e}function m(e,t,i){var n=h[t.type]||{};if(e==null){return i||!t.def?null:t.def}e=n.floor?~~e:parseFloat(e);if(isNaN(e)){return t.def}if(n.mod){return(e+n.mod)%n.mod}return Math.min(n.max,Math.max(0,e))}function y(a){var s=f(),l=s._rgba=[];a=a.toLowerCase();g(r,function(e,t){var i,n=t.re.exec(a),r=n&&t.parse(n),o=t.space||"rgba";if(r){i=s[o](r);s[p[o].cache]=i[p[o].cache];l=s._rgba=i._rgba;return false}});if(l.length){if(l.join()==="0,0,0,0"){c.extend(l,u.transparent)}return s}return u[a]}f.fn=c.extend(f.prototype,{parse:function(r,e,t,i){if(r===undefined){this._rgba=[null,null,null,null];return this}if(r.jquery||r.nodeType){r=c(r).css(e);e=undefined}var o=this,n=v(r),a=this._rgba=[];if(e!==undefined){r=[r,e,t,i];n="array"}if(n==="string"){return this.parse(y(r)||u._default)}if(n==="array"){g(p.rgba.props,function(e,t){a[t.idx]=m(r[t.idx],t)});return this}if(n==="object"){if(r instanceof f){g(p,function(e,t){if(r[t.cache]){o[t.cache]=r[t.cache].slice()}})}else{g(p,function(e,i){var n=i.cache;g(i.props,function(e,t){if(!o[n]&&i.to){if(e==="alpha"||r[e]==null){return}o[n]=i.to(o._rgba)}o[n][t.idx]=m(r[e],t,true)});if(o[n]&&c.inArray(null,o[n].slice(0,3))<0){if(o[n][3]==null){o[n][3]=1}if(i.from){o._rgba=i.from(o[n])}}})}return this}},is:function(e){var r=f(e),o=true,a=this;g(p,function(e,t){var i,n=r[t.cache];if(n){i=a[t.cache]||t.to&&t.to(a._rgba)||[];g(t.props,function(e,t){if(n[t.idx]!=null){o=n[t.idx]===i[t.idx];return o}})}return o});return o},_space:function(){var i=[],n=this;g(p,function(e,t){if(n[t.cache]){i.push(e)}});return i.pop()},transition:function(e,a){var s=f(e),t=s._space(),i=p[t],n=this.alpha()===0?f("transparent"):this,l=n[i.cache]||i.to(n._rgba),u=l.slice();s=s[i.cache];g(i.props,function(e,t){var i=t.idx,n=l[i],r=s[i],o=h[t.type]||{};if(r===null){return}if(n===null){u[i]=r}else{if(o.mod){if(r-n>o.mod/2){n+=o.mod}else if(n-r>o.mod/2){n-=o.mod}}u[i]=m((r-n)*a+n,t)}});return this[t](u)},blend:function(e){if(this._rgba[3]===1){return this}var t=this._rgba.slice(),i=t.pop(),n=f(e)._rgba;return f(c.map(t,function(e,t){return(1-i)*n[t]+i*e}))},toRgbaString:function(){var e="rgba(",t=c.map(this._rgba,function(e,t){if(e!=null){return e}return t>2?1:0});if(t[3]===1){t.pop();e="rgb("}return e+t.join()+")"},toHslaString:function(){var e="hsla(",t=c.map(this.hsla(),function(e,t){if(e==null){e=t>2?1:0}if(t&&t<3){e=Math.round(e*100)+"%"}return e});if(t[3]===1){t.pop();e="hsl("}return e+t.join()+")"},toHexString:function(e){var t=this._rgba.slice(),i=t.pop();if(e){t.push(~~(i*255))}return"#"+c.map(t,function(e){e=(e||0).toString(16);return e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});f.fn.parse.prototype=f.fn;function b(e,t,i){i=(i+1)%1;if(i*6<1){return e+(t-e)*i*6}if(i*2<1){return t}if(i*3<2){return e+(t-e)*(2/3-i)*6}return e}p.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null){return[null,null,null,e[3]]}var t=e[0]/255,i=e[1]/255,n=e[2]/255,r=e[3],o=Math.max(t,i,n),a=Math.min(t,i,n),s=o-a,l=o+a,u=l*.5,c,d;if(a===o){c=0}else if(t===o){c=60*(i-n)/s+360}else if(i===o){c=60*(n-t)/s+120}else{c=60*(t-i)/s+240}if(s===0){d=0}else if(u<=.5){d=s/l}else{d=s/(2-l)}return[Math.round(c)%360,d,u,r==null?1:r]};p.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null){return[null,null,null,e[3]]}var t=e[0]/360,i=e[1],n=e[2],r=e[3],o=n<=.5?n*(1+i):n+i-n*i,a=2*n-o;return[Math.round(b(a,o,t+1/3)*255),Math.round(b(a,o,t)*255),Math.round(b(a,o,t-1/3)*255),r]};g(p,function(l,e){var i=e.props,a=e.cache,s=e.to,u=e.from;f.fn[l]=function(e){if(s&&!this[a]){this[a]=s(this._rgba)}if(e===undefined){return this[a].slice()}var t,n=v(e),r=n==="array"||n==="object"?e:arguments,o=this[a].slice();g(i,function(e,t){var i=r[n==="object"?e:t.idx];if(i==null){i=o[t.idx]}o[t.idx]=m(i,t)});if(u){t=f(u(o));t[a]=o;return t}else{return f(o)}};g(i,function(a,s){if(f.fn[a]){return}f.fn[a]=function(e){var t,i,n,r,o=v(e);if(a==="alpha"){r=this._hsla?"hsla":"rgba"}else{r=l}t=this[r]();i=t[s.idx];if(o==="undefined"){return i}if(o==="function"){e=e.call(this,i);o=v(e)}if(e==null&&s.empty){return this}if(o==="string"){n=d.exec(e);if(n){e=i+parseFloat(n[2])*(n[1]==="+"?1:-1)}}t[s.idx]=e;return this[r](t)}})});f.hook=function(e){var t=e.split(" ");g(t,function(e,o){c.cssHooks[o]={set:function(e,t){var i,n,r="";if(t!=="transparent"&&(v(t)!=="string"||(i=y(t)))){t=f(i||t);if(!l.rgba&&t._rgba[3]!==1){n=o==="backgroundColor"?e.parentNode:e;while((r===""||r==="transparent")&&n&&n.style){try{r=c.css(n,"backgroundColor");n=n.parentNode}catch(e){}}t=t.blend(r&&r!=="transparent"?r:"_default")}t=t.toRgbaString()}try{e.style[o]=t}catch(e){}}};c.fx.step[o]=function(e){if(!e.colorInit){e.start=f(e.elem,o);e.end=f(e.end);e.colorInit=true}c.cssHooks[o].set(e.elem,e.start.transition(e.end,e.pos))}})};f.hook(e);c.cssHooks.borderColor={expand:function(i){var n={};g(["Top","Right","Bottom","Left"],function(e,t){n["border"+t+"Color"]=i});return n}};u=c.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"};var _="ui-effects-",w="ui-effects-style",C="ui-effects-animated";te.effects={effect:{}};(function(){var a=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};te.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,t){te.fx.step[t]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr){c.style(e.elem,t,e.end);e.setAttr=true}}});function s(e){return e.replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function l(e){var t,i,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,r={};if(n&&n.length&&n[0]&&n[n[0]]){i=n.length;while(i--){t=n[i];if(typeof n[t]==="string"){r[s(t)]=n[t]}}}else{for(t in n){if(typeof n[t]==="string"){r[t]=n[t]}}}return r}function u(e,t){var i={},n,r;for(n in t){r=t[n];if(e[n]!==r){if(!o[n]){if(te.fx.step[n]||!isNaN(parseFloat(r))){i[n]=r}}}}return i}if(!te.fn.addBack){te.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}te.effects.animateClass=function(r,e,t,i){var o=te.speed(e,t,i);return this.queue(function(){var i=te(this),e=i.attr("class")||"",t,n=o.children?i.find("*").addBack():i;n=n.map(function(){var e=te(this);return{el:e,start:l(this)}});t=function(){te.each(a,function(e,t){if(r[t]){i[t+"Class"](r[t])}})};t();n=n.map(function(){this.end=l(this.el[0]);this.diff=u(this.start,this.end);return this});i.attr("class",e);n=n.map(function(){var e=this,t=te.Deferred(),i=te.extend({},o,{queue:false,complete:function(){t.resolve(e)}});this.el.animate(this.diff,i);return t.promise()});te.when.apply(te,n.get()).done(function(){t();te.each(arguments,function(){var t=this.el;te.each(this.diff,function(e){t.css(e,"")})});o.complete.call(i[0])})})};te.fn.extend({addClass:function(r){return function(e,t,i,n){return t?te.effects.animateClass.call(this,{add:e},t,i,n):r.apply(this,arguments)}}(te.fn.addClass),removeClass:function(r){return function(e,t,i,n){return arguments.length>1?te.effects.animateClass.call(this,{remove:e},t,i,n):r.apply(this,arguments)}}(te.fn.removeClass),toggleClass:function(o){return function(e,t,i,n,r){if(typeof t==="boolean"||t===undefined){if(!i){return o.apply(this,arguments)}else{return te.effects.animateClass.call(this,t?{add:e}:{remove:e},i,n,r)}}else{return te.effects.animateClass.call(this,{toggle:e},t,i,n)}}}(te.fn.toggleClass),switchClass:function(e,t,i,n,r){return te.effects.animateClass.call(this,{add:t,remove:e},i,n,r)}})})();(function(){if(te.expr&&te.expr.pseudos&&te.expr.pseudos.animated){te.expr.pseudos.animated=function(t){return function(e){return!!te(e).data(C)||t(e)}}(te.expr.pseudos.animated)}if(te.uiBackCompat!==false){te.extend(te.effects,{save:function(e,t){var i=0,n=t.length;for(;i<n;i++){if(t[i]!==null){e.data(_+t[i],e[0].style[t[i]])}}},restore:function(e,t){var i,n=0,r=t.length;for(;n<r;n++){if(t[n]!==null){i=e.data(_+t[n]);e.css(t[n],i)}}},setMode:function(e,t){if(t==="toggle"){t=e.is(":hidden")?"show":"hide"}return t},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper")){return i.parent()}var n={width:i.outerWidth(true),height:i.outerHeight(true),float:i.css("float")},e=te("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),t={width:i.width(),height:i.height()},r=document.activeElement;try{r.id}catch(e){r=document.body}i.wrap(e);if(i[0]===r||te.contains(i[0],r)){te(r).trigger("focus")}e=i.parent();if(i.css("position")==="static"){e.css({position:"relative"});i.css({position:"relative"})}else{te.extend(n,{position:i.css("position"),zIndex:i.css("z-index")});te.each(["top","left","bottom","right"],function(e,t){n[t]=i.css(t);if(isNaN(parseInt(n[t],10))){n[t]="auto"}});i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}i.css(t);return e.css(n).show()},removeWrapper:function(e){var t=document.activeElement;if(e.parent().is(".ui-effects-wrapper")){e.parent().replaceWith(e);if(e[0]===t||te.contains(e[0],t)){te(t).trigger("focus")}}return e}})}te.extend(te.effects,{version:"1.13.1",define:function(e,t,i){if(!i){i=t;t="effect"}te.effects.effect[e]=i;te.effects.effect[e].mode=t;return i},scaledDimensions:function(e,t,i){if(t===0){return{height:0,width:0,outerHeight:0,outerWidth:0}}var n=i!=="horizontal"?(t||100)/100:1,r=i!=="vertical"?(t||100)/100:1;return{height:e.height()*r,width:e.width()*n,outerHeight:e.outerHeight()*r,outerWidth:e.outerWidth()*n}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(e,t,i){var n=e.queue();if(t>1){n.splice.apply(n,[1,0].concat(n.splice(t,i)))}e.dequeue()},saveStyle:function(e){e.data(w,e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data(w)||"";e.removeData(w)},mode:function(e,t){var i=e.is(":hidden");if(t==="toggle"){t=i?"show":"hide"}if(i?t==="hide":t==="show"){t="none"}return t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createPlaceholder:function(e){var t,i=e.css("position"),n=e.position();e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight());if(/^(static|relative)/.test(i)){i="absolute";t=te("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),float:e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder");e.data(_+"placeholder",t)}e.css({position:i,left:n.left,top:n.top});return t},removePlaceholder:function(e){var t=_+"placeholder",i=e.data(t);if(i){i.remove();e.removeData(t)}},cleanUp:function(e){te.effects.restoreStyle(e);te.effects.removePlaceholder(e)},setTransition:function(n,e,r,o){o=o||{};te.each(e,function(e,t){var i=n.cssUnit(t);if(i[0]>0){o[t]=i[0]*r+i[1]}});return o}});function c(e,t,i,n){if(te.isPlainObject(e)){t=e;e=e.effect}e={effect:e};if(t==null){t={}}if(typeof t==="function"){n=t;i=null;t={}}if(typeof t==="number"||te.fx.speeds[t]){n=i;i=t;t={}}if(typeof i==="function"){n=i;i=null}if(t){te.extend(e,t)}i=i||t.duration;e.duration=te.fx.off?0:typeof i==="number"?i:i in te.fx.speeds?te.fx.speeds[i]:te.fx.speeds._default;e.complete=n||t.complete;return e}function n(e){if(!e||typeof e==="number"||te.fx.speeds[e]){return true}if(typeof e==="string"&&!te.effects.effect[e]){return true}if(typeof e==="function"){return true}if(typeof e==="object"&&!e.effect){return true}return false}te.fn.extend({effect:function(){var r=c.apply(this,arguments),o=te.effects.effect[r.effect],a=o.mode,e=r.queue,t=e||"fx",s=r.complete,l=r.mode,u=[],i=function(e){var t=te(this),i=te.effects.mode(t,l)||a;t.data(C,true);u.push(i);if(a&&(i==="show"||i===a&&i==="hide")){t.show()}if(!a||i!=="none"){te.effects.saveStyle(t)}if(typeof e==="function"){e()}};if(te.fx.off||!o){if(l){return this[l](r.duration,s)}else{return this.each(function(){if(s){s.call(this)}})}}function n(e){var t=te(this);function i(){t.removeData(C);te.effects.cleanUp(t);if(r.mode==="hide"){t.hide()}n()}function n(){if(typeof s==="function"){s.call(t[0])}if(typeof e==="function"){e()}}r.mode=u.shift();if(te.uiBackCompat!==false&&!a){if(t.is(":hidden")?l==="hide":l==="show"){t[l]();n()}else{o.call(t[0],r,n)}}else{if(r.mode==="none"){t[l]();n()}else{o.call(t[0],r,i)}}}return e===false?this.each(i).each(n):this.queue(t,i).queue(t,n)},show:function(i){return function(e){if(n(e)){return i.apply(this,arguments)}else{var t=c.apply(this,arguments);t.mode="show";return this.effect.call(this,t)}}}(te.fn.show),hide:function(i){return function(e){if(n(e)){return i.apply(this,arguments)}else{var t=c.apply(this,arguments);t.mode="hide";return this.effect.call(this,t)}}}(te.fn.hide),toggle:function(i){return function(e){if(n(e)||typeof e==="boolean"){return i.apply(this,arguments)}else{var t=c.apply(this,arguments);t.mode="toggle";return this.effect.call(this,t)}}}(te.fn.toggle),cssUnit:function(e){var i=this.css(e),n=[];te.each(["em","px","%","pt"],function(e,t){if(i.indexOf(t)>0){n=[parseFloat(i),t]}});return n},cssClip:function(e){if(e){return this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)")}return t(this.css("clip"),this)},transfer:function(e,t){var i=te(this),n=te(e.to),r=n.css("position")==="fixed",o=te("body"),a=r?o.scrollTop():0,s=r?o.scrollLeft():0,l=n.offset(),u={top:l.top-a,left:l.left-s,height:n.innerHeight(),width:n.innerWidth()},c=i.offset(),d=te("<div class='ui-effects-transfer'></div>");d.appendTo("body").addClass(e.className).css({top:c.top-a,left:c.left-s,height:i.innerHeight(),width:i.innerWidth(),position:r?"fixed":"absolute"}).animate(u,e.duration,e.easing,function(){d.remove();if(typeof t==="function"){t()}})}});function t(e,t){var i=t.outerWidth(),n=t.outerHeight(),r=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=r.exec(e)||["",0,i,n,0];return{top:parseFloat(o[1])||0,right:o[2]==="auto"?i:parseFloat(o[2]),bottom:o[3]==="auto"?n:parseFloat(o[3]),left:parseFloat(o[4])||0}}te.fx.step.clip=function(e){if(!e.clipInit){e.start=te(e.elem).cssClip();if(typeof e.end==="string"){e.end=t(e.end,e.elem)}e.clipInit=true}te(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}})();(function(){var i={};te.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,e){i[e]=function(e){return Math.pow(e,t+2)}});te.extend(i,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,i=4;while(e<((t=Math.pow(2,--i))-1)/11){}return 1/Math.pow(4,3-i)-7.5625*Math.pow((t*3-2)/22-e,2)}});te.each(i,function(e,t){te.easing["easeIn"+e]=t;te.easing["easeOut"+e]=function(e){return 1-t(1-e)};te.easing["easeInOut"+e]=function(e){return e<.5?t(e*2)/2:1-t(e*-2+2)/2}})})();var A=te.effects;var W=te.effects.define("blind","hide",function(e,t){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=te(this),r=e.direction||"up",o=n.cssClip(),a={clip:te.extend({},o)},s=te.effects.createPlaceholder(n);a.clip[i[r][0]]=a.clip[i[r][1]];if(e.mode==="show"){n.cssClip(a.clip);if(s){s.css(te.effects.clipToBox(a))}a.clip=o}if(s){s.animate(te.effects.clipToBox(a),e.duration,e.easing)}n.animate(a,{queue:false,duration:e.duration,easing:e.easing,complete:t})});var H=te.effects.define("bounce",function(e,t){var i,n,r,o=te(this),a=e.mode,s=a==="hide",l=a==="show",u=e.direction||"up",c=e.distance,d=e.times||5,f=d*2+(l||s?1:0),p=e.duration/f,h=e.easing,g=u==="up"||u==="down"?"top":"left",v=u==="up"||u==="left",m=0,y=o.queue().length;te.effects.createPlaceholder(o);r=o.css(g);if(!c){c=o[g==="top"?"outerHeight":"outerWidth"]()/3}if(l){n={opacity:1};n[g]=r;o.css("opacity",0).css(g,v?-c*2:c*2).animate(n,p,h)}if(s){c=c/Math.pow(2,d-1)}n={};n[g]=r;for(;m<d;m++){i={};i[g]=(v?"-=":"+=")+c;o.animate(i,p,h).animate(n,p,h);c=s?c*2:c/2}if(s){i={opacity:0};i[g]=(v?"-=":"+=")+c;o.animate(i,p,h)}o.queue(t);te.effects.unshift(o,y,f+1)});var j=te.effects.define("clip","hide",function(e,t){var i,n={},r=te(this),o=e.direction||"vertical",a=o==="both",s=a||o==="horizontal",l=a||o==="vertical";i=r.cssClip();n.clip={top:l?(i.bottom-i.top)/2:i.top,right:s?(i.right-i.left)/2:i.right,bottom:l?(i.bottom-i.top)/2:i.bottom,left:s?(i.right-i.left)/2:i.left};te.effects.createPlaceholder(r);if(e.mode==="show"){r.cssClip(n.clip);n.clip=i}r.animate(n,{queue:false,duration:e.duration,easing:e.easing,complete:t})});var B=te.effects.define("drop","hide",function(e,t){var i,n=te(this),r=e.mode,o=r==="show",a=e.direction||"left",s=a==="up"||a==="down"?"top":"left",l=a==="up"||a==="left"?"-=":"+=",u=l==="+="?"-=":"+=",c={opacity:0};te.effects.createPlaceholder(n);i=e.distance||n[s==="top"?"outerHeight":"outerWidth"](true)/2;c[s]=l+i;if(o){n.css(c);c[s]=u+i;c.opacity=1}n.animate(c,{queue:false,duration:e.duration,easing:e.easing,complete:t})});var V=te.effects.define("explode","hide",function(e,t){var i,n,r,o,a,s,l=e.pieces?Math.round(Math.sqrt(e.pieces)):3,u=l,c=te(this),d=e.mode,f=d==="show",p=c.show().css("visibility","hidden").offset(),h=Math.ceil(c.outerWidth()/u),g=Math.ceil(c.outerHeight()/l),v=[];function m(){v.push(this);if(v.length===l*u){y()}}for(i=0;i<l;i++){o=p.top+i*g;s=i-(l-1)/2;for(n=0;n<u;n++){r=p.left+n*h;a=n-(u-1)/2;c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-n*h,top:-i*g}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h,height:g,left:r+(f?a*h:0),top:o+(f?s*g:0),opacity:f?0:1}).animate({left:r+(f?0:a*h),top:o+(f?0:s*g),opacity:f?1:0},e.duration||500,e.easing,m)}}function y(){c.css({visibility:"visible"});te(v).remove();t()}});var z=te.effects.define("fade","toggle",function(e,t){var i=e.mode==="show";te(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:false,duration:e.duration,easing:e.easing,complete:t})});var U=te.effects.define("fold","hide",function(t,e){var i=te(this),n=t.mode,r=n==="show",o=n==="hide",a=t.size||15,s=/([0-9]+)%/.exec(a),l=!!t.horizFirst,u=l?["right","bottom"]:["bottom","right"],c=t.duration/2,d=te.effects.createPlaceholder(i),f=i.cssClip(),p={clip:te.extend({},f)},h={clip:te.extend({},f)},g=[f[u[0]],f[u[1]]],v=i.queue().length;if(s){a=parseInt(s[1],10)/100*g[o?0:1]}p.clip[u[0]]=a;h.clip[u[0]]=a;h.clip[u[1]]=0;if(r){i.cssClip(h.clip);if(d){d.css(te.effects.clipToBox(h))}h.clip=f}i.queue(function(e){if(d){d.animate(te.effects.clipToBox(p),c,t.easing).animate(te.effects.clipToBox(h),c,t.easing)}e()}).animate(p,c,t.easing).animate(h,c,t.easing).queue(e);te.effects.unshift(i,v,4)});var Y=te.effects.define("highlight","show",function(e,t){var i=te(this),n={backgroundColor:i.css("backgroundColor")};if(e.mode==="hide"){n.opacity=0}te.effects.saveStyle(i);i.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:false,duration:e.duration,easing:e.easing,complete:t})});var q=te.effects.define("size",function(r,t){var e,o,i,n=te(this),a=["fontSize"],s=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],u=r.mode,c=u!=="effect",d=r.scale||"both",f=r.origin||["middle","center"],p=n.css("position"),h=n.position(),g=te.effects.scaledDimensions(n),v=r.from||g,m=r.to||te.effects.scaledDimensions(n,0);te.effects.createPlaceholder(n);if(u==="show"){i=v;v=m;m=i}o={from:{y:v.height/g.height,x:v.width/g.width},to:{y:m.height/g.height,x:m.width/g.width}};if(d==="box"||d==="both"){if(o.from.y!==o.to.y){v=te.effects.setTransition(n,s,o.from.y,v);m=te.effects.setTransition(n,s,o.to.y,m)}if(o.from.x!==o.to.x){v=te.effects.setTransition(n,l,o.from.x,v);m=te.effects.setTransition(n,l,o.to.x,m)}}if(d==="content"||d==="both"){if(o.from.y!==o.to.y){v=te.effects.setTransition(n,a,o.from.y,v);m=te.effects.setTransition(n,a,o.to.y,m)}}if(f){e=te.effects.getBaseline(f,g);v.top=(g.outerHeight-v.outerHeight)*e.y+h.top;v.left=(g.outerWidth-v.outerWidth)*e.x+h.left;m.top=(g.outerHeight-m.outerHeight)*e.y+h.top;m.left=(g.outerWidth-m.outerWidth)*e.x+h.left}delete v.outerHeight;delete v.outerWidth;n.css(v);if(d==="content"||d==="both"){s=s.concat(["marginTop","marginBottom"]).concat(a);l=l.concat(["marginLeft","marginRight"]);n.find("*[width]").each(function(){var e=te(this),t=te.effects.scaledDimensions(e),i={height:t.height*o.from.y,width:t.width*o.from.x,outerHeight:t.outerHeight*o.from.y,outerWidth:t.outerWidth*o.from.x},n={height:t.height*o.to.y,width:t.width*o.to.x,outerHeight:t.height*o.to.y,outerWidth:t.width*o.to.x};if(o.from.y!==o.to.y){i=te.effects.setTransition(e,s,o.from.y,i);n=te.effects.setTransition(e,s,o.to.y,n)}if(o.from.x!==o.to.x){i=te.effects.setTransition(e,l,o.from.x,i);n=te.effects.setTransition(e,l,o.to.x,n)}if(c){te.effects.saveStyle(e)}e.css(i);e.animate(n,r.duration,r.easing,function(){if(c){te.effects.restoreStyle(e)}})})}n.animate(m,{queue:false,duration:r.duration,easing:r.easing,complete:function(){var e=n.offset();if(m.opacity===0){n.css("opacity",v.opacity)}if(!c){n.css("position",p==="static"?"relative":p).offset(e);te.effects.saveStyle(n)}t()}})});var X=te.effects.define("scale",function(e,t){var i=te(this),n=e.mode,r=parseInt(e.percent,10)||(parseInt(e.percent,10)===0?0:n!=="effect"?0:100),o=te.extend(true,{from:te.effects.scaledDimensions(i),to:te.effects.scaledDimensions(i,r,e.direction||"both"),origin:e.origin||["middle","center"]},e);if(e.fade){o.from.opacity=1;o.to.opacity=0}te.effects.effect.size.call(this,o,t)});var K=te.effects.define("puff","hide",function(e,t){var i=te.extend(true,{},e,{fade:true,percent:parseInt(e.percent,10)||150});te.effects.effect.scale.call(this,i,t)});var Q=te.effects.define("pulsate","show",function(e,t){var i=te(this),n=e.mode,r=n==="show",o=n==="hide",a=r||o,s=(e.times||5)*2+(a?1:0),l=e.duration/s,u=0,c=1,d=i.queue().length;if(r||!i.is(":visible")){i.css("opacity",0).show();u=1}for(;c<s;c++){i.animate({opacity:u},l,e.easing);u=1-u}i.animate({opacity:u},l,e.easing);i.queue(t);te.effects.unshift(i,d,s+1)});var Z=te.effects.define("shake",function(e,t){var i=1,n=te(this),r=e.direction||"left",o=e.distance||20,a=e.times||3,s=a*2+1,l=Math.round(e.duration/s),u=r==="up"||r==="down"?"top":"left",c=r==="up"||r==="left",d={},f={},p={},h=n.queue().length;te.effects.createPlaceholder(n);d[u]=(c?"-=":"+=")+o;f[u]=(c?"+=":"-=")+o*2;p[u]=(c?"-=":"+=")+o*2;n.animate(d,l,e.easing);for(;i<a;i++){n.animate(f,l,e.easing).animate(p,l,e.easing)}n.animate(f,l,e.easing).animate(d,l/2,e.easing).queue(t);te.effects.unshift(n,h,s+1)});var J=te.effects.define("slide","show",function(e,t){var i,n,r=te(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=e.mode,s=e.direction||"left",l=s==="up"||s==="down"?"top":"left",u=s==="up"||s==="left",c=e.distance||r[l==="top"?"outerHeight":"outerWidth"](true),d={};te.effects.createPlaceholder(r);i=r.cssClip();n=r.position()[l];d[l]=(u?-1:1)*c+n;d.clip=r.cssClip();d.clip[o[s][1]]=d.clip[o[s][0]];if(a==="show"){r.cssClip(d.clip);r.css(l,d[l]);d.clip=i;d[l]=n}r.animate(d,{queue:false,duration:e.duration,easing:e.easing,complete:t})});var A;if(te.uiBackCompat!==false){A=te.effects.define("transfer",function(e,t){te(this).transfer(e,t)})}var ee=A;te.ui.focusable=function(e,t){var i,n,r,o,a,s=e.nodeName.toLowerCase();if("area"===s){i=e.parentNode;n=i.name;if(!e.href||!n||i.nodeName.toLowerCase()!=="map"){return false}r=te("img[usemap='#"+n+"']");return r.length>0&&r.is(":visible")}if(/^(input|select|textarea|button|object)$/.test(s)){o=!e.disabled;if(o){a=te(e).closest("fieldset")[0];if(a){o=!a.disabled}}}else if("a"===s){o=e.href||t}else{o=t}return o&&te(e).is(":visible")&&E(te(e))};function E(e){var t=e.css("visibility");while(t==="inherit"){e=e.parent();t=e.css("visibility")}return t==="visible"}te.extend(te.expr.pseudos,{focusable:function(e){return te.ui.focusable(e,te.attr(e,"tabindex")!=null)}});var ie=te.ui.focusable;var ne=te.fn._form=function(){return typeof this[0].form==="string"?this.closest("form"):te(this[0].form)};var re=te.ui.formResetMixin={_formResetHandler:function(){var t=te(this);setTimeout(function(){var e=t.data("ui-form-reset-instances");te.each(e,function(){this.refresh()})})},_bindFormResetHandler:function(){this.form=this.element._form();if(!this.form.length){return}var e=this.form.data("ui-form-reset-instances")||[];if(!e.length){this.form.on("reset.ui-form-reset",this._formResetHandler)}e.push(this);this.form.data("ui-form-reset-instances",e)},_unbindFormResetHandler:function(){if(!this.form.length){return}var e=this.form.data("ui-form-reset-instances");e.splice(te.inArray(this,e),1);if(e.length){this.form.data("ui-form-reset-instances",e)}else{this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};if(!te.expr.pseudos){te.expr.pseudos=te.expr[":"]}if(!te.uniqueSort){te.uniqueSort=te.unique}if(!te.escapeSelector){var x=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;var T=function(e,t){if(t){if(e==="\0"){return""}return e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" "}return"\\"+e};te.escapeSelector=function(e){return(e+"").replace(x,T)}}if(!te.fn.even||!te.fn.odd){te.fn.extend({even:function(){return this.filter(function(e){return e%2===0})},odd:function(){return this.filter(function(e){return e%2===1})}})}var oe=te.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};var ae=te.fn.labels=function(){var e,t,i,n,r;if(!this.length){return this.pushStack([])}if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0].labels)}n=this.eq(0).parents("label");i=this.attr("id");if(i){e=this.eq(0).parents().last();r=e.add(e.length?e.siblings():this.siblings());t="label[for='"+te.escapeSelector(i)+"']";n=n.add(r.find(t).addBack(t))}return this.pushStack(n)};var se=te.fn.scrollParent=function(e){var t=this.css("position"),i=t==="absolute",n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var e=te(this);if(i&&e.css("position")==="static"){return false}return n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return t==="fixed"||!r.length?te(this[0].ownerDocument||document):r};var le=te.extend(te.expr.pseudos,{tabbable:function(e){var t=te.attr(e,"tabindex"),i=t!=null;return(!i||t>=0)&&te.ui.focusable(e,i)}});var ue=te.fn.extend({uniqueId:function(){var e=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+ ++e}})}}(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){te(this).removeAttr("id")}})}});var ce=te.widget("ui.accordion",{version:"1.13.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(e){return e.find("> li > :first-child").add(e.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=te();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");if(!e.collapsible&&(e.active===false||e.active==null)){e.active=0}this._processPanels();if(e.active<0){e.active+=this.headers.length}this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?te():this.active.next()}},_createIcons:function(){var e,t,i=this.options.icons;if(i){e=te("<span>");this._addClass(e,"ui-accordion-header-icon","ui-icon "+i.header);e.prependTo(this.headers);t=this.active.children(".ui-accordion-header-icon");this._removeClass(t,i.header)._addClass(t,null,i.activeHeader)._addClass(this.headers,"ui-accordion-icons")}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){e.css("height","")}},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="event"){if(this.options.event){this._off(this.headers,this.options.event)}this._setupEvents(t)}this._super(e,t);if(e==="collapsible"&&!t&&this.options.active===false){this._activate(0)}if(e==="icons"){this._destroyIcons();if(t){this._createIcons()}}},_setOptionDisabled:function(e){this._super(e);this.element.attr("aria-disabled",e);this._toggleClass(null,"ui-state-disabled",!!e);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(e){if(e.altKey||e.ctrlKey){return}var t=te.ui.keyCode,i=this.headers.length,n=this.headers.index(e.target),r=false;switch(e.keyCode){case t.RIGHT:case t.DOWN:r=this.headers[(n+1)%i];break;case t.LEFT:case t.UP:r=this.headers[(n-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:r=this.headers[0];break;case t.END:r=this.headers[i-1];break}if(r){te(e.target).attr("tabIndex",-1);te(r).attr("tabIndex",0);te(r).trigger("focus");e.preventDefault()}},_panelKeyDown:function(e){if(e.keyCode===te.ui.keyCode.UP&&e.ctrlKey){te(e.currentTarget).prev().trigger("focus")}},refresh:function(){var e=this.options;this._processPanels();if(e.active===false&&e.collapsible===true||!this.headers.length){e.active=false;this.active=te()}else if(e.active===false){this._activate(0)}else if(this.active.length&&!te.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){e.active=false;this.active=te()}else{this._activate(Math.max(0,e.active-1))}}else{e.active=this.headers.index(this.active)}this._destroyIcons();this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;if(typeof this.options.header==="function"){this.headers=this.options.header(this.element)}else{this.headers=this.element.find(this.options.header)}this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(t){this._off(e.not(this.headers));this._off(t.not(this.panels))}},_refresh:function(){var i,e=this.options,t=e.heightStyle,n=this.element.parent();this.active=this._findActive(e.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var e=te(this),t=e.uniqueId().attr("id"),i=e.next(),n=i.uniqueId().attr("id");e.attr("aria-controls",n);i.attr("aria-labelledby",t)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"})}this._createIcons();this._setupEvents(e.event);if(t==="fill"){i=n.height();this.element.siblings(":visible").each(function(){var e=te(this),t=e.css("position");if(t==="absolute"||t==="fixed"){return}i-=e.outerHeight(true)});this.headers.each(function(){i-=te(this).outerHeight(true)});this.headers.next().each(function(){te(this).height(Math.max(0,i-te(this).innerHeight()+te(this).height()))}).css("overflow","auto")}else if(t==="auto"){i=0;this.headers.next().each(function(){var e=te(this).is(":visible");if(!e){te(this).show()}i=Math.max(i,te(this).css("height","").height());if(!e){te(this).hide()}}).height(i)}},_activate:function(e){var t=this._findActive(e)[0];if(t===this.active[0]){return}t=t||this.active[0];this._eventHandler({target:t,currentTarget:t,preventDefault:te.noop})},_findActive:function(e){return typeof e==="number"?this.headers.eq(e):te()},_setupEvents:function(e){var i={keydown:"_keydown"};if(e){te.each(e.split(" "),function(e,t){i[t]="_eventHandler"})}this._off(this.headers.add(this.headers.next()));this._on(this.headers,i);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(e){var t,i,n=this.options,r=this.active,o=te(e.currentTarget),a=o[0]===r[0],s=a&&n.collapsible,l=s?te():o.next(),u=r.next(),c={oldHeader:r,oldPanel:u,newHeader:s?te():o,newPanel:l};e.preventDefault();if(a&&!n.collapsible||this._trigger("beforeActivate",e,c)===false){return}n.active=s?false:this.headers.index(o);this.active=a?te():o;this._toggle(c);this._removeClass(r,"ui-accordion-header-active","ui-state-active");if(n.icons){t=r.children(".ui-accordion-header-icon");this._removeClass(t,null,n.icons.activeHeader)._addClass(t,null,n.icons.header)}if(!a){this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active");if(n.icons){i=o.children(".ui-accordion-header-icon");this._removeClass(i,null,n.icons.header)._addClass(i,null,n.icons.activeHeader)}this._addClass(o.next(),"ui-accordion-content-active")}},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=t;this.prevHide=i;if(this.options.animate){this._animate(t,i,e)}else{i.hide();t.show();this._toggleComplete(e)}i.attr({"aria-hidden":"true"});i.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(t.length&&i.length){i.prev().attr({tabIndex:-1,"aria-expanded":"false"})}else if(t.length){this.headers.filter(function(){return parseInt(te(this).attr("tabIndex"),10)===0}).attr("tabIndex",-1)}t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){var n,r,o,a=this,s=0,l=e.css("box-sizing"),u=e.length&&(!i.length||e.index()<i.index()),c=this.options.animate||{},d=u&&c.down||c,f=function(){a._toggleComplete(t)};if(typeof d==="number"){o=d}if(typeof d==="string"){r=d}r=r||d.easing||c.easing;o=o||d.duration||c.duration;if(!i.length){return e.animate(this.showProps,o,r,f)}if(!e.length){return i.animate(this.hideProps,o,r,f)}n=e.show().outerHeight();i.animate(this.hideProps,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}});e.hide().animate(this.showProps,{duration:o,easing:r,complete:f,step:function(e,t){t.now=Math.round(e);if(t.prop!=="height"){if(l==="content-box"){s+=t.now}}else if(a.options.heightStyle!=="content"){t.now=Math.round(n-i.outerHeight()-s);s=0}}})},_toggleComplete:function(e){var t=e.oldPanel,i=t.prev();this._removeClass(t,"ui-accordion-content-active");this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed");if(t.length){t.parent()[0].className=t.parent()[0].className}this._trigger("activate",null,e)}});var de=te.ui.safeActiveElement=function(t){var i;try{i=t.activeElement}catch(e){i=t.body}if(!i){i=t.body}if(!i.nodeName){i=t.body}return i};var fe=te.widget("ui.menu",{version:"1.13.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.lastMousePosition={x:null,y:null};this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(e){e.preventDefault();this._activateItem(e)},"click .ui-menu-item":function(e){var t=te(e.target);var i=te(te.ui.safeActiveElement(this.document[0]));if(!this.mouseHandled&&t.not(".ui-state-disabled").length){this.select(e);if(!e.isPropagationStopped()){this.mouseHandled=true}if(t.has(".ui-menu").length){this.expand(e)}else if(!this.element.is(":focus")&&i.closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer)}}}},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this._menuItems().first();if(!t){this.focus(e,i)}},blur:function(t){this._delay(function(){var e=!te.contains(this.element[0],te.ui.safeActiveElement(this.document[0]));if(e){this.collapseAll(t)}})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(e){if(this._closeOnDocumentClick(e)){this.collapseAll(e,true)}this.mouseHandled=false}})},_activateItem:function(e){if(this.previousFilter){return}if(e.clientX===this.lastMousePosition.x&&e.clientY===this.lastMousePosition.y){return}this.lastMousePosition={x:e.clientX,y:e.clientY};var t=te(e.target).closest(".ui-menu-item"),i=te(e.currentTarget);if(t[0]!==i[0]){return}if(i.is(".ui-state-active")){return}this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active");this.focus(e,i)},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),t=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled "+"tabIndex").removeUniqueId().show();t.children().each(function(){var e=te(this);if(e.data("ui-menu-submenu-caret")){e.remove()}})},_keydown:function(e){var t,i,n,r,o=true;switch(e.keyCode){case te.ui.keyCode.PAGE_UP:this.previousPage(e);break;case te.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case te.ui.keyCode.HOME:this._move("first","first",e);break;case te.ui.keyCode.END:this._move("last","last",e);break;case te.ui.keyCode.UP:this.previous(e);break;case te.ui.keyCode.DOWN:this.next(e);break;case te.ui.keyCode.LEFT:this.collapse(e);break;case te.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(e)}break;case te.ui.keyCode.ENTER:case te.ui.keyCode.SPACE:this._activate(e);break;case te.ui.keyCode.ESCAPE:this.collapse(e);break;default:o=false;i=this.previousFilter||"";r=false;n=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode);clearTimeout(this.filterTimer);if(n===i){r=true}else{n=i+n}t=this._filterMenuItems(n);t=r&&t.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):t;if(!t.length){n=String.fromCharCode(e.keyCode);t=this._filterMenuItems(n)}if(t.length){this.focus(e,t);this.previousFilter=n;this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)}else{delete this.previousFilter}}if(o){e.preventDefault()}},_activate:function(e){if(this.active&&!this.active.is(".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(e)}else{this.select(e)}}},refresh:function(){var e,t,i,n,r,o=this,a=this.options.icons.submenu,s=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);i=s.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=te(this),t=e.prev(),i=te("<span>").data("ui-menu-submenu-caret",true);o._addClass(i,"ui-menu-icon","ui-icon "+a);t.attr("aria-haspopup","true").prepend(i);e.attr("aria-labelledby",t.attr("id"))});this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front");e=s.add(this.element);t=e.find(this.options.items);t.not(".ui-menu-item").each(function(){var e=te(this);if(o._isDivider(e)){o._addClass(e,"ui-menu-divider","ui-widget-content")}});n=t.not(".ui-menu-item, .ui-menu-divider");r=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(n,"ui-menu-item")._addClass(r,"ui-menu-item-wrapper");t.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!te.contains(this.element[0],this.active[0])){this.blur()}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){if(e==="icons"){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e);this.element.attr("aria-disabled",String(e));this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var i,n,r;this.blur(e,e&&e.type==="focus");this._scrollIntoView(t);this.active=t.first();n=this.active.children(".ui-menu-item-wrapper");this._addClass(n,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",n.attr("id"))}r=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(r,null,"ui-state-active");if(e&&e.type==="keydown"){this._close()}else{this.timer=this._delay(function(){this._close()},this.delay)}i=t.children(".ui-menu");if(i.length&&e&&/^mouse/.test(e.type)){this._startOpening(i)}this.activeMenu=t.parent();this._trigger("focus",e,{item:t})},_scrollIntoView:function(e){var t,i,n,r,o,a;if(this._hasScroll()){t=parseFloat(te.css(this.activeMenu[0],"borderTopWidth"))||0;i=parseFloat(te.css(this.activeMenu[0],"paddingTop"))||0;n=e.offset().top-this.activeMenu.offset().top-t-i;r=this.activeMenu.scrollTop();o=this.activeMenu.height();a=e.outerHeight();if(n<0){this.activeMenu.scrollTop(r+n)}else if(n+a>o){this.activeMenu.scrollTop(r+n-o+a)}}},blur:function(e,t){if(!t){clearTimeout(this.timer)}if(!this.active){return}this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",e,{item:this.active});this.active=null},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(e)},this.delay)},_open:function(e){var t=te.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true");e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(t)},collapseAll:function(t,i){clearTimeout(this.timer);this.timer=this._delay(function(){var e=i?this.element:te(t&&t.target).closest(this.element.find(".ui-menu"));if(!e.length){e=this.element}this._close(e);this.blur(t);this._removeClass(e.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=e},i?0:this.delay)},_close:function(e){if(!e){e=this.active?this.active.parent():this.element}e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!te(e.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(t&&t.length){this._close();this.focus(e,t)}},expand:function(e){var t=this.active&&this._menuItems(this.active.children(".ui-menu")).first();if(t&&t.length){this._open(t.parent());this._delay(function(){this.focus(e,t)})}},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(e){return(e||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(e,t,i){var n;if(this.active){if(e==="first"||e==="last"){n=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").last()}else{n=this.active[e+"All"](".ui-menu-item").first()}}if(!n||!n.length||!this.active){n=this._menuItems(this.activeMenu)[t]()}this.focus(i,n)},nextPage:function(e){var t,i,n;if(!this.active){this.next(e);return}if(this.isLastItem()){return}if(this._hasScroll()){i=this.active.offset().top;n=this.element.innerHeight();if(te.fn.jquery.indexOf("3.2.")===0){n+=this.element[0].offsetHeight-this.element.outerHeight()}this.active.nextAll(".ui-menu-item").each(function(){t=te(this);return t.offset().top-i-n<0});this.focus(e,t)}else{this.focus(e,this._menuItems(this.activeMenu)[!this.active?"first":"last"]())}},previousPage:function(e){var t,i,n;if(!this.active){this.next(e);return}if(this.isFirstItem()){return}if(this._hasScroll()){i=this.active.offset().top;n=this.element.innerHeight();if(te.fn.jquery.indexOf("3.2.")===0){n+=this.element[0].offsetHeight-this.element.outerHeight()}this.active.prevAll(".ui-menu-item").each(function(){t=te(this);return t.offset().top-i+n>0});this.focus(e,t)}else{this.focus(e,this._menuItems(this.activeMenu).first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||te(e.target).closest(".ui-menu-item");var t={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(e,true)}this._trigger("select",e,t)},_filterMenuItems:function(e){var t=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),i=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return i.test(String.prototype.trim.call(te(this).children(".ui-menu-item-wrapper").text()))})}});te.widget("ui.autocomplete",{version:"1.13.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,n,r,e=this.element[0].nodeName.toLowerCase(),t=e==="textarea",o=e==="input";this.isMultiLine=t||!o&&this._isContentEditable(this.element);this.valueMethod=this.element[t||o?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly")){i=true;r=true;n=true;return}i=false;r=false;n=false;var t=te.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:i=true;this._move("previousPage",e);break;case t.PAGE_DOWN:i=true;this._move("nextPage",e);break;case t.UP:i=true;this._keyEvent("previous",e);break;case t.DOWN:i=true;this._keyEvent("next",e);break;case t.ENTER:if(this.menu.active){i=true;e.preventDefault();this.menu.select(e)}break;case t.TAB:if(this.menu.active){this.menu.select(e)}break;case t.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term)}this.close(e);e.preventDefault()}break;default:n=true;this._searchTimeout(e);break}},keypress:function(e){if(i){i=false;if(!this.isMultiLine||this.menu.element.is(":visible")){e.preventDefault()}return}if(n){return}var t=te.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e);break}},input:function(e){if(r){r=false;e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(e){clearTimeout(this.searching);this.close(e);this._change(e)}});this._initSource();this.menu=te("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(e){e.preventDefault()},menufocus:function(e,t){var i,n;if(this.isNewMenu){this.isNewMenu=false;if(e.originalEvent&&/^mouse/.test(e.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){te(e.target).trigger(e.originalEvent)});return}}n=t.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",e,{item:n})){if(e.originalEvent&&/^key/.test(e.originalEvent.type)){this._value(n.value)}}i=t.item.attr("aria-label")||n.value;if(i&&String.prototype.trim.call(i).length){clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html(te("<div>").text(i))},100)}},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),n=this.previous;if(this.element[0]!==te.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=n;this._delay(function(){this.previous=n;this.selectedItem=i})}if(false!==this._trigger("select",e,{item:i})){this._value(i.value)}this.term=this._value();this.close(e);this.selectedItem=i}});this.liveRegion=te("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t);if(e==="source"){this._initSource()}if(e==="appendTo"){this.menu.element.appendTo(this._appendTo())}if(e==="disabled"&&t&&this.xhr){this.xhr.abort()}},_isEventTargetInWidget:function(e){var t=this.menu.element[0];return e.target===this.element[0]||e.target===t||te.contains(t,e.target)},_closeOnClickOutside:function(e){if(!this._isEventTargetInWidget(e)){this.close()}},_appendTo:function(){var e=this.options.appendTo;if(e){e=e.jquery||e.nodeType?te(e):this.document.find(e).eq(0)}if(!e||!e[0]){e=this.element.closest(".ui-front, dialog")}if(!e.length){e=this.document[0].body}return e},_initSource:function(){var i,n,r=this;if(Array.isArray(this.options.source)){i=this.options.source;this.source=function(e,t){t(te.ui.autocomplete.filter(i,e.term))}}else if(typeof this.options.source==="string"){n=this.options.source;this.source=function(e,t){if(r.xhr){r.xhr.abort()}r.xhr=te.ajax({url:n,data:e,dataType:"json",success:function(e){t(e)},error:function(){t([])}})}}else{this.source=this.options.source}},_searchTimeout:function(n){clearTimeout(this.searching);this.searching=this._delay(function(){var e=this.term===this._value(),t=this.menu.element.is(":visible"),i=n.altKey||n.ctrlKey||n.metaKey||n.shiftKey;if(!e||e&&!t&&!i){this.selectedItem=null;this.search(null,n)}},this.options.delay)},search:function(e,t){e=e!=null?e:this._value();this.term=this._value();if(e.length<this.options.minLength){return this.close(t)}if(this._trigger("search",t)===false){return}return this._search(e)},_search:function(e){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return function(e){if(t===this.requestIndex){this.__response(e)}this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading")}}.bind(this)},__response:function(e){if(e){e=this._normalize(e)}this._trigger("response",null,{content:e});if(!this.options.disabled&&e&&e.length&&!this.cancelSearch){this._suggest(e);this._trigger("open")}else{this._close()}},close:function(e){this.cancelSearch=true;this._close(e)},_close:function(e){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",e)}},_change:function(e){if(this.previous!==this._value()){this._trigger("change",e,{item:this.selectedItem})}},_normalize:function(e){if(e.length&&e[0].label&&e[0].value){return e}return te.map(e,function(e){if(typeof e==="string"){return{label:e,value:e}}return te.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var t=this.menu.element.empty();this._renderMenu(t,e);this.isNewMenu=true;this.menu.refresh();t.show();this._resizeMenu();t.position(te.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next()}this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,e){var n=this;te.each(e,function(e,t){n._renderItemData(i,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(e,t){return te("<li>").append(te("<div>").text(t.label)).appendTo(e)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){if(!this.isMultiLine){this._value(this.term)}this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(e,t);t.preventDefault()}},_isContentEditable:function(e){if(!e.length){return false}var t=e.prop("contentEditable");if(t==="inherit"){return this._isContentEditable(e.parent())}return t==="true"}});te.extend(te.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var i=new RegExp(te.ui.autocomplete.escapeRegex(t),"i");return te.grep(e,function(e){return i.test(e.label||e.value||e)})}});te.widget("ui.autocomplete",te.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return}if(e&&e.length){t=this.options.messages.results(e.length)}else{t=this.options.messages.noResults}clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html(te("<div>").text(t))},100)}});var pe=te.ui.autocomplete;var S=/ui-corner-([a-z]){2,6}/g;var he=te.widget("ui.controlgroup",{version:"1.13.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar");this.refresh()},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()}},_initWidgets:function(){var a=this,s=[];te.each(this.options.items,function(r,e){var t;var o={};if(!e){return}if(r==="controlgroupLabel"){t=a.element.find(e);t.each(function(){var e=te(this);if(e.children(".ui-controlgroup-label-contents").length){return}e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")});a._addClass(t,null,"ui-widget ui-widget-content ui-state-default");s=s.concat(t.get());return}if(!te.fn[r]){return}if(a["_"+r+"Options"]){o=a["_"+r+"Options"]("middle")}else{o={classes:{}}}a.element.find(e).each(function(){var e=te(this);var t=e[r]("instance");var i=te.widget.extend({},o);if(r==="button"&&e.parent(".ui-spinner").length){return}if(!t){t=e[r]()[r]("instance")}if(t){i.classes=a._resolveClassesValues(i.classes,t)}e[r](i);var n=e[r]("widget");te.data(n[0],"ui-controlgroup-data",t?t:e[r]("instance"));s.push(n[0])})});this.childWidgets=te(te.uniqueSort(s));this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(i){this.childWidgets.each(function(){var e=te(this),t=e.data("ui-controlgroup-data");if(t&&t[i]){t[i]()}})},_updateCornerClass:function(e,t){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var n=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(e,null,i);this._addClass(e,null,n)},_buildSimpleOptions:function(e,t){var i=this.options.direction==="vertical";var n={classes:{}};n.classes[t]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[e];return n},_spinnerOptions:function(e){var t=this._buildSimpleOptions(e,"ui-spinner");t.classes["ui-spinner-up"]="";t.classes["ui-spinner-down"]="";return t},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t=this.options.direction==="vertical";return{width:t?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(i,n){var r={};te.each(i,function(e){var t=n.options.classes[e]||"";t=String.prototype.trim.call(t.replace(S,""));r[e]=(t+" "+i[e]).replace(/\s+/g," ")});return r},_setOption:function(e,t){if(e==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction)}this._super(e,t);if(e==="disabled"){this._callChildMethod(t?"disable":"enable");return}this.refresh()},refresh:function(){var r,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix")}this._initWidgets();r=this.childWidgets;if(this.options.onlyVisible){r=r.filter(":visible")}if(r.length){te.each(["first","last"],function(e,t){var i=r[t]().data("ui-controlgroup-data");if(i&&o["_"+i.widgetName+"Options"]){var n=o["_"+i.widgetName+"Options"](r.length===1?"only":t);n.classes=o._resolveClassesValues(n.classes,i);i.element[i.widgetName](n)}else{o._updateCornerClass(r[t](),t)}});this._callChildMethod("refresh")}}});te.widget("ui.checkboxradio",[te.ui.formResetMixin,{version:"1.13.1",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,t;var i=this;var n=this._super()||{};this._readType();t=this.element.labels();this.label=te(t[t.length-1]);if(!this.label.length){te.error("No label found for checkboxradio widget")}this.originalLabel="";this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=this.nodeType===3?te(this).text():this.outerHTML});if(this.originalLabel){n.label=this.originalLabel}e=this.element[0].disabled;if(e!=null){n.disabled=e}return n},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){this.options.disabled=this.element[0].disabled}this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label")}if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel()}else if(this.originalLabel){this.options.label=this.originalLabel}this._enhance();if(e){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active")}this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(e!=="input"||!/radio|checkbox/.test(this.type)){te.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)}},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e;var t=this.element[0].name;var i="input[name='"+te.escapeSelector(t)+"']";if(!t){return te([])}if(this.form.length){e=te(this.form[0].elements).filter(i)}else{e=te(i).filter(function(){return te(this)._form().length===0})}return e.not(this.element)},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e)}if(this.type==="radio"){this._getRadioGroup().each(function(){var e=te(this).checkboxradio("instance");if(e){e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")}})}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove()}},_setOption:function(e,t){if(e==="label"&&!t){return}this._super(e,t);if(e==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",t);this.element[0].disabled=t;return}this.refresh()},_updateIcon:function(e){var t="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=te("<span>");this.iconSpace=te("<span> </span>");this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")}if(this.type==="checkbox"){t+=e?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")}else{t+="ui-icon-blank"}this._addClass(this.icon,"ui-checkboxradio-icon",t);if(!e){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked")}this.icon.prependTo(this.label).after(this.iconSpace)}else if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon}},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);if(this.icon){e=e.not(this.icon[0])}if(this.iconSpace){e=e.not(this.iconSpace[0])}e.remove();this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e);if(this.options.label!==null){this._updateLabel()}if(t!==this.options.disabled){this._setOptions({disabled:t})}}}]);var ge=te.ui.checkboxradio;te.widget("ui.button",{version:"1.13.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:true},_getCreateOptions:function(){var e,t=this._super()||{};this.isInput=this.element.is("input");e=this.element[0].disabled;if(e!=null){t.disabled=e}this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){t.label=this.originalLabel}return t},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true}if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false}this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label)}else{this.element.html(this.options.label)}}this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({keyup:function(e){if(e.keyCode===te.ui.keyCode.SPACE){e.preventDefault();if(this.element[0].click){this.element[0].click()}else{this.element.trigger("click")}}}})}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button")}if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip()}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label)}},_updateIcon:function(e,t){var i=e!=="iconPosition",n=i?this.options.iconPosition:t,r=n==="top"||n==="bottom";if(!this.icon){this.icon=te("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only")}}else if(i){this._removeClass(this.icon,null,this.options.icon)}if(i){this._addClass(this.icon,null,t)}this._attachIcon(n);if(r){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove()}}else{if(!this.iconSpace){this.iconSpace=te("<span> </span>");this._addClass(this.iconSpace,"ui-button-icon-space")}this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(n)}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove()}if(this.iconSpace){this.iconSpace.remove()}if(!this.hasTitle){this.element.removeAttr("title")}},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=e.showLabel===undefined?this.options.showLabel:e.showLabel,i=e.icon===undefined?this.options.icon:e.icon;if(!t&&!i){e.showLabel=true}this._super(e)},_setOption:function(e,t){if(e==="icon"){if(t){this._updateIcon(e,t)}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove()}}}if(e==="iconPosition"){this._updateIcon(e,t)}if(e==="showLabel"){this._toggleClass("ui-button-icon-only",null,!t);this._updateTooltip()}if(e==="label"){if(this.isInput){this.element.val(t)}else{this.element.html(t);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition)}}}this._super(e,t);if(e==="disabled"){this._toggleClass(null,"ui-state-disabled",t);this.element[0].disabled=t;if(t){this.element.trigger("blur")}}},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(e!==this.options.disabled){this._setOptions({disabled:e})}this._updateTooltip()}});if(te.uiBackCompat!==false){te.widget("ui.button",te.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text}if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel}if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end"}}else if(this.options.icon){this.options.icons.primary=this.options.icon}this._super()},_setOption:function(e,t){if(e==="text"){this._super("showLabel",t);return}if(e==="showLabel"){this.options.text=t}if(e==="icon"){this.options.icons.primary=t}if(e==="icons"){if(t.primary){this._super("icon",t.primary);this._super("iconPosition","beginning")}else if(t.secondary){this._super("icon",t.secondary);this._super("iconPosition","end")}}this._superApply(arguments)}});te.fn.button=function(n){return function(r){var e=typeof r==="string";var o=Array.prototype.slice.call(arguments,1);var a=this;if(e){if(!this.length&&r==="instance"){a=undefined}else{this.each(function(){var e;var t=te(this).attr("type");var i=t!=="checkbox"&&t!=="radio"?"button":"checkboxradio";var n=te.data(this,"ui-"+i);if(r==="instance"){a=n;return false}if(!n){return te.error("cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+r+"'")}if(typeof n[r]!=="function"||r.charAt(0)==="_"){return te.error("no such method '"+r+"' for button"+" widget instance")}e=n[r].apply(n,o);if(e!==n&&e!==undefined){a=e&&e.jquery?a.pushStack(e.get()):e;return false}})}}else{if(o.length){r=te.widget.extend.apply(null,[r].concat(o))}this.each(function(){var e=te(this).attr("type");var t=e!=="checkbox"&&e!=="radio"?"button":"checkboxradio";var i=te.data(this,"ui-"+t);if(i){i.option(r||{});if(i._init){i._init()}}else{if(t==="button"){n.call(te(this),r);return}te(this).checkboxradio(te.extend({icon:false},r))}})}return a}}(te.fn.button);te.fn.buttonset=function(){if(!te.ui.controlgroup){te.error("Controlgroup widget missing")}if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]])}if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"])}if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items}}return this.controlgroup.apply(this,arguments)}}var ve=te.ui.button;te.extend(te.ui,{datepicker:{version:"1.13.1"}});var D;function me(e){var t,i;while(e.length&&e[0]!==document){t=e.css("position");if(t==="absolute"||t==="relative"||t==="fixed"){i=parseInt(e.css("zIndex"),10);if(!isNaN(i)&&i!==0){return i}}e=e.parent()}return 0}function k(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};te.extend(this._defaults,this.regional[""]);this.regional.en=te.extend(true,{},this.regional[""]);this.regional["en-US"]=te.extend(true,{},this.regional.en);this.dpDiv=O(te("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}te.extend(k.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){N(this._defaults,e||{});return this},_attachDatepicker:function(e,t){var i,n,r;i=e.nodeName.toLowerCase();n=i==="div"||i==="span";if(!e.id){this.uuid+=1;e.id="dp"+this.uuid}r=this._newInst(te(e),n);r.settings=te.extend({},t||{});if(i==="input"){this._connectDatepicker(e,r)}else if(n){this._inlineDatepicker(e,r)}},_newInst:function(e,t){var i=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:i,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:!t?this.dpDiv:O(te("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}},_connectDatepicker:function(e,t){var i=te(e);t.append=te([]);t.trigger=te([]);if(i.hasClass(this.markerClassName)){return}this._attachments(i,t);i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(t);te.data(e,"datepicker",t);if(t.settings.disabled){this._disableDatepicker(e)}},_attachments:function(e,t){var i,n,r,o=this._get(t,"appendText"),a=this._get(t,"isRTL");if(t.append){t.append.remove()}if(o){t.append=te("<span>").addClass(this._appendClass).text(o);e[a?"before":"after"](t.append)}e.off("focus",this._showDatepicker);if(t.trigger){t.trigger.remove()}i=this._get(t,"showOn");if(i==="focus"||i==="both"){e.on("focus",this._showDatepicker)}if(i==="button"||i==="both"){n=this._get(t,"buttonText");r=this._get(t,"buttonImage");if(this._get(t,"buttonImageOnly")){t.trigger=te("<img>").addClass(this._triggerClass).attr({src:r,alt:n,title:n})}else{t.trigger=te("<button type='button'>").addClass(this._triggerClass);if(r){t.trigger.html(te("<img>").attr({src:r,alt:n,title:n}))}else{t.trigger.text(n)}}e[a?"before":"after"](t.trigger);t.trigger.on("click",function(){if(te.datepicker._datepickerShowing&&te.datepicker._lastInput===e[0]){te.datepicker._hideDatepicker()}else if(te.datepicker._datepickerShowing&&te.datepicker._lastInput!==e[0]){te.datepicker._hideDatepicker();te.datepicker._showDatepicker(e[0])}else{te.datepicker._showDatepicker(e[0])}return false})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,n,r,o=new Date(2009,12-1,20),a=this._get(e,"dateFormat");if(a.match(/[DM]/)){t=function(e){i=0;n=0;for(r=0;r<e.length;r++){if(e[r].length>i){i=e[r].length;n=r}}return n};o.setMonth(t(this._get(e,a.match(/MM/)?"monthNames":"monthNamesShort")));o.setDate(t(this._get(e,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())}e.input.attr("size",this._formatDate(e,o).length)}},_inlineDatepicker:function(e,t){var i=te(e);if(i.hasClass(this.markerClassName)){return}i.addClass(this.markerClassName).append(t.dpDiv);te.data(e,"datepicker",t);this._setDate(t,this._getDefaultDate(t),true);this._updateDatepicker(t);this._updateAlternate(t);if(t.settings.disabled){this._disableDatepicker(e)}t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,i,n,r){var o,a,s,l,u,c=this._dialogInst;if(!c){this.uuid+=1;o="dp"+this.uuid;this._dialogInput=te("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.on("keydown",this._doKeyDown);te("body").append(this._dialogInput);c=this._dialogInst=this._newInst(this._dialogInput,false);c.settings={};te.data(this._dialogInput[0],"datepicker",c)}N(c.settings,n||{});t=t&&t.constructor===Date?this._formatDate(c,t):t;this._dialogInput.val(t);this._pos=r?r.length?r:[r.pageX,r.pageY]:null;if(!this._pos){a=document.documentElement.clientWidth;s=document.documentElement.clientHeight;l=document.documentElement.scrollLeft||document.body.scrollLeft;u=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[a/2-100+l,s/2-150+u]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");c.settings.onSelect=i;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if(te.blockUI){te.blockUI(this.dpDiv)}te.data(this._dialogInput[0],"datepicker",c);return this},_destroyDatepicker:function(e){var t,i=te(e),n=te.data(e,"datepicker");if(!i.hasClass(this.markerClassName)){return}t=e.nodeName.toLowerCase();te.removeData(e,"datepicker");if(t==="input"){n.append.remove();n.trigger.remove();i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)}else if(t==="div"||t==="span"){i.removeClass(this.markerClassName).empty()}if(D===n){D=null;this._curInst=null}},_enableDatepicker:function(t){var e,i,n=te(t),r=te.data(t,"datepicker");if(!n.hasClass(this.markerClassName)){return}e=t.nodeName.toLowerCase();if(e==="input"){t.disabled=false;r.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e==="div"||e==="span"){i=n.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled");i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false)}this._disabledInputs=te.map(this._disabledInputs,function(e){return e===t?null:e})},_disableDatepicker:function(t){var e,i,n=te(t),r=te.data(t,"datepicker");if(!n.hasClass(this.markerClassName)){return}e=t.nodeName.toLowerCase();if(e==="input"){t.disabled=true;r.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e==="div"||e==="span"){i=n.children("."+this._inlineClass);i.children().addClass("ui-state-disabled");i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true)}this._disabledInputs=te.map(this._disabledInputs,function(e){return e===t?null:e});this._disabledInputs[this._disabledInputs.length]=t},_isDisabledDatepicker:function(e){if(!e){return false}for(var t=0;t<this._disabledInputs.length;t++){if(this._disabledInputs[t]===e){return true}}return false},_getInst:function(e){try{return te.data(e,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,i){var n,r,o,a,s=this._getInst(e);if(arguments.length===2&&typeof t==="string"){return t==="defaults"?te.extend({},te.datepicker._defaults):s?t==="all"?te.extend({},s.settings):this._get(s,t):null}n=t||{};if(typeof t==="string"){n={};n[t]=i}if(s){if(this._curInst===s){this._hideDatepicker()}r=this._getDateDatepicker(e,true);o=this._getMinMaxDate(s,"min");a=this._getMinMaxDate(s,"max");N(s.settings,n);if(o!==null&&n.dateFormat!==undefined&&n.minDate===undefined){s.settings.minDate=this._formatDate(s,o)}if(a!==null&&n.dateFormat!==undefined&&n.maxDate===undefined){s.settings.maxDate=this._formatDate(s,a)}if("disabled"in n){if(n.disabled){this._disableDatepicker(e)}else{this._enableDatepicker(e)}}this._attachments(te(e),s);this._autoSize(s);this._setDate(s,r);this._updateAlternate(s);this._updateDatepicker(s)}},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);if(t){this._updateDatepicker(t)}},_setDateDatepicker:function(e,t){var i=this._getInst(e);if(i){this._setDate(i,t);this._updateDatepicker(i);this._updateAlternate(i)}},_getDateDatepicker:function(e,t){var i=this._getInst(e);if(i&&!i.inline){this._setDateFromField(i,t)}return i?this._getDate(i):null},_doKeyDown:function(e){var t,i,n,r=te.datepicker._getInst(e.target),o=true,a=r.dpDiv.is(".ui-datepicker-rtl");r._keyEvent=true;if(te.datepicker._datepickerShowing){switch(e.keyCode){case 9:te.datepicker._hideDatepicker();o=false;break;case 13:n=te("td."+te.datepicker._dayOverClass+":not(."+te.datepicker._currentClass+")",r.dpDiv);if(n[0]){te.datepicker._selectDay(e.target,r.selectedMonth,r.selectedYear,n[0])}t=te.datepicker._get(r,"onSelect");if(t){i=te.datepicker._formatDate(r);t.apply(r.input?r.input[0]:null,[i,r])}else{te.datepicker._hideDatepicker()}return false;case 27:te.datepicker._hideDatepicker();break;case 33:te.datepicker._adjustDate(e.target,e.ctrlKey?-te.datepicker._get(r,"stepBigMonths"):-te.datepicker._get(r,"stepMonths"),"M");break;case 34:te.datepicker._adjustDate(e.target,e.ctrlKey?+te.datepicker._get(r,"stepBigMonths"):+te.datepicker._get(r,"stepMonths"),"M");break;case 35:if(e.ctrlKey||e.metaKey){te.datepicker._clearDate(e.target)}o=e.ctrlKey||e.metaKey;break;case 36:if(e.ctrlKey||e.metaKey){te.datepicker._gotoToday(e.target)}o=e.ctrlKey||e.metaKey;break;case 37:if(e.ctrlKey||e.metaKey){te.datepicker._adjustDate(e.target,a?+1:-1,"D")}o=e.ctrlKey||e.metaKey;if(e.originalEvent.altKey){te.datepicker._adjustDate(e.target,e.ctrlKey?-te.datepicker._get(r,"stepBigMonths"):-te.datepicker._get(r,"stepMonths"),"M")}break;case 38:if(e.ctrlKey||e.metaKey){te.datepicker._adjustDate(e.target,-7,"D")}o=e.ctrlKey||e.metaKey;break;case 39:if(e.ctrlKey||e.metaKey){te.datepicker._adjustDate(e.target,a?-1:+1,"D")}o=e.ctrlKey||e.metaKey;if(e.originalEvent.altKey){te.datepicker._adjustDate(e.target,e.ctrlKey?+te.datepicker._get(r,"stepBigMonths"):+te.datepicker._get(r,"stepMonths"),"M")}break;case 40:if(e.ctrlKey||e.metaKey){te.datepicker._adjustDate(e.target,+7,"D")}o=e.ctrlKey||e.metaKey;break;default:o=false}}else if(e.keyCode===36&&e.ctrlKey){te.datepicker._showDatepicker(this)}else{o=false}if(o){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var t,i,n=te.datepicker._getInst(e.target);if(te.datepicker._get(n,"constrainInput")){t=te.datepicker._possibleChars(te.datepicker._get(n,"dateFormat"));i=String.fromCharCode(e.charCode==null?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||(i<" "||!t||t.indexOf(i)>-1)}},_doKeyUp:function(e){var t,i=te.datepicker._getInst(e.target);if(i.input.val()!==i.lastVal){try{t=te.datepicker.parseDate(te.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,te.datepicker._getFormatConfig(i));if(t){te.datepicker._setDateFromField(i);te.datepicker._updateAlternate(i);te.datepicker._updateDatepicker(i)}}catch(e){}}return true},_showDatepicker:function(e){e=e.target||e;if(e.nodeName.toLowerCase()!=="input"){e=te("input",e.parentNode)[0]}if(te.datepicker._isDisabledDatepicker(e)||te.datepicker._lastInput===e){return}var t,i,n,r,o,a,s;t=te.datepicker._getInst(e);if(te.datepicker._curInst&&te.datepicker._curInst!==t){te.datepicker._curInst.dpDiv.stop(true,true);if(t&&te.datepicker._datepickerShowing){te.datepicker._hideDatepicker(te.datepicker._curInst.input[0])}}i=te.datepicker._get(t,"beforeShow");n=i?i.apply(e,[e,t]):{};if(n===false){return}N(t.settings,n);t.lastVal=null;te.datepicker._lastInput=e;te.datepicker._setDateFromField(t);if(te.datepicker._inDialog){e.value=""}if(!te.datepicker._pos){te.datepicker._pos=te.datepicker._findPos(e);te.datepicker._pos[1]+=e.offsetHeight}r=false;te(e).parents().each(function(){r|=te(this).css("position")==="fixed";return!r});o={left:te.datepicker._pos[0],top:te.datepicker._pos[1]};te.datepicker._pos=null;t.dpDiv.empty();t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});te.datepicker._updateDatepicker(t);o=te.datepicker._checkOffset(t,o,r);t.dpDiv.css({position:te.datepicker._inDialog&&te.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"});if(!t.inline){a=te.datepicker._get(t,"showAnim");s=te.datepicker._get(t,"duration");t.dpDiv.css("z-index",me(te(e))+1);te.datepicker._datepickerShowing=true;if(te.effects&&te.effects.effect[a]){t.dpDiv.show(a,te.datepicker._get(t,"showOptions"),s)}else{t.dpDiv[a||"show"](a?s:null)}if(te.datepicker._shouldFocusInput(t)){t.input.trigger("focus")}te.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;D=e;e.dpDiv.empty().append(this._generateHTML(e));this._attachHandlers(e);var t,i=this._getNumberOfMonths(e),n=i[1],r=17,o=e.dpDiv.find("."+this._dayOverClass+" a"),a=te.datepicker._get(e,"onUpdateDatepicker");if(o.length>0){R.apply(o.get(0))}e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(n>1){e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em")}e.dpDiv[(i[0]!==1||i[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(e===te.datepicker._curInst&&te.datepicker._datepickerShowing&&te.datepicker._shouldFocusInput(e)){e.input.trigger("focus")}if(e.yearshtml){t=e.yearshtml;setTimeout(function(){if(t===e.yearshtml&&e.yearshtml){e.dpDiv.find("select.ui-datepicker-year").first().replaceWith(e.yearshtml)}t=e.yearshtml=null},0)}if(a){a.apply(e.input?e.input[0]:null,[e])}},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,i){var n=e.dpDiv.outerWidth(),r=e.dpDiv.outerHeight(),o=e.input?e.input.outerWidth():0,a=e.input?e.input.outerHeight():0,s=document.documentElement.clientWidth+(i?0:te(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:te(document).scrollTop());t.left-=this._get(e,"isRTL")?n-o:0;t.left-=i&&t.left===e.input.offset().left?te(document).scrollLeft():0;t.top-=i&&t.top===e.input.offset().top+a?te(document).scrollTop():0;t.left-=Math.min(t.left,t.left+n>s&&s>n?Math.abs(t.left+n-s):0);t.top-=Math.min(t.top,t.top+r>l&&l>r?Math.abs(r+a):0);return t},_findPos:function(e){var t,i=this._getInst(e),n=this._get(i,"isRTL");while(e&&(e.type==="hidden"||e.nodeType!==1||te.expr.pseudos.hidden(e))){e=e[n?"previousSibling":"nextSibling"]}t=te(e).offset();return[t.left,t.top]},_hideDatepicker:function(e){var t,i,n,r,o=this._curInst;if(!o||e&&o!==te.data(e,"datepicker")){return}if(this._datepickerShowing){t=this._get(o,"showAnim");i=this._get(o,"duration");n=function(){te.datepicker._tidyDialog(o)};if(te.effects&&(te.effects.effect[t]||te.effects[t])){o.dpDiv.hide(t,te.datepicker._get(o,"showOptions"),i,n)}else{o.dpDiv[t==="slideDown"?"slideUp":t==="fadeIn"?"fadeOut":"hide"](t?i:null,n)}if(!t){n()}this._datepickerShowing=false;r=this._get(o,"onClose");if(r){r.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(te.blockUI){te.unblockUI();te("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!te.datepicker._curInst){return}var t=te(e.target),i=te.datepicker._getInst(t[0]);if(t[0].id!==te.datepicker._mainDivId&&t.parents("#"+te.datepicker._mainDivId).length===0&&!t.hasClass(te.datepicker.markerClassName)&&!t.closest("."+te.datepicker._triggerClass).length&&te.datepicker._datepickerShowing&&!(te.datepicker._inDialog&&te.blockUI)||t.hasClass(te.datepicker.markerClassName)&&te.datepicker._curInst!==i){te.datepicker._hideDatepicker()}},_adjustDate:function(e,t,i){var n=te(e),r=this._getInst(n[0]);if(this._isDisabledDatepicker(n[0])){return}this._adjustInstDate(r,t,i);this._updateDatepicker(r)},_gotoToday:function(e){var t,i=te(e),n=this._getInst(i[0]);if(this._get(n,"gotoCurrent")&&n.currentDay){n.selectedDay=n.currentDay;n.drawMonth=n.selectedMonth=n.currentMonth;n.drawYear=n.selectedYear=n.currentYear}else{t=new Date;n.selectedDay=t.getDate();n.drawMonth=n.selectedMonth=t.getMonth();n.drawYear=n.selectedYear=t.getFullYear()}this._notifyChange(n);this._adjustDate(i)},_selectMonthYear:function(e,t,i){var n=te(e),r=this._getInst(n[0]);r["selected"+(i==="M"?"Month":"Year")]=r["draw"+(i==="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10);this._notifyChange(r);this._adjustDate(n)},_selectDay:function(e,t,i,n){var r,o=te(e);if(te(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])){return}r=this._getInst(o[0]);r.selectedDay=r.currentDay=parseInt(te("a",n).attr("data-date"));r.selectedMonth=r.currentMonth=t;r.selectedYear=r.currentYear=i;this._selectDate(e,this._formatDate(r,r.currentDay,r.currentMonth,r.currentYear))},_clearDate:function(e){var t=te(e);this._selectDate(t,"")},_selectDate:function(e,t){var i,n=te(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r);if(r.input){r.input.val(t)}this._updateAlternate(r);i=this._get(r,"onSelect");if(i){i.apply(r.input?r.input[0]:null,[t,r])}else if(r.input){r.input.trigger("change")}if(r.inline){this._updateDatepicker(r)}else{this._hideDatepicker();this._lastInput=r.input[0];if(typeof r.input[0]!=="object"){r.input.trigger("focus")}this._lastInput=null}},_updateAlternate:function(e){var t,i,n,r=this._get(e,"altField");if(r){t=this._get(e,"altFormat")||this._get(e,"dateFormat");i=this._getDate(e);n=this.formatDate(t,i,this._getFormatConfig(e));te(document).find(r).val(n)}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());i.setDate(i.getDate()+4-(i.getDay()||7));t=i.getTime();i.setMonth(0);i.setDate(1);return Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,e){if(i==null||a==null){throw"Invalid arguments"}a=typeof a==="object"?a.toString():a+"";if(a===""){return null}var n,t,r,s=0,o=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,l=typeof o!=="string"?o:(new Date).getFullYear()%100+parseInt(o,10),u=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,c=(e?e.dayNames:null)||this._defaults.dayNames,d=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,f=(e?e.monthNames:null)||this._defaults.monthNames,p=-1,h=-1,g=-1,v=-1,m=false,y,b=function(e){var t=n+1<i.length&&i.charAt(n+1)===e;if(t){n++}return t},_=function(e){var t=b(e),i=e==="@"?14:e==="!"?20:e==="y"&&t?4:e==="o"?3:2,n=e==="y"?i:1,r=new RegExp("^\\d{"+n+","+i+"}"),o=a.substring(s).match(r);if(!o){throw"Missing number at position "+s}s+=o[0].length;return parseInt(o[0],10)},w=function(e,t,i){var n=-1,r=te.map(b(e)?i:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});te.each(r,function(e,t){var i=t[1];if(a.substr(s,i.length).toLowerCase()===i.toLowerCase()){n=t[0];s+=i.length;return false}});if(n!==-1){return n+1}else{throw"Unknown name at position "+s}},C=function(){if(a.charAt(s)!==i.charAt(n)){throw"Unexpected literal at position "+s}s++};for(n=0;n<i.length;n++){if(m){if(i.charAt(n)==="'"&&!b("'")){m=false}else{C()}}else{switch(i.charAt(n)){case"d":g=_("d");break;case"D":w("D",u,c);break;case"o":v=_("o");break;case"m":h=_("m");break;case"M":h=w("M",d,f);break;case"y":p=_("y");break;case"@":y=new Date(_("@"));p=y.getFullYear();h=y.getMonth()+1;g=y.getDate();break;case"!":y=new Date((_("!")-this._ticksTo1970)/1e4);p=y.getFullYear();h=y.getMonth()+1;g=y.getDate();break;case"'":if(b("'")){C()}else{m=true}break;default:C()}}}if(s<a.length){r=a.substr(s);if(!/^\s+/.test(r)){throw"Extra/unparsed characters found in date: "+r}}if(p===-1){p=(new Date).getFullYear()}else if(p<100){p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=l?0:-100)}if(v>-1){h=1;g=v;do{t=this._getDaysInMonth(p,h-1);if(g<=t){break}h++;g-=t}while(true)}y=this._daylightSavingAdjust(new Date(p,h-1,g));if(y.getFullYear()!==p||y.getMonth()+1!==h||y.getDate()!==g){throw"Invalid date"}return y},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*1e7,formatDate:function(i,e,t){if(!e){return""}var n,r=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,o=(t?t.dayNames:null)||this._defaults.dayNames,a=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,s=(t?t.monthNames:null)||this._defaults.monthNames,l=function(e){var t=n+1<i.length&&i.charAt(n+1)===e;if(t){n++}return t},u=function(e,t,i){var n=""+t;if(l(e)){while(n.length<i){n="0"+n}}return n},c=function(e,t,i,n){return l(e)?n[t]:i[t]},d="",f=false;if(e){for(n=0;n<i.length;n++){if(f){if(i.charAt(n)==="'"&&!l("'")){f=false}else{d+=i.charAt(n)}}else{switch(i.charAt(n)){case"d":d+=u("d",e.getDate(),2);break;case"D":d+=c("D",e.getDay(),r,o);break;case"o":d+=u("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=u("m",e.getMonth()+1,2);break;case"M":d+=c("M",e.getMonth(),a,s);break;case"y":d+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":d+=e.getTime();break;case"!":d+=e.getTime()*1e4+this._ticksTo1970;break;case"'":if(l("'")){d+="'"}else{f=true}break;default:d+=i.charAt(n)}}}}return d},_possibleChars:function(i){var n,e="",t=false,r=function(e){var t=n+1<i.length&&i.charAt(n+1)===e;if(t){n++}return t};for(n=0;n<i.length;n++){if(t){if(i.charAt(n)==="'"&&!r("'")){t=false}else{e+=i.charAt(n)}}else{switch(i.charAt(n)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":if(r("'")){e+="'"}else{t=true}break;default:e+=i.charAt(n)}}}return e},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()===e.lastVal){return}var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,r=this._getDefaultDate(e),o=r,a=this._getFormatConfig(e);try{o=this.parseDate(i,n,a)||r}catch(e){n=t?"":n}e.selectedDay=o.getDate();e.drawMonth=e.selectedMonth=o.getMonth();e.drawYear=e.selectedYear=o.getFullYear();e.currentDay=n?o.getDate():0;e.currentMonth=n?o.getMonth():0;e.currentYear=n?o.getFullYear():0;this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(s,e,t){var i=function(e){var t=new Date;t.setDate(t.getDate()+e);return t},n=function(e){try{return te.datepicker.parseDate(te.datepicker._get(s,"dateFormat"),e,te.datepicker._getFormatConfig(s))}catch(e){}var t=(e.toLowerCase().match(/^c/)?te.datepicker._getDate(s):null)||new Date,i=t.getFullYear(),n=t.getMonth(),r=t.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(e);while(a){switch(a[2]||"d"){case"d":case"D":r+=parseInt(a[1],10);break;case"w":case"W":r+=parseInt(a[1],10)*7;break;case"m":case"M":n+=parseInt(a[1],10);r=Math.min(r,te.datepicker._getDaysInMonth(i,n));break;case"y":case"Y":i+=parseInt(a[1],10);r=Math.min(r,te.datepicker._getDaysInMonth(i,n));break}a=o.exec(e)}return new Date(i,n,r)},r=e==null||e===""?t:typeof e==="string"?n(e):typeof e==="number"?isNaN(e)?t:i(e):new Date(e.getTime());r=r&&r.toString()==="Invalid Date"?t:r;if(r){r.setHours(0);r.setMinutes(0);r.setSeconds(0);r.setMilliseconds(0)}return this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){if(!e){return null}e.setHours(e.getHours()>12?e.getHours()+2:0);return e},_setDate:function(e,t,i){var n=!t,r=e.selectedMonth,o=e.selectedYear,a=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=a.getDate();e.drawMonth=e.selectedMonth=e.currentMonth=a.getMonth();e.drawYear=e.selectedYear=e.currentYear=a.getFullYear();if((r!==e.selectedMonth||o!==e.selectedYear)&&!i){this._notifyChange(e)}this._adjustInstDate(e);if(e.input){e.input.val(n?"":this._formatDate(e))}},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()===""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),i="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){te.datepicker._adjustDate(i,-t,"M")},next:function(){te.datepicker._adjustDate(i,+t,"M")},hide:function(){te.datepicker._hideDatepicker()},today:function(){te.datepicker._gotoToday(i)},selectDay:function(){te.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){te.datepicker._selectMonthYear(i,this,"M");return false},selectYear:function(){te.datepicker._selectMonthYear(i,this,"Y");return false}};te(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,n,r,o,a,s,l,u,c,d,L,F,G,$,f,p,W,h,g,v,m,y,b,_,w,C,A,H,j,B,E,V,x,z,U,T,S,D,Y=new Date,q=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth(),Y.getDate())),k=this._get(e,"isRTL"),X=this._get(e,"showButtonPanel"),K=this._get(e,"hideIfNoPrevNext"),Q=this._get(e,"navigationAsDateFormat"),O=this._getNumberOfMonths(e),Z=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),ee=O[0]!==1||O[1]!==1,R=this._daylightSavingAdjust(!e.currentDay?new Date(9999,9,9):new Date(e.currentYear,e.currentMonth,e.currentDay)),N=this._getMinMaxDate(e,"min"),I=this._getMinMaxDate(e,"max"),P=e.drawMonth-Z,M=e.drawYear;if(P<0){P+=12;M--}if(I){t=this._daylightSavingAdjust(new Date(I.getFullYear(),I.getMonth()-O[0]*O[1]+1,I.getDate()));t=N&&t<N?N:t;while(this._daylightSavingAdjust(new Date(M,P,1))>t){P--;if(P<0){P=11;M--}}}e.drawMonth=P;e.drawYear=M;i=this._get(e,"prevText");i=!Q?i:this.formatDate(i,this._daylightSavingAdjust(new Date(M,P-J,1)),this._getFormatConfig(e));if(this._canAdjustMonth(e,-1,M,P)){n=te("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:i}).append(te("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(k?"e":"w")).text(i))[0].outerHTML}else if(K){n=""}else{n=te("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:i}).append(te("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(k?"e":"w")).text(i))[0].outerHTML}r=this._get(e,"nextText");r=!Q?r:this.formatDate(r,this._daylightSavingAdjust(new Date(M,P+J,1)),this._getFormatConfig(e));if(this._canAdjustMonth(e,+1,M,P)){o=te("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:r}).append(te("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(k?"w":"e")).text(r))[0].outerHTML}else if(K){o=""}else{o=te("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:r}).append(te("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(k?"w":"e")).text(r))[0].outerHTML}a=this._get(e,"currentText");s=this._get(e,"gotoCurrent")&&e.currentDay?R:q;a=!Q?a:this.formatDate(a,s,this._getFormatConfig(e));l="";if(!e.inline){l=te("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(e,"closeText"))[0].outerHTML}u="";if(X){u=te("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(k?l:"").append(this._isInRange(e,s)?te("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(a):"").append(k?"":l)[0].outerHTML}c=parseInt(this._get(e,"firstDay"),10);c=isNaN(c)?0:c;d=this._get(e,"showWeek");L=this._get(e,"dayNames");F=this._get(e,"dayNamesMin");G=this._get(e,"monthNames");$=this._get(e,"monthNamesShort");f=this._get(e,"beforeShowDay");p=this._get(e,"showOtherMonths");W=this._get(e,"selectOtherMonths");h=this._getDefaultDate(e);g="";for(m=0;m<O[0];m++){y="";this.maxRows=4;for(b=0;b<O[1];b++){_=this._daylightSavingAdjust(new Date(M,P,e.selectedDay));w=" ui-corner-all";C="";if(ee){C+="<div class='ui-datepicker-group";if(O[1]>1){switch(b){case 0:C+=" ui-datepicker-group-first";w=" ui-corner-"+(k?"right":"left");break;case O[1]-1:C+=" ui-datepicker-group-last";w=" ui-corner-"+(k?"left":"right");break;default:C+=" ui-datepicker-group-middle";w="";break}}C+="'>"}C+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+w+"'>"+(/all|left/.test(w)&&m===0?k?o:n:"")+(/all|right/.test(w)&&m===0?k?n:o:"")+this._generateMonthYearHeader(e,P,M,N,I,m>0||b>0,G,$)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";A=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"";for(v=0;v<7;v++){H=(v+c)%7;A+="<th scope='col'"+((v+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+L[H]+"'>"+F[H]+"</span></th>"}C+=A+"</tr></thead><tbody>";j=this._getDaysInMonth(M,P);if(M===e.selectedYear&&P===e.selectedMonth){e.selectedDay=Math.min(e.selectedDay,j)}B=(this._getFirstDayOfMonth(M,P)-c+7)%7;E=Math.ceil((B+j)/7);V=ee?this.maxRows>E?this.maxRows:E:E;this.maxRows=V;x=this._daylightSavingAdjust(new Date(M,P,1-B));for(z=0;z<V;z++){C+="<tr>";U=!d?"":"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(x)+"</td>";for(v=0;v<7;v++){T=f?f.apply(e.input?e.input[0]:null,[x]):[true,""];S=x.getMonth()!==P;D=S&&!W||!T[0]||N&&x<N||I&&x>I;U+="<td class='"+((v+c+6)%7>=5?" ui-datepicker-week-end":"")+(S?" ui-datepicker-other-month":"")+(x.getTime()===_.getTime()&&P===e.selectedMonth&&e._keyEvent||h.getTime()===x.getTime()&&h.getTime()===_.getTime()?" "+this._dayOverClass:"")+(D?" "+this._unselectableClass+" ui-state-disabled":"")+(S&&!p?"":" "+T[1]+(x.getTime()===R.getTime()?" "+this._currentClass:"")+(x.getTime()===q.getTime()?" ui-datepicker-today":""))+"'"+((!S||p)&&T[2]?" title='"+T[2].replace(/'/g,"&#39;")+"'":"")+(D?"":" data-handler='selectDay' data-event='click' data-month='"+x.getMonth()+"' data-year='"+x.getFullYear()+"'")+">"+(S&&!p?"&#xa0;":D?"<span class='ui-state-default'>"+x.getDate()+"</span>":"<a class='ui-state-default"+(x.getTime()===q.getTime()?" ui-state-highlight":"")+(x.getTime()===R.getTime()?" ui-state-active":"")+(S?" ui-priority-secondary":"")+"' href='#' aria-current='"+(x.getTime()===R.getTime()?"true":"false")+"' data-date='"+x.getDate()+"'>"+x.getDate()+"</a>")+"</td>";x.setDate(x.getDate()+1);x=this._daylightSavingAdjust(x)}C+=U+"</tr>"}P++;if(P>11){P=0;M++}C+="</tbody></table>"+(ee?"</div>"+(O[0]>0&&b===O[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"");y+=C}g+=y}g+=u;e._keyEvent=false;return g},_generateMonthYearHeader:function(e,t,i,n,r,o,a,s){var l,u,c,d,f,p,h,g,v=this._get(e,"changeMonth"),m=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b=this._get(e,"selectMonthLabel"),_=this._get(e,"selectYearLabel"),w="<div class='ui-datepicker-title'>",C="";if(o||!v){C+="<span class='ui-datepicker-month'>"+a[t]+"</span>"}else{l=n&&n.getFullYear()===i;u=r&&r.getFullYear()===i;C+="<select class='ui-datepicker-month' aria-label='"+b+"' data-handler='selectMonth' data-event='change'>";for(c=0;c<12;c++){if((!l||c>=n.getMonth())&&(!u||c<=r.getMonth())){C+="<option value='"+c+"'"+(c===t?" selected='selected'":"")+">"+s[c]+"</option>"}}C+="</select>"}if(!y){w+=C+(o||!(v&&m)?"&#xa0;":"")}if(!e.yearshtml){e.yearshtml="";if(o||!m){w+="<span class='ui-datepicker-year'>"+i+"</span>"}else{d=this._get(e,"yearRange").split(":");f=(new Date).getFullYear();p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?f+parseInt(e,10):parseInt(e,10);return isNaN(t)?f:t};h=p(d[0]);g=Math.max(h,p(d[1]||""));h=n?Math.max(h,n.getFullYear()):h;g=r?Math.min(g,r.getFullYear()):g;e.yearshtml+="<select class='ui-datepicker-year' aria-label='"+_+"' data-handler='selectYear' data-event='change'>";for(;h<=g;h++){e.yearshtml+="<option value='"+h+"'"+(h===i?" selected='selected'":"")+">"+h+"</option>"}e.yearshtml+="</select>";w+=e.yearshtml;e.yearshtml=null}}w+=this._get(e,"yearSuffix");if(y){w+=(o||!(v&&m)?"&#xa0;":"")+C}w+="</div>";return w},_adjustInstDate:function(e,t,i){var n=e.selectedYear+(i==="Y"?t:0),r=e.selectedMonth+(i==="M"?t:0),o=Math.min(e.selectedDay,this._getDaysInMonth(n,r))+(i==="D"?t:0),a=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,r,o)));e.selectedDay=a.getDate();e.drawMonth=e.selectedMonth=a.getMonth();e.drawYear=e.selectedYear=a.getFullYear();if(i==="M"||i==="Y"){this._notifyChange(e)}},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=i&&t<i?i:t;return n&&r>n?n:r},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");if(t){t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])}},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t==="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var r=this._getNumberOfMonths(e),o=this._daylightSavingAdjust(new Date(i,n+(t<0?t:r[0]*r[1]),1));if(t<0){o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth()))}return this._isInRange(e,o)},_isInRange:function(e,t){var i,n,r=this._getMinMaxDate(e,"min"),o=this._getMinMaxDate(e,"max"),a=null,s=null,l=this._get(e,"yearRange");if(l){i=l.split(":");n=(new Date).getFullYear();a=parseInt(i[0],10);s=parseInt(i[1],10);if(i[0].match(/[+\-].*/)){a+=n}if(i[1].match(/[+\-].*/)){s+=n}}return(!r||t.getTime()>=r.getTime())&&(!o||t.getTime()<=o.getTime())&&(!a||t.getFullYear()>=a)&&(!s||t.getFullYear()<=s)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");t=typeof t!=="string"?t:(new Date).getFullYear()%100+parseInt(t,10);return{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){if(!t){e.currentDay=e.selectedDay;e.currentMonth=e.selectedMonth;e.currentYear=e.selectedYear}var r=t?typeof t==="object"?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),r,this._getFormatConfig(e))}});function O(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",t,function(){te(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){te(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){te(this).removeClass("ui-datepicker-next-hover")}}).on("mouseover",t,R)}function R(){if(!te.datepicker._isDisabledDatepicker(D.inline?D.dpDiv.parent()[0]:D.input[0])){te(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");te(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){te(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){te(this).addClass("ui-datepicker-next-hover")}}}function N(e,t){te.extend(e,t);for(var i in t){if(t[i]==null){e[i]=t[i]}}return e}te.fn.datepicker=function(e){if(!this.length){return this}if(!te.datepicker.initialized){te(document).on("mousedown",te.datepicker._checkExternalClick);te.datepicker.initialized=true}if(te("#"+te.datepicker._mainDivId).length===0){te("body").append(te.datepicker.dpDiv)}var t=Array.prototype.slice.call(arguments,1);if(typeof e==="string"&&(e==="isDisabled"||e==="getDate"||e==="widget")){return te.datepicker["_"+e+"Datepicker"].apply(te.datepicker,[this[0]].concat(t))}if(e==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return te.datepicker["_"+e+"Datepicker"].apply(te.datepicker,[this[0]].concat(t))}return this.each(function(){if(typeof e==="string"){te.datepicker["_"+e+"Datepicker"].apply(te.datepicker,[this].concat(t))}else{te.datepicker._attachDatepicker(this,e)}})};te.datepicker=new k;te.datepicker.initialized=false;te.datepicker.uuid=(new Date).getTime();te.datepicker.version="1.13.1";var ye=te.datepicker;var be=te.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var I=false;te(document).on("mouseup",function(){I=false});var _e=te.widget("ui.mouse",{version:"1.13.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(e){if(true===te.data(e.target,t.widgetName+".preventClickEvent")){te.removeData(e.target,t.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(e){if(I){return}this._mouseMoved=false;if(this._mouseStarted){this._mouseUp(e)}this._mouseDownEvent=e;var t=this,i=e.which===1,n=typeof this.options.cancel==="string"&&e.target.nodeName?te(e.target).closest(this.options.cancel).length:false;if(!i||n||!this._mouseCapture(e)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(e)!==false;if(!this._mouseStarted){e.preventDefault();return true}}if(true===te.data(e.target,this.widgetName+".preventClickEvent")){te.removeData(e.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(e){return t._mouseMove(e)};this._mouseUpDelegate=function(e){return t._mouseUp(e)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);e.preventDefault();I=true;return true},_mouseMove:function(e){if(this._mouseMoved){if(te.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button){return this._mouseUp(e)}else if(!e.which){if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(e)}}}if(e.which||e.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==false;if(this._mouseStarted){this._mouseDrag(e)}else{this._mouseUp(e)}}return!this._mouseStarted},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(e.target===this._mouseDownEvent.target){te.data(e.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(e)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;I=false;e.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});var we=te.ui.plugin={add:function(e,t,i){var n,r=te.ui[e].prototype;for(n in i){r.plugins[n]=r.plugins[n]||[];r.plugins[n].push([t,i[n]])}},call:function(e,t,i,n){var r,o=e.plugins[t];if(!o){return}if(!n&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)){return}for(r=0;r<o.length;r++){if(e.options[o[r][0]]){o[r][1].apply(e.element,i)}}}};var Ce=te.ui.safeBlur=function(e){if(e&&e.nodeName.toLowerCase()!=="body"){te(e).trigger("blur")}};te.widget("ui.draggable",te.ui.mouse,{version:"1.13.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(e,t){this._super(e,t);if(e==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(e){var t=this.options;if(this.helper||t.disabled||te(e.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(e);if(!this.handle){return false}this._blurActiveElement(e);this._blockFrames(t.iframeFix===true?"iframe":t.iframeFix);return true},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=te(this);return te("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(e){var t=te.ui.safeActiveElement(this.document[0]),i=te(e.target);if(i.closest(t).length){return}te.ui.safeBlur(t)},_mouseStart:function(e){var t=this.options;this.helper=this._createHelper(e);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(te.ui.ddmanager){te.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return te(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(e);this.originalPosition=this.position=this._generatePosition(e,false);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(t.cursorAt){this._adjustOffsetFromHelper(t.cursorAt)}this._setContainment();if(this._trigger("start",e)===false){this._clear();return false}this._cacheHelperProportions();if(te.ui.ddmanager&&!t.dropBehaviour){te.ui.ddmanager.prepareOffsets(this,e)}this._mouseDrag(e,true);if(te.ui.ddmanager){te.ui.ddmanager.dragStart(this,e)}return true},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(e,t){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(e,true);this.positionAbs=this._convertPositionTo("absolute");if(!t){var i=this._uiHash();if(this._trigger("drag",e,i)===false){this._mouseUp(new te.Event("mouseup",e));return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(te.ui.ddmanager){te.ui.ddmanager.drag(this,e)}return false},_mouseStop:function(e){var t=this,i=false;if(te.ui.ddmanager&&!this.options.dropBehaviour){i=te.ui.ddmanager.drop(this,e)}if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||typeof this.options.revert==="function"&&this.options.revert.call(this.element,i)){te(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(t._trigger("stop",e)!==false){t._clear()}})}else{if(this._trigger("stop",e)!==false){this._clear()}}return false},_mouseUp:function(e){this._unblockFrames();if(te.ui.ddmanager){te.ui.ddmanager.dragStop(this,e)}if(this.handleElement.is(e.target)){this.element.trigger("focus")}return te.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new te.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(e){return this.options.handle?!!te(e.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var t=this.options,i=typeof t.helper==="function",n=i?te(t.helper.apply(this.element[0],[e])):t.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!n.parents("body").length){n.appendTo(t.appendTo==="parent"?this.element[0].parentNode:t.appendTo)}if(i&&n[0]===this.element[0]){this._setPositionRelative()}if(n[0]!==this.element[0]&&!/(fixed|absolute)/.test(n.css("position"))){n.css("position","absolute")}return n},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")}if(Array.isArray(e)){e={left:+e[0],top:+e[1]||0}}if("left"in e){this.offset.click.left=e.left+this.margins.left}if("right"in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left}if("top"in e){this.offset.click.top=e.top+this.margins.top}if("bottom"in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),t=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==t&&te.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(!t?this.scrollParent.scrollTop():0),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(!t?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,i,n=this.options,r=this.document[0];this.relativeContainer=null;if(!n.containment){this.containment=null;return}if(n.containment==="window"){this.containment=[te(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,te(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,te(window).scrollLeft()+te(window).width()-this.helperProportions.width-this.margins.left,te(window).scrollTop()+(te(window).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(n.containment==="document"){this.containment=[0,0,te(r).width()-this.helperProportions.width-this.margins.left,(te(r).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(n.containment.constructor===Array){this.containment=n.containment;return}if(n.containment==="parent"){n.containment=this.helper[0].parentNode}t=te(n.containment);i=t[0];if(!i){return}e=/(scroll|auto)/.test(t.css("overflow"));this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(e?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=t},_convertPositionTo:function(e,t){if(!t){t=this.position}var i=e==="absolute"?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,n,r,o,a=this.options,s=this._isRootNode(this.scrollParent[0]),l=e.pageX,u=e.pageY;if(!s||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(t){if(this.containment){if(this.relativeContainer){n=this.relativeContainer.offset();i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]}else{i=this.containment}if(e.pageX-this.offset.click.left<i[0]){l=i[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<i[1]){u=i[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>i[2]){l=i[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>i[3]){u=i[3]+this.offset.click.top}}if(a.grid){r=a.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY;u=i?r-this.offset.click.top>=i[1]||r-this.offset.click.top>i[3]?r:r-this.offset.click.top>=i[1]?r-a.grid[1]:r+a.grid[1]:r;o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX;l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o}if(a.axis==="y"){l=this.originalPageX}if(a.axis==="x"){u=this.originalPageY}}return{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:s?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:s?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(e,t,i){i=i||this._uiHash();te.ui.plugin.call(this,e,[t,i,this],true);if(/^(drag|start|stop)/.test(e)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return te.Widget.prototype._trigger.call(this,e,t,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});te.ui.plugin.add("draggable","connectToSortable",{start:function(t,e,i){var n=te.extend({},e,{item:i.element});i.sortables=[];te(i.options.connectToSortable).each(function(){var e=te(this).sortable("instance");if(e&&!e.options.disabled){i.sortables.push(e);e.refreshPositions();e._trigger("activate",t,n)}})},stop:function(t,e,i){var n=te.extend({},e,{item:i.element});i.cancelHelperRemoval=false;te.each(i.sortables,function(){var e=this;if(e.isOver){e.isOver=0;i.cancelHelperRemoval=true;e.cancelHelperRemoval=false;e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")};e._mouseStop(t);e.options.helper=e.options._helper}else{e.cancelHelperRemoval=true;e._trigger("deactivate",t,n)}})},drag:function(i,n,r){te.each(r.sortables,function(){var e=false,t=this;t.positionAbs=r.positionAbs;t.helperProportions=r.helperProportions;t.offset.click=r.offset.click;if(t._intersectsWith(t.containerCache)){e=true;te.each(r.sortables,function(){this.positionAbs=r.positionAbs;this.helperProportions=r.helperProportions;this.offset.click=r.offset.click;if(this!==t&&this._intersectsWith(this.containerCache)&&te.contains(t.element[0],this.element[0])){e=false}return e})}if(e){if(!t.isOver){t.isOver=1;r._parent=n.helper.parent();t.currentItem=n.helper.appendTo(t.element).data("ui-sortable-item",true);t.options._helper=t.options.helper;t.options.helper=function(){return n.helper[0]};i.target=t.currentItem[0];t._mouseCapture(i,true);t._mouseStart(i,true,true);t.offset.click.top=r.offset.click.top;t.offset.click.left=r.offset.click.left;t.offset.parent.left-=r.offset.parent.left-t.offset.parent.left;t.offset.parent.top-=r.offset.parent.top-t.offset.parent.top;r._trigger("toSortable",i);r.dropped=t.element;te.each(r.sortables,function(){this.refreshPositions()});r.currentItem=r.element;t.fromOutside=r}if(t.currentItem){t._mouseDrag(i);n.position=t.position}}else{if(t.isOver){t.isOver=0;t.cancelHelperRemoval=true;t.options._revert=t.options.revert;t.options.revert=false;t._trigger("out",i,t._uiHash(t));t._mouseStop(i,true);t.options.revert=t.options._revert;t.options.helper=t.options._helper;if(t.placeholder){t.placeholder.remove()}n.helper.appendTo(r._parent);r._refreshOffsets(i);n.position=r._generatePosition(i,true);r._trigger("fromSortable",i);r.dropped=false;te.each(r.sortables,function(){this.refreshPositions()})}}})}});te.ui.plugin.add("draggable","cursor",{start:function(e,t,i){var n=te("body"),r=i.options;if(n.css("cursor")){r._cursor=n.css("cursor")}n.css("cursor",r.cursor)},stop:function(e,t,i){var n=i.options;if(n._cursor){te("body").css("cursor",n._cursor)}}});te.ui.plugin.add("draggable","opacity",{start:function(e,t,i){var n=te(t.helper),r=i.options;if(n.css("opacity")){r._opacity=n.css("opacity")}n.css("opacity",r.opacity)},stop:function(e,t,i){var n=i.options;if(n._opacity){te(t.helper).css("opacity",n._opacity)}}});te.ui.plugin.add("draggable","scroll",{start:function(e,t,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false)}if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(e,t,i){var n=i.options,r=false,o=i.scrollParentNotHidden[0],a=i.document[0];if(o!==a&&o.tagName!=="HTML"){if(!n.axis||n.axis!=="x"){if(i.overflowOffset.top+o.offsetHeight-e.pageY<n.scrollSensitivity){o.scrollTop=r=o.scrollTop+n.scrollSpeed}else if(e.pageY-i.overflowOffset.top<n.scrollSensitivity){o.scrollTop=r=o.scrollTop-n.scrollSpeed}}if(!n.axis||n.axis!=="y"){if(i.overflowOffset.left+o.offsetWidth-e.pageX<n.scrollSensitivity){o.scrollLeft=r=o.scrollLeft+n.scrollSpeed}else if(e.pageX-i.overflowOffset.left<n.scrollSensitivity){o.scrollLeft=r=o.scrollLeft-n.scrollSpeed}}}else{if(!n.axis||n.axis!=="x"){if(e.pageY-te(a).scrollTop()<n.scrollSensitivity){r=te(a).scrollTop(te(a).scrollTop()-n.scrollSpeed)}else if(te(window).height()-(e.pageY-te(a).scrollTop())<n.scrollSensitivity){r=te(a).scrollTop(te(a).scrollTop()+n.scrollSpeed)}}if(!n.axis||n.axis!=="y"){if(e.pageX-te(a).scrollLeft()<n.scrollSensitivity){r=te(a).scrollLeft(te(a).scrollLeft()-n.scrollSpeed)}else if(te(window).width()-(e.pageX-te(a).scrollLeft())<n.scrollSensitivity){r=te(a).scrollLeft(te(a).scrollLeft()+n.scrollSpeed)}}}if(r!==false&&te.ui.ddmanager&&!n.dropBehaviour){te.ui.ddmanager.prepareOffsets(i,e)}}});te.ui.plugin.add("draggable","snap",{start:function(e,t,i){var n=i.options;i.snapElements=[];te(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=te(this),t=e.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:t.top,left:t.left})}})},drag:function(e,t,i){var n,r,o,a,s,l,u,c,d,f,p=i.options,h=p.snapTolerance,g=t.offset.left,v=g+i.helperProportions.width,m=t.offset.top,y=m+i.helperProportions.height;for(d=i.snapElements.length-1;d>=0;d--){s=i.snapElements[d].left-i.margins.left;l=s+i.snapElements[d].width;u=i.snapElements[d].top-i.margins.top;c=u+i.snapElements[d].height;if(v<s-h||g>l+h||y<u-h||m>c+h||!te.contains(i.snapElements[d].item.ownerDocument,i.snapElements[d].item)){if(i.snapElements[d].snapping){if(i.options.snap.release){i.options.snap.release.call(i.element,e,te.extend(i._uiHash(),{snapItem:i.snapElements[d].item}))}}i.snapElements[d].snapping=false;continue}if(p.snapMode!=="inner"){n=Math.abs(u-y)<=h;r=Math.abs(c-m)<=h;o=Math.abs(s-v)<=h;a=Math.abs(l-g)<=h;if(n){t.position.top=i._convertPositionTo("relative",{top:u-i.helperProportions.height,left:0}).top}if(r){t.position.top=i._convertPositionTo("relative",{top:c,left:0}).top}if(o){t.position.left=i._convertPositionTo("relative",{top:0,left:s-i.helperProportions.width}).left}if(a){t.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}}f=n||r||o||a;if(p.snapMode!=="outer"){n=Math.abs(u-m)<=h;r=Math.abs(c-y)<=h;o=Math.abs(s-g)<=h;a=Math.abs(l-v)<=h;if(n){t.position.top=i._convertPositionTo("relative",{top:u,left:0}).top}if(r){t.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top}if(o){t.position.left=i._convertPositionTo("relative",{top:0,left:s}).left}if(a){t.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}}if(!i.snapElements[d].snapping&&(n||r||o||a||f)){if(i.options.snap.snap){i.options.snap.snap.call(i.element,e,te.extend(i._uiHash(),{snapItem:i.snapElements[d].item}))}}i.snapElements[d].snapping=n||r||o||a||f}}});te.ui.plugin.add("draggable","stack",{start:function(e,t,i){var n,r=i.options,o=te.makeArray(te(r.stack)).sort(function(e,t){return(parseInt(te(e).css("zIndex"),10)||0)-(parseInt(te(t).css("zIndex"),10)||0)});if(!o.length){return}n=parseInt(te(o[0]).css("zIndex"),10)||0;te(o).each(function(e){te(this).css("zIndex",n+e)});this.css("zIndex",n+o.length)}});te.ui.plugin.add("draggable","zIndex",{start:function(e,t,i){var n=te(t.helper),r=i.options;if(n.css("zIndex")){r._zIndex=n.css("zIndex")}n.css("zIndex",r.zIndex)},stop:function(e,t,i){var n=i.options;if(n._zIndex){te(t.helper).css("zIndex",n._zIndex)}}});var Ae=te.ui.draggable;te.widget("ui.resizable",te.ui.mouse,{version:"1.13.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(e,t){if(te(e).css("overflow")==="hidden"){return false}var i=t&&t==="left"?"scrollLeft":"scrollTop",n=false;if(e[i]>0){return true}try{e[i]=1;n=e[i]>0;e[i]=0}catch(e){}return n},_create:function(){var e,t=this.options,i=this;this._addClass("ui-resizable");te.extend(this,{_aspectRatio:!!t.aspectRatio,aspectRatio:t.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:t.helper||t.ghost||t.animate?t.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(te("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(e);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(e);this._proportionallyResize()}this._setupHandles();if(t.autoHide){te(this.element).on("mouseenter",function(){if(t.disabled){return}i._removeClass("ui-resizable-autohide");i._handles.show()}).on("mouseleave",function(){if(t.disabled){return}if(!i.resizing){i._addClass("ui-resizable-autohide");i._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();this._addedHandles.remove();var e,t=function(e){te(e).removeData("resizable").removeData("ui-resizable").off(".resizable")};if(this.elementIsWrapper){t(this.element);e=this.element;this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e);e.remove()}this.originalElement.css("resize",this.originalResizeStyle);t(this.originalElement);return this},_setOption:function(e,t){this._super(e,t);switch(e){case"handles":this._removeHandles();this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!t;break;default:break}},_setupHandles:function(){var e=this.options,t,i,n,r,o,a=this;this.handles=e.handles||(!te(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=te();this._addedHandles=te();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){t=String.prototype.trim.call(n[i]);r="ui-resizable-"+t;o=te("<div>");this._addClass(o,"ui-resizable-handle "+r);o.css({zIndex:e.zIndex});this.handles[t]=".ui-resizable-"+t;if(!this.element.children(this.handles[t]).length){this.element.append(o);this._addedHandles=this._addedHandles.add(o)}}}this._renderAxis=function(e){var t,i,n,r;e=e||this.element;for(t in this.handles){if(this.handles[t].constructor===String){this.handles[t]=this.element.children(this.handles[t]).first().show()}else if(this.handles[t].jquery||this.handles[t].nodeType){this.handles[t]=te(this.handles[t]);this._on(this.handles[t],{mousedown:a._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){i=te(this.handles[t],this.element);r=/sw|ne|nw|se|n|s/.test(t)?i.outerHeight():i.outerWidth();n=["padding",/ne|nw|n/.test(t)?"Top":/se|sw|s/.test(t)?"Bottom":/^e$/.test(t)?"Right":"Left"].join("");e.css(n,r);this._proportionallyResize()}this._handles=this._handles.add(this.handles[t])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!a.resizing){if(this.className){o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}a.axis=o&&o[1]?o[1]:"se"}});if(e.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(e){var t,i,n=false;for(t in this.handles){i=te(this.handles[t])[0];if(i===e.target||te.contains(i,e.target)){n=true}}return!this.options.disabled&&n},_mouseStart:function(e){var t,i,n,r=this.options,o=this.element;this.resizing=true;this._renderProxy();t=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(r.containment){t+=te(r.containment).scrollLeft()||0;i+=te(r.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:t,top:i};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()};this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()};this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()};this.originalPosition={left:t,top:i};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof r.aspectRatio==="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;n=te(".ui-resizable-"+this.axis).css("cursor");te("body").css("cursor",n==="auto"?this.axis+"-resize":n);this._addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var t,i,n=this.originalMousePosition,r=this.axis,o=e.pageX-n.left||0,a=e.pageY-n.top||0,s=this._change[r];this._updatePrevProperties();if(!s){return false}t=s.apply(this,[e,o,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){t=this._updateRatio(t,e)}t=this._respectSize(t,e);this._updateCache(t);this._propagate("resize",e);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!te.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",e,this.ui());this._applyChanges()}return false},_mouseStop:function(e){this.resizing=false;var t,i,n,r,o,a,s,l=this.options,u=this;if(this._helper){t=this._proportionallyResizeElements;i=t.length&&/textarea/i.test(t[0].nodeName);n=i&&this._hasScroll(t[0],"left")?0:u.sizeDiff.height;r=i?0:u.sizeDiff.width;o={width:u.helper.width()-r,height:u.helper.height()-n};a=parseFloat(u.element.css("left"))+(u.position.left-u.originalPosition.left)||null;s=parseFloat(u.element.css("top"))+(u.position.top-u.originalPosition.top)||null;if(!l.animate){this.element.css(te.extend(o,{top:s,left:a}))}u.helper.height(u.size.height);u.helper.width(u.size.width);if(this._helper&&!l.animate){this._proportionallyResize()}}te("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",e);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};if(this.position.top!==this.prevPosition.top){e.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){e.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){e.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){e.height=this.size.height+"px"}this.helper.css(e);return e},_updateVirtualBoundaries:function(e){var t,i,n,r,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:Infinity,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:Infinity};if(this._aspectRatio||e){t=o.minHeight*this.aspectRatio;n=o.minWidth/this.aspectRatio;i=o.maxHeight*this.aspectRatio;r=o.maxWidth/this.aspectRatio;if(t>o.minWidth){o.minWidth=t}if(n>o.minHeight){o.minHeight=n}if(i<o.maxWidth){o.maxWidth=i}if(r<o.maxHeight){o.maxHeight=r}}this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset();if(this._isNumber(e.left)){this.position.left=e.left}if(this._isNumber(e.top)){this.position.top=e.top}if(this._isNumber(e.height)){this.size.height=e.height}if(this._isNumber(e.width)){this.size.width=e.width}},_updateRatio:function(e){var t=this.position,i=this.size,n=this.axis;if(this._isNumber(e.height)){e.width=e.height*this.aspectRatio}else if(this._isNumber(e.width)){e.height=e.width/this.aspectRatio}if(n==="sw"){e.left=t.left+(i.width-e.width);e.top=null}if(n==="nw"){e.top=t.top+(i.height-e.height);e.left=t.left+(i.width-e.width)}return e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,n=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,r=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,a=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,s=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,u=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);if(o){e.width=t.minWidth}if(a){e.height=t.minHeight}if(n){e.width=t.maxWidth}if(r){e.height=t.maxHeight}if(o&&u){e.left=s-t.minWidth}if(n&&u){e.left=s-t.maxWidth}if(a&&c){e.top=l-t.minHeight}if(r&&c){e.top=l-t.maxHeight}if(!e.width&&!e.height&&!e.left&&e.top){e.top=null}else if(!e.width&&!e.height&&!e.top&&e.left){e.left=null}return e},_getPaddingPlusBorderDimensions:function(e){var t=0,i=[],n=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],r=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];for(;t<4;t++){i[t]=parseFloat(n[t])||0;i[t]+=parseFloat(r[t])||0}return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var e,t=0,i=this.helper||this.element;for(;t<this._proportionallyResizeElements.length;t++){e=this._proportionallyResizeElements[t];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(e)}e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var e=this.element,t=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||te("<div></div>").css({overflow:"hidden"});this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++t.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,n=this.originalPosition;return{left:n.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize,r=this.originalPosition;return{top:r.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(e,t,i){return te.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,t,i]))},sw:function(e,t,i){return te.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,t,i]))},ne:function(e,t,i){return te.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,t,i]))},nw:function(e,t,i){return te.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,t,i]))}},_propagate:function(e,t){te.ui.plugin.call(this,e,[t,this.ui()]);if(e!=="resize"){this._trigger(e,t,this.ui())}},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});te.ui.plugin.add("resizable","animate",{stop:function(t){var i=te(this).resizable("instance"),e=i.options,n=i._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),o=r&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,a=r?0:i.sizeDiff.width,s={width:i.size.width-a,height:i.size.height-o},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,u=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(te.extend(s,u&&l?{top:u,left:l}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var e={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};if(n&&n.length){te(n[0]).css({width:e.width,height:e.height})}i._updateCache(e);i._propagate("resize",t)}})}});te.ui.plugin.add("resizable","containment",{start:function(){var i,n,e,t,r,o,a,s=te(this).resizable("instance"),l=s.options,u=s.element,c=l.containment,d=c instanceof te?c.get(0):/parent/.test(c)?u.parent().get(0):c;if(!d){return}s.containerElement=te(d);if(/document/.test(c)||c===document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:te(document),left:0,top:0,width:te(document).width(),height:te(document).height()||document.body.parentNode.scrollHeight}}else{i=te(d);n=[];te(["Top","Right","Left","Bottom"]).each(function(e,t){n[e]=s._num(i.css("padding"+t))});s.containerOffset=i.offset();s.containerPosition=i.position();s.containerSize={height:i.innerHeight()-n[3],width:i.innerWidth()-n[1]};e=s.containerOffset;t=s.containerSize.height;r=s.containerSize.width;o=s._hasScroll(d,"left")?d.scrollWidth:r;a=s._hasScroll(d)?d.scrollHeight:t;s.parentData={element:d,left:e.left,top:e.top,width:o,height:a}}},resize:function(e){var t,i,n,r,o=te(this).resizable("instance"),a=o.options,s=o.containerOffset,l=o.position,u=o._aspectRatio||e.shiftKey,c={top:0,left:0},d=o.containerElement,f=true;if(d[0]!==document&&/static/.test(d.css("position"))){c=s}if(l.left<(o._helper?s.left:0)){o.size.width=o.size.width+(o._helper?o.position.left-s.left:o.position.left-c.left);if(u){o.size.height=o.size.width/o.aspectRatio;f=false}o.position.left=a.helper?s.left:0}if(l.top<(o._helper?s.top:0)){o.size.height=o.size.height+(o._helper?o.position.top-s.top:o.position.top);if(u){o.size.width=o.size.height*o.aspectRatio;f=false}o.position.top=o._helper?s.top:0}n=o.containerElement.get(0)===o.element.parent().get(0);r=/relative|absolute/.test(o.containerElement.css("position"));if(n&&r){o.offset.left=o.parentData.left+o.position.left;o.offset.top=o.parentData.top+o.position.top}else{o.offset.left=o.element.offset().left;o.offset.top=o.element.offset().top}t=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-s.left));i=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-s.top));if(t+o.size.width>=o.parentData.width){o.size.width=o.parentData.width-t;if(u){o.size.height=o.size.width/o.aspectRatio;f=false}}if(i+o.size.height>=o.parentData.height){o.size.height=o.parentData.height-i;if(u){o.size.width=o.size.height*o.aspectRatio;f=false}}if(!f){o.position.left=o.prevPosition.left;o.position.top=o.prevPosition.top;o.size.width=o.prevSize.width;o.size.height=o.prevSize.height}},stop:function(){var e=te(this).resizable("instance"),t=e.options,i=e.containerOffset,n=e.containerPosition,r=e.containerElement,o=te(e.helper),a=o.offset(),s=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;if(e._helper&&!t.animate&&/relative/.test(r.css("position"))){te(this).css({left:a.left-n.left-i.left,width:s,height:l})}if(e._helper&&!t.animate&&/static/.test(r.css("position"))){te(this).css({left:a.left-n.left-i.left,width:s,height:l})}}});te.ui.plugin.add("resizable","alsoResize",{start:function(){var e=te(this).resizable("instance"),t=e.options;te(t.alsoResize).each(function(){var e=te(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var t=te(this).resizable("instance"),n=t.options,r=t.originalSize,o=t.originalPosition,a={height:t.size.height-r.height||0,width:t.size.width-r.width||0,top:t.position.top-o.top||0,left:t.position.left-o.left||0};te(n.alsoResize).each(function(){var e=te(this),n=te(this).data("ui-resizable-alsoresize"),r={},t=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];te.each(t,function(e,t){var i=(n[t]||0)+(a[t]||0);if(i&&i>=0){r[t]=i||null}});e.css(r)})},stop:function(){te(this).removeData("ui-resizable-alsoresize")}});te.ui.plugin.add("resizable","ghost",{start:function(){var e=te(this).resizable("instance"),t=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:.25,display:"block",position:"relative",height:t.height,width:t.width,margin:0,left:0,top:0});e._addClass(e.ghost,"ui-resizable-ghost");if(te.uiBackCompat!==false&&typeof e.options.ghost==="string"){e.ghost.addClass(this.options.ghost)}e.ghost.appendTo(e.helper)},resize:function(){var e=te(this).resizable("instance");if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(){var e=te(this).resizable("instance");if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});te.ui.plugin.add("resizable","grid",{resize:function(){var e,t=te(this).resizable("instance"),i=t.options,n=t.size,r=t.originalSize,o=t.originalPosition,a=t.axis,s=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,l=s[0]||1,u=s[1]||1,c=Math.round((n.width-r.width)/l)*l,d=Math.round((n.height-r.height)/u)*u,f=r.width+c,p=r.height+d,h=i.maxWidth&&i.maxWidth<f,g=i.maxHeight&&i.maxHeight<p,v=i.minWidth&&i.minWidth>f,m=i.minHeight&&i.minHeight>p;i.grid=s;if(v){f+=l}if(m){p+=u}if(h){f-=l}if(g){p-=u}if(/^(se|s|e)$/.test(a)){t.size.width=f;t.size.height=p}else if(/^(ne)$/.test(a)){t.size.width=f;t.size.height=p;t.position.top=o.top-d}else if(/^(sw)$/.test(a)){t.size.width=f;t.size.height=p;t.position.left=o.left-c}else{if(p-u<=0||f-l<=0){e=t._getPaddingPlusBorderDimensions(this)}if(p-u>0){t.size.height=p;t.position.top=o.top-d}else{p=u-e.height;t.size.height=p;t.position.top=o.top+r.height-p}if(f-l>0){t.size.width=f;t.position.left=o.left-c}else{f=l-e.width;t.size.width=f;t.position.left=o.left+r.width-f}}}});var Ee=te.ui.resizable;te.widget("ui.dialog",{version:"1.13.1",options:{appendTo:"body",autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var t=te(this).css(e).offset().top;if(t<0){te(this).css("top",e.top-t)}}},resizable:true,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");if(this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle}if(this.options.disabled){this.options.disabled=false}this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();if(this.options.draggable&&te.fn.draggable){this._makeDraggable()}if(this.options.resizable&&te.fn.resizable){this._makeResizable()}this._isOpen=false;this._trackFocus()},_init:function(){if(this.options.autoOpen){this.open()}},_appendTo:function(){var e=this.options.appendTo;if(e&&(e.jquery||e.nodeType)){return te(e)}return this.document.find(e||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(this.originalTitle){this.element.attr("title",this.originalTitle)}e=t.parent.children().eq(t.index);if(e.length&&e[0]!==this.element[0]){e.before(this.element)}else{t.parent.append(this.element)}},widget:function(){return this.uiDialog},disable:te.noop,enable:te.noop,close:function(e){var t=this;if(!this._isOpen||this._trigger("beforeClose",e)===false){return}this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").trigger("focus").length){te.ui.safeBlur(te.ui.safeActiveElement(this.document[0]))}this._hide(this.uiDialog,this.options.hide,function(){t._trigger("close",e)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=false,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+te(this).css("z-index")}).get(),r=Math.max.apply(null,n);if(r>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",r+1);i=true}if(i&&!t){this._trigger("focus",e)}return i},open:function(){var e=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable()}return}this._isOpen=true;this.opener=te(te.ui.safeActiveElement(this.document[0]));this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1)}this._show(this.uiDialog,this.options.show,function(){e._focusTabbable();e._trigger("focus")});this._makeFocusTarget();this._trigger("open")},_focusTabbable:function(){var e=this._focusedElement;if(!e){e=this.element.find("[autofocus]")}if(!e.length){e=this.element.find(":tabbable")}if(!e.length){e=this.uiDialogButtonPane.find(":tabbable")}if(!e.length){e=this.uiDialogTitlebarClose.filter(":tabbable")}if(!e.length){e=this.uiDialog}e.eq(0).trigger("focus")},_restoreTabbableFocus:function(){var e=te.ui.safeActiveElement(this.document[0]),t=this.uiDialog[0]===e||te.contains(this.uiDialog[0],e);if(!t){this._focusTabbable()}},_keepFocus:function(e){e.preventDefault();this._restoreTabbableFocus();this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=te("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===te.ui.keyCode.ESCAPE){e.preventDefault();this.close(e);return}if(e.keyCode!==te.ui.keyCode.TAB||e.isDefaultPrevented()){return}var t=this.uiDialog.find(":tabbable"),i=t.first(),n=t.last();if((e.target===n[0]||e.target===this.uiDialog[0])&&!e.shiftKey){this._delay(function(){i.trigger("focus")});e.preventDefault()}else if((e.target===i[0]||e.target===this.uiDialog[0])&&e.shiftKey){this._delay(function(){n.trigger("focus")});e.preventDefault()}},mousedown:function(e){if(this._moveToTop(e)){this._focusTabbable()}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})}},_createTitlebar:function(){var e;this.uiDialogTitlebar=te("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(e){if(!te(e.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.trigger("focus")}}});this.uiDialogTitlebarClose=te("<button type='button'></button>").button({label:te("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault();this.close(e)}});e=te("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(e,"ui-dialog-title");this._title(e);this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(e){if(this.options.title){e.text(this.options.title)}else{e.html("&#160;")}},_createButtonPane:function(){this.uiDialogButtonPane=te("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=te("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons()},_createButtons:function(){var r=this,e=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if(te.isEmptyObject(e)||Array.isArray(e)&&!e.length){this._removeClass(this.uiDialog,"ui-dialog-buttons");return}te.each(e,function(e,t){var i,n;t=typeof t==="function"?{click:t,text:e}:t;t=te.extend({type:"button"},t);i=t.click;n={icon:t.icon,iconPosition:t.iconPosition,showLabel:t.showLabel,icons:t.icons,text:t.text};delete t.click;delete t.icon;delete t.iconPosition;delete t.showLabel;delete t.icons;if(typeof t.text==="boolean"){delete t.text}te("<button></button>",t).button(n).appendTo(r.uiButtonSet).on("click",function(){i.apply(r.element[0],arguments)})});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){var r=this,o=this.options;function a(e){return{position:e.position,offset:e.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,t){r._addClass(te(this),"ui-dialog-dragging");r._blockFrames();r._trigger("dragStart",e,a(t))},drag:function(e,t){r._trigger("drag",e,a(t))},stop:function(e,t){var i=t.offset.left-r.document.scrollLeft(),n=t.offset.top-r.document.scrollTop();o.position={my:"left top",at:"left"+(i>=0?"+":"")+i+" "+"top"+(n>=0?"+":"")+n,of:r.window};r._removeClass(te(this),"ui-dialog-dragging");r._unblockFrames();r._trigger("dragStop",e,a(t))}})},_makeResizable:function(){var o=this,a=this.options,e=a.resizable,t=this.uiDialog.css("position"),i=typeof e==="string"?e:"n,e,s,w,se,sw,ne,nw";function s(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:i,start:function(e,t){o._addClass(te(this),"ui-dialog-resizing");o._blockFrames();o._trigger("resizeStart",e,s(t))},resize:function(e,t){o._trigger("resize",e,s(t))},stop:function(e,t){var i=o.uiDialog.offset(),n=i.left-o.document.scrollLeft(),r=i.top-o.document.scrollTop();a.height=o.uiDialog.height();a.width=o.uiDialog.width();a.position={my:"left top",at:"left"+(n>=0?"+":"")+n+" "+"top"+(r>=0?"+":"")+r,of:o.window};o._removeClass(te(this),"ui-dialog-resizing");o._unblockFrames();o._trigger("resizeStop",e,s(t))}}).css("position",t)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget();this._focusedElement=te(e.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),t=te.inArray(this,e);if(t!==-1){e.splice(t,1)}},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");if(!e){e=[];this.document.data("ui-dialog-instances",e)}return e},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");if(!e){this.uiDialog.show()}this.uiDialog.position(this.options.position);if(!e){this.uiDialog.hide()}},_setOptions:function(e){var i=this,n=false,r={};te.each(e,function(e,t){i._setOption(e,t);if(e in i.sizeRelatedOptions){n=true}if(e in i.resizableRelatedOptions){r[e]=t}});if(n){this._size();this._position()}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",r)}},_setOption:function(e,t){var i,n,r=this.uiDialog;if(e==="disabled"){return}this._super(e,t);if(e==="appendTo"){this.uiDialog.appendTo(this._appendTo())}if(e==="buttons"){this._createButtons()}if(e==="closeText"){this.uiDialogTitlebarClose.button({label:te("<a>").text(""+this.options.closeText).html()})}if(e==="draggable"){i=r.is(":data(ui-draggable)");if(i&&!t){r.draggable("destroy")}if(!i&&t){this._makeDraggable()}}if(e==="position"){this._position()}if(e==="resizable"){n=r.is(":data(ui-resizable)");if(n&&!t){r.resizable("destroy")}if(n&&typeof t==="string"){r.resizable("option","handles",t)}if(!n&&t!==false){this._makeResizable()}}if(e==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))}},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(n.minWidth>n.width){n.width=n.minWidth}e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight();t=Math.max(0,n.minHeight-e);i=typeof n.maxHeight==="number"?Math.max(0,n.maxHeight-e):"none";if(n.height==="auto"){this.element.css({minHeight:t,maxHeight:i,height:"auto"})}else{this.element.height(Math.max(0,n.height-e))}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=te(this);return te("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_allowInteraction:function(e){if(te(e.target).closest(".ui-dialog").length){return true}return!!te(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal){return}var i=te.fn.jquery.substring(0,4);var n=true;this._delay(function(){n=false});if(!this.document.data("ui-dialog-overlays")){this.document.on("focusin.ui-dialog",function(e){if(n){return}var t=this._trackingInstances()[0];if(!t._allowInteraction(e)){e.preventDefault();t._focusTabbable();if(i==="3.4."||i==="3.5."){t._delay(t._restoreTabbableFocus)}}}.bind(this))}this.overlay=te("<div>").appendTo(this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)},_destroyOverlay:function(){if(!this.options.modal){return}if(this.overlay){var e=this.document.data("ui-dialog-overlays")-1;if(!e){this.document.off("focusin.ui-dialog");this.document.removeData("ui-dialog-overlays")}else{this.document.data("ui-dialog-overlays",e)}this.overlay.remove();this.overlay=null}}});if(te.uiBackCompat!==false){te.widget("ui.dialog",te.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){if(e==="dialogClass"){this.uiDialog.removeClass(this.options.dialogClass).addClass(t)}this._superApply(arguments)}})}var xe=te.ui.dialog;te.widget("ui.droppable",{version:"1.13.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,t=this.options,i=t.accept;this.isover=false;this.isout=true;this.accept=typeof i==="function"?i:function(e){return e.is(i)};this.proportions=function(){if(arguments.length){e=arguments[0]}else{return e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(t.scope);if(t.addClasses){this._addClass("ui-droppable")}},_addToManager:function(e){te.ui.ddmanager.droppables[e]=te.ui.ddmanager.droppables[e]||[];te.ui.ddmanager.droppables[e].push(this)},_splice:function(e){var t=0;for(;t<e.length;t++){if(e[t]===this){e.splice(t,1)}}},_destroy:function(){var e=te.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,t){if(e==="accept"){this.accept=typeof t==="function"?t:function(e){return e.is(t)}}else if(e==="scope"){var i=te.ui.ddmanager.droppables[this.options.scope];this._splice(i);this._addToManager(t)}this._super(e,t)},_activate:function(e){var t=te.ui.ddmanager.current;this._addActiveClass();if(t){this._trigger("activate",e,this.ui(t))}},_deactivate:function(e){var t=te.ui.ddmanager.current;this._removeActiveClass();if(t){this._trigger("deactivate",e,this.ui(t))}},_over:function(e){var t=te.ui.ddmanager.current;if(!t||(t.currentItem||t.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],t.currentItem||t.element)){this._addHoverClass();this._trigger("over",e,this.ui(t))}},_out:function(e){var t=te.ui.ddmanager.current;if(!t||(t.currentItem||t.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],t.currentItem||t.element)){this._removeHoverClass();this._trigger("out",e,this.ui(t))}},_drop:function(t,e){var i=e||te.ui.ddmanager.current,n=false;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=te(this).droppable("instance");if(e.options.greedy&&!e.options.disabled&&e.options.scope===i.options.scope&&e.accept.call(e.element[0],i.currentItem||i.element)&&te.ui.intersect(i,te.extend(e,{offset:e.element.offset()}),e.options.tolerance,t)){n=true;return false}});if(n){return false}if(this.accept.call(this.element[0],i.currentItem||i.element)){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",t,this.ui(i));return this.element}return false},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});te.ui.intersect=function(){function f(e,t,i){return e>=t&&e<t+i}return function(e,t,i,n){if(!t.offset){return false}var r=(e.positionAbs||e.position.absolute).left+e.margins.left,o=(e.positionAbs||e.position.absolute).top+e.margins.top,a=r+e.helperProportions.width,s=o+e.helperProportions.height,l=t.offset.left,u=t.offset.top,c=l+t.proportions().width,d=u+t.proportions().height;switch(i){case"fit":return l<=r&&a<=c&&u<=o&&s<=d;case"intersect":return l<r+e.helperProportions.width/2&&a-e.helperProportions.width/2<c&&u<o+e.helperProportions.height/2&&s-e.helperProportions.height/2<d;case"pointer":return f(n.pageY,u,t.proportions().height)&&f(n.pageX,l,t.proportions().width);case"touch":return(o>=u&&o<=d||s>=u&&s<=d||o<u&&s>d)&&(r>=l&&r<=c||a>=l&&a<=c||r<l&&a>c);default:return false}}}();te.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,t){var i,n,r=te.ui.ddmanager.droppables[e.options.scope]||[],o=t?t.type:null,a=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();e:for(i=0;i<r.length;i++){if(r[i].options.disabled||e&&!r[i].accept.call(r[i].element[0],e.currentItem||e.element)){continue}for(n=0;n<a.length;n++){if(a[n]===r[i].element[0]){r[i].proportions().height=0;continue e}}r[i].visible=r[i].element.css("display")!=="none";if(!r[i].visible){continue}if(o==="mousedown"){r[i]._activate.call(r[i],t)}r[i].offset=r[i].element.offset();r[i].proportions({width:r[i].element[0].offsetWidth,height:r[i].element[0].offsetHeight})}},drop:function(e,t){var i=false;te.each((te.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&te.ui.intersect(e,this,this.options.tolerance,t)){i=this._drop.call(this,t)||i}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)){this.isout=true;this.isover=false;this._deactivate.call(this,t)}});return i},dragStart:function(e,t){e.element.parentsUntil("body").on("scroll.droppable",function(){if(!e.options.refreshPositions){te.ui.ddmanager.prepareOffsets(e,t)}})},drag:function(o,a){if(o.options.refreshPositions){te.ui.ddmanager.prepareOffsets(o,a)}te.each(te.ui.ddmanager.droppables[o.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e,t,i,n=te.ui.intersect(o,this,this.options.tolerance,a),r=!n&&this.isover?"isout":n&&!this.isover?"isover":null;if(!r){return}if(this.options.greedy){t=this.options.scope;i=this.element.parents(":data(ui-droppable)").filter(function(){return te(this).droppable("instance").options.scope===t});if(i.length){e=te(i[0]).droppable("instance");e.greedyChild=r==="isover"}}if(e&&r==="isover"){e.isover=false;e.isout=true;e._out.call(e,a)}this[r]=true;this[r==="isout"?"isover":"isout"]=false;this[r==="isover"?"_over":"_out"].call(this,a);if(e&&r==="isout"){e.isout=false;e.isover=true;e._over.call(e,a)}})},dragStop:function(e,t){e.element.parentsUntil("body").off("scroll.droppable");if(!e.options.refreshPositions){te.ui.ddmanager.prepareOffsets(e,t)}}};if(te.uiBackCompat!==false){te.widget("ui.droppable",te.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}var Te=te.ui.droppable;var Se=te.widget("ui.progressbar",{version:"1.13.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.attr({role:"progressbar","aria-valuemin":this.min});this._addClass("ui-progressbar","ui-widget ui-widget-content");this.valueDiv=te("<div>").appendTo(this.element);this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header");this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");this.valueDiv.remove()},value:function(e){if(e===undefined){return this.options.value}this.options.value=this._constrainedValue(e);this._refreshValue()},_constrainedValue:function(e){if(e===undefined){e=this.options.value}this.indeterminate=e===false;if(typeof e!=="number"){e=0}return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value;this._super(e);this.options.value=this._constrainedValue(t);this._refreshValue()},_setOption:function(e,t){if(e==="max"){t=Math.max(this.min,t)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e);this.element.attr("aria-disabled",e);this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,t=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(t.toFixed(0)+"%");this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=te("<div>").appendTo(this.valueDiv);this._addClass(this.overlayDiv,"ui-progressbar-overlay")}}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null}}if(this.oldValue!==e){this.oldValue=e;this._trigger("change")}if(e===this.options.max){this._trigger("complete")}}});var De=te.widget("ui.selectable",te.ui.mouse,{version:"1.13.1",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var r=this;this._addClass("ui-selectable");this.dragged=false;this.refresh=function(){r.elementPos=te(r.element[0]).offset();r.selectees=te(r.options.filter,r.element[0]);r._addClass(r.selectees,"ui-selectee");r.selectees.each(function(){var e=te(this),t=e.offset(),i=this.getBoundingClientRect(),n={left:t.left-r.elementPos.left,top:t.top-r.elementPos.top};te.data(this,"selectable-item",{element:this,$element:e,left:n.left,top:n.top,right:n.left+i.width,bottom:n.top+i.height,startselected:false,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this._mouseInit();this.helper=te("<div>");this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy()},_mouseStart:function(i){var n=this,e=this.options;this.opos=[i.pageX,i.pageY];this.elementPos=te(this.element[0]).offset();if(this.options.disabled){return}this.selectees=te(e.filter,this.element[0]);this._trigger("start",i);te(e.appendTo).append(this.helper);this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0});if(e.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=te.data(this,"selectable-item");e.startselected=true;if(!i.metaKey&&!i.ctrlKey){n._removeClass(e.$element,"ui-selected");e.selected=false;n._addClass(e.$element,"ui-unselecting");e.unselecting=true;n._trigger("unselecting",i,{unselecting:e.element})}});te(i.target).parents().addBack().each(function(){var e,t=te.data(this,"selectable-item");if(t){e=!i.metaKey&&!i.ctrlKey||!t.$element.hasClass("ui-selected");n._removeClass(t.$element,e?"ui-unselecting":"ui-selected")._addClass(t.$element,e?"ui-selecting":"ui-unselecting");t.unselecting=!e;t.selecting=e;t.selected=e;if(e){n._trigger("selecting",i,{selecting:t.element})}else{n._trigger("unselecting",i,{unselecting:t.element})}return false}})},_mouseDrag:function(n){this.dragged=true;if(this.options.disabled){return}var e,r=this,o=this.options,a=this.opos[0],s=this.opos[1],l=n.pageX,u=n.pageY;if(a>l){e=l;l=a;a=e}if(s>u){e=u;u=s;s=e}this.helper.css({left:a,top:s,width:l-a,height:u-s});this.selectees.each(function(){var e=te.data(this,"selectable-item"),t=false,i={};if(!e||e.element===r.element[0]){return}i.left=e.left+r.elementPos.left;i.right=e.right+r.elementPos.left;i.top=e.top+r.elementPos.top;i.bottom=e.bottom+r.elementPos.top;if(o.tolerance==="touch"){t=!(i.left>l||i.right<a||i.top>u||i.bottom<s)}else if(o.tolerance==="fit"){t=i.left>a&&i.right<l&&i.top>s&&i.bottom<u}if(t){if(e.selected){r._removeClass(e.$element,"ui-selected");e.selected=false}if(e.unselecting){r._removeClass(e.$element,"ui-unselecting");e.unselecting=false}if(!e.selecting){r._addClass(e.$element,"ui-selecting");e.selecting=true;r._trigger("selecting",n,{selecting:e.element})}}else{if(e.selecting){if((n.metaKey||n.ctrlKey)&&e.startselected){r._removeClass(e.$element,"ui-selecting");e.selecting=false;r._addClass(e.$element,"ui-selected");e.selected=true}else{r._removeClass(e.$element,"ui-selecting");e.selecting=false;if(e.startselected){r._addClass(e.$element,"ui-unselecting");e.unselecting=true}r._trigger("unselecting",n,{unselecting:e.element})}}if(e.selected){if(!n.metaKey&&!n.ctrlKey&&!e.startselected){r._removeClass(e.$element,"ui-selected");e.selected=false;r._addClass(e.$element,"ui-unselecting");e.unselecting=true;r._trigger("unselecting",n,{unselecting:e.element})}}}});return false},_mouseStop:function(t){var i=this;this.dragged=false;te(".ui-unselecting",this.element[0]).each(function(){var e=te.data(this,"selectable-item");i._removeClass(e.$element,"ui-unselecting");e.unselecting=false;e.startselected=false;i._trigger("unselected",t,{unselected:e.element})});te(".ui-selecting",this.element[0]).each(function(){var e=te.data(this,"selectable-item");i._removeClass(e.$element,"ui-selecting")._addClass(e.$element,"ui-selected");e.selecting=false;e.selected=true;e.startselected=true;i._trigger("selected",t,{selected:e.element})});this._trigger("stop",t);this.helper.remove();return false}});var ke=te.widget("ui.selectmenu",[te.ui.formResetMixin,{version:"1.13.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:false,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"};this._drawButton();this._drawMenu();this._bindFormResetHandler();this._rendered=false;this.menuItems=te()},_drawButton:function(){var e,t=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button);this._on(this.labels,{click:function(e){this.button.trigger("focus");e.preventDefault()}});this.element.hide();this.button=te("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element);this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget");e=te("<span>").appendTo(this.button);this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button);this.buttonItem=this._renderButtonItem(i).appendTo(this.button);if(this.options.width!==false){this._resizeButton()}this._on(this.button,this._buttonEvents);this.button.one("focusin",function(){if(!t._rendered){t._refreshMenu()}})},_drawMenu:function(){var n=this;this.menu=te("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=te("<div>").append(this.menu);this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front");this.menuWrap.appendTo(this._appendTo());this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,t){e.preventDefault();n._setSelection();n._select(t.item.data("ui-selectmenu-item"),e)},focus:function(e,t){var i=t.item.data("ui-selectmenu-item");if(n.focusIndex!=null&&i.index!==n.focusIndex){n._trigger("focus",e,{item:i});if(!n.isOpen){n._select(i,e)}}n.focusIndex=i.index;n.button.attr("aria-activedescendant",n.menuItems.eq(i.index).attr("id"))}}).menu("instance");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return false};this.menuInstance._isDivider=function(){return false}},refresh:function(){this._refreshMenu();this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{}));if(this.options.width===null){this._resizeButton()}},_refreshMenu:function(){var e,t=this.element.find("option");this.menu.empty();this._parseOptions(t);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper");this._rendered=true;if(!t.length){return}e=this._getSelectedItem();this.menuInstance.focus(null,e);this._setAria(e.data("ui-selectmenu-item"));this._setOption("disabled",this.element.prop("disabled"))},open:function(e){if(this.options.disabled){return}if(!this._rendered){this._refreshMenu()}else{this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active");this.menuInstance.focus(null,this._getSelectedItem())}if(!this.menuItems.length){return}this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(this.document,this._documentClick);this._trigger("open",e)},_position:function(){this.menuWrap.position(te.extend({of:this.button},this.options.position))},close:function(e){if(!this.isOpen){return}this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);this._trigger("close",e)},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var t=te("<span>");this._setText(t,e.label);this._addClass(t,"ui-selectmenu-text");return t},_renderMenu:function(n,e){var r=this,o="";te.each(e,function(e,t){var i;if(t.optgroup!==o){i=te("<li>",{text:t.optgroup});r._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(t.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""));i.appendTo(n);o=t.optgroup}r._renderItemData(n,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(e,t){var i=te("<li>"),n=te("<div>",{title:t.element.attr("title")});if(t.disabled){this._addClass(i,null,"ui-state-disabled")}this._setText(n,t.label);return i.append(n).appendTo(e)},_setText:function(e,t){if(t){e.text(t)}else{e.html("&#160;")}},_move:function(e,t){var i,n,r=".ui-menu-item";if(this.isOpen){i=this.menuItems.eq(this.focusIndex).parent("li")}else{i=this.menuItems.eq(this.element[0].selectedIndex).parent("li");r+=":not(.ui-state-disabled)"}if(e==="first"||e==="last"){n=i[e==="first"?"prevAll":"nextAll"](r).eq(-1)}else{n=i[e+"All"](r).eq(0)}if(n.length){this.menuInstance.focus(t,n)}},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;if(!this.range){return}if(window.getSelection){e=window.getSelection();e.removeAllRanges();e.addRange(this.range)}else{this.range.select()}this.button.focus()},_documentClick:{mousedown:function(e){if(!this.isOpen){return}if(!te(e.target).closest(".ui-selectmenu-menu, #"+te.escapeSelector(this.ids.button)).length){this.close(e)}}},_buttonEvents:{mousedown:function(){var e;if(window.getSelection){e=window.getSelection();if(e.rangeCount){this.range=e.getRangeAt(0)}}else{this.range=document.selection.createRange()}},click:function(e){this._setSelection();this._toggle(e)},keydown:function(e){var t=true;switch(e.keyCode){case te.ui.keyCode.TAB:case te.ui.keyCode.ESCAPE:this.close(e);t=false;break;case te.ui.keyCode.ENTER:if(this.isOpen){this._selectFocusedItem(e)}break;case te.ui.keyCode.UP:if(e.altKey){this._toggle(e)}else{this._move("prev",e)}break;case te.ui.keyCode.DOWN:if(e.altKey){this._toggle(e)}else{this._move("next",e)}break;case te.ui.keyCode.SPACE:if(this.isOpen){this._selectFocusedItem(e)}else{this._toggle(e)}break;case te.ui.keyCode.LEFT:this._move("prev",e);break;case te.ui.keyCode.RIGHT:this._move("next",e);break;case te.ui.keyCode.HOME:case te.ui.keyCode.PAGE_UP:this._move("first",e);break;case te.ui.keyCode.END:case te.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e);t=false}if(t){e.preventDefault()}}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");if(!t.hasClass("ui-state-disabled")){this._select(t.data("ui-selectmenu-item"),e)}},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index;this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e));this._setAria(e);this._trigger("select",t,{item:e});if(e.index!==i){this._trigger("change",t,{item:e})}this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t});this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){if(e==="icons"){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,t.button)}this._super(e,t);if(e==="appendTo"){this.menuWrap.appendTo(this._appendTo())}if(e==="width"){this._resizeButton()}},_setOptionDisabled:function(e){this._super(e);this.menuInstance.option("disabled",e);this.button.attr("aria-disabled",e);this._toggleClass(this.button,null,"ui-state-disabled",e);this.element.prop("disabled",e);if(e){this.button.attr("tabindex",-1);this.close()}else{this.button.attr("tabindex",0)}},_appendTo:function(){var e=this.options.appendTo;if(e){e=e.jquery||e.nodeType?te(e):this.document.find(e).eq(0)}if(!e||!e[0]){e=this.element.closest(".ui-front, dialog")}if(!e.length){e=this.document[0].body}return e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen);this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen);this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;if(e===false){this.button.css("width","");return}if(e===null){e=this.element.show().outerWidth();this.element.hide()}this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();e.disabled=this.element.prop("disabled");return e},_parseOptions:function(e){var i=this,n=[];e.each(function(e,t){if(t.hidden){return}n.push(i._parseOption(te(t),e))});this.items=n},_parseOption:function(e,t){var i=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler();this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.labels.attr("for",this.ids.element)}}]);var Oe=te.widget("ui.slider",te.ui.mouse,{version:"1.13.1",widgetEventPrefix:"slide",options:{animate:false,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content");this._refresh();this._animateOff=false},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var e,t,i=this.options,n=this.element.find(".ui-slider-handle"),r="<span tabindex='0'></span>",o=[];t=i.values&&i.values.length||1;if(n.length>t){n.slice(t).remove();n=n.slice(0,t)}for(e=n.length;e<t;e++){o.push(r)}this.handles=n.add(te(o.join("")).appendTo(this.element));this._addClass(this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);this.handles.each(function(e){te(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;if(e.range){if(e.range===true){if(!e.values){e.values=[this._valueMin(),this._valueMin()]}else if(e.values.length&&e.values.length!==2){e.values=[e.values[0],e.values[0]]}else if(Array.isArray(e.values)){e.values=e.values.slice(0)}}if(!this.range||!this.range.length){this.range=te("<div>").appendTo(this.element);this._addClass(this.range,"ui-slider-range")}else{this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max");this.range.css({left:"",bottom:""})}if(e.range==="min"||e.range==="max"){this._addClass(this.range,"ui-slider-range-"+e.range)}}else{if(this.range){this.range.remove()}this.range=null}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();if(this.range){this.range.remove()}this._mouseDestroy()},_mouseCapture:function(e){var t,i,n,r,o,a,s,l,u=this,c=this.options;if(c.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();t={x:e.pageX,y:e.pageY};i=this._normValueFromMouse(t);n=this._valueMax()-this._valueMin()+1;this.handles.each(function(e){var t=Math.abs(i-u.values(e));if(n>t||n===t&&(e===u._lastChangedValue||u.values(e)===c.min)){n=t;r=te(this);o=e}});a=this._start(e,o);if(a===false){return false}this._mouseSliding=true;this._handleIndex=o;this._addClass(r,null,"ui-state-active");r.trigger("focus");s=r.offset();l=!te(e.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=l?{left:0,top:0}:{left:e.pageX-s.left-r.width()/2,top:e.pageY-s.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(e,o,i)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);this._slide(e,this._handleIndex,i);return false},_mouseStop:function(e){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=false;this._stop(e,this._handleIndex);this._change(e,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,n,r,o;if(this.orientation==="horizontal"){t=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{t=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}n=i/t;if(n>1){n=1}if(n<0){n=0}if(this.orientation==="vertical"){n=1-n}r=this._valueMax()-this._valueMin();o=this._valueMin()+n*r;return this._trimAlignValue(o)},_uiHash:function(e,t,i){var n={handle:this.handles[e],handleIndex:e,value:t!==undefined?t:this.value()};if(this._hasMultipleValues()){n.value=t!==undefined?t:this.values(e);n.values=i||this.values()}return n},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,i){var n,r,o=this.value(),a=this.values();if(this._hasMultipleValues()){r=this.values(t?0:1);o=this.values(t);if(this.options.values.length===2&&this.options.range===true){i=t===0?Math.min(r,i):Math.max(r,i)}a[t]=i}if(i===o){return}n=this._trigger("slide",e,this._uiHash(t,i,a));if(n===false){return}if(this._hasMultipleValues()){this.values(t,i)}else{this.value(i)}},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){this._lastChangedValue=t;this._trigger("change",e,this._uiHash(t))}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e);this._refreshValue();this._change(null,0);return}return this._value()},values:function(e,t){var i,n,r;if(arguments.length>1){this.options.values[e]=this._trimAlignValue(t);this._refreshValue();this._change(null,e);return}if(arguments.length){if(Array.isArray(arguments[0])){i=this.options.values;n=arguments[0];for(r=0;r<i.length;r+=1){i[r]=this._trimAlignValue(n[r]);this._change(null,r)}this._refreshValue()}else{if(this._hasMultipleValues()){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(e,t){var i,n=0;if(e==="range"&&this.options.range===true){if(t==="min"){this.options.value=this._values(0);this.options.values=null}else if(t==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}if(Array.isArray(this.options.values)){n=this.options.values.length}this._super(e,t);switch(e){case"orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(t)}this.handles.css(t==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=n-1;i>=0;i--){this._change(null,i)}this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break}},_setOptionDisabled:function(e){this._super(e);this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;e=this._trimAlignValue(e);return e},_values:function(e){var t,i,n;if(arguments.length){t=this.options.values[e];t=this._trimAlignValue(t);return t}else if(this._hasMultipleValues()){i=this.options.values.slice();for(n=0;n<i.length;n+=1){i[n]=this._trimAlignValue(i[n])}return i}else{return[]}},_trimAlignValue:function(e){if(e<=this._valueMin()){return this._valueMin()}if(e>=this._valueMax()){return this._valueMax()}var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,n=e-i;if(Math.abs(i)*2>=t){n+=i>0?t:-t}return parseFloat(n.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,n=Math.round((e-t)/i)*i;e=n+t;if(e>this.options.max){e-=i}this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);if(this.options.min!==null){e=Math.max(e,this._precisionOf(this.options.min))}return e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return i===-1?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){if(e==="vertical"){this.range.css({width:"",left:""})}if(e==="horizontal"){this.range.css({height:"",bottom:""})}},_refreshValue:function(){var t,i,e,n,r,o=this.options.range,a=this.options,s=this,l=!this._animateOff?a.animate:false,u={};if(this._hasMultipleValues()){this.handles.each(function(e){i=(s.values(e)-s._valueMin())/(s._valueMax()-s._valueMin())*100;u[s.orientation==="horizontal"?"left":"bottom"]=i+"%";te(this).stop(1,1)[l?"animate":"css"](u,a.animate);if(s.options.range===true){if(s.orientation==="horizontal"){if(e===0){s.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate)}if(e===1){s.range[l?"animate":"css"]({width:i-t+"%"},{queue:false,duration:a.animate})}}else{if(e===0){s.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate)}if(e===1){s.range[l?"animate":"css"]({height:i-t+"%"},{queue:false,duration:a.animate})}}}t=i})}else{e=this.value();n=this._valueMin();r=this._valueMax();i=r!==n?(e-n)/(r-n)*100:0;u[this.orientation==="horizontal"?"left":"bottom"]=i+"%";this.handle.stop(1,1)[l?"animate":"css"](u,a.animate);if(o==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate)}if(o==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate)}if(o==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate)}if(o==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate)}}},_handleEvents:{keydown:function(e){var t,i,n,r,o=te(e.target).data("ui-slider-handle-index");switch(e.keyCode){case te.ui.keyCode.HOME:case te.ui.keyCode.END:case te.ui.keyCode.PAGE_UP:case te.ui.keyCode.PAGE_DOWN:case te.ui.keyCode.UP:case te.ui.keyCode.RIGHT:case te.ui.keyCode.DOWN:case te.ui.keyCode.LEFT:e.preventDefault();if(!this._keySliding){this._keySliding=true;this._addClass(te(e.target),null,"ui-state-active");t=this._start(e,o);if(t===false){return}}break}r=this.options.step;if(this._hasMultipleValues()){i=n=this.values(o)}else{i=n=this.value()}switch(e.keyCode){case te.ui.keyCode.HOME:n=this._valueMin();break;case te.ui.keyCode.END:n=this._valueMax();break;case te.ui.keyCode.PAGE_UP:n=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case te.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case te.ui.keyCode.UP:case te.ui.keyCode.RIGHT:if(i===this._valueMax()){return}n=this._trimAlignValue(i+r);break;case te.ui.keyCode.DOWN:case te.ui.keyCode.LEFT:if(i===this._valueMin()){return}n=this._trimAlignValue(i-r);break}this._slide(e,o,n)},keyup:function(e){var t=te(e.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(e,t);this._change(e,t);this._removeClass(te(e.target),null,"ui-state-active")}}}});var Re=te.widget("ui.sortable",te.ui.mouse,{version:"1.13.1",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&e<t+i},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true},_setOption:function(e,t){this._super(e,t);if(e==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");te.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--){this.items[e].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(e,t){var i=null,n=false,r=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){return false}this._refreshItems(e);te(e.target).parents().each(function(){if(te.data(this,r.widgetName+"-item")===r){i=te(this);return false}});if(te.data(e.target,r.widgetName+"-item")===r){i=te(e.target)}if(!i){return false}if(this.options.handle&&!t){te(this.options.handle,i).find("*").addBack().each(function(){if(this===e.target){n=true}});if(!n){return false}}this.currentItem=i;this._removeCurrentsFromItems();return true},_mouseStart:function(e,t,i){var n,r,o=this.options;this.currentContainer=this;this.refreshPositions();this.appendTo=te(o.appendTo!=="parent"?o.appendTo:this.currentItem.parent());this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};te.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");if(o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();this.scrollParent=this.placeholder.scrollParent();te.extend(this.offset,{parent:this._getParentOffset()});if(o.containment){this._setContainment()}if(o.cursor&&o.cursor!=="auto"){r=this.document.find("body");this.storedCursor=r.css("cursor");r.css("cursor",o.cursor);this.storedStylesheet=te("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(r)}if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",o.zIndex)}if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",o.opacity)}if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!i){for(n=this.containers.length-1;n>=0;n--){this.containers[n]._trigger("activate",e,this._uiHash(this))}}if(te.ui.ddmanager){te.ui.ddmanager.current=this}if(te.ui.ddmanager&&!o.dropBehaviour){te.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");if(!this.helper.parent().is(this.appendTo)){this.helper.detach().appendTo(this.appendTo);this.offset.parent=this._getParentOffset()}this.position=this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute");this._mouseDrag(e);return true},_scroll:function(e){var t=this.options,i=false;if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<t.scrollSensitivity){this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+t.scrollSpeed}else if(e.pageY-this.overflowOffset.top<t.scrollSensitivity){this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-t.scrollSpeed}if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<t.scrollSensitivity){this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+t.scrollSpeed}else if(e.pageX-this.overflowOffset.left<t.scrollSensitivity){this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-t.scrollSpeed}}else{if(e.pageY-this.document.scrollTop()<t.scrollSensitivity){i=this.document.scrollTop(this.document.scrollTop()-t.scrollSpeed)}else if(this.window.height()-(e.pageY-this.document.scrollTop())<t.scrollSensitivity){i=this.document.scrollTop(this.document.scrollTop()+t.scrollSpeed)}if(e.pageX-this.document.scrollLeft()<t.scrollSensitivity){i=this.document.scrollLeft(this.document.scrollLeft()-t.scrollSpeed)}else if(this.window.width()-(e.pageX-this.document.scrollLeft())<t.scrollSensitivity){i=this.document.scrollLeft(this.document.scrollLeft()+t.scrollSpeed)}}return i},_mouseDrag:function(e){var t,i,n,r,o=this.options;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}if(o.scroll){if(this._scroll(e)!==false){this._refreshItemPositions(true);if(te.ui.ddmanager&&!o.dropBehaviour){te.ui.ddmanager.prepareOffsets(this,e)}}}this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()};for(t=this.items.length-1;t>=0;t--){i=this.items[t];n=i.item[0];r=this._intersectsWithPointer(i);if(!r){continue}if(i.instance!==this.currentContainer){continue}if(n!==this.currentItem[0]&&this.placeholder[r===1?"next":"prev"]()[0]!==n&&!te.contains(this.placeholder[0],n)&&(this.options.type==="semi-dynamic"?!te.contains(this.element[0],n):true)){this.direction=r===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(i)){this._rearrange(e,i)}else{break}this._trigger("change",e,this._uiHash());break}}this._contactContainers(e);if(te.ui.ddmanager){te.ui.ddmanager.drag(this,e)}this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(e,t){if(!e){return}if(te.ui.ddmanager&&!this.options.dropBehaviour){te.ui.ddmanager.drop(this,e)}if(this.options.revert){var i=this,n=this.placeholder.offset(),r=this.options.axis,o={};if(!r||r==="x"){o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)}if(!r||r==="y"){o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)}this.reverting=true;te(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(e)})}else{this._clear(e,t)}return false},cancel:function(){if(this.dragging){this._mouseUp(new te.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}te.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){te(this.domPosition.prev).after(this.currentItem)}else{te(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];t=t||{};te(e).each(function(){var e=(te(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);if(e){i.push((t.key||e[1]+"[]")+"="+(t.key&&t.expression?e[1]:e[2]))}});if(!i.length&&t.key){i.push(t.key+"=")}return i.join("&")},toArray:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};t.each(function(){i.push(te(e.item||this).attr(e.attribute||"id")||"")});return i},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,r=n+this.helperProportions.height,o=e.left,a=o+e.width,s=e.top,l=s+e.height,u=this.offset.click.top,c=this.offset.click.left,d=this.options.axis==="x"||n+u>s&&n+u<l,f=this.options.axis==="y"||t+c>o&&t+c<a,p=d&&f;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]){return p}else{return o<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&s<n+this.helperProportions.height/2&&r-this.helperProportions.height/2<l}},_intersectsWithPointer:function(e){var t,i,n=this.options.axis==="x"||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),r=this.options.axis==="y"||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),o=n&&r;if(!o){return false}t=this.dragDirection.vertical;i=this.dragDirection.horizontal;return this.floating?i==="right"||t==="down"?2:1:t&&(t==="down"?2:1)},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),n=this.dragDirection.vertical,r=this.dragDirection.horizontal;if(this.floating&&r){return r==="right"&&i||r==="left"&&!i}else{return n&&(n==="down"&&t||n==="up"&&!t)}},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!==0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!==0&&(e>0?"right":"left")},refresh:function(e){this._refreshItems(e);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(e){var t,i,n,r,o=[],a=[],s=this._connectWith();if(s&&e){for(t=s.length-1;t>=0;t--){n=te(s[t],this.document[0]);for(i=n.length-1;i>=0;i--){r=te.data(n[i],this.widgetFullName);if(r&&r!==this&&!r.options.disabled){a.push([typeof r.options.items==="function"?r.options.items.call(r.element):te(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r])}}}}a.push([typeof this.options.items==="function"?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):te(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function l(){o.push(this)}for(t=a.length-1;t>=0;t--){a[t][0].each(l)}return te(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=te.grep(this.items,function(e){for(var t=0;t<i.length;t++){if(i[t]===e.item[0]){return false}}return true})},_refreshItems:function(e){this.items=[];this.containers=[this];var t,i,n,r,o,a,s,l,u=this.items,c=[[typeof this.options.items==="function"?this.options.items.call(this.element[0],e,{item:this.currentItem}):te(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready){for(t=d.length-1;t>=0;t--){n=te(d[t],this.document[0]);for(i=n.length-1;i>=0;i--){r=te.data(n[i],this.widgetFullName);if(r&&r!==this&&!r.options.disabled){c.push([typeof r.options.items==="function"?r.options.items.call(r.element[0],e,{item:this.currentItem}):te(r.options.items,r.element),r]);this.containers.push(r)}}}}for(t=c.length-1;t>=0;t--){o=c[t][1];a=c[t][0];for(i=0,l=a.length;i<l;i++){s=te(a[i]);s.data(this.widgetName+"-item",o);u.push({item:s,instance:o,width:0,height:0,left:0,top:0})}}},_refreshItemPositions:function(e){var t,i,n,r;for(t=this.items.length-1;t>=0;t--){i=this.items[t];if(this.currentContainer&&i.instance!==this.currentContainer&&i.item[0]!==this.currentItem[0]){continue}n=this.options.toleranceElement?te(this.options.toleranceElement,i.item):i.item;if(!e){i.width=n.outerWidth();i.height=n.outerHeight()}r=n.offset();i.left=r.left;i.top=r.top}},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}this._refreshItemPositions(e);var t,i;if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(t=this.containers.length-1;t>=0;t--){i=this.containers[t].element.offset();this.containers[t].containerCache.left=i.left;this.containers[t].containerCache.top=i.top;this.containers[t].containerCache.width=this.containers[t].element.outerWidth();this.containers[t].containerCache.height=this.containers[t].element.outerHeight()}}return this},_createPlaceholder:function(i){i=i||this;var n,r,o=i.options;if(!o.placeholder||o.placeholder.constructor===String){n=o.placeholder;r=i.currentItem[0].nodeName.toLowerCase();o.placeholder={element:function(){var e=te("<"+r+">",i.document[0]);i._addClass(e,"ui-sortable-placeholder",n||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper");if(r==="tbody"){i._createTrPlaceholder(i.currentItem.find("tr").eq(0),te("<tr>",i.document[0]).appendTo(e))}else if(r==="tr"){i._createTrPlaceholder(i.currentItem,e)}else if(r==="img"){e.attr("src",i.currentItem.attr("src"))}if(!n){e.css("visibility","hidden")}return e},update:function(e,t){if(n&&!o.forcePlaceholderSize){return}if(!t.height()||o.forcePlaceholderSize&&(r==="tbody"||r==="tr")){t.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10))}if(!t.width()){t.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10))}}}}i.placeholder=te(o.placeholder.element.call(i.element,i.currentItem));i.currentItem.after(i.placeholder);o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(e,t){var i=this;e.children().each(function(){te("<td>&#160;</td>",i.document[0]).attr("colspan",te(this).attr("colspan")||1).appendTo(t)})},_contactContainers:function(e){var t,i,n,r,o,a,s,l,u,c,d=null,f=null;for(t=this.containers.length-1;t>=0;t--){if(te.contains(this.currentItem[0],this.containers[t].element[0])){continue}if(this._intersectsWith(this.containers[t].containerCache)){if(d&&te.contains(this.containers[t].element[0],d.element[0])){continue}d=this.containers[t];f=t}else{if(this.containers[t].containerCache.over){this.containers[t]._trigger("out",e,this._uiHash(this));this.containers[t].containerCache.over=0}}}if(!d){return}if(this.containers.length===1){if(!this.containers[f].containerCache.over){this.containers[f]._trigger("over",e,this._uiHash(this));this.containers[f].containerCache.over=1}}else{n=1e4;r=null;u=d.floating||this._isFloating(this.currentItem);o=u?"left":"top";a=u?"width":"height";c=u?"pageX":"pageY";for(i=this.items.length-1;i>=0;i--){if(!te.contains(this.containers[f].element[0],this.items[i].item[0])){continue}if(this.items[i].item[0]===this.currentItem[0]){continue}s=this.items[i].item.offset()[o];l=false;if(e[c]-s>this.items[i][a]/2){l=true}if(Math.abs(e[c]-s)<n){n=Math.abs(e[c]-s);r=this.items[i];this.direction=l?"up":"down"}}if(!r&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[f]){if(!this.currentContainer.containerCache.over){this.containers[f]._trigger("over",e,this._uiHash());this.currentContainer.containerCache.over=1}return}if(r){this._rearrange(e,r,null,true)}else{this._rearrange(e,null,this.containers[f].element,true)}this._trigger("change",e,this._uiHash());this.containers[f]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[f];this.options.placeholder.update(this.currentContainer,this.placeholder);this.scrollParent=this.placeholder.scrollParent();if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this.containers[f]._trigger("over",e,this._uiHash(this));this.containers[f].containerCache.over=1}},_createHelper:function(e){var t=this.options,i=typeof t.helper==="function"?te(t.helper.apply(this.element[0],[e,this.currentItem])):t.helper==="clone"?this.currentItem.clone():this.currentItem;if(!i.parents("body").length){this.appendTo[0].appendChild(i[0])}if(i[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(!i[0].style.width||t.forceHelperSize){i.width(this.currentItem.width())}if(!i[0].style.height||t.forceHelperSize){i.height(this.currentItem.height())}return i},_adjustOffsetFromHelper:function(e){if(typeof e==="function"){e=e.call(this)}if(typeof e==="string"){e=e.split(" ")}if(Array.isArray(e)){e={left:+e[0],top:+e[1]||0}}if("left"in e){this.offset.click.left=e.left+this.margins.left}if("right"in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left}if("top"in e){this.offset.click.top=e.top+this.margins.top}if("bottom"in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&te.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&te.ui.ie){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,i,n=this.options;if(n.containment==="parent"){n.containment=this.helper[0].parentNode}if(n.containment==="document"||n.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,n.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(n.containment==="document"?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(n.containment)){e=te(n.containment)[0];t=te(n.containment).offset();i=te(e).css("overflow")!=="hidden";this.containment=[t.left+(parseInt(te(e).css("borderLeftWidth"),10)||0)+(parseInt(te(e).css("paddingLeft"),10)||0)-this.margins.left,t.top+(parseInt(te(e).css("borderTopWidth"),10)||0)+(parseInt(te(e).css("paddingTop"),10)||0)-this.margins.top,t.left+(i?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(te(e).css("borderLeftWidth"),10)||0)-(parseInt(te(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,t.top+(i?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(te(e).css("borderTopWidth"),10)||0)-(parseInt(te(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,t){if(!t){t=this.position}var i=e==="absolute"?1:-1,n=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&te.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,r=/(html|body)/i.test(n[0].tagName);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():r?0:n.scrollTop())*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():r?0:n.scrollLeft())*i}},_generatePosition:function(e){var t,i,n=this.options,r=e.pageX,o=e.pageY,a=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&te.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,s=/(html|body)/i.test(a[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){r=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){o=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){r=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){o=this.containment[3]+this.offset.click.top}}if(n.grid){t=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-n.grid[1]:t+n.grid[1]:t;i=this.originalPageX+Math.round((r-this.originalPageX)/n.grid[0])*n.grid[0];r=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-n.grid[0]:i+n.grid[0]:i}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:a.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:a.scrollLeft())}},_rearrange:function(e,t,i,n){if(i){i[0].appendChild(this.placeholder[0])}else{t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?t.item[0]:t.item[0].nextSibling)}this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay(function(){if(r===this.counter){this.refreshPositions(!n)}})},_clear:function(e,t){this.reverting=false;var i,n=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}}this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!t){n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!t){n.push(function(e){this._trigger("update",e,this._uiHash())})}if(this!==this.currentContainer){if(!t){n.push(function(e){this._trigger("remove",e,this._uiHash())});n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer));n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))}}function r(t,i,n){return function(e){n._trigger(t,e,i._uiHash(i))}}for(i=this.containers.length-1;i>=0;i--){if(!t){n.push(r("deactivate",this,this.containers[i]))}if(this.containers[i].containerCache.over){n.push(r("out",this,this.containers[i]));this.containers[i].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!t){this._trigger("beforeStop",e,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null}if(!t){for(i=0;i<n.length;i++){n[i].call(this,e)}this._trigger("stop",e,this._uiHash())}this.fromOutside=false;return!this.cancelHelperRemoval},_trigger:function(){if(te.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(e){var t=e||this;return{helper:t.helper,placeholder:t.placeholder||te([]),position:t.position,originalPosition:t.originalPosition,offset:t.positionAbs,item:t.currentItem,sender:e?e.element:null}}});function P(t){return function(){var e=this.element.val();t.apply(this,arguments);this._refresh();if(e!==this.element.val()){this._trigger("change")}}}te.widget("ui.spinner",{version:"1.13.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",this.options.step);if(this.value()!==""){this._value(this.element.val(),true)}this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var n=this._super();var r=this.element;te.each(["min","max","step"],function(e,t){var i=r.attr(t);if(i!=null&&i.length){n[t]=i}});return n},_events:{keydown:function(e){if(this._start(e)&&this._keydown(e)){e.preventDefault()}},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._stop();this._refresh();if(this.previous!==this.element.val()){this._trigger("change",e)}},mousewheel:function(e,t){var i=te.ui.safeActiveElement(this.document[0]);var n=this.element[0]===i;if(!n||!t){return}if(!this.spinning&&!this._start(e)){return false}this._spin((t>0?1:-1)*this.options.step,e);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(e)}},100);e.preventDefault()},"mousedown .ui-spinner-button":function(e){var t;t=this.element[0]===te.ui.safeActiveElement(this.document[0])?this.previous:this.element.val();function i(){var e=this.element[0]===te.ui.safeActiveElement(this.document[0]);if(!e){this.element.trigger("focus");this.previous=t;this._delay(function(){this.previous=t})}}e.preventDefault();i.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;i.call(this)});if(this._start(e)===false){return}this._repeat(null,te(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(!te(e.currentTarget).hasClass("ui-state-active")){return}if(this._start(e)===false){return false}this._repeat(null,te(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance();this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content");this._addClass("ui-spinner-input");this.element.attr("role","spinbutton");this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",true).button({classes:{"ui-button":""}});this._removeClass(this.buttons,"ui-corner-all");this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up");this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down");this.buttons.first().button({icon:this.options.icons.up,showLabel:false});this.buttons.last().button({icon:this.options.icons.down,showLabel:false});if(this.buttons.height()>Math.ceil(this.uiSpinner.height()*.5)&&this.uiSpinner.height()>0){this.uiSpinner.height(this.uiSpinner.height())}},_keydown:function(e){var t=this.options,i=te.ui.keyCode;switch(e.keyCode){case i.UP:this._repeat(null,1,e);return true;case i.DOWN:this._repeat(null,-1,e);return true;case i.PAGE_UP:this._repeat(null,t.page,e);return true;case i.PAGE_DOWN:this._repeat(null,-t.page,e);return true}return false},_start:function(e){if(!this.spinning&&this._trigger("start",e)===false){return false}if(!this.counter){this.counter=1}this.spinning=true;return true},_repeat:function(e,t,i){e=e||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,t,i)},e);this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;if(!this.counter){this.counter=1}i=this._adjustValue(i+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:i})!==false){this._value(i);this.counter++}},_increment:function(e){var t=this.options.incremental;if(t){return typeof t==="function"?t(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1)}return 1},_precision:function(){var e=this._precisionOf(this.options.step);if(this.options.min!==null){e=Math.max(e,this._precisionOf(this.options.min))}return e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return i===-1?0:t.length-i-1},_adjustValue:function(e){var t,i,n=this.options;t=n.min!==null?n.min:0;i=e-t;i=Math.round(i/n.step)*n.step;e=t+i;e=parseFloat(e.toFixed(this._precision()));if(n.max!==null&&e>n.max){return n.max}if(n.min!==null&&e<n.min){return n.min}return e},_stop:function(e){if(!this.spinning){return}clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",e)},_setOption:function(e,t){var i,n,r;if(e==="culture"||e==="numberFormat"){i=this._parse(this.element.val());this.options[e]=t;this.element.val(this._format(i));return}if(e==="max"||e==="min"||e==="step"){if(typeof t==="string"){t=this._parse(t)}}if(e==="icons"){n=this.buttons.first().find(".ui-icon");this._removeClass(n,null,this.options.icons.up);this._addClass(n,null,t.up);r=this.buttons.last().find(".ui-icon");this._removeClass(r,null,this.options.icons.down);this._addClass(r,null,t.down)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e);this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!e);this.element.prop("disabled",!!e);this.buttons.button(e?"disable":"enable")},_setOptions:P(function(e){this._super(e)}),_parse:function(e){if(typeof e==="string"&&e!==""){e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e}return e===""||isNaN(e)?null:e},_format:function(e){if(e===""){return""}return window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();if(e===null){return false}return e===this._adjustValue(e)},_value:function(e,t){var i;if(e!==""){i=this._parse(e);if(i!==null){if(!t){i=this._adjustValue(i)}e=this._format(i)}}this.element.val(e);this._refresh()},_destroy:function(){this.element.prop("disabled",false).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow");this.uiSpinner.replaceWith(this.element)},stepUp:P(function(e){this._stepUp(e)}),_stepUp:function(e){if(this._start()){this._spin((e||1)*this.options.step);this._stop()}},stepDown:P(function(e){this._stepDown(e)}),_stepDown:function(e){if(this._start()){this._spin((e||1)*-this.options.step);this._stop()}},pageUp:P(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:P(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length){return this._parse(this.element.val())}P(this._value).call(this,e)},widget:function(){return this.uiSpinner}});if(te.uiBackCompat!==false){te.widget("ui.spinner",te.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}})}var Ne=te.ui.spinner;te.widget("ui.tabs",{version:"1.13.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var n=/#.*$/;return function(e){var t,i;t=e.href.replace(n,"");i=location.href.replace(n,"");try{t=decodeURIComponent(t)}catch(e){}try{i=decodeURIComponent(i)}catch(e){}return e.hash.length>1&&t===i}}(),_create:function(){var t=this,e=this.options;this.running=false;this._addClass("ui-tabs","ui-widget ui-widget-content");this._toggleClass("ui-tabs-collapsible",null,e.collapsible);this._processTabs();e.active=this._initialActive();if(Array.isArray(e.disabled)){e.disabled=te.uniqueSort(e.disabled.concat(te.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()}if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(e.active)}else{this.active=te()}this._refresh();if(this.active.length){this.load(e.active)}},_initialActive:function(){var i=this.options.active,e=this.options.collapsible,n=location.hash.substring(1);if(i===null){if(n){this.tabs.each(function(e,t){if(te(t).attr("aria-controls")===n){i=e;return false}})}if(i===null){i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))}if(i===null||i===-1){i=this.tabs.length?0:false}}if(i!==false){i=this.tabs.index(this.tabs.eq(i));if(i===-1){i=e?false:0}}if(!e&&i===false&&this.anchors.length){i=0}return i},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?te():this._getPanelForTab(this.active)}},_tabKeydown:function(e){var t=te(te.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(t),n=true;if(this._handlePageNav(e)){return}switch(e.keyCode){case te.ui.keyCode.RIGHT:case te.ui.keyCode.DOWN:i++;break;case te.ui.keyCode.UP:case te.ui.keyCode.LEFT:n=false;i--;break;case te.ui.keyCode.END:i=this.anchors.length-1;break;case te.ui.keyCode.HOME:i=0;break;case te.ui.keyCode.SPACE:e.preventDefault();clearTimeout(this.activating);this._activate(i);return;case te.ui.keyCode.ENTER:e.preventDefault();clearTimeout(this.activating);this._activate(i===this.options.active?false:i);return;default:return}e.preventDefault();clearTimeout(this.activating);i=this._focusNextTab(i,n);if(!e.ctrlKey&&!e.metaKey){t.attr("aria-selected","false");this.tabs.eq(i).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",i)},this.delay)}},_panelKeydown:function(e){if(this._handlePageNav(e)){return}if(e.ctrlKey&&e.keyCode===te.ui.keyCode.UP){e.preventDefault();this.active.trigger("focus")}},_handlePageNav:function(e){if(e.altKey&&e.keyCode===te.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true}if(e.altKey&&e.keyCode===te.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true}},_findNextTab:function(e,t){var i=this.tabs.length-1;function n(){if(e>i){e=0}if(e<0){e=i}return e}while(te.inArray(n(),this.options.disabled)!==-1){e=t?e+1:e-1}return e},_focusNextTab:function(e,t){e=this._findNextTab(e,t);this.tabs.eq(e).trigger("focus");return e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}this._super(e,t);if(e==="collapsible"){this._toggleClass("ui-tabs-collapsible",null,t);if(!t&&this.options.active===false){this._activate(0)}}if(e==="event"){this._setupEvents(t)}if(e==="heightStyle"){this._setupHeightStyle(t)}},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,t=this.tablist.children(":has(a[href])");e.disabled=te.map(t.filter(".ui-state-disabled"),function(e){return t.index(e)});this._processTabs();if(e.active===false||!this.anchors.length){e.active=false;this.active=te()}else if(this.active.length&&!te.contains(this.tablist[0],this.active[0])){if(this.tabs.length===e.disabled.length){e.active=false;this.active=te()}else{this._activate(this._findNextTab(Math.max(0,e.active-1),false))}}else{e.active=this.tabs.index(this.active)}this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._addClass(this.active,"ui-tabs-active","ui-state-active");this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})}},_processTabs:function(){var l=this,e=this.tabs,t=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist");this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){if(te(this).is(".ui-state-disabled")){e.preventDefault()}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){if(te(this).closest("li").is(".ui-state-disabled")){this.blur()}});this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return te("a",this)[0]}).attr({tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=te();this.anchors.each(function(e,t){var i,n,r,o=te(t).uniqueId().attr("id"),a=te(t).closest("li"),s=a.attr("aria-controls");if(l._isLocal(t)){i=t.hash;r=i.substring(1);n=l.element.find(l._sanitizeSelector(i))}else{r=a.attr("aria-controls")||te({}).uniqueId()[0].id;i="#"+r;n=l.element.find(i);if(!n.length){n=l._createPanel(r);n.insertAfter(l.panels[e-1]||l.tablist)}n.attr("aria-live","polite")}if(n.length){l.panels=l.panels.add(n)}if(s){a.data("ui-tabs-aria-controls",s)}a.attr({"aria-controls":r,"aria-labelledby":o});n.attr("aria-labelledby",o)});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(e){this._off(e.not(this.tabs));this._off(t.not(this.anchors));this._off(i.not(this.panels))}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return te("<div>").attr("id",e).data("ui-tabs-destroy",true)},_setOptionDisabled:function(e){var t,i,n;if(Array.isArray(e)){if(!e.length){e=false}else if(e.length===this.anchors.length){e=true}}for(n=0;i=this.tabs[n];n++){t=te(i);if(e===true||te.inArray(n,e)!==-1){t.attr("aria-disabled","true");this._addClass(t,null,"ui-state-disabled")}else{t.removeAttr("aria-disabled");this._removeClass(t,null,"ui-state-disabled")}}this.options.disabled=e;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===true)},_setupEvents:function(e){var i={};if(e){te.each(e.split(" "),function(e,t){i[t]="_eventHandler"})}this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(e){e.preventDefault()}});this._on(this.anchors,i);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,t=this.element.parent();if(e==="fill"){i=t.height();i-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var e=te(this),t=e.css("position");if(t==="absolute"||t==="fixed"){return}i-=e.outerHeight(true)});this.element.children().not(this.panels).each(function(){i-=te(this).outerHeight(true)});this.panels.each(function(){te(this).height(Math.max(0,i-te(this).innerHeight()+te(this).height()))}).css("overflow","auto")}else if(e==="auto"){i=0;this.panels.each(function(){i=Math.max(i,te(this).height("").height())}).height(i)}},_eventHandler:function(e){var t=this.options,i=this.active,n=te(e.currentTarget),r=n.closest("li"),o=r[0]===i[0],a=o&&t.collapsible,s=a?te():this._getPanelForTab(r),l=!i.length?te():this._getPanelForTab(i),u={oldTab:i,oldPanel:l,newTab:a?te():r,newPanel:s};e.preventDefault();if(r.hasClass("ui-state-disabled")||r.hasClass("ui-tabs-loading")||this.running||o&&!t.collapsible||this._trigger("beforeActivate",e,u)===false){return}t.active=a?false:this.tabs.index(r);this.active=o?te():r;if(this.xhr){this.xhr.abort()}if(!l.length&&!s.length){te.error("jQuery UI Tabs: Mismatching fragment identifier.")}if(s.length){this.load(this.tabs.index(r),e)}this._toggle(e,u)},_toggle:function(e,t){var i=this,n=t.newPanel,r=t.oldPanel;this.running=true;function o(){i.running=false;i._trigger("activate",e,t)}function a(){i._addClass(t.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(n.length&&i.options.show){i._show(n,i.options.show,o)}else{n.show();o()}}if(r.length&&this.options.hide){this._hide(r,this.options.hide,function(){i._removeClass(t.oldTab.closest("li"),"ui-tabs-active","ui-state-active");a()})}else{this._removeClass(t.oldTab.closest("li"),"ui-tabs-active","ui-state-active");r.hide();a()}r.attr("aria-hidden","true");t.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(n.length&&r.length){t.oldTab.attr("tabIndex",-1)}else if(n.length){this.tabs.filter(function(){return te(this).attr("tabIndex")===0}).attr("tabIndex",-1)}n.attr("aria-hidden","false");t.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var t,i=this._findActive(e);if(i[0]===this.active[0]){return}if(!i.length){i=this.active}t=i.find(".ui-tabs-anchor")[0];this._eventHandler({target:t,currentTarget:t,preventDefault:te.noop})},_findActive:function(e){return e===false?te():this.tabs.eq(e)},_getIndex:function(e){if(typeof e==="string"){e=this.anchors.index(this.anchors.filter("[href$='"+te.escapeSelector(e)+"']"))}return e},_destroy:function(){if(this.xhr){this.xhr.abort()}this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr("role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if(te.data(this,"ui-tabs-destroy")){te(this).remove()}else{te(this).removeAttr("role tabIndex "+"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}});this.tabs.each(function(){var e=te(this),t=e.data("ui-tabs-aria-controls");if(t){e.attr("aria-controls",t).removeData("ui-tabs-aria-controls")}else{e.removeAttr("aria-controls")}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","")}},enable:function(i){var e=this.options.disabled;if(e===false){return}if(i===undefined){e=false}else{i=this._getIndex(i);if(Array.isArray(e)){e=te.map(e,function(e){return e!==i?e:null})}else{e=te.map(this.tabs,function(e,t){return t!==i?t:null})}}this._setOptionDisabled(e)},disable:function(e){var t=this.options.disabled;if(t===true){return}if(e===undefined){t=true}else{e=this._getIndex(e);if(te.inArray(e,t)!==-1){return}if(Array.isArray(t)){t=te.merge([e],t).sort()}else{t=[e]}}this._setOptionDisabled(t)},load:function(e,n){e=this._getIndex(e);var r=this,i=this.tabs.eq(e),t=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),a={tab:i,panel:o},s=function(e,t){if(t==="abort"){r.panels.stop(false,true)}r._removeClass(i,"ui-tabs-loading");o.removeAttr("aria-busy");if(e===r.xhr){delete r.xhr}};if(this._isLocal(t[0])){return}this.xhr=te.ajax(this._ajaxSettings(t,n,a));if(this.xhr&&this.xhr.statusText!=="canceled"){this._addClass(i,"ui-tabs-loading");o.attr("aria-busy","true");this.xhr.done(function(e,t,i){setTimeout(function(){o.html(e);r._trigger("load",n,a);s(i,t)},1)}).fail(function(e,t){setTimeout(function(){s(e,t)},1)})}},_ajaxSettings:function(e,i,n){var r=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,t){return r._trigger("beforeLoad",i,te.extend({jqXHR:e,ajaxSettings:t},n))}}},_getPanelForTab:function(e){var t=te(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}});if(te.uiBackCompat!==false){te.widget("ui.tabs",te.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab")}})}var Ie=te.ui.tabs;te.widget("ui.tooltip",{version:"1.13.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=te(this).attr("title");return te("<a>").text(e).html()},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,track:false,close:null,open:null},_addDescribedBy:function(e,t){var i=(e.attr("aria-describedby")||"").split(/\s+/);i.push(t);e.data("ui-tooltip-id",t).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(e){var t=e.data("ui-tooltip-id"),i=(e.attr("aria-describedby")||"").split(/\s+/),n=te.inArray(t,i);if(n!==-1){i.splice(n,1)}e.removeData("ui-tooltip-id");i=String.prototype.trim.call(i.join(" "));if(i){e.attr("aria-describedby",i)}else{e.removeAttr("aria-describedby")}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=te("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=te([])},_setOption:function(e,t){var i=this;this._super(e,t);if(e==="content"){te.each(this.tooltips,function(e,t){i._updateContent(t.element)})}},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var n=this;te.each(this.tooltips,function(e,t){var i=te.Event("blur");i.target=i.currentTarget=t.element[0];n.close(i,true)});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=te(this);if(e.is("[title]")){return e.data("ui-tooltip-title",e.attr("title")).removeAttr("title")}}))},_enable:function(){this.disabledTitles.each(function(){var e=te(this);if(e.data("ui-tooltip-title")){e.attr("title",e.data("ui-tooltip-title"))}});this.disabledTitles=te([])},open:function(e){var i=this,t=te(e?e.target:this.element).closest(this.options.items);if(!t.length||t.data("ui-tooltip-id")){return}if(t.attr("title")){t.data("ui-tooltip-title",t.attr("title"))}t.data("ui-tooltip-open",true);if(e&&e.type==="mouseover"){t.parents().each(function(){var e=te(this),t;if(e.data("ui-tooltip-open")){t=te.Event("blur");t.target=t.currentTarget=this;i.close(t,true)}if(e.attr("title")){e.uniqueId();i.parents[this.id]={element:this,title:e.attr("title")};e.attr("title","")}})}this._registerCloseHandlers(e,t);this._updateContent(t,e)},_updateContent:function(t,i){var e,n=this.options.content,r=this,o=i?i.type:null;if(typeof n==="string"||n.nodeType||n.jquery){return this._open(i,t,n)}e=n.call(t[0],function(e){r._delay(function(){if(!t.data("ui-tooltip-open")){return}if(i){i.type=o}this._open(i,t,e)})});if(e){this._open(i,t,e)}},_open:function(e,t,i){var n,r,o,a,s=te.extend({},this.options.position);if(!i){return}n=this._find(t);if(n){n.tooltip.find(".ui-tooltip-content").html(i);return}if(t.is("[title]")){if(e&&e.type==="mouseover"){t.attr("title","")}else{t.removeAttr("title")}}n=this._tooltip(t);r=n.tooltip;this._addDescribedBy(t,r.attr("id"));r.find(".ui-tooltip-content").html(i);this.liveRegion.children().hide();a=te("<div>").html(r.find(".ui-tooltip-content").html());a.removeAttr("name").find("[name]").removeAttr("name");a.removeAttr("id").find("[id]").removeAttr("id");a.appendTo(this.liveRegion);function l(e){s.of=e;if(r.is(":hidden")){return}r.position(s)}if(this.options.track&&e&&/^mouse/.test(e.type)){this._on(this.document,{mousemove:l});l(e)}else{r.position(te.extend({of:t},this.options.position))}r.hide();this._show(r,this.options.show);if(this.options.track&&this.options.show&&this.options.show.delay){o=this.delayedShow=setInterval(function(){if(r.is(":visible")){l(s.of);clearInterval(o)}},13)}this._trigger("open",e,{tooltip:r})},_registerCloseHandlers:function(e,i){var t={keyup:function(e){if(e.keyCode===te.ui.keyCode.ESCAPE){var t=te.Event(e);t.currentTarget=i[0];this.close(t,true)}}};if(i[0]!==this.element[0]){t.remove=function(){var e=this._find(i);if(e){this._removeTooltip(e.tooltip)}}}if(!e||e.type==="mouseover"){t.mouseleave="close"}if(!e||e.type==="focusin"){t.focusout="close"}this._on(true,i,t)},close:function(e){var t,i=this,n=te(e?e.currentTarget:this.element),r=this._find(n);if(!r){n.removeData("ui-tooltip-open");return}t=r.tooltip;if(r.closing){return}clearInterval(this.delayedShow);if(n.data("ui-tooltip-title")&&!n.attr("title")){n.attr("title",n.data("ui-tooltip-title"))}this._removeDescribedBy(n);r.hiding=true;t.stop(true);this._hide(t,this.options.hide,function(){i._removeTooltip(te(this))});n.removeData("ui-tooltip-open");this._off(n,"mouseleave focusout keyup");if(n[0]!==this.element[0]){this._off(n,"remove")}this._off(this.document,"mousemove");if(e&&e.type==="mouseleave"){te.each(this.parents,function(e,t){te(t.element).attr("title",t.title);delete i.parents[e]})}r.closing=true;this._trigger("close",e,{tooltip:t});if(!r.hiding){r.closing=false}},_tooltip:function(e){var t=te("<div>").attr("role","tooltip"),i=te("<div>").appendTo(t),n=t.uniqueId().attr("id");this._addClass(i,"ui-tooltip-content");this._addClass(t,"ui-tooltip","ui-widget ui-widget-content");t.appendTo(this._appendTo(e));return this.tooltips[n]={element:e,tooltip:t}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){clearInterval(this.delayedShow);e.remove();delete this.tooltips[e.attr("id")]},_appendTo:function(e){var t=e.closest(".ui-front, dialog");if(!t.length){t=this.document[0].body}return t},_destroy:function(){var r=this;te.each(this.tooltips,function(e,t){var i=te.Event("blur"),n=t.element;i.target=i.currentTarget=n[0];r.close(i,true);te("#"+e).remove();if(n.data("ui-tooltip-title")){if(!n.attr("title")){n.attr("title",n.data("ui-tooltip-title"))}n.removeData("ui-tooltip-title")}});this.liveRegion.remove()}});if(te.uiBackCompat!==false){te.widget("ui.tooltip",te.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);if(this.options.tooltipClass){e.tooltip.addClass(this.options.tooltipClass)}return e}})}var Pe=te.ui.tooltip});(function(){var sc;var Wc="4.17.21";var Hc=200;var jc="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",lc="Expected a function",Bc="Invalid `variable` option passed into `_.template`";var Vc="__lodash_hash_undefined__";var zc=500;var Uc="__lodash_placeholder__";var uc=1,Yc=2,cc=4;var dc=1,qc=2;var fc=1,pc=2,Xc=4,hc=8,gc=16,vc=32,mc=64,yc=128,Kc=256,Qc=512;var Zc=30,Jc="...";var ed=800,td=16;var id=1,nd=2,rd=3;var bc=1/0,_c=9007199254740991,od=17976931348623157e292,ad=0/0;var wc=4294967295,sd=wc-1,ld=wc>>>1;var ud=[["ary",yc],["bind",fc],["bindKey",pc],["curry",hc],["curryRight",gc],["flip",Qc],["partial",vc],["partialRight",mc],["rearg",Kc]];var Cc="[object Arguments]",cd="[object Array]",dd="[object AsyncFunction]",fd="[object Boolean]",pd="[object Date]",hd="[object DOMException]",gd="[object Error]",vd="[object Function]",md="[object GeneratorFunction]",Ac="[object Map]",yd="[object Number]",bd="[object Null]",Ec="[object Object]",_d="[object Promise]",wd="[object Proxy]",Cd="[object RegExp]",xc="[object Set]",Ad="[object String]",Ed="[object Symbol]",xd="[object Undefined]",Td="[object WeakMap]",Sd="[object WeakSet]";var Dd="[object ArrayBuffer]",Tc="[object DataView]",kd="[object Float32Array]",Od="[object Float64Array]",Rd="[object Int8Array]",Nd="[object Int16Array]",Id="[object Int32Array]",Pd="[object Uint8Array]",Md="[object Uint8ClampedArray]",Ld="[object Uint16Array]",Fd="[object Uint32Array]";var Gd=/\b__p \+= '';/g,$d=/\b(__p \+=) '' \+/g,Wd=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Hd=/&(?:amp|lt|gt|quot|#39);/g,jd=/[&<>"']/g,Bd=RegExp(Hd.source),Vd=RegExp(jd.source);var zd=/<%-([\s\S]+?)%>/g,Ud=/<%([\s\S]+?)%>/g,Yd=/<%=([\s\S]+?)%>/g;var qd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xd=/^\w*$/,Kd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var Qd=/[\\^$.*+?()[\]{}|]/g,Zd=RegExp(Qd.source);var Jd=/^\s+/;var n=/\s/;var ef=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tf=/\{\n\/\* \[wrapped with (.+)\] \*/,nf=/,? & /;var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var rf=/[()=,{}\[\]\/\s]/;var of=/\\(\\)?/g;var af=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var sf=/\w*$/;var lf=/^[-+]0x[0-9a-f]+$/i;var uf=/^0b[01]+$/i;var cf=/^\[object .+?Constructor\]$/;var df=/^0o[0-7]+$/i;var ff=/^(?:0|[1-9]\d*)$/;var pf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var hf=/($^)/;var gf=/['\n\r\u2028\u2029\\]/g;var o="\\ud800-\\udfff",a="\\u0300-\\u036f",s="\\ufe20-\\ufe2f",l="\\u20d0-\\u20ff",u=a+s+l,c="\\u2700-\\u27bf",d="a-z\\xdf-\\xf6\\xf8-\\xff",f="\\xac\\xb1\\xd7\\xf7",p="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",h="\\u2000-\\u206f",g=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",v="A-Z\\xc0-\\xd6\\xd8-\\xde",m="\\ufe0e\\ufe0f",y=f+p+h+g;var b="['’]",_="["+o+"]",w="["+y+"]",C="["+u+"]",A="\\d+",E="["+c+"]",x="["+d+"]",T="[^"+o+y+A+c+d+v+"]",S="\\ud83c[\\udffb-\\udfff]",D="(?:"+C+"|"+S+")",k="[^"+o+"]",O="(?:\\ud83c[\\udde6-\\uddff]){2}",R="[\\ud800-\\udbff][\\udc00-\\udfff]",e="["+v+"]",N="\\u200d";var I="(?:"+x+"|"+T+")",P="(?:"+e+"|"+T+")",M="(?:"+b+"(?:d|ll|m|re|s|t|ve))?",L="(?:"+b+"(?:D|LL|M|RE|S|T|VE))?",F=D+"?",G="["+m+"]?",$="(?:"+N+"(?:"+[k,O,R].join("|")+")"+G+F+")*",W="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",H="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",j=G+F+$,B="(?:"+[E,O,R].join("|")+")"+j,V="(?:"+[k+C+"?",C,O,R,_].join("|")+")";var vf=RegExp(b,"g");var mf=RegExp(C,"g");var z=RegExp(S+"(?="+S+")|"+V+j,"g");var U=RegExp([e+"?"+x+"+"+M+"(?="+[w,e,"$"].join("|")+")",P+"+"+L+"(?="+[w,e+I,"$"].join("|")+")",e+"?"+I+"+"+M,e+"+"+L,H,W,A,B].join("|"),"g");var Y=RegExp("["+N+o+u+m+"]");var q=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var yf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"];var bf=-1;var Sc={};Sc[kd]=Sc[Od]=Sc[Rd]=Sc[Nd]=Sc[Id]=Sc[Pd]=Sc[Md]=Sc[Ld]=Sc[Fd]=true;Sc[Cc]=Sc[cd]=Sc[Dd]=Sc[fd]=Sc[Tc]=Sc[pd]=Sc[gd]=Sc[vd]=Sc[Ac]=Sc[yd]=Sc[Ec]=Sc[Cd]=Sc[xc]=Sc[Ad]=Sc[Td]=false;var Dc={};Dc[Cc]=Dc[cd]=Dc[Dd]=Dc[Tc]=Dc[fd]=Dc[pd]=Dc[kd]=Dc[Od]=Dc[Rd]=Dc[Nd]=Dc[Id]=Dc[Ac]=Dc[yd]=Dc[Ec]=Dc[Cd]=Dc[xc]=Dc[Ad]=Dc[Ed]=Dc[Pd]=Dc[Md]=Dc[Ld]=Dc[Fd]=true;Dc[gd]=Dc[vd]=Dc[Td]=false;var X={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Ĳ":"IJ","ĳ":"ij","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"};var K={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var Q={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};var Z={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var _f=parseFloat,wf=parseInt;var J=typeof global=="object"&&global&&global.Object===Object&&global;var ee=typeof self=="object"&&self&&self.Object===Object&&self;var kc=J||ee||Function("return this")();var te=typeof exports=="object"&&exports&&!exports.nodeType&&exports;var t=te&&typeof module=="object"&&module&&!module.nodeType&&module;var Cf=t&&t.exports===te;var ie=Cf&&J.process;var i=function(){try{var e=t&&t.require&&t.require("util").types;if(e){return e}return ie&&ie.binding&&ie.binding("util")}catch(e){}}();var Af=i&&i.isArrayBuffer,Ef=i&&i.isDate,xf=i&&i.isMap,Tf=i&&i.isRegExp,Sf=i&&i.isSet,Df=i&&i.isTypedArray;function Oc(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function kf(e,t,i,n){var r=-1,o=e==null?0:e.length;while(++r<o){var a=e[r];t(n,a,i(a),e)}return n}function Rc(e,t){var i=-1,n=e==null?0:e.length;while(++i<n){if(t(e[i],i,e)===false){break}}return e}function Of(e,t){var i=e==null?0:e.length;while(i--){if(t(e[i],i,e)===false){break}}return e}function Rf(e,t){var i=-1,n=e==null?0:e.length;while(++i<n){if(!t(e[i],i,e)){return false}}return true}function Nc(e,t){var i=-1,n=e==null?0:e.length,r=0,o=[];while(++i<n){var a=e[i];if(t(a,i,e)){o[r++]=a}}return o}function Nf(e,t){var i=e==null?0:e.length;return!!i&&Mc(e,t,0)>-1}function If(e,t,i){var n=-1,r=e==null?0:e.length;while(++n<r){if(i(t,e[n])){return true}}return false}function Ic(e,t){var i=-1,n=e==null?0:e.length,r=Array(n);while(++i<n){r[i]=t(e[i],i,e)}return r}function Pc(e,t){var i=-1,n=t.length,r=e.length;while(++i<n){e[r+i]=t[i]}return e}function Pf(e,t,i,n){var r=-1,o=e==null?0:e.length;if(n&&o){i=e[++r]}while(++r<o){i=t(i,e[r],r,e)}return i}function Mf(e,t,i,n){var r=e==null?0:e.length;if(n&&r){i=e[--r]}while(r--){i=t(i,e[r],r,e)}return i}function Lf(e,t){var i=-1,n=e==null?0:e.length;while(++i<n){if(t(e[i],i,e)){return true}}return false}var ne=Bf("length");function re(e){return e.split("")}function Ff(e){return e.match(r)||[]}function Gf(e,n,t){var r;t(e,function(e,t,i){if(n(e,t,i)){r=t;return false}});return r}function $f(e,t,i,n){var r=e.length,o=i+(n?1:-1);while(n?o--:++o<r){if(t(e[o],o,e)){return o}}return-1}function Mc(e,t,i){return t===t?ae(e,t,i):$f(e,Hf,i)}function Wf(e,t,i,n){var r=i-1,o=e.length;while(++r<o){if(n(e[r],t)){return r}}return-1}function Hf(e){return e!==e}function jf(e,t){var i=e==null?0:e.length;return i?Uf(e,t)/i:ad}function Bf(t){return function(e){return e==null?sc:e[t]}}function oe(t){return function(e){return t==null?sc:t[e]}}function Vf(e,n,r,o,t){t(e,function(e,t,i){r=o?(o=false,e):n(r,e,t,i)});return r}function zf(e,t){var i=e.length;e.sort(t);while(i--){e[i]=e[i].value}return e}function Uf(e,t){var i,n=-1,r=e.length;while(++n<r){var o=t(e[n]);if(o!==sc){i=i===sc?o:i+o}}return i}function Yf(e,t){var i=-1,n=Array(e);while(++i<e){n[i]=t(i)}return n}function qf(t,e){return Ic(e,function(e){return[e,t[e]]})}function Xf(e){return e?e.slice(0,hp(e)+1).replace(Jd,""):e}function Lc(t){return function(e){return t(e)}}function Kf(t,e){return Ic(e,function(e){return t[e]})}function Qf(e,t){return e.has(t)}function Zf(e,t){var i=-1,n=e.length;while(++i<n&&Mc(t,e[i],0)>-1){}return i}function Jf(e,t){var i=e.length;while(i--&&Mc(t,e[i],0)>-1){}return i}function ep(e,t){var i=e.length,n=0;while(i--){if(e[i]===t){++n}}return n}var tp=oe(X);var ip=oe(K);function np(e){return"\\"+Z[e]}function rp(e,t){return e==null?sc:e[t]}function op(e){return Y.test(e)}function ap(e){return q.test(e)}function sp(e){var t,i=[];while(!(t=e.next()).done){i.push(t.value)}return i}function lp(e){var i=-1,n=Array(e.size);e.forEach(function(e,t){n[++i]=[t,e]});return n}function up(t,i){return function(e){return t(i(e))}}function Fc(e,t){var i=-1,n=e.length,r=0,o=[];while(++i<n){var a=e[i];if(a===t||a===Uc){e[i]=Uc;o[r++]=i}}return o}function cp(e){var t=-1,i=Array(e.size);e.forEach(function(e){i[++t]=e});return i}function dp(e){var t=-1,i=Array(e.size);e.forEach(function(e){i[++t]=[e,e]});return i}function ae(e,t,i){var n=i-1,r=e.length;while(++n<r){if(e[n]===t){return n}}return-1}function fp(e,t,i){var n=i+1;while(n--){if(e[n]===t){return n}}return n}function pp(e){return op(e)?se(e):ne(e)}function Gc(e){return op(e)?le(e):re(e)}function hp(e){var t=e.length;while(t--&&n.test(e.charAt(t))){}return t}var gp=oe(Q);function se(e){var t=z.lastIndex=0;while(z.test(e)){++t}return t}function le(e){return e.match(z)||[]}function vp(e){return e.match(U)||[]}var ue=function t(e){e=e==null?kc:$c.defaults(kc.Object(),e,$c.pick(kc,yf));var x=e.Array,n=e.Date,G=e.Error,$=e.Function,W=e.Math,p=e.Object,H=e.RegExp,j=e.String,C=e.TypeError;var B=x.prototype,V=$.prototype,z=p.prototype;var U=e["__core-js_shared__"];var Y=V.toString;var A=z.hasOwnProperty;var q=0;var X=function(){var e=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var K=z.toString;var Q=Y.call(p);var Z=kc._;var J=H("^"+Y.call(A).replace(Qd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ee=Cf?e.Buffer:sc,te=e.Symbol,ie=e.Uint8Array,ne=ee?ee.allocUnsafe:sc,re=up(p.getPrototypeOf,p),oe=p.create,ae=z.propertyIsEnumerable,se=B.splice,le=te?te.isConcatSpreadable:sc,ue=te?te.iterator:sc,ce=te?te.toStringTag:sc;var de=function(){try{var e=Jn(p,"defineProperty");e({},"",{});return e}catch(e){}}();var fe=e.clearTimeout!==kc.clearTimeout&&e.clearTimeout,pe=n&&n.now!==kc.Date.now&&n.now,he=e.setTimeout!==kc.setTimeout&&e.setTimeout;var ge=W.ceil,ve=W.floor,me=p.getOwnPropertySymbols,ye=ee?ee.isBuffer:sc,be=e.isFinite,_e=B.join,we=up(p.keys,p),E=W.max,T=W.min,Ce=n.now,Ae=e.parseInt,Ee=W.random,xe=B.reverse;var Te=Jn(e,"DataView"),Se=Jn(e,"Map"),De=Jn(e,"Promise"),ke=Jn(e,"Set"),Oe=Jn(e,"WeakMap"),Re=Jn(p,"create");var Ne=Oe&&new Oe;var Ie={};var Pe=Lr(Te),Me=Lr(Se),Le=Lr(De),Fe=Lr(ke),Ge=Lr(Oe);var $e=te?te.prototype:sc,We=$e?$e.valueOf:sc,He=$e?$e.toString:sc;function v(e){if(f(e)&&!k(e)&&!(e instanceof y)){if(e instanceof m){return e}if(A.call(e,"__wrapped__")){return Gr(e)}}return new m(e)}var je=function(){function i(){}return function(e){if(!O(e)){return{}}if(oe){return oe(e)}i.prototype=e;var t=new i;i.prototype=sc;return t}}();function Be(){}function m(e,t){this.__wrapped__=e;this.__actions__=[];this.__chain__=!!t;this.__index__=0;this.__values__=sc}v.templateSettings={escape:zd,evaluate:Ud,interpolate:Yd,variable:"",imports:{_:v}};v.prototype=Be.prototype;v.prototype.constructor=v;m.prototype=je(Be.prototype);m.prototype.constructor=m;function y(e){this.__wrapped__=e;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=wc;this.__views__=[]}function Ve(){var e=new y(this.__wrapped__);e.__actions__=w(this.__actions__);e.__dir__=this.__dir__;e.__filtered__=this.__filtered__;e.__iteratees__=w(this.__iteratees__);e.__takeCount__=this.__takeCount__;e.__views__=w(this.__views__);return e}function ze(){if(this.__filtered__){var e=new y(this);e.__dir__=-1;e.__filtered__=true}else{e=this.clone();e.__dir__*=-1}return e}function Ue(){var e=this.__wrapped__.value(),t=this.__dir__,i=k(e),n=t<0,r=i?e.length:0,o=nr(0,r,this.__views__),a=o.start,s=o.end,l=s-a,u=n?s:a-1,c=this.__iteratees__,d=c.length,f=0,p=T(l,this.__takeCount__);if(!i||!n&&r==l&&p==l){return Ui(e,this.__actions__)}var h=[];e:while(l--&&f<p){u+=t;var g=-1,v=e[u];while(++g<d){var m=c[g],y=m.iteratee,b=m.type,_=y(v);if(b==nd){v=_}else if(!_){if(b==id){continue e}else{break e}}}h[f++]=v}return h}y.prototype=je(Be.prototype);y.prototype.constructor=y;function Ye(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t<i){var n=e[t];this.set(n[0],n[1])}}function qe(){this.__data__=Re?Re(null):{};this.size=0}function Xe(e){var t=this.has(e)&&delete this.__data__[e];this.size-=t?1:0;return t}function Ke(e){var t=this.__data__;if(Re){var i=t[e];return i===Vc?sc:i}return A.call(t,e)?t[e]:sc}function Qe(e){var t=this.__data__;return Re?t[e]!==sc:A.call(t,e)}function Ze(e,t){var i=this.__data__;this.size+=this.has(e)?0:1;i[e]=Re&&t===sc?Vc:t;return this}Ye.prototype.clear=qe;Ye.prototype["delete"]=Xe;Ye.prototype.get=Ke;Ye.prototype.has=Qe;Ye.prototype.set=Ze;function Je(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t<i){var n=e[t];this.set(n[0],n[1])}}function et(){this.__data__=[];this.size=0}function tt(e){var t=this.__data__,i=xt(t,e);if(i<0){return false}var n=t.length-1;if(i==n){t.pop()}else{se.call(t,i,1)}--this.size;return true}function it(e){var t=this.__data__,i=xt(t,e);return i<0?sc:t[i][1]}function nt(e){return xt(this.__data__,e)>-1}function rt(e,t){var i=this.__data__,n=xt(i,e);if(n<0){++this.size;i.push([e,t])}else{i[n][1]=t}return this}Je.prototype.clear=et;Je.prototype["delete"]=tt;Je.prototype.get=it;Je.prototype.has=nt;Je.prototype.set=rt;function ot(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t<i){var n=e[t];this.set(n[0],n[1])}}function at(){this.size=0;this.__data__={hash:new Ye,map:new(Se||Je),string:new Ye}}function st(e){var t=Qn(this,e)["delete"](e);this.size-=t?1:0;return t}function lt(e){return Qn(this,e).get(e)}function ut(e){return Qn(this,e).has(e)}function ct(e,t){var i=Qn(this,e),n=i.size;i.set(e,t);this.size+=i.size==n?0:1;return this}ot.prototype.clear=at;ot.prototype["delete"]=st;ot.prototype.get=lt;ot.prototype.has=ut;ot.prototype.set=ct;function dt(e){var t=-1,i=e==null?0:e.length;this.__data__=new ot;while(++t<i){this.add(e[t])}}function ft(e){this.__data__.set(e,Vc);return this}function pt(e){return this.__data__.has(e)}dt.prototype.add=dt.prototype.push=ft;dt.prototype.has=pt;function b(e){var t=this.__data__=new Je(e);this.size=t.size}function ht(){this.__data__=new Je;this.size=0}function gt(e){var t=this.__data__,i=t["delete"](e);this.size=t.size;return i}function vt(e){return this.__data__.get(e)}function mt(e){return this.__data__.has(e)}function yt(e,t){var i=this.__data__;if(i instanceof Je){var n=i.__data__;if(!Se||n.length<Hc-1){n.push([e,t]);this.size=++i.size;return this}i=this.__data__=new ot(n)}i.set(e,t);this.size=i.size;return this}b.prototype.clear=ht;b.prototype["delete"]=gt;b.prototype.get=vt;b.prototype.has=mt;b.prototype.set=yt;function bt(e,t){var i=k(e),n=!i&&cs(e),r=!i&&!n&&ps(e),o=!i&&!n&&!r&&Fs(e),a=i||n||r||o,s=a?Yf(e.length,j):[],l=s.length;for(var u in e){if((t||A.call(e,u))&&!(a&&(u=="length"||r&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||dr(u,l)))){s.push(u)}}return s}function _t(e){var t=e.length;return t?e[Di(0,t-1)]:sc}function wt(e,t){return Ir(w(e),Rt(t,0,e.length))}function Ct(e){return Ir(w(e))}function At(e,t,i){if(i!==sc&&!d(e[t],i)||i===sc&&!(t in e)){kt(e,t,i)}}function Et(e,t,i){var n=e[t];if(!(A.call(e,t)&&d(n,i))||i===sc&&!(t in e)){kt(e,t,i)}}function xt(e,t){var i=e.length;while(i--){if(d(e[i][0],t)){return i}}return-1}function Tt(e,n,r,o){Lt(e,function(e,t,i){n(o,e,r(e),i)});return o}function St(e,t){return e&&fn(t,M(t),e)}function Dt(e,t){return e&&fn(t,L(t),e)}function kt(e,t,i){if(t=="__proto__"&&de){de(e,t,{configurable:true,enumerable:true,value:i,writable:true})}else{e[t]=i}}function Ot(e,t){var i=-1,n=t.length,r=x(n),o=e==null;while(++i<n){r[i]=o?sc:cl(e,t[i])}return r}function Rt(e,t,i){if(e===e){if(i!==sc){e=e<=i?e:i}if(t!==sc){e=e>=t?e:t}}return e}function _(i,n,r,e,t,o){var a,s=n&uc,l=n&Yc,u=n&cc;if(r){a=t?r(i,e,t,o):r(i)}if(a!==sc){return a}if(!O(i)){return i}var c=k(i);if(c){a=ar(i);if(!s){return w(i,a)}}else{var d=S(i),f=d==vd||d==md;if(ps(i)){return tn(i,s)}if(d==Ec||d==Cc||f&&!t){a=l||f?{}:sr(i);if(!s){return l?hn(i,Dt(a,i)):pn(i,St(a,i))}}else{if(!Dc[d]){return t?i:{}}a=lr(i,d,s)}}o||(o=new b);var p=o.get(i);if(p){return p}o.set(i,a);if(Ms(i)){i.forEach(function(e){a.add(_(e,n,r,e,i,o))})}else if(Es(i)){i.forEach(function(e,t){a.set(t,_(e,n,r,t,i,o))})}var h=u?l?Yn:Un:l?L:M;var g=c?sc:h(i);Rc(g||i,function(e,t){if(g){t=e;e=i[t]}Et(a,t,_(e,n,r,t,i,o))});return a}function Nt(t){var i=M(t);return function(e){return It(e,t,i)}}function It(e,t,i){var n=i.length;if(e==null){return!n}e=p(e);while(n--){var r=i[n],o=t[r],a=e[r];if(a===sc&&!(r in e)||!o(a)){return false}}return true}function Pt(e,t,i){if(typeof e!="function"){throw new C(lc)}return kr(function(){e.apply(sc,i)},t)}function Mt(e,t,i,n){var r=-1,o=Nf,a=true,s=e.length,l=[],u=t.length;if(!s){return l}if(i){t=Ic(t,Lc(i))}if(n){o=If;a=false}else if(t.length>=Hc){o=Qf;a=false;t=new dt(t)}e:while(++r<s){var c=e[r],d=i==null?c:i(c);c=n||c!==0?c:0;if(a&&d===d){var f=u;while(f--){if(t[f]===d){continue e}}l.push(c)}else if(!o(t,d,n)){l.push(c)}}return l}var Lt=mn(a);var Ft=mn(Vt,true);function Gt(e,n){var r=true;Lt(e,function(e,t,i){r=!!n(e,t,i);return r});return r}function $t(e,t,i){var n=-1,r=e.length;while(++n<r){var o=e[n],a=t(o);if(a!=null&&(s===sc?a===a&&!R(a):i(a,s))){var s=a,l=o}}return l}function Wt(e,t,i,n){var r=e.length;i=N(i);if(i<0){i=-i>r?0:r+i}n=n===sc||n>r?r:N(n);if(n<0){n+=r}n=i>n?0:zs(n);while(i<n){e[i++]=t}return e}function Ht(e,n){var r=[];Lt(e,function(e,t,i){if(n(e,t,i)){r.push(e)}});return r}function l(e,t,i,n,r){var o=-1,a=e.length;i||(i=cr);r||(r=[]);while(++o<a){var s=e[o];if(t>0&&i(s)){if(t>1){l(s,t-1,i,n,r)}else{Pc(r,s)}}else if(!n){r[r.length]=s}}return r}var jt=yn();var Bt=yn(true);function a(e,t){return e&&jt(e,t,M)}function Vt(e,t){return e&&Bt(e,t,M)}function zt(t,e){return Nc(e,function(e){return ws(t[e])})}function Ut(e,t){t=Qi(t,e);var i=0,n=t.length;while(e!=null&&i<n){e=e[Mr(t[i++])]}return i&&i==n?e:sc}function Yt(e,t,i){var n=t(e);return k(e)?n:Pc(n,i(e))}function r(e){if(e==null){return e===sc?xd:bd}return ce&&ce in p(e)?er(e):Ar(e)}function qt(e,t){return e>t}function Xt(e,t){return e!=null&&A.call(e,t)}function Kt(e,t){return e!=null&&t in p(e)}function Qt(e,t,i){return e>=T(t,i)&&e<E(t,i)}function Zt(e,t,i){var n=i?If:Nf,r=e[0].length,o=e.length,a=o,s=x(o),l=Infinity,u=[];while(a--){var c=e[a];if(a&&t){c=Ic(c,Lc(t))}l=T(c.length,l);s[a]=!i&&(t||r>=120&&c.length>=120)?new dt(a&&c):sc}c=e[0];var d=-1,f=s[0];e:while(++d<r&&u.length<l){var p=c[d],h=t?t(p):p;p=i||p!==0?p:0;if(!(f?Qf(f,h):n(u,h,i))){a=o;while(--a){var g=s[a];if(!(g?Qf(g,h):n(e[a],h,i))){continue e}}if(f){f.push(h)}u.push(p)}}return u}function Jt(e,n,r,o){a(e,function(e,t,i){n(o,r(e),t,i)});return o}function ei(e,t,i){t=Qi(t,e);e=xr(e,t);var n=e==null?e:e[Mr(o(t))];return n==null?sc:Oc(n,e,i)}function ti(e){return f(e)&&r(e)==Cc}function ii(e){return f(e)&&r(e)==Dd}function ni(e){return f(e)&&r(e)==pd}function ri(e,t,i,n,r){if(e===t){return true}if(e==null||t==null||!f(e)&&!f(t)){return e!==e&&t!==t}return oi(e,t,i,n,ri,r)}function oi(e,t,i,n,r,o){var a=k(e),s=k(t),l=a?cd:S(e),u=s?cd:S(t);l=l==Cc?Ec:l;u=u==Cc?Ec:u;var c=l==Ec,d=u==Ec,f=l==u;if(f&&ps(e)){if(!ps(t)){return false}a=true;c=false}if(f&&!c){o||(o=new b);return a||Fs(e)?jn(e,t,i,n,r,o):Bn(e,t,l,i,n,r,o)}if(!(i&dc)){var p=c&&A.call(e,"__wrapped__"),h=d&&A.call(t,"__wrapped__");if(p||h){var g=p?e.value():e,v=h?t.value():t;o||(o=new b);return r(g,v,i,n,o)}}if(!f){return false}o||(o=new b);return Vn(e,t,i,n,r,o)}function ai(e){return f(e)&&S(e)==Ac}function si(e,t,i,n){var r=i.length,o=r,a=!n;if(e==null){return!o}e=p(e);while(r--){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e)){return false}}while(++r<o){s=i[r];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===sc&&!(l in e)){return false}}else{var d=new b;if(n){var f=n(u,c,l,e,t,d)}if(!(f===sc?ri(c,u,dc|qc,n,d):f)){return false}}}return true}function li(e){if(!O(e)||gr(e)){return false}var t=ws(e)?J:cf;return t.test(Lr(e))}function ui(e){return f(e)&&r(e)==Cd}function ci(e){return f(e)&&S(e)==xc}function di(e){return f(e)&&As(e.length)&&!!Sc[r(e)]}function fi(e){if(typeof e=="function"){return e}if(e==null){return F}if(typeof e=="object"){return k(e)?yi(e[0],e[1]):mi(e)}return Pu(e)}function pi(e){if(!mr(e)){return we(e)}var t=[];for(var i in p(e)){if(A.call(e,i)&&i!="constructor"){t.push(i)}}return t}function hi(e){if(!O(e)){return Cr(e)}var t=mr(e),i=[];for(var n in e){if(!(n=="constructor"&&(t||!A.call(e,n)))){i.push(n)}}return i}function gi(e,t){return e<t}function vi(e,n){var r=-1,o=c(e)?x(e.length):[];Lt(e,function(e,t,i){o[++r]=n(e,t,i)});return o}function mi(t){var i=Zn(t);if(i.length==1&&i[0][2]){return br(i[0][0],i[0][1])}return function(e){return e===t||si(e,t,i)}}function yi(i,n){if(fr(i)&&yr(n)){return br(Mr(i),n)}return function(e){var t=cl(e,i);return t===sc&&t===n?fl(e,i):ri(n,t,dc|qc)}}function bi(n,r,o,a,s){if(n===r){return}jt(r,function(e,t){s||(s=new b);if(O(e)){_i(n,r,t,o,bi,a,s)}else{var i=a?a(Sr(n,t),e,t+"",n,r,s):sc;if(i===sc){i=e}At(n,t,i)}},L)}function _i(e,t,i,n,r,o,a){var s=Sr(e,i),l=Sr(t,i),u=a.get(l);if(u){At(e,i,u);return}var c=o?o(s,l,i+"",e,t,a):sc;var d=c===sc;if(d){var f=k(l),p=!f&&ps(l),h=!f&&!p&&Fs(l);c=l;if(f||p||h){if(k(s)){c=s}else if(g(s)){c=w(s)}else if(p){d=false;c=tn(l,true)}else if(h){d=false;c=sn(l,true)}else{c=[]}}else if(Ns(l)||cs(l)){c=s;if(cs(s)){c=Us(s)}else if(!O(s)||ws(s)){c=sr(l)}}else{d=false}}if(d){a.set(l,c);r(c,l,n,o,a);a["delete"](l)}At(e,i,c)}function wi(e,t){var i=e.length;if(!i){return}t+=t<0?i:0;return dr(t,i)?e[t]:sc}function Ci(e,r,i){if(r.length){r=Ic(r,function(t){if(k(t)){return function(e){return Ut(e,t.length===1?t[0]:t)}}return t})}else{r=[F]}var o=-1;r=Ic(r,Lc(u()));var t=vi(e,function(t,e,i){var n=Ic(r,function(e){return e(t)});return{criteria:n,index:++o,value:t}});return zf(t,function(e,t){return un(e,t,i)})}function Ai(i,e){return Ei(i,e,function(e,t){return fl(i,t)})}function Ei(e,t,i){var n=-1,r=t.length,o={};while(++n<r){var a=t[n],s=Ut(e,a);if(i(s,a)){Ii(o,Qi(a,e),s)}}return o}function xi(t){return function(e){return Ut(e,t)}}function Ti(e,t,i,n){var r=n?Wf:Mc,o=-1,a=t.length,s=e;if(e===t){t=w(t)}if(i){s=Ic(e,Lc(i))}while(++o<a){var l=0,u=t[o],c=i?i(u):u;while((l=r(s,c,l,n))>-1){if(s!==e){se.call(s,l,1)}se.call(e,l,1)}}return e}function Si(e,t){var i=e?t.length:0,n=i-1;while(i--){var r=t[i];if(i==n||r!==o){var o=r;if(dr(r)){se.call(e,r,1)}else{Bi(e,r)}}}return e}function Di(e,t){return e+ve(Ee()*(t-e+1))}function ki(e,t,i,n){var r=-1,o=E(ge((t-e)/(i||1)),0),a=x(o);while(o--){a[n?o:++r]=e;e+=i}return a}function Oi(e,t){var i="";if(!e||t<1||t>_c){return i}do{if(t%2){i+=e}t=ve(t/2);if(t){e+=e}}while(t);return i}function i(e,t){return Or(Er(e,t,F),e+"")}function Ri(e){return _t(Il(e))}function Ni(e,t){var i=Il(e);return Ir(i,Rt(t,0,i.length))}function Ii(e,t,i,n){if(!O(e)){return e}t=Qi(t,e);var r=-1,o=t.length,a=o-1,s=e;while(s!=null&&++r<o){var l=Mr(t[r]),u=i;if(l==="__proto__"||l==="constructor"||l==="prototype"){return e}if(r!=a){var c=s[l];u=n?n(c,l,s):sc;if(u===sc){u=O(c)?c:dr(t[r+1])?[]:{}}}Et(s,l,u);s=s[l]}return e}var Pi=!Ne?F:function(e,t){Ne.set(e,t);return e};var Mi=!de?F:function(e,t){return de(e,"toString",{configurable:true,enumerable:false,value:yu(t),writable:true})};function Li(e){return Ir(Il(e))}function s(e,t,i){var n=-1,r=e.length;if(t<0){t=-t>r?0:r+t}i=i>r?r:i;if(i<0){i+=r}r=t>i?0:i-t>>>0;t>>>=0;var o=x(r);while(++n<r){o[n]=e[n+t]}return o}function Fi(e,n){var r;Lt(e,function(e,t,i){r=n(e,t,i);return!r});return!!r}function Gi(e,t,i){var n=0,r=e==null?n:e.length;if(typeof t=="number"&&t===t&&r<=ld){while(n<r){var o=n+r>>>1,a=e[o];if(a!==null&&!R(a)&&(i?a<=t:a<t)){n=o+1}else{r=o}}return r}return $i(e,t,F,i)}function $i(e,t,i,n){var r=0,o=e==null?0:e.length;if(o===0){return 0}t=i(t);var a=t!==t,s=t===null,l=R(t),u=t===sc;while(r<o){var c=ve((r+o)/2),d=i(e[c]),f=d!==sc,p=d===null,h=d===d,g=R(d);if(a){var v=n||h}else if(u){v=h&&(n||f)}else if(s){v=h&&f&&(n||!p)}else if(l){v=h&&f&&!p&&(n||!g)}else if(p||g){v=false}else{v=n?d<=t:d<t}if(v){r=c+1}else{o=c}}return T(o,sd)}function Wi(e,t){var i=-1,n=e.length,r=0,o=[];while(++i<n){var a=e[i],s=t?t(a):a;if(!i||!d(s,l)){var l=s;o[r++]=a===0?0:a}}return o}function Hi(e){if(typeof e=="number"){return e}if(R(e)){return ad}return+e}function h(e){if(typeof e=="string"){return e}if(k(e)){return Ic(e,h)+""}if(R(e)){return He?He.call(e):""}var t=e+"";return t=="0"&&1/e==-bc?"-0":t}function ji(e,t,i){var n=-1,r=Nf,o=e.length,a=true,s=[],l=s;if(i){a=false;r=If}else if(o>=Hc){var u=t?null:Ln(e);if(u){return cp(u)}a=false;r=Qf;l=new dt}else{l=t?[]:s}e:while(++n<o){var c=e[n],d=t?t(c):c;c=i||c!==0?c:0;if(a&&d===d){var f=l.length;while(f--){if(l[f]===d){continue e}}if(t){l.push(d)}s.push(c)}else if(!r(l,d,i)){if(l!==s){l.push(d)}s.push(c)}}return s}function Bi(e,t){t=Qi(t,e);e=xr(e,t);return e==null||delete e[Mr(o(t))]}function Vi(e,t,i,n){return Ii(e,t,i(Ut(e,t)),n)}function zi(e,t,i,n){var r=e.length,o=n?r:-1;while((n?o--:++o<r)&&t(e[o],o,e)){}return i?s(e,n?0:o,n?o+1:r):s(e,n?o+1:0,n?r:o)}function Ui(e,t){var i=e;if(i instanceof y){i=i.value()}return Pf(t,function(e,t){return t.func.apply(t.thisArg,Pc([e],t.args))},i)}function Yi(e,t,i){var n=e.length;if(n<2){return n?ji(e[0]):[]}var r=-1,o=x(n);while(++r<n){var a=e[r],s=-1;while(++s<n){if(s!=r){o[r]=Mt(o[r]||a,e[s],t,i)}}}return ji(l(o,1),t,i)}function qi(e,t,i){var n=-1,r=e.length,o=t.length,a={};while(++n<r){var s=n<o?t[n]:sc;i(a,e[n],s)}return a}function Xi(e){return g(e)?e:[]}function Ki(e){return typeof e=="function"?e:F}function Qi(e,t){if(k(e)){return e}return fr(e,t)?[e]:Pr(P(e))}var Zi=i;function Ji(e,t,i){var n=e.length;i=i===sc?n:i;return!t&&i>=n?e:s(e,t,i)}var en=fe||function(e){return kc.clearTimeout(e)};function tn(e,t){if(t){return e.slice()}var i=e.length,n=ne?ne(i):new e.constructor(i);e.copy(n);return n}function nn(e){var t=new e.constructor(e.byteLength);new ie(t).set(new ie(e));return t}function rn(e,t){var i=t?nn(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}function on(e){var t=new e.constructor(e.source,sf.exec(e));t.lastIndex=e.lastIndex;return t}function an(e){return We?p(We.call(e)):{}}function sn(e,t){var i=t?nn(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function ln(e,t){if(e!==t){var i=e!==sc,n=e===null,r=e===e,o=R(e);var a=t!==sc,s=t===null,l=t===t,u=R(t);if(!s&&!u&&!o&&e>t||o&&a&&l&&!s&&!u||n&&a&&l||!i&&l||!r){return 1}if(!n&&!o&&!u&&e<t||u&&i&&r&&!n&&!o||s&&i&&r||!a&&r||!l){return-1}}return 0}function un(e,t,i){var n=-1,r=e.criteria,o=t.criteria,a=r.length,s=i.length;while(++n<a){var l=ln(r[n],o[n]);if(l){if(n>=s){return l}var u=i[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}function cn(e,t,i,n){var r=-1,o=e.length,a=i.length,s=-1,l=t.length,u=E(o-a,0),c=x(l+u),d=!n;while(++s<l){c[s]=t[s]}while(++r<a){if(d||r<o){c[i[r]]=e[r]}}while(u--){c[s++]=e[r++]}return c}function dn(e,t,i,n){var r=-1,o=e.length,a=-1,s=i.length,l=-1,u=t.length,c=E(o-s,0),d=x(c+u),f=!n;while(++r<c){d[r]=e[r]}var p=r;while(++l<u){d[p+l]=t[l]}while(++a<s){if(f||r<o){d[p+i[a]]=e[r++]}}return d}function w(e,t){var i=-1,n=e.length;t||(t=x(n));while(++i<n){t[i]=e[i]}return t}function fn(e,t,i,n){var r=!i;i||(i={});var o=-1,a=t.length;while(++o<a){var s=t[o];var l=n?n(i[s],e[s],s,i,e):sc;if(l===sc){l=e[s]}if(r){kt(i,s,l)}else{Et(i,s,l)}}return i}function pn(e,t){return fn(e,tr(e),t)}function hn(e,t){return fn(e,ir(e),t)}function gn(r,o){return function(e,t){var i=k(e)?kf:Tt,n=o?o():{};return i(e,r,u(t,2),n)}}function vn(s){return i(function(e,t){var i=-1,n=t.length,r=n>1?t[n-1]:sc,o=n>2?t[2]:sc;r=s.length>3&&typeof r=="function"?(n--,r):sc;if(o&&D(t[0],t[1],o)){r=n<3?sc:r;n=1}e=p(e);while(++i<n){var a=t[i];if(a){s(e,a,i,r)}}return e})}function mn(o,a){return function(e,t){if(e==null){return e}if(!c(e)){return o(e,t)}var i=e.length,n=a?i:-1,r=p(e);while(a?n--:++n<i){if(t(r[n],n,r)===false){break}}return e}}function yn(l){return function(e,t,i){var n=-1,r=p(e),o=i(e),a=o.length;while(a--){var s=o[l?a:++n];if(t(r[s],s,r)===false){break}}return e}}function bn(t,e,i){var n=e&fc,r=Cn(t);function o(){var e=this&&this!==kc&&this instanceof o?r:t;return e.apply(n?i:this,arguments)}return o}function _n(r){return function(e){e=P(e);var t=op(e)?Gc(e):sc;var i=t?t[0]:e.charAt(0);var n=t?Ji(t,1).join(""):e.slice(1);return i[r]()+n}}function wn(t){return function(e){return Pf(pu(Wl(e).replace(vf,"")),t,"")}}function Cn(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=je(n.prototype),i=n.apply(t,e);return O(i)?i:t}}function An(a,s,l){var u=Cn(a);function c(){var e=arguments.length,t=x(e),i=e,n=Kn(c);while(i--){t[i]=arguments[i]}var r=e<3&&t[0]!==n&&t[e-1]!==n?[]:Fc(t,n);e-=r.length;if(e<l){return Pn(a,s,Tn,c.placeholder,sc,t,r,sc,sc,l-e)}var o=this&&this!==kc&&this instanceof c?u:a;return Oc(o,this,t)}return c}function En(a){return function(e,t,i){var n=p(e);if(!c(e)){var r=u(t,3);e=M(e);t=function(e){return r(n[e],e,n)}}var o=a(e,t,i);return o>-1?n[r?e[o]:o]:sc}}function xn(l){return zn(function(r){var o=r.length,e=o,t=m.prototype.thru;if(l){r.reverse()}while(e--){var i=r[e];if(typeof i!="function"){throw new C(lc)}if(t&&!a&&Xn(i)=="wrapper"){var a=new m([],true)}}e=a?e:o;while(++e<o){i=r[e];var n=Xn(i),s=n=="wrapper"?qn(i):sc;if(s&&hr(s[0])&&s[1]==(yc|hc|vc|Kc)&&!s[4].length&&s[9]==1){a=a[Xn(s[0])].apply(a,s[3])}else{a=i.length==1&&hr(i)?a[n]():a.thru(i)}}return function(){var e=arguments,t=e[0];if(a&&e.length==1&&k(t)){return a.plant(t).value()}var i=0,n=o?r[i].apply(this,e):t;while(++i<o){n=r[i].call(this,n)}return n}})}function Tn(l,u,c,d,f,p,h,g,v,m){var y=u&yc,b=u&fc,_=u&pc,w=u&(hc|gc),C=u&Qc,A=_?sc:Cn(l);function E(){var e=arguments.length,t=x(e),i=e;while(i--){t[i]=arguments[i]}if(w){var n=Kn(E),r=ep(t,n)}if(d){t=cn(t,d,f,w)}if(p){t=dn(t,p,h,w)}e-=r;if(w&&e<m){var o=Fc(t,n);return Pn(l,u,Tn,E.placeholder,c,t,o,g,v,m-e)}var a=b?c:this,s=_?a[l]:l;e=t.length;if(g){t=Tr(t,g)}else if(C&&e>1){t.reverse()}if(y&&v<e){t.length=v}if(this&&this!==kc&&this instanceof E){s=A||Cn(s)}return s.apply(a,t)}return E}function Sn(i,n){return function(e,t){return Jt(e,i,n(t),{})}}function Dn(n,r){return function(e,t){var i;if(e===sc&&t===sc){return r}if(e!==sc){i=e}if(t!==sc){if(i===sc){return t}if(typeof e=="string"||typeof t=="string"){e=h(e);t=h(t)}else{e=Hi(e);t=Hi(t)}i=n(e,t)}return i}}function kn(n){return zn(function(e){e=Ic(e,Lc(u()));return i(function(t){var i=this;return n(e,function(e){return Oc(e,i,t)})})})}function On(e,t){t=t===sc?" ":h(t);var i=t.length;if(i<2){return i?Oi(t,e):t}var n=Oi(t,ge(e/pp(t)));return op(t)?Ji(Gc(n),0,e).join(""):n.slice(0,e)}function Rn(a,e,s,l){var u=e&fc,c=Cn(a);function d(){var e=-1,t=arguments.length,i=-1,n=l.length,r=x(n+t),o=this&&this!==kc&&this instanceof d?c:a;while(++i<n){r[i]=l[i]}while(t--){r[i++]=arguments[++e]}return Oc(o,u?s:this,r)}return d}function Nn(n){return function(e,t,i){if(i&&typeof i!="number"&&D(e,t,i)){t=i=sc}e=Vs(e);if(t===sc){t=e;e=0}else{t=Vs(t)}i=i===sc?e<t?1:-1:Vs(i);return ki(e,t,i,n)}}function In(i){return function(e,t){if(!(typeof e=="string"&&typeof t=="string")){e=I(e);t=I(t)}return i(e,t)}}function Pn(e,t,i,n,r,o,a,s,l,u){var c=t&hc,d=c?a:sc,f=c?sc:a,p=c?o:sc,h=c?sc:o;t|=c?vc:mc;t&=~(c?mc:vc);if(!(t&Xc)){t&=~(fc|pc)}var g=[e,t,r,p,d,h,f,s,l,u];var v=i.apply(sc,g);if(hr(e)){Dr(v,g)}v.placeholder=n;return Rr(v,e,t)}function Mn(e){var r=W[e];return function(e,t){e=I(e);t=t==null?0:T(N(t),292);if(t&&be(e)){var i=(P(e)+"e").split("e"),n=r(i[0]+"e"+(+i[1]+t));i=(P(n)+"e").split("e");return+(i[0]+"e"+(+i[1]-t))}return r(e)}}var Ln=!(ke&&1/cp(new ke([,-0]))[1]==bc)?ku:function(e){return new ke(e)};function Fn(i){return function(e){var t=S(e);if(t==Ac){return lp(e)}if(t==xc){return dp(e)}return qf(e,i(e))}}function Gn(e,t,i,n,r,o,a,s){var l=t&pc;if(!l&&typeof e!="function"){throw new C(lc)}var u=n?n.length:0;if(!u){t&=~(vc|mc);n=r=sc}a=a===sc?a:E(N(a),0);s=s===sc?s:N(s);u-=r?r.length:0;if(t&mc){var c=n,d=r;n=r=sc}var f=l?sc:qn(e);var p=[e,t,i,n,r,c,d,o,a,s];if(f){wr(p,f)}e=p[0];t=p[1];i=p[2];n=p[3];r=p[4];s=p[9]=p[9]===sc?l?0:e.length:E(p[9]-u,0);if(!s&&t&(hc|gc)){t&=~(hc|gc)}if(!t||t==fc){var h=bn(e,t,i)}else if(t==hc||t==gc){h=An(e,t,s)}else if((t==vc||t==(fc|vc))&&!r.length){h=Rn(e,t,i,n)}else{h=Tn.apply(sc,p)}var g=f?Pi:Dr;return Rr(g(h,p),e,t)}function $n(e,t,i,n){if(e===sc||d(e,z[i])&&!A.call(n,i)){return t}return e}function Wn(e,t,i,n,r,o){if(O(e)&&O(t)){o.set(t,e);bi(e,t,sc,Wn,o);o["delete"](t)}return e}function Hn(e){return Ns(e)?sc:e}function jn(e,t,i,n,r,o){var a=i&dc,s=e.length,l=t.length;if(s!=l&&!(a&&l>s)){return false}var u=o.get(e);var c=o.get(t);if(u&&c){return u==t&&c==e}var d=-1,f=true,p=i&qc?new dt:sc;o.set(e,t);o.set(t,e);while(++d<s){var h=e[d],g=t[d];if(n){var v=a?n(g,h,d,t,e,o):n(h,g,d,e,t,o)}if(v!==sc){if(v){continue}f=false;break}if(p){if(!Lf(t,function(e,t){if(!Qf(p,t)&&(h===e||r(h,e,i,n,o))){return p.push(t)}})){f=false;break}}else if(!(h===g||r(h,g,i,n,o))){f=false;break}}o["delete"](e);o["delete"](t);return f}function Bn(e,t,i,n,r,o,a){switch(i){case Tc:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset){return false}e=e.buffer;t=t.buffer;case Dd:if(e.byteLength!=t.byteLength||!o(new ie(e),new ie(t))){return false}return true;case fd:case pd:case yd:return d(+e,+t);case gd:return e.name==t.name&&e.message==t.message;case Cd:case Ad:return e==t+"";case Ac:var s=lp;case xc:var l=n&dc;s||(s=cp);if(e.size!=t.size&&!l){return false}var u=a.get(e);if(u){return u==t}n|=qc;a.set(e,t);var c=jn(s(e),s(t),n,r,o,a);a["delete"](e);return c;case Ed:if(We){return We.call(e)==We.call(t)}}return false}function Vn(e,t,i,n,r,o){var a=i&dc,s=Un(e),l=s.length,u=Un(t),c=u.length;if(l!=c&&!a){return false}var d=l;while(d--){var f=s[d];if(!(a?f in t:A.call(t,f))){return false}}var p=o.get(e);var h=o.get(t);if(p&&h){return p==t&&h==e}var g=true;o.set(e,t);o.set(t,e);var v=a;while(++d<l){f=s[d];var m=e[f],y=t[f];if(n){var b=a?n(y,m,f,t,e,o):n(m,y,f,e,t,o)}if(!(b===sc?m===y||r(m,y,i,n,o):b)){g=false;break}v||(v=f=="constructor")}if(g&&!v){var _=e.constructor,w=t.constructor;if(_!=w&&("constructor"in e&&"constructor"in t)&&!(typeof _=="function"&&_ instanceof _&&typeof w=="function"&&w instanceof w)){g=false}}o["delete"](e);o["delete"](t);return g}function zn(e){return Or(Er(e,sc,Zr),e+"")}function Un(e){return Yt(e,M,tr)}function Yn(e){return Yt(e,L,ir)}var qn=!Ne?ku:function(e){return Ne.get(e)};function Xn(e){var t=e.name+"",i=Ie[t],n=A.call(Ie,t)?i.length:0;while(n--){var r=i[n],o=r.func;if(o==null||o==e){return r.name}}return t}function Kn(e){var t=A.call(v,"placeholder")?v:e;return t.placeholder}function u(){var e=v.iteratee||Cu;e=e===Cu?fi:e;return arguments.length?e(arguments[0],arguments[1]):e}function Qn(e,t){var i=e.__data__;return pr(t)?i[typeof t=="string"?"string":"hash"]:i.map}function Zn(e){var t=M(e),i=t.length;while(i--){var n=t[i],r=e[n];t[i]=[n,r,yr(r)]}return t}function Jn(e,t){var i=rp(e,t);return li(i)?i:sc}function er(e){var t=A.call(e,ce),i=e[ce];try{e[ce]=sc;var n=true}catch(e){}var r=K.call(e);if(n){if(t){e[ce]=i}else{delete e[ce]}}return r}var tr=!me?Gu:function(t){if(t==null){return[]}t=p(t);return Nc(me(t),function(e){return ae.call(t,e)})};var ir=!me?Gu:function(e){var t=[];while(e){Pc(t,tr(e));e=re(e)}return t};var S=r;if(Te&&S(new Te(new ArrayBuffer(1)))!=Tc||Se&&S(new Se)!=Ac||De&&S(De.resolve())!=_d||ke&&S(new ke)!=xc||Oe&&S(new Oe)!=Td){S=function(e){var t=r(e),i=t==Ec?e.constructor:sc,n=i?Lr(i):"";if(n){switch(n){case Pe:return Tc;case Me:return Ac;case Le:return _d;case Fe:return xc;case Ge:return Td}}return t}}function nr(e,t,i){var n=-1,r=i.length;while(++n<r){var o=i[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=T(t,e+a);break;case"takeRight":e=E(e,t-a);break}}return{start:e,end:t}}function rr(e){var t=e.match(tf);return t?t[1].split(nf):[]}function or(e,t,i){t=Qi(t,e);var n=-1,r=t.length,o=false;while(++n<r){var a=Mr(t[n]);if(!(o=e!=null&&i(e,a))){break}e=e[a]}if(o||++n!=r){return o}r=e==null?0:e.length;return!!r&&As(r)&&dr(a,r)&&(k(e)||cs(e))}function ar(e){var t=e.length,i=new e.constructor(t);if(t&&typeof e[0]=="string"&&A.call(e,"index")){i.index=e.index;i.input=e.input}return i}function sr(e){return typeof e.constructor=="function"&&!mr(e)?je(re(e)):{}}function lr(e,t,i){var n=e.constructor;switch(t){case Dd:return nn(e);case fd:case pd:return new n(+e);case Tc:return rn(e,i);case kd:case Od:case Rd:case Nd:case Id:case Pd:case Md:case Ld:case Fd:return sn(e,i);case Ac:return new n;case yd:case Ad:return new n(e);case Cd:return on(e);case xc:return new n;case Ed:return an(e)}}function ur(e,t){var i=t.length;if(!i){return e}var n=i-1;t[n]=(i>1?"& ":"")+t[n];t=t.join(i>2?", ":" ");return e.replace(ef,"{\n/* [wrapped with "+t+"] */\n")}function cr(e){return k(e)||cs(e)||!!(le&&e&&e[le])}function dr(e,t){var i=typeof e;t=t==null?_c:t;return!!t&&(i=="number"||i!="symbol"&&ff.test(e))&&(e>-1&&e%1==0&&e<t)}function D(e,t,i){if(!O(i)){return false}var n=typeof t;if(n=="number"?c(i)&&dr(t,i.length):n=="string"&&t in i){return d(i[t],e)}return false}function fr(e,t){if(k(e)){return false}var i=typeof e;if(i=="number"||i=="symbol"||i=="boolean"||e==null||R(e)){return true}return Xd.test(e)||!qd.test(e)||t!=null&&e in p(t)}function pr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function hr(e){var t=Xn(e),i=v[t];if(typeof i!="function"||!(t in y.prototype)){return false}if(e===i){return true}var n=qn(i);return!!n&&e===n[0]}function gr(e){return!!X&&X in e}var vr=U?ws:$u;function mr(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||z;return e===i}function yr(e){return e===e&&!O(e)}function br(t,i){return function(e){if(e==null){return false}return e[t]===i&&(i!==sc||t in p(e))}}function _r(e){var t=Va(e,function(e){if(i.size===zc){i.clear()}return e});var i=t.cache;return t}function wr(e,t){var i=e[1],n=t[1],r=i|n,o=r<(fc|pc|yc);var a=n==yc&&i==hc||n==yc&&i==Kc&&e[7].length<=t[8]||n==(yc|Kc)&&t[7].length<=t[8]&&i==hc;if(!(o||a)){return e}if(n&fc){e[2]=t[2];r|=i&fc?0:Xc}var s=t[3];if(s){var l=e[3];e[3]=l?cn(l,s,t[4]):s;e[4]=l?Fc(e[3],Uc):t[4]}s=t[5];if(s){l=e[5];e[5]=l?dn(l,s,t[6]):s;e[6]=l?Fc(e[5],Uc):t[6]}s=t[7];if(s){e[7]=s}if(n&yc){e[8]=e[8]==null?t[8]:T(e[8],t[8])}if(e[9]==null){e[9]=t[9]}e[0]=t[0];e[1]=r;return e}function Cr(e){var t=[];if(e!=null){for(var i in p(e)){t.push(i)}}return t}function Ar(e){return K.call(e)}function Er(o,a,s){a=E(a===sc?o.length-1:a,0);return function(){var e=arguments,t=-1,i=E(e.length-a,0),n=x(i);while(++t<i){n[t]=e[a+t]}t=-1;var r=x(a+1);while(++t<a){r[t]=e[t]}r[a]=s(n);return Oc(o,this,r)}}function xr(e,t){return t.length<2?e:Ut(e,s(t,0,-1))}function Tr(e,t){var i=e.length,n=T(t.length,i),r=w(e);while(n--){var o=t[n];e[n]=dr(o,i)?r[o]:sc}return e}function Sr(e,t){if(t==="constructor"&&typeof e[t]==="function"){return}if(t=="__proto__"){return}return e[t]}var Dr=Nr(Pi);var kr=he||function(e,t){return kc.setTimeout(e,t)};var Or=Nr(Mi);function Rr(e,t,i){var n=t+"";return Or(e,ur(n,Fr(rr(n),i)))}function Nr(i){var n=0,r=0;return function(){var e=Ce(),t=td-(e-r);r=e;if(t>0){if(++n>=ed){return arguments[0]}}else{n=0}return i.apply(sc,arguments)}}function Ir(e,t){var i=-1,n=e.length,r=n-1;t=t===sc?n:t;while(++i<t){var o=Di(i,r),a=e[o];e[o]=e[i];e[i]=a}e.length=t;return e}var Pr=_r(function(e){var r=[];if(e.charCodeAt(0)===46){r.push("")}e.replace(Kd,function(e,t,i,n){r.push(i?n.replace(of,"$1"):t||e)});return r});function Mr(e){if(typeof e=="string"||R(e)){return e}var t=e+"";return t=="0"&&1/e==-bc?"-0":t}function Lr(e){if(e!=null){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fr(i,n){Rc(ud,function(e){var t="_."+e[0];if(n&e[1]&&!Nf(i,t)){i.push(t)}});return i.sort()}function Gr(e){if(e instanceof y){return e.clone()}var t=new m(e.__wrapped__,e.__chain__);t.__actions__=w(e.__actions__);t.__index__=e.__index__;t.__values__=e.__values__;return t}function $r(e,t,i){if(i?D(e,t,i):t===sc){t=1}else{t=E(N(t),0)}var n=e==null?0:e.length;if(!n||t<1){return[]}var r=0,o=0,a=x(ge(n/t));while(r<n){a[o++]=s(e,r,r+=t)}return a}function Wr(e){var t=-1,i=e==null?0:e.length,n=0,r=[];while(++t<i){var o=e[t];if(o){r[n++]=o}}return r}function Hr(){var e=arguments.length;if(!e){return[]}var t=x(e-1),i=arguments[0],n=e;while(n--){t[n-1]=arguments[n]}return Pc(k(i)?w(i):[i],l(t,1))}var jr=i(function(e,t){return g(e)?Mt(e,l(t,1,g,true)):[]});var Br=i(function(e,t){var i=o(t);if(g(i)){i=sc}return g(e)?Mt(e,l(t,1,g,true),u(i,2)):[]});var Vr=i(function(e,t){var i=o(t);if(g(i)){i=sc}return g(e)?Mt(e,l(t,1,g,true),sc,i):[]});function zr(e,t,i){var n=e==null?0:e.length;if(!n){return[]}t=i||t===sc?1:N(t);return s(e,t<0?0:t,n)}function Ur(e,t,i){var n=e==null?0:e.length;if(!n){return[]}t=i||t===sc?1:N(t);t=n-t;return s(e,0,t<0?0:t)}function Yr(e,t){return e&&e.length?zi(e,u(t,3),true,true):[]}function qr(e,t){return e&&e.length?zi(e,u(t,3),true):[]}function Xr(e,t,i,n){var r=e==null?0:e.length;if(!r){return[]}if(i&&typeof i!="number"&&D(e,t,i)){i=0;n=r}return Wt(e,t,i,n)}function Kr(e,t,i){var n=e==null?0:e.length;if(!n){return-1}var r=i==null?0:N(i);if(r<0){r=E(n+r,0)}return $f(e,u(t,3),r)}function Qr(e,t,i){var n=e==null?0:e.length;if(!n){return-1}var r=n-1;if(i!==sc){r=N(i);r=i<0?E(n+r,0):T(r,n-1)}return $f(e,u(t,3),r,true)}function Zr(e){var t=e==null?0:e.length;return t?l(e,1):[]}function Jr(e){var t=e==null?0:e.length;return t?l(e,bc):[]}function eo(e,t){var i=e==null?0:e.length;if(!i){return[]}t=t===sc?1:N(t);return l(e,t)}function to(e){var t=-1,i=e==null?0:e.length,n={};while(++t<i){var r=e[t];n[r[0]]=r[1]}return n}function io(e){return e&&e.length?e[0]:sc}function no(e,t,i){var n=e==null?0:e.length;if(!n){return-1}var r=i==null?0:N(i);if(r<0){r=E(n+r,0)}return Mc(e,t,r)}function ro(e){var t=e==null?0:e.length;return t?s(e,0,-1):[]}var oo=i(function(e){var t=Ic(e,Xi);return t.length&&t[0]===e[0]?Zt(t):[]});var ao=i(function(e){var t=o(e),i=Ic(e,Xi);if(t===o(i)){t=sc}else{i.pop()}return i.length&&i[0]===e[0]?Zt(i,u(t,2)):[]});var so=i(function(e){var t=o(e),i=Ic(e,Xi);t=typeof t=="function"?t:sc;if(t){i.pop()}return i.length&&i[0]===e[0]?Zt(i,sc,t):[]});function lo(e,t){return e==null?"":_e.call(e,t)}function o(e){var t=e==null?0:e.length;return t?e[t-1]:sc}function uo(e,t,i){var n=e==null?0:e.length;if(!n){return-1}var r=n;if(i!==sc){r=N(i);r=r<0?E(n+r,0):T(r,n-1)}return t===t?fp(e,t,r):$f(e,Hf,r,true)}function co(e,t){return e&&e.length?wi(e,N(t)):sc}var fo=i(po);function po(e,t){return e&&e.length&&t&&t.length?Ti(e,t):e}function ho(e,t,i){return e&&e.length&&t&&t.length?Ti(e,t,u(i,2)):e}function go(e,t,i){return e&&e.length&&t&&t.length?Ti(e,t,sc,i):e}var vo=zn(function(e,t){var i=e==null?0:e.length,n=Ot(e,t);Si(e,Ic(t,function(e){return dr(e,i)?+e:e}).sort(ln));return n});function mo(e,t){var i=[];if(!(e&&e.length)){return i}var n=-1,r=[],o=e.length;t=u(t,3);while(++n<o){var a=e[n];if(t(a,n,e)){i.push(a);r.push(n)}}Si(e,r);return i}function yo(e){return e==null?e:xe.call(e)}function bo(e,t,i){var n=e==null?0:e.length;if(!n){return[]}if(i&&typeof i!="number"&&D(e,t,i)){t=0;i=n}else{t=t==null?0:N(t);i=i===sc?n:N(i)}return s(e,t,i)}function _o(e,t){return Gi(e,t)}function wo(e,t,i){return $i(e,t,u(i,2))}function Co(e,t){var i=e==null?0:e.length;if(i){var n=Gi(e,t);if(n<i&&d(e[n],t)){return n}}return-1}function Ao(e,t){return Gi(e,t,true)}function Eo(e,t,i){return $i(e,t,u(i,2),true)}function xo(e,t){var i=e==null?0:e.length;if(i){var n=Gi(e,t,true)-1;if(d(e[n],t)){return n}}return-1}function To(e){return e&&e.length?Wi(e):[]}function So(e,t){return e&&e.length?Wi(e,u(t,2)):[]}function Do(e){var t=e==null?0:e.length;return t?s(e,1,t):[]}function ko(e,t,i){if(!(e&&e.length)){return[]}t=i||t===sc?1:N(t);return s(e,0,t<0?0:t)}function Oo(e,t,i){var n=e==null?0:e.length;if(!n){return[]}t=i||t===sc?1:N(t);t=n-t;return s(e,t<0?0:t,n)}function Ro(e,t){return e&&e.length?zi(e,u(t,3),false,true):[]}function No(e,t){return e&&e.length?zi(e,u(t,3)):[]}var Io=i(function(e){return ji(l(e,1,g,true))});var Po=i(function(e){var t=o(e);if(g(t)){t=sc}return ji(l(e,1,g,true),u(t,2))});var Mo=i(function(e){var t=o(e);t=typeof t=="function"?t:sc;return ji(l(e,1,g,true),sc,t)});function Lo(e){return e&&e.length?ji(e):[]}function Fo(e,t){return e&&e.length?ji(e,u(t,2)):[]}function Go(e,t){t=typeof t=="function"?t:sc;return e&&e.length?ji(e,sc,t):[]}function $o(t){if(!(t&&t.length)){return[]}var i=0;t=Nc(t,function(e){if(g(e)){i=E(e.length,i);return true}});return Yf(i,function(e){return Ic(t,Bf(e))})}function Wo(e,t){if(!(e&&e.length)){return[]}var i=$o(e);if(t==null){return i}return Ic(i,function(e){return Oc(t,sc,e)})}var Ho=i(function(e,t){return g(e)?Mt(e,t):[]});var jo=i(function(e){return Yi(Nc(e,g))});var Bo=i(function(e){var t=o(e);if(g(t)){t=sc}return Yi(Nc(e,g),u(t,2))});var Vo=i(function(e){var t=o(e);t=typeof t=="function"?t:sc;return Yi(Nc(e,g),sc,t)});var zo=i($o);function Uo(e,t){return qi(e||[],t||[],Et)}function Yo(e,t){return qi(e||[],t||[],Ii)}var qo=i(function(e){var t=e.length,i=t>1?e[t-1]:sc;i=typeof i=="function"?(e.pop(),i):sc;return Wo(e,i)});function Xo(e){var t=v(e);t.__chain__=true;return t}function Ko(e,t){t(e);return e}function Qo(e,t){return t(e)}var Zo=zn(function(t){var i=t.length,e=i?t[0]:0,n=this.__wrapped__,r=function(e){return Ot(e,t)};if(i>1||this.__actions__.length||!(n instanceof y)||!dr(e)){return this.thru(r)}n=n.slice(e,+e+(i?1:0));n.__actions__.push({func:Qo,args:[r],thisArg:sc});return new m(n,this.__chain__).thru(function(e){if(i&&!e.length){e.push(sc)}return e})});function Jo(){return Xo(this)}function ea(){return new m(this.value(),this.__chain__)}function ta(){if(this.__values__===sc){this.__values__=Bs(this.value())}var e=this.__index__>=this.__values__.length,t=e?sc:this.__values__[this.__index__++];return{done:e,value:t}}function ia(){return this}function na(e){var t,i=this;while(i instanceof Be){var n=Gr(i);n.__index__=0;n.__values__=sc;if(t){r.__wrapped__=n}else{t=n}var r=n;i=i.__wrapped__}r.__wrapped__=e;return t}function ra(){var e=this.__wrapped__;if(e instanceof y){var t=e;if(this.__actions__.length){t=new y(this)}t=t.reverse();t.__actions__.push({func:Qo,args:[yo],thisArg:sc});return new m(t,this.__chain__)}return this.thru(yo)}function oa(){return Ui(this.__wrapped__,this.__actions__)}var aa=gn(function(e,t,i){if(A.call(e,i)){++e[i]}else{kt(e,i,1)}});function sa(e,t,i){var n=k(e)?Rf:Gt;if(i&&D(e,t,i)){t=sc}return n(e,u(t,3))}function la(e,t){var i=k(e)?Nc:Ht;return i(e,u(t,3))}var ua=En(Kr);var ca=En(Qr);function da(e,t){return l(_a(e,t),1)}function fa(e,t){return l(_a(e,t),bc)}function pa(e,t,i){i=i===sc?1:N(i);return l(_a(e,t),i)}function ha(e,t){var i=k(e)?Rc:Lt;return i(e,u(t,3))}function ga(e,t){var i=k(e)?Of:Ft;return i(e,u(t,3))}var va=gn(function(e,t,i){if(A.call(e,i)){e[i].push(t)}else{kt(e,i,[t])}});function ma(e,t,i,n){e=c(e)?e:Il(e);i=i&&!n?N(i):0;var r=e.length;if(i<0){i=E(r+i,0)}return Ls(e)?i<=r&&e.indexOf(t,i)>-1:!!r&&Mc(e,t,i)>-1}var ya=i(function(e,t,i){var n=-1,r=typeof t=="function",o=c(e)?x(e.length):[];Lt(e,function(e){o[++n]=r?Oc(t,e,i):ei(e,t,i)});return o});var ba=gn(function(e,t,i){kt(e,i,t)});function _a(e,t){var i=k(e)?Ic:vi;return i(e,u(t,3))}function wa(e,t,i,n){if(e==null){return[]}if(!k(t)){t=t==null?[]:[t]}i=n?sc:i;if(!k(i)){i=i==null?[]:[i]}return Ci(e,t,i)}var Ca=gn(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]});function Aa(e,t,i){var n=k(e)?Pf:Vf,r=arguments.length<3;return n(e,u(t,4),i,r,Lt)}function Ea(e,t,i){var n=k(e)?Mf:Vf,r=arguments.length<3;return n(e,u(t,4),i,r,Ft)}function xa(e,t){var i=k(e)?Nc:Ht;return i(e,za(u(t,3)))}function Ta(e){var t=k(e)?_t:Ri;return t(e)}function Sa(e,t,i){if(i?D(e,t,i):t===sc){t=1}else{t=N(t)}var n=k(e)?wt:Ni;return n(e,t)}function Da(e){var t=k(e)?Ct:Li;return t(e)}function ka(e){if(e==null){return 0}if(c(e)){return Ls(e)?pp(e):e.length}var t=S(e);if(t==Ac||t==xc){return e.size}return pi(e).length}function Oa(e,t,i){var n=k(e)?Lf:Fi;if(i&&D(e,t,i)){t=sc}return n(e,u(t,3))}var Ra=i(function(e,t){if(e==null){return[]}var i=t.length;if(i>1&&D(e,t[0],t[1])){t=[]}else if(i>2&&D(t[0],t[1],t[2])){t=[t[0]]}return Ci(e,l(t,1),[])});var Na=pe||function(){return kc.Date.now()};function Ia(e,t){if(typeof t!="function"){throw new C(lc)}e=N(e);return function(){if(--e<1){return t.apply(this,arguments)}}}function Pa(e,t,i){t=i?sc:t;t=e&&t==null?e.length:t;return Gn(e,yc,sc,sc,sc,sc,t)}function Ma(e,t){var i;if(typeof t!="function"){throw new C(lc)}e=N(e);return function(){if(--e>0){i=t.apply(this,arguments)}if(e<=1){t=sc}return i}}var La=i(function(e,t,i){var n=fc;if(i.length){var r=Fc(i,Kn(La));n|=vc}return Gn(e,n,t,i,r)});var Fa=i(function(e,t,i){var n=fc|pc;if(i.length){var r=Fc(i,Kn(Fa));n|=vc}return Gn(t,n,e,i,r)});function Ga(e,t,i){t=i?sc:t;var n=Gn(e,hc,sc,sc,sc,sc,sc,t);n.placeholder=Ga.placeholder;return n}function $a(e,t,i){t=i?sc:t;var n=Gn(e,gc,sc,sc,sc,sc,sc,t);n.placeholder=$a.placeholder;return n}function Wa(n,r,e){var o,a,s,l,i,u,c=0,t=false,d=false,f=true;if(typeof n!="function"){throw new C(lc)}r=I(r)||0;if(O(e)){t=!!e.leading;d="maxWait"in e;s=d?E(I(e.maxWait)||0,r):s;f="trailing"in e?!!e.trailing:f}function p(e){var t=o,i=a;o=a=sc;c=e;l=n.apply(i,t);return l}function h(e){c=e;i=kr(m,r);return t?p(e):l}function g(e){var t=e-u,i=e-c,n=r-t;return d?T(n,s-i):n}function v(e){var t=e-u,i=e-c;return u===sc||t>=r||t<0||d&&i>=s}function m(){var e=Na();if(v(e)){return y(e)}i=kr(m,g(e))}function y(e){i=sc;if(f&&o){return p(e)}o=a=sc;return l}function b(){if(i!==sc){en(i)}c=0;o=u=a=i=sc}function _(){return i===sc?l:y(Na())}function w(){var e=Na(),t=v(e);o=arguments;a=this;u=e;if(t){if(i===sc){return h(u)}if(d){en(i);i=kr(m,r);return p(u)}}if(i===sc){i=kr(m,r)}return l}w.cancel=b;w.flush=_;return w}var Ha=i(function(e,t){return Pt(e,1,t)});var ja=i(function(e,t,i){return Pt(e,I(t)||0,i)});function Ba(e){return Gn(e,Qc)}function Va(r,o){if(typeof r!="function"||o!=null&&typeof o!="function"){throw new C(lc)}var a=function(){var e=arguments,t=o?o.apply(this,e):e[0],i=a.cache;if(i.has(t)){return i.get(t)}var n=r.apply(this,e);a.cache=i.set(t,n)||i;return n};a.cache=new(Va.Cache||ot);return a}Va.Cache=ot;function za(t){if(typeof t!="function"){throw new C(lc)}return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Ua(e){return Ma(2,e)}var Ya=Zi(function(n,r){r=r.length==1&&k(r[0])?Ic(r[0],Lc(u())):Ic(l(r,1),Lc(u()));var o=r.length;return i(function(e){var t=-1,i=T(e.length,o);while(++t<i){e[t]=r[t].call(this,e[t])}return Oc(n,this,e)})});var qa=i(function(e,t){var i=Fc(t,Kn(qa));return Gn(e,vc,sc,t,i)});var Xa=i(function(e,t){var i=Fc(t,Kn(Xa));return Gn(e,mc,sc,t,i)});var Ka=zn(function(e,t){return Gn(e,Kc,sc,sc,sc,t)});function Qa(e,t){if(typeof e!="function"){throw new C(lc)}t=t===sc?t:N(t);return i(e,t)}function Za(n,r){if(typeof n!="function"){throw new C(lc)}r=r==null?0:E(N(r),0);return i(function(e){var t=e[r],i=Ji(e,0,r);if(t){Pc(i,t)}return Oc(n,this,i)})}function Ja(e,t,i){var n=true,r=true;if(typeof e!="function"){throw new C(lc)}if(O(i)){n="leading"in i?!!i.leading:n;r="trailing"in i?!!i.trailing:r}return Wa(e,t,{leading:n,maxWait:t,trailing:r})}function es(e){return Pa(e,1)}function ts(e,t){return qa(Ki(t),e)}function is(){if(!arguments.length){return[]}var e=arguments[0];return k(e)?e:[e]}function ns(e){return _(e,cc)}function rs(e,t){t=typeof t=="function"?t:sc;return _(e,cc,t)}function os(e){return _(e,uc|cc)}function as(e,t){t=typeof t=="function"?t:sc;return _(e,uc|cc,t)}function ss(e,t){return t==null||It(e,t,M(t))}function d(e,t){return e===t||e!==e&&t!==t}var ls=In(qt);var us=In(function(e,t){return e>=t});var cs=ti(function(){return arguments}())?ti:function(e){return f(e)&&A.call(e,"callee")&&!ae.call(e,"callee")};var k=x.isArray;var ds=Af?Lc(Af):ii;function c(e){return e!=null&&As(e.length)&&!ws(e)}function g(e){return f(e)&&c(e)}function fs(e){return e===true||e===false||f(e)&&r(e)==fd}var ps=ye||$u;var hs=Ef?Lc(Ef):ni;function gs(e){return f(e)&&e.nodeType===1&&!Ns(e)}function vs(e){if(e==null){return true}if(c(e)&&(k(e)||typeof e=="string"||typeof e.splice=="function"||ps(e)||Fs(e)||cs(e))){return!e.length}var t=S(e);if(t==Ac||t==xc){return!e.size}if(mr(e)){return!pi(e).length}for(var i in e){if(A.call(e,i)){return false}}return true}function ms(e,t){return ri(e,t)}function ys(e,t,i){i=typeof i=="function"?i:sc;var n=i?i(e,t):sc;return n===sc?ri(e,t,sc,i):!!n}function bs(e){if(!f(e)){return false}var t=r(e);return t==gd||t==hd||typeof e.message=="string"&&typeof e.name=="string"&&!Ns(e)}function _s(e){return typeof e=="number"&&be(e)}function ws(e){if(!O(e)){return false}var t=r(e);return t==vd||t==md||t==dd||t==wd}function Cs(e){return typeof e=="number"&&e==N(e)}function As(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=_c}function O(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function f(e){return e!=null&&typeof e=="object"}var Es=xf?Lc(xf):ai;function xs(e,t){return e===t||si(e,t,Zn(t))}function Ts(e,t,i){i=typeof i=="function"?i:sc;return si(e,t,Zn(t),i)}function Ss(e){return Rs(e)&&e!=+e}function Ds(e){if(vr(e)){throw new G(jc)}return li(e)}function ks(e){return e===null}function Os(e){return e==null}function Rs(e){return typeof e=="number"||f(e)&&r(e)==yd}function Ns(e){if(!f(e)||r(e)!=Ec){return false}var t=re(e);if(t===null){return true}var i=A.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&Y.call(i)==Q}var Is=Tf?Lc(Tf):ui;function Ps(e){return Cs(e)&&e>=-_c&&e<=_c}var Ms=Sf?Lc(Sf):ci;function Ls(e){return typeof e=="string"||!k(e)&&f(e)&&r(e)==Ad}function R(e){return typeof e=="symbol"||f(e)&&r(e)==Ed}var Fs=Df?Lc(Df):di;function Gs(e){return e===sc}function $s(e){return f(e)&&S(e)==Td}function Ws(e){return f(e)&&r(e)==Sd}var Hs=In(gi);var js=In(function(e,t){return e<=t});function Bs(e){if(!e){return[]}if(c(e)){return Ls(e)?Gc(e):w(e)}if(ue&&e[ue]){return sp(e[ue]())}var t=S(e),i=t==Ac?lp:t==xc?cp:Il;return i(e)}function Vs(e){if(!e){return e===0?e:0}e=I(e);if(e===bc||e===-bc){var t=e<0?-1:1;return t*od}return e===e?e:0}function N(e){var t=Vs(e),i=t%1;return t===t?i?t-i:t:0}function zs(e){return e?Rt(N(e),0,wc):0}function I(e){if(typeof e=="number"){return e}if(R(e)){return ad}if(O(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=O(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=Xf(e);var i=uf.test(e);return i||df.test(e)?wf(e.slice(2),i?2:8):lf.test(e)?ad:+e}function Us(e){return fn(e,L(e))}function Ys(e){return e?Rt(N(e),-_c,_c):e===0?e:0}function P(e){return e==null?"":h(e)}var qs=vn(function(e,t){if(mr(t)||c(t)){fn(t,M(t),e);return}for(var i in t){if(A.call(t,i)){Et(e,i,t[i])}}});var Xs=vn(function(e,t){fn(t,L(t),e)});var Ks=vn(function(e,t,i,n){fn(t,L(t),e,n)});var Qs=vn(function(e,t,i,n){fn(t,M(t),e,n)});var Zs=zn(Ot);function Js(e,t){var i=je(e);return t==null?i:St(i,t)}var el=i(function(e,t){e=p(e);var i=-1;var n=t.length;var r=n>2?t[2]:sc;if(r&&D(t[0],t[1],r)){n=1}while(++i<n){var o=t[i];var a=L(o);var s=-1;var l=a.length;while(++s<l){var u=a[s];var c=e[u];if(c===sc||d(c,z[u])&&!A.call(e,u)){e[u]=o[u]}}}return e});var tl=i(function(e){e.push(sc,Wn);return Oc(bl,sc,e)});function il(e,t){return Gf(e,u(t,3),a)}function nl(e,t){return Gf(e,u(t,3),Vt)}function rl(e,t){return e==null?e:jt(e,u(t,3),L)}function ol(e,t){return e==null?e:Bt(e,u(t,3),L)}function al(e,t){return e&&a(e,u(t,3))}function sl(e,t){return e&&Vt(e,u(t,3))}function ll(e){return e==null?[]:zt(e,M(e))}function ul(e){return e==null?[]:zt(e,L(e))}function cl(e,t,i){var n=e==null?sc:Ut(e,t);return n===sc?i:n}function dl(e,t){return e!=null&&or(e,t,Xt)}function fl(e,t){return e!=null&&or(e,t,Kt)}var pl=Sn(function(e,t,i){if(t!=null&&typeof t.toString!="function"){t=K.call(t)}e[t]=i},yu(F));var hl=Sn(function(e,t,i){if(t!=null&&typeof t.toString!="function"){t=K.call(t)}if(A.call(e,t)){e[t].push(i)}else{e[t]=[i]}},u);var gl=i(ei);function M(e){return c(e)?bt(e):pi(e)}function L(e){return c(e)?bt(e,true):hi(e)}function vl(e,n){var r={};n=u(n,3);a(e,function(e,t,i){kt(r,n(e,t,i),e)});return r}function ml(e,n){var r={};n=u(n,3);a(e,function(e,t,i){kt(r,t,n(e,t,i))});return r}var yl=vn(function(e,t,i){bi(e,t,i)});var bl=vn(function(e,t,i,n){bi(e,t,i,n)});var _l=zn(function(t,e){var i={};if(t==null){return i}var n=false;e=Ic(e,function(e){e=Qi(e,t);n||(n=e.length>1);return e});fn(t,Yn(t),i);if(n){i=_(i,uc|Yc|cc,Hn)}var r=e.length;while(r--){Bi(i,e[r])}return i});function wl(e,t){return Al(e,za(u(t)))}var Cl=zn(function(e,t){return e==null?{}:Ai(e,t)});function Al(e,i){if(e==null){return{}}var t=Ic(Yn(e),function(e){return[e]});i=u(i);return Ei(e,t,function(e,t){return i(e,t[0])})}function El(e,t,i){t=Qi(t,e);var n=-1,r=t.length;if(!r){r=1;e=sc}while(++n<r){var o=e==null?sc:e[Mr(t[n])];if(o===sc){n=r;o=i}e=ws(o)?o.call(e):o}return e}function xl(e,t,i){return e==null?e:Ii(e,t,i)}function Tl(e,t,i,n){n=typeof n=="function"?n:sc;return e==null?e:Ii(e,t,i,n)}var Sl=Fn(M);var Dl=Fn(L);function kl(e,n,r){var t=k(e),i=t||ps(e)||Fs(e);n=u(n,4);if(r==null){var o=e&&e.constructor;if(i){r=t?new o:[]}else if(O(e)){r=ws(o)?je(re(e)):{}}else{r={}}}(i?Rc:a)(e,function(e,t,i){return n(r,e,t,i)});return r}function Ol(e,t){return e==null?true:Bi(e,t)}function Rl(e,t,i){return e==null?e:Vi(e,t,Ki(i))}function Nl(e,t,i,n){n=typeof n=="function"?n:sc;return e==null?e:Vi(e,t,Ki(i),n)}function Il(e){return e==null?[]:Kf(e,M(e))}function Pl(e){return e==null?[]:Kf(e,L(e))}function Ml(e,t,i){if(i===sc){i=t;t=sc}if(i!==sc){i=I(i);i=i===i?i:0}if(t!==sc){t=I(t);t=t===t?t:0}return Rt(I(e),t,i)}function Ll(e,t,i){t=Vs(t);if(i===sc){i=t;t=0}else{i=Vs(i)}e=I(e);return Qt(e,t,i)}function Fl(e,t,i){if(i&&typeof i!="boolean"&&D(e,t,i)){t=i=sc}if(i===sc){if(typeof t=="boolean"){i=t;t=sc}else if(typeof e=="boolean"){i=e;e=sc}}if(e===sc&&t===sc){e=0;t=1}else{e=Vs(e);if(t===sc){t=e;e=0}else{t=Vs(t)}}if(e>t){var n=e;e=t;t=n}if(i||e%1||t%1){var r=Ee();return T(e+r*(t-e+_f("1e-"+((r+"").length-1))),t)}return Di(e,t)}var Gl=wn(function(e,t,i){t=t.toLowerCase();return e+(i?$l(t):t)});function $l(e){return fu(P(e).toLowerCase())}function Wl(e){e=P(e);return e&&e.replace(pf,tp).replace(mf,"")}function Hl(e,t,i){e=P(e);t=h(t);var n=e.length;i=i===sc?n:Rt(N(i),0,n);var r=i;i-=t.length;return i>=0&&e.slice(i,r)==t}function jl(e){e=P(e);return e&&Vd.test(e)?e.replace(jd,ip):e}function Bl(e){e=P(e);return e&&Zd.test(e)?e.replace(Qd,"\\$&"):e}var Vl=wn(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()});var zl=wn(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()});var Ul=_n("toLowerCase");function Yl(e,t,i){e=P(e);t=N(t);var n=t?pp(e):0;if(!t||n>=t){return e}var r=(t-n)/2;return On(ve(r),i)+e+On(ge(r),i)}function ql(e,t,i){e=P(e);t=N(t);var n=t?pp(e):0;return t&&n<t?e+On(t-n,i):e}function Xl(e,t,i){e=P(e);t=N(t);var n=t?pp(e):0;return t&&n<t?On(t-n,i)+e:e}function Kl(e,t,i){if(i||t==null){t=0}else if(t){t=+t}return Ae(P(e).replace(Jd,""),t||0)}function Ql(e,t,i){if(i?D(e,t,i):t===sc){t=1}else{t=N(t)}return Oi(P(e),t)}function Zl(){var e=arguments,t=P(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Jl=wn(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()});function eu(e,t,i){if(i&&typeof i!="number"&&D(e,t,i)){t=i=sc}i=i===sc?wc:i>>>0;if(!i){return[]}e=P(e);if(e&&(typeof t=="string"||t!=null&&!Is(t))){t=h(t);if(!t&&op(e)){return Ji(Gc(e),0,i)}}return e.split(t,i)}var tu=wn(function(e,t,i){return e+(i?" ":"")+fu(t)});function iu(e,t,i){e=P(e);i=i==null?0:Rt(N(i),0,e.length);t=h(t);return e.slice(i,i+t.length)==t}function nu(a,e,t){var i=v.templateSettings;if(t&&D(a,e,t)){e=sc}a=P(a);e=Ks({},e,i,$n);var n=Ks({},e.imports,i.imports,$n),r=M(n),o=Kf(n,r);var s,l,u=0,c=e.interpolate||hf,d="__p += '";var f=H((e.escape||hf).source+"|"+c.source+"|"+(c===Yd?af:hf).source+"|"+(e.evaluate||hf).source+"|$","g");var p="//# sourceURL="+(A.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++bf+"]")+"\n";a.replace(f,function(e,t,i,n,r,o){i||(i=n);d+=a.slice(u,o).replace(gf,np);if(t){s=true;d+="' +\n__e("+t+") +\n'"}if(r){l=true;d+="';\n"+r+";\n__p += '"}if(i){d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"}u=o+e.length;return e});d+="';\n";var h=A.call(e,"variable")&&e.variable;if(!h){d="with (obj) {\n"+d+"\n}\n"}else if(rf.test(h)){throw new G(Bc)}d=(l?d.replace(Gd,""):d).replace($d,"$1").replace(Wd,"$1;");d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=hu(function(){return $(r,p+"return "+d).apply(sc,o)});g.source=d;if(bs(g)){throw g}return g}function ru(e){return P(e).toLowerCase()}function ou(e){return P(e).toUpperCase()}function au(e,t,i){e=P(e);if(e&&(i||t===sc)){return Xf(e)}if(!e||!(t=h(t))){return e}var n=Gc(e),r=Gc(t),o=Zf(n,r),a=Jf(n,r)+1;return Ji(n,o,a).join("")}function su(e,t,i){e=P(e);if(e&&(i||t===sc)){return e.slice(0,hp(e)+1)}if(!e||!(t=h(t))){return e}var n=Gc(e),r=Jf(n,Gc(t))+1;return Ji(n,0,r).join("")}function lu(e,t,i){e=P(e);if(e&&(i||t===sc)){return e.replace(Jd,"")}if(!e||!(t=h(t))){return e}var n=Gc(e),r=Zf(n,Gc(t));return Ji(n,r).join("")}function uu(e,t){var i=Zc,n=Jc;if(O(t)){var r="separator"in t?t.separator:r;i="length"in t?N(t.length):i;n="omission"in t?h(t.omission):n}e=P(e);var o=e.length;if(op(e)){var a=Gc(e);o=a.length}if(i>=o){return e}var s=i-pp(n);if(s<1){return n}var l=a?Ji(a,0,s).join(""):e.slice(0,s);if(r===sc){return l+n}if(a){s+=l.length-s}if(Is(r)){if(e.slice(s).search(r)){var u,c=l;if(!r.global){r=H(r.source,P(sf.exec(r))+"g")}r.lastIndex=0;while(u=r.exec(c)){var d=u.index}l=l.slice(0,d===sc?s:d)}}else if(e.indexOf(h(r),s)!=s){var f=l.lastIndexOf(r);if(f>-1){l=l.slice(0,f)}}return l+n}function cu(e){e=P(e);return e&&Bd.test(e)?e.replace(Hd,gp):e}var du=wn(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()});var fu=_n("toUpperCase");function pu(e,t,i){e=P(e);t=i?sc:t;if(t===sc){return ap(e)?vp(e):Ff(e)}return e.match(t)||[]}var hu=i(function(e,t){try{return Oc(e,sc,t)}catch(e){return bs(e)?e:new G(e)}});var gu=zn(function(t,e){Rc(e,function(e){e=Mr(e);kt(t,e,La(t[e],t))});return t});function vu(n){var r=n==null?0:n.length,t=u();n=!r?[]:Ic(n,function(e){if(typeof e[1]!="function"){throw new C(lc)}return[t(e[0]),e[1]]});return i(function(e){var t=-1;while(++t<r){var i=n[t];if(Oc(i[0],this,e)){return Oc(i[1],this,e)}}})}function mu(e){return Nt(_(e,uc))}function yu(e){return function(){return e}}function bu(e,t){return e==null||e!==e?t:e}var _u=xn();var wu=xn(true);function F(e){return e}function Cu(e){return fi(typeof e=="function"?e:_(e,uc))}function Au(e){return mi(_(e,uc))}function Eu(e,t){return yi(e,_(t,uc))}var xu=i(function(t,i){return function(e){return ei(e,t,i)}});var Tu=i(function(t,i){return function(e){return ei(t,e,i)}});function Su(r,t,e){var i=M(t),n=zt(t,i);if(e==null&&!(O(t)&&(n.length||!i.length))){e=t;t=r;r=this;n=zt(t,M(t))}var o=!(O(e)&&"chain"in e)||!!e.chain,a=ws(r);Rc(n,function(e){var n=t[e];r[e]=n;if(a){r.prototype[e]=function(){var e=this.__chain__;if(o||e){var t=r(this.__wrapped__),i=t.__actions__=w(this.__actions__);i.push({func:n,args:arguments,thisArg:r});t.__chain__=e;return t}return n.apply(r,Pc([this.value()],arguments))}}});return r}function Du(){if(kc._===this){kc._=Z}return this}function ku(){}function Ou(t){t=N(t);return i(function(e){return wi(e,t)})}var Ru=kn(Ic);var Nu=kn(Rf);var Iu=kn(Lf);function Pu(e){return fr(e)?Bf(Mr(e)):xi(e)}function Mu(t){return function(e){return t==null?sc:Ut(t,e)}}var Lu=Nn();var Fu=Nn(true);function Gu(){return[]}function $u(){return false}function Wu(){return{}}function Hu(){return""}function ju(){return true}function Bu(e,t){e=N(e);if(e<1||e>_c){return[]}var i=wc,n=T(e,wc);t=u(t);e-=wc;var r=Yf(n,t);while(++i<e){t(i)}return r}function Vu(e){if(k(e)){return Ic(e,Mr)}return R(e)?[e]:w(Pr(P(e)))}function zu(e){var t=++q;return P(e)+t}var Uu=Dn(function(e,t){return e+t},0);var Yu=Mn("ceil");var qu=Dn(function(e,t){return e/t},1);var Xu=Mn("floor");function Ku(e){return e&&e.length?$t(e,F,qt):sc}function Qu(e,t){return e&&e.length?$t(e,u(t,2),qt):sc}function Zu(e){return jf(e,F)}function Ju(e,t){return jf(e,u(t,2))}function ec(e){return e&&e.length?$t(e,F,gi):sc}function tc(e,t){return e&&e.length?$t(e,u(t,2),gi):sc}var ic=Dn(function(e,t){return e*t},1);var nc=Mn("round");var rc=Dn(function(e,t){return e-t},0);function oc(e){return e&&e.length?Uf(e,F):0}function ac(e,t){return e&&e.length?Uf(e,u(t,2)):0}v.after=Ia;v.ary=Pa;v.assign=qs;v.assignIn=Xs;v.assignInWith=Ks;v.assignWith=Qs;v.at=Zs;v.before=Ma;v.bind=La;v.bindAll=gu;v.bindKey=Fa;v.castArray=is;v.chain=Xo;v.chunk=$r;v.compact=Wr;v.concat=Hr;v.cond=vu;v.conforms=mu;v.constant=yu;v.countBy=aa;v.create=Js;v.curry=Ga;v.curryRight=$a;v.debounce=Wa;v.defaults=el;v.defaultsDeep=tl;v.defer=Ha;v.delay=ja;v.difference=jr;v.differenceBy=Br;v.differenceWith=Vr;v.drop=zr;v.dropRight=Ur;v.dropRightWhile=Yr;v.dropWhile=qr;v.fill=Xr;v.filter=la;v.flatMap=da;v.flatMapDeep=fa;v.flatMapDepth=pa;v.flatten=Zr;v.flattenDeep=Jr;v.flattenDepth=eo;v.flip=Ba;v.flow=_u;v.flowRight=wu;v.fromPairs=to;v.functions=ll;v.functionsIn=ul;v.groupBy=va;v.initial=ro;v.intersection=oo;v.intersectionBy=ao;v.intersectionWith=so;v.invert=pl;v.invertBy=hl;v.invokeMap=ya;v.iteratee=Cu;v.keyBy=ba;v.keys=M;v.keysIn=L;v.map=_a;v.mapKeys=vl;v.mapValues=ml;v.matches=Au;v.matchesProperty=Eu;v.memoize=Va;v.merge=yl;v.mergeWith=bl;v.method=xu;v.methodOf=Tu;v.mixin=Su;v.negate=za;v.nthArg=Ou;v.omit=_l;v.omitBy=wl;v.once=Ua;v.orderBy=wa;v.over=Ru;v.overArgs=Ya;v.overEvery=Nu;v.overSome=Iu;v.partial=qa;v.partialRight=Xa;v.partition=Ca;v.pick=Cl;v.pickBy=Al;v.property=Pu;v.propertyOf=Mu;v.pull=fo;v.pullAll=po;v.pullAllBy=ho;v.pullAllWith=go;v.pullAt=vo;v.range=Lu;v.rangeRight=Fu;v.rearg=Ka;v.reject=xa;v.remove=mo;v.rest=Qa;v.reverse=yo;v.sampleSize=Sa;v.set=xl;v.setWith=Tl;v.shuffle=Da;v.slice=bo;v.sortBy=Ra;v.sortedUniq=To;v.sortedUniqBy=So;v.split=eu;v.spread=Za;v.tail=Do;v.take=ko;v.takeRight=Oo;v.takeRightWhile=Ro;v.takeWhile=No;v.tap=Ko;v.throttle=Ja;v.thru=Qo;v.toArray=Bs;v.toPairs=Sl;v.toPairsIn=Dl;v.toPath=Vu;v.toPlainObject=Us;v.transform=kl;v.unary=es;v.union=Io;v.unionBy=Po;v.unionWith=Mo;v.uniq=Lo;v.uniqBy=Fo;v.uniqWith=Go;v.unset=Ol;v.unzip=$o;v.unzipWith=Wo;v.update=Rl;v.updateWith=Nl;v.values=Il;v.valuesIn=Pl;v.without=Ho;v.words=pu;v.wrap=ts;v.xor=jo;v.xorBy=Bo;v.xorWith=Vo;v.zip=zo;v.zipObject=Uo;v.zipObjectDeep=Yo;v.zipWith=qo;v.entries=Sl;v.entriesIn=Dl;v.extend=Xs;v.extendWith=Ks;Su(v,v);v.add=Uu;v.attempt=hu;v.camelCase=Gl;v.capitalize=$l;v.ceil=Yu;v.clamp=Ml;v.clone=ns;v.cloneDeep=os;v.cloneDeepWith=as;v.cloneWith=rs;v.conformsTo=ss;v.deburr=Wl;v.defaultTo=bu;v.divide=qu;v.endsWith=Hl;v.eq=d;v.escape=jl;v.escapeRegExp=Bl;v.every=sa;v.find=ua;v.findIndex=Kr;v.findKey=il;v.findLast=ca;v.findLastIndex=Qr;v.findLastKey=nl;v.floor=Xu;v.forEach=ha;v.forEachRight=ga;v.forIn=rl;v.forInRight=ol;v.forOwn=al;v.forOwnRight=sl;v.get=cl;v.gt=ls;v.gte=us;v.has=dl;v.hasIn=fl;v.head=io;v.identity=F;v.includes=ma;v.indexOf=no;v.inRange=Ll;v.invoke=gl;v.isArguments=cs;v.isArray=k;v.isArrayBuffer=ds;v.isArrayLike=c;v.isArrayLikeObject=g;v.isBoolean=fs;v.isBuffer=ps;v.isDate=hs;v.isElement=gs;v.isEmpty=vs;v.isEqual=ms;v.isEqualWith=ys;v.isError=bs;v.isFinite=_s;v.isFunction=ws;v.isInteger=Cs;v.isLength=As;v.isMap=Es;v.isMatch=xs;v.isMatchWith=Ts;v.isNaN=Ss;v.isNative=Ds;v.isNil=Os;v.isNull=ks;v.isNumber=Rs;v.isObject=O;v.isObjectLike=f;v.isPlainObject=Ns;v.isRegExp=Is;v.isSafeInteger=Ps;v.isSet=Ms;v.isString=Ls;v.isSymbol=R;v.isTypedArray=Fs;v.isUndefined=Gs;v.isWeakMap=$s;v.isWeakSet=Ws;v.join=lo;v.kebabCase=Vl;v.last=o;v.lastIndexOf=uo;v.lowerCase=zl;v.lowerFirst=Ul;v.lt=Hs;v.lte=js;v.max=Ku;v.maxBy=Qu;v.mean=Zu;v.meanBy=Ju;v.min=ec;v.minBy=tc;v.stubArray=Gu;v.stubFalse=$u;v.stubObject=Wu;v.stubString=Hu;v.stubTrue=ju;v.multiply=ic;v.nth=co;v.noConflict=Du;v.noop=ku;v.now=Na;v.pad=Yl;v.padEnd=ql;v.padStart=Xl;v.parseInt=Kl;v.random=Fl;v.reduce=Aa;v.reduceRight=Ea;v.repeat=Ql;v.replace=Zl;v.result=El;v.round=nc;v.runInContext=t;v.sample=Ta;v.size=ka;v.snakeCase=Jl;v.some=Oa;v.sortedIndex=_o;v.sortedIndexBy=wo;v.sortedIndexOf=Co;v.sortedLastIndex=Ao;v.sortedLastIndexBy=Eo;v.sortedLastIndexOf=xo;v.startCase=tu;v.startsWith=iu;v.subtract=rc;v.sum=oc;v.sumBy=ac;v.template=nu;v.times=Bu;v.toFinite=Vs;v.toInteger=N;v.toLength=zs;v.toLower=ru;v.toNumber=I;v.toSafeInteger=Ys;v.toString=P;v.toUpper=ou;v.trim=au;v.trimEnd=su;v.trimStart=lu;v.truncate=uu;v.unescape=cu;v.uniqueId=zu;v.upperCase=du;v.upperFirst=fu;v.each=ha;v.eachRight=ga;v.first=io;Su(v,function(){var i={};a(v,function(e,t){if(!A.call(v.prototype,t)){i[t]=e}});return i}(),{chain:false});v.VERSION=Wc;Rc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){v[e].placeholder=v});Rc(["drop","take"],function(i,n){y.prototype[i]=function(e){e=e===sc?1:E(N(e),0);var t=this.__filtered__&&!n?new y(this):this.clone();if(t.__filtered__){t.__takeCount__=T(e,t.__takeCount__)}else{t.__views__.push({size:T(e,wc),type:i+(t.__dir__<0?"Right":"")})}return t};y.prototype[i+"Right"]=function(e){return this.reverse()[i](e).reverse()}});Rc(["filter","map","takeWhile"],function(e,t){var i=t+1,n=i==id||i==rd;y.prototype[e]=function(e){var t=this.clone();t.__iteratees__.push({iteratee:u(e,3),type:i});t.__filtered__=t.__filtered__||n;return t}});Rc(["head","last"],function(e,t){var i="take"+(t?"Right":"");y.prototype[e]=function(){return this[i](1).value()[0]}});Rc(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");y.prototype[e]=function(){return this.__filtered__?new y(this):this[i](1)}});y.prototype.compact=function(){return this.filter(F)};y.prototype.find=function(e){return this.filter(e).head()};y.prototype.findLast=function(e){return this.reverse().find(e)};y.prototype.invokeMap=i(function(t,i){if(typeof t=="function"){return new y(this)}return this.map(function(e){return ei(e,t,i)})});y.prototype.reject=function(e){return this.filter(za(u(e)))};y.prototype.slice=function(e,t){e=N(e);var i=this;if(i.__filtered__&&(e>0||t<0)){return new y(i)}if(e<0){i=i.takeRight(-e)}else if(e){i=i.drop(e)}if(t!==sc){t=N(t);i=t<0?i.dropRight(-t):i.take(t-e)}return i};y.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};y.prototype.toArray=function(){return this.take(wc)};a(y.prototype,function(d,e){var f=/^(?:filter|find|map|reject)|While$/.test(e),p=/^(?:head|last)$/.test(e),h=v[p?"take"+(e=="last"?"Right":""):e],g=p||/^find/.test(e);if(!h){return}v.prototype[e]=function(){var e=this.__wrapped__,i=p?[1]:arguments,t=e instanceof y,n=i[0],r=t||k(e);var o=function(e){var t=h.apply(v,Pc([e],i));return p&&a?t[0]:t};if(r&&f&&typeof n=="function"&&n.length!=1){t=r=false}var a=this.__chain__,s=!!this.__actions__.length,l=g&&!a,u=t&&!s;if(!g&&r){e=u?e:new y(this);var c=d.apply(e,i);c.__actions__.push({func:Qo,args:[o],thisArg:sc});return new m(c,a)}if(l&&u){return d.apply(this,i)}c=this.thru(o);return l?p?c.value()[0]:c.value():c}});Rc(["pop","push","shift","sort","splice","unshift"],function(e){var i=B[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);v.prototype[e]=function(){var t=arguments;if(r&&!this.__chain__){var e=this.value();return i.apply(k(e)?e:[],t)}return this[n](function(e){return i.apply(k(e)?e:[],t)})}});a(y.prototype,function(e,t){var i=v[t];if(i){var n=i.name+"";if(!A.call(Ie,n)){Ie[n]=[]}Ie[n].push({name:t,func:i})}});Ie[Tn(sc,pc).name]=[{name:"wrapper",func:sc}];y.prototype.clone=Ve;y.prototype.reverse=ze;y.prototype.value=Ue;v.prototype.at=Zo;v.prototype.chain=Jo;v.prototype.commit=ea;v.prototype.next=ta;v.prototype.plant=na;v.prototype.reverse=ra;v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=oa;v.prototype.first=v.prototype.head;if(ue){v.prototype[ue]=ia}return v};var $c=ue();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){kc._=$c;define(function(){return $c})}else if(t){(t.exports=$c)._=$c;te._=$c}else{kc._=$c}}).call(this);(function(i){var t=Array.prototype.slice;var n={dict:null,load:function(e){if(this.dict!==null){i.extend(this.dict,e)}else{this.dict=e}},_:function(e){dict=this.dict;if(dict&&dict.hasOwnProperty(e)){e=dict[e]}args=t.call(arguments);args[0]=e;return this.printf.apply(this,args)},printf:function(e,n){if(arguments.length<2)return e;n=i.isArray(n)?n:t.call(arguments,1);return e.replace(/([^%]|^)%(?:(\d+)\$)?s/g,function(e,t,i){if(i){return t+n[parseInt(i)-1]}return t+n.shift()}).replace(/%%s/g,"%s")}};i.fn._t=function(e,t){return i(this).html(n._.apply(n,arguments))};i.i18n=n})(jQuery);(function(r){if(typeof r.fn.each2=="undefined"){r.extend(r.fn,{each2:function(e){var t=r([0]),i=-1,n=this.length;while(++i<n&&(t.context=t[0]=this[i])&&e.call(t[0],i,t)!==false);return this}})}})(jQuery);(function(E,_){"use strict";if(window.Select2!==_){return}var e,t,i,w,n,r={x:0,y:0},o,x,s={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case s.LEFT:case s.RIGHT:case s.UP:case s.DOWN:return true}return false},isControl:function(e){var t=e.which;switch(t){case s.SHIFT:case s.CTRL:case s.ALT:return true}if(e.metaKey)return true;return false},isFunctionKey:function(e){e=e.which?e.which:e;return e>=112&&e<=123}},a="<div class='select2-measure-scrollbar'></div>",l={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};o=E(document);w=function(){var e=1;return function(){return e++}}();function u(e){var t=E(document.createTextNode(""));e.before(t);t.before(e);t.remove()}function c(e){function t(e){return l[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function d(e,t){var i=0,n=t.length;for(;i<n;i=i+1){if(p(e,t[i]))return i}return-1}function f(){var e=E(a);e.appendTo(E(document.body));var t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};e.remove();return t}function p(e,t){if(e===t)return true;if(e===_||t===_)return false;if(e===null||t===null)return false;if(e.constructor===String)return e+""===t+"";if(t.constructor===String)return t+""===e+"";return false}function h(e,t,i){var n,r,o;if(e===null||e.length<1)return[];n=e.split(t);for(r=0,o=n.length;r<o;r=r+1)n[r]=i(n[r]);return n}function g(e){return e.outerWidth(false)-e.width()}function v(t){var i="keyup-change-value";t.on("keydown",function(){if(E.data(t,i)===_){E.data(t,i,t.val())}});t.on("keyup",function(){var e=E.data(t,i);if(e!==_&&t.val()!==e){E.removeData(t,i);t.trigger("keyup-change")}})}function m(e){e.on("mousemove",function(e){var t=r;if(t===_||t.x!==e.pageX||t.y!==e.pageY){E(e.target).trigger("mousemove-filtered",e)}})}function y(t,i,n){n=n||_;var r;return function(){var e=arguments;window.clearTimeout(r);r=window.setTimeout(function(){i.apply(n,e)},t)}}function b(e,t){var i=y(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){if(d(e.target,t.get())>=0)i(e)})}function L(r){if(r[0]===document.activeElement)return;window.setTimeout(function(){var e=r[0],t=r.val().length,i;r.focus();var n=e.offsetWidth>0||e.offsetHeight>0;if(n&&e===document.activeElement){if(e.setSelectionRange){e.setSelectionRange(t,t)}else if(e.createTextRange){i=e.createTextRange();i.collapse(false);i.select()}}},0)}function F(e){e=E(e)[0];var t=0;var i=0;if("selectionStart"in e){t=e.selectionStart;i=e.selectionEnd-t}else if("selection"in document){e.focus();var n=document.selection.createRange();i=document.selection.createRange().text.length;n.moveStart("character",-e.value.length);t=n.text.length-i}return{offset:t,length:i}}function C(e){e.preventDefault();e.stopPropagation()}function G(e){e.preventDefault();e.stopImmediatePropagation()}function $(e){if(!n){var t=e[0].currentStyle||window.getComputedStyle(e[0],null);n=E(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:t.fontSize,fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,textTransform:t.textTransform,whiteSpace:"nowrap"});n.attr("class","select2-sizer");E(document.body).append(n)}n.text(e.val());return n.width()}function A(e,t,i){var n,r=[],o;n=E.trim(e.attr("class"));if(n){n=""+n;E(n.split(/\s+/)).each2(function(){if(this.indexOf("select2-")===0){r.push(this)}})}n=E.trim(t.attr("class"));if(n){n=""+n;E(n.split(/\s+/)).each2(function(){if(this.indexOf("select2-")!==0){o=i(this);if(o){r.push(o)}}})}e.attr("class",r.join(" "))}function T(e,t,i,n){var r=c(e.toUpperCase()).indexOf(c(t.toUpperCase())),o=t.length;if(r<0){i.push(n(e));return}i.push(n(e.substring(0,r)));i.push("<span class='select2-match'>");i.push(n(e.substring(r,r+o)));i.push("</span>");i.push(n(e.substring(r+o,e.length)))}function S(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function D(a){var e,s=null,t=a.quietMillis||100,l=a.url,u=this;return function(o){window.clearTimeout(e);e=window.setTimeout(function(){var e=a.data,t=l,i=a.transport||E.fn.select2.ajaxDefaults.transport,n={type:a.type||"GET",cache:a.cache||false,jsonpCallback:a.jsonpCallback||_,dataType:a.dataType||"json"},r=E.extend({},E.fn.select2.ajaxDefaults.params,n);e=e?e.call(u,o.term,o.page,o.context):null;t=typeof t==="function"?t.call(u,o.term,o.page,o.context):t;if(s&&typeof s.abort==="function"){s.abort()}if(a.params){if(E.isFunction(a.params)){E.extend(r,a.params.call(u))}else{E.extend(r,a.params)}}E.extend(r,{url:t,dataType:a.dataType,data:e,success:function(e){var t=a.results(e,o.page,o);o.callback(t)},error:function(e,t,i){var n={hasError:true,jqXHR:e,textStatus:t,errorThrown:i};o.callback(n)}});s=i.call(u,r)},t)}}function k(e){var t=e,i,n,s=function(e){return""+e.text};if(E.isArray(t)){n=t;t={results:n}}if(E.isFunction(t)===false){n=t;t=function(){return n}}var r=t();if(r.text){s=r.text;if(!E.isFunction(s)){i=r.text;s=function(e){return e[i]}}}return function(r){var o=r.term,i={results:[]},a;if(o===""){r.callback(t());return}a=function(e,t){var i,n;e=e[0];if(e.children){i={};for(n in e){if(e.hasOwnProperty(n))i[n]=e[n]}i.children=[];E(e.children).each2(function(e,t){a(t,i.children)});if(i.children.length||r.matcher(o,s(i),e)){t.push(i)}}else{if(r.matcher(o,s(e),e)){t.push(e)}}};E(t().results).each2(function(e,t){a(t,i.results)});r.callback(i)}}function O(t){var o=E.isFunction(t);return function(i){var n=i.term,r={results:[]};var e=o?t(i):t;if(E.isArray(e)){E(e).each(function(){var e=this.text!==_,t=e?this.text:this;if(n===""||i.matcher(n,t)){r.results.push(e?this:{id:this,text:this})}});i.callback(r)}}}function R(e,t){if(E.isFunction(e))return true;if(!e)return false;if(typeof e==="string")return true;throw new Error(t+" must be a string, function, or falsy value")}function N(e,t){if(E.isFunction(e)){var i=Array.prototype.slice.call(arguments,2);return e.apply(t,i)}return e}function I(e){var i=0;E.each(e,function(e,t){if(E(t.element).is("optgroup")){i+=I(t.children)}else{if(t.children&&t.children.length){i+=I(t.children)}i++}});return i}function W(e,t,i,n){var r=e,o=false,a,s,l,u,c;if(!n.createSearchChoice||!n.tokenSeparators||n.tokenSeparators.length<1)return _;while(true){s=-1;for(l=0,u=n.tokenSeparators.length;l<u;l++){c=n.tokenSeparators[l];s=e.indexOf(c);if(s>=0)break}if(s<0)break;a=e.substring(0,s);e=e.substring(s+c.length);if(a.length>0){a=n.createSearchChoice.call(this,a,t);if(a!==_&&a!==null&&n.id(a)!==_&&n.id(a)!==null){o=false;for(l=0,u=t.length;l<u;l++){if(p(n.id(a),n.id(t[l]))){o=true;break}}if(!o)i(a)}}}if(r!==e)return e}function P(){var i=this;E.each(arguments,function(e,t){i[t].remove();i[t]=null})}function M(e,t){var i=function(){};i.prototype=new e;i.prototype.constructor=i;i.prototype.parent=e.prototype;i.prototype=E.extend(i.prototype,t);return i}e=M(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(e){var o,t,i=".select2-results";this.opts=e=this.prepareOpts(e);this.id=e.id;if(e.element.data("select2")!==_&&e.element.data("select2")!==null){e.element.data("select2").destroy()}this.container=this.createContainer();this.liveRegion=E(".select2-hidden-accessible");if(this.liveRegion.length==0){this.liveRegion=E("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(E(document.body))}this.containerId="s2id_"+(e.element.attr("id")||"autogen"+w());this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);this.container.attr("title",e.element.attr("title"));this.body=E(document.body);A(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.attr("style",e.element.attr("style"));this.container.css(N(e.containerCss,this.opts.element));this.container.addClass(N(e.containerCssClass,this.opts.element));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",C);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");A(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(N(e.dropdownCssClass,this.opts.element));this.dropdown.data("select2",this);this.dropdown.on("click",C);this.results=o=this.container.find(i);this.search=t=this.container.find("input.select2-input");this.queryCount=0;this.resultsPage=0;this.context=null;this.initContainer();this.container.on("click",function(e){if(e.target&&E(e.target).is(".select2-search-choice *")){return}return C(e)});m(this.results);this.dropdown.on("mousemove-filtered",i,this.bind(this.highlightUnderEvent));this.dropdown.on("touchstart touchmove touchend",i,this.bind(function(e){this._touchEvent=true;this.highlightUnderEvent(e)}));this.dropdown.on("touchmove",i,this.bind(this.touchMoved));this.dropdown.on("touchstart touchend",i,this.bind(this.clearTouchMoved));this.dropdown.on("click",this.bind(function(e){if(this._touchEvent){this._touchEvent=false;this.selectHighlighted()}}));b(80,this.results);this.dropdown.on("scroll-debounced",i,this.bind(this.loadMoreIfNeeded));E(this.container).on("change",".select2-input",function(e){e.stopPropagation()});E(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()});if(E.fn.mousewheel){o.mousewheel(function(e,t,i,n){var r=o.scrollTop();if(n>0&&r-n<=0){o.scrollTop(0);C(e)}else if(n<0&&o.get(0).scrollHeight-o.scrollTop()+n<=o.height()){o.scrollTop(o.get(0).scrollHeight-o.height());C(e)}})}v(t);t.on("keyup-change input paste",this.bind(this.updateResults));t.on("focus",function(){t.addClass("select2-focused")});t.on("blur",function(){t.removeClass("select2-focused")});this.dropdown.on("mouseup",i,this.bind(function(e){if(E(e.target).closest(".select2-result-selectable").length>0){this.highlightUnderEvent(e);this.selectHighlighted(e)}}));this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){var t=E.Event(e.type+".sortable");e.stopPropagation();E(e.target).trigger(t)});this.nextSearchTerm=_;if(E.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource()}if(e.maximumInputLength!==null){this.search.attr("maxlength",e.maximumInputLength)}var n=e.element.prop("disabled");if(n===_)n=false;this.enable(!n);var r=e.element.prop("readonly");if(r===_)r=false;this.readonly(r);x=x||f();this.autofocus=e.element.prop("autofocus");e.element.prop("autofocus",false);if(this.autofocus)this.focus();this.search.attr("placeholder",e.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,t=e.data("select2"),i=this;this.close();if(e.length&&e[0].detachEvent&&i._sync){e.each(function(){if(i._sync){this.detachEvent("onpropertychange",i._sync)}})}if(this.propertyObserver){this.propertyObserver.disconnect();this.propertyObserver=null}this._sync=null;if(t!==_){t.container.remove();t.liveRegion.remove();t.dropdown.remove();e.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||false);if(this.elementTabIndex){e.attr({tabindex:this.elementTabIndex})}else{e.removeAttr("tabindex")}e.show()}P.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){if(e.is("option")){return{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:p(e.attr("locked"),"locked")||p(e.data("locked"),true)}}else if(e.is("optgroup")){return{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}}},prepareOpts:function(y){var n,e,t,i,b=this;n=y.element;if(n.get(0).tagName.toLowerCase()==="select"){this.select=e=y.element}if(e){E.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in y){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}})}y=E.extend({},{populateResults:function(e,t,h){var g,v=this.opts.id,m=this.liveRegion;g=function(e,t,i){var n,r,o,a,s,l,u,c,d,f;e=y.sortResults(e,t,h);var p=[];for(n=0,r=e.length;n<r;n=n+1){o=e[n];s=o.disabled===true;a=!s&&v(o)!==_;l=o.children&&o.children.length>0;u=E("<li></li>");u.addClass("select2-results-dept-"+i);u.addClass("select2-result");u.addClass(a?"select2-result-selectable":"select2-result-unselectable");if(s){u.addClass("select2-disabled")}if(l){u.addClass("select2-result-with-children")}u.addClass(b.opts.formatResultCssClass(o));u.attr("role","presentation");c=E(document.createElement("div"));c.addClass("select2-result-label");c.attr("id","select2-result-label-"+w());c.attr("role","option");f=y.formatResult(o,c,h,b.opts.escapeMarkup);if(f!==_){c.html(f);u.append(c)}if(l){d=E("<ul></ul>");d.addClass("select2-result-sub");g(o.children,d,i+1);u.append(d)}u.data("select2-data",o);p.push(u[0])}t.append(p);m.text(y.formatMatches(e.length))};g(t,e,0)}},E.fn.select2.defaults,y);if(typeof y.id!=="function"){t=y.id;y.id=function(e){return e[t]}}if(E.isArray(y.element.data("select2Tags"))){if("tags"in y){throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+y.element.attr("id")}y.tags=y.element.data("select2Tags")}if(e){var l=e.hasClass("js-tree-select");y.query=this.bind(function(r){var i={results:[],more:false},o=r.term,e,t,a;e=n.children();if(this.getPlaceholder()!==_&&e.length>0){t=this.getPlaceholderOption();if(t){e=e.not(t)}}if(l){var s=function(e){var n=[];var r=null;e.each2(function(e,t){var i={element:E(t[0]),id:parseInt(t.data("id")),children:[]};if(t.is("option")){if(r&&r.id==parseInt(t.data("parent-id"))){r.children.push(i)}else{r=i;n.push(i)}}else if(t.is("optgroup")){i.children=s(t.children());n.push(i);r=null}});return n};a=function(e,n){e.forEach(function(e){if(e.element.is("option")){var t=[];a(e.children,t);if(r.matcher(o,e.element.text(),e.element)){n.push(E.extend(b.optionToData(e.element),{children:t}))}else if(t.length>0){n.push(E.extend(b.optionToData(e.element),{disabled:true,children:t}))}}else if(e.element.is("optgroup")){var i=b.optionToData(e.element);a(e.children,i.children);if(i.children.length>0){n.push(i)}}})};a(s(e),i.results)}else{a=function(e,t){var i;if(e.is("option")){if(r.matcher(o,e.text(),e)){t.push(b.optionToData(e))}}else if(e.is("optgroup")){i=b.optionToData(e);e.children().each2(function(e,t){a(t,i.children)});if(i.children.length>0){t.push(i)}}};e.each2(function(e,t){a(t,i.results)})}r.callback(i)});y.id=function(e){return e.id}}else{if(!("query"in y)){if("ajax"in y){i=y.element.data("ajax-url");if(i&&i.length>0){y.ajax.url=i}y.query=D.call(y.element,y.ajax)}else if("data"in y){y.query=k(y.data)}else if("tags"in y){y.query=O(y.tags);if(y.createSearchChoice===_){y.createSearchChoice=function(e){return{id:E.trim(e),text:E.trim(e)}}}if(y.initSelection===_){y.initSelection=function(e,t){var i=[];E(h(e.val(),y.separator,y.transformVal)).each(function(){var e={id:this,text:this},t=y.tags;if(E.isFunction(t))t=t();E(t).each(function(){if(p(this.id,e.id)){e=this;return false}});i.push(e)});t(i)}}}}}if(typeof y.query!=="function"){throw"query function not defined for Select2 "+y.element.attr("id")}if(y.createSearchChoicePosition==="top"){y.createSearchChoicePosition=function(e,t){e.unshift(t)}}else if(y.createSearchChoicePosition==="bottom"){y.createSearchChoicePosition=function(e,t){e.push(t)}}else if(typeof y.createSearchChoicePosition!=="function"){throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function"}return y},monitorSource:function(){var i=this.opts.element,e,t=this;i.on("change.select2",this.bind(function(e){if(this.opts.element.data("select2-change-triggered")!==true){this.initSelection()}}));this._sync=this.bind(function(){var e=i.prop("disabled");if(e===_)e=false;this.enable(!e);var t=i.prop("readonly");if(t===_)t=false;this.readonly(t);if(this.container){A(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.addClass(N(this.opts.containerCssClass,this.opts.element))}if(this.dropdown){A(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(N(this.opts.dropdownCssClass,this.opts.element))}});if(i.length&&i[0].attachEvent){i.each(function(){this.attachEvent("onpropertychange",t._sync)})}e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(e!==_){if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null}this.propertyObserver=new e(function(e){E.each(e,t._sync)});this.propertyObserver.observe(i.get(0),{attributes:true,subtree:false})}},triggerSelect:function(e){var t=E.Event("select2-selecting",{val:this.id(e),object:e,choice:e});this.opts.element.trigger(t);return!t.isDefaultPrevented()},triggerChange:function(e){e=e||{};e=E.extend({},e,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",true);this.opts.element.trigger(e);this.opts.element.data("select2-change-triggered",false);this.opts.element.click();if(this.opts.blurOnChange)this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===true},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;if(e===this.enabledInterface)return false;this.container.toggleClass("select2-container-disabled",t);this.close();this.enabledInterface=e;return true},enable:function(e){if(e===_)e=true;if(this._enabled===e)return;this._enabled=e;this.opts.element.prop("disabled",!e);this.enableInterface()},disable:function(){this.enable(false)},readonly:function(e){if(e===_)e=false;if(this._readonly===e)return;this._readonly=e;this.opts.element.prop("readonly",e);this.enableInterface()},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):false},positionDropdown:function(){var e=this.dropdown,t=this.container,i=t.offset(),n=t.outerHeight(false),r=t.outerWidth(false),o=e.outerHeight(false),a=E(window),s=a.width(),l=a.height(),u=a.scrollLeft()+s,c=a.scrollTop()+l,d=i.top+n,f=i.left,p=d+o<=c,h=i.top-o>=a.scrollTop(),g=e.outerWidth(false),v=function(){return f+g<=u},m=function(){return i.left+u+t.outerWidth(false)>g},y=e.hasClass("select2-drop-above"),b,_,w,C,A;if(y){_=true;if(!h&&p){w=true;_=false}}else{_=false;if(!p&&h){w=true;_=true}}if(w){e.hide();i=this.container.offset();n=this.container.outerHeight(false);r=this.container.outerWidth(false);o=e.outerHeight(false);u=a.scrollLeft()+s;c=a.scrollTop()+l;d=i.top+n;f=i.left;g=e.outerWidth(false);e.show();this.focusSearch()}if(this.opts.dropdownAutoWidth){A=E(".select2-results",e)[0];e.addClass("select2-drop-auto-width");e.css("width","");g=e.outerWidth(false)+(A.scrollHeight===A.clientHeight?0:x.width);g>r?r=g:g=r;o=e.outerHeight(false)}else{this.container.removeClass("select2-drop-auto-width")}if(this.body.css("position")!=="static"){b=this.body.offset();d-=b.top;f-=b.left}if(!v()&&m()){f=i.left+this.container.outerWidth(false)-g}C={left:f,width:r};if(_){C.top=i.top-o;C.bottom="auto";this.container.addClass("select2-drop-above");e.addClass("select2-drop-above")}else{C.top=d;C.bottom="auto";this.container.removeClass("select2-drop-above");e.removeClass("select2-drop-above")}C=E.extend(C,N(this.opts.dropdownCss,this.opts.element));e.css(C)},shouldOpen:function(){var e;if(this.opened())return false;if(this._enabled===false||this._readonly===true)return false;e=E.Event("select2-opening");this.opts.element.trigger(e);return!e.isDefaultPrevented()},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return false;this.opening();o.on("mousemove.select2Event",function(e){r.x=e.pageX;r.y=e.pageY});return true},opening:function(){var e=this.containerEventName,t="scroll."+e,i="resize."+e,n="orientationchange."+e,r;this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.clearDropdownAlignmentPreference();if(this.dropdown[0]!==this.body.children().last()[0]){this.dropdown.detach().appendTo(this.body)}r=E("#select2-drop-mask");if(r.length===0){r=E(document.createElement("div"));r.attr("id","select2-drop-mask").attr("class","select2-drop-mask");r.hide();r.appendTo(this.body);r.on("mousedown touchstart click",function(e){u(r);var t=E("#select2-drop"),i;if(t.length>0){i=t.data("select2");if(i.opts.selectOnBlur){i.selectHighlighted({noFocus:true})}i.close();e.preventDefault();e.stopPropagation()}})}if(this.dropdown.prev()[0]!==r[0]){this.dropdown.before(r)}E("#select2-drop").removeAttr("id");this.dropdown.attr("id","select2-drop");r.show();this.positionDropdown();this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each(function(){E(this).on(i+" "+t+" "+n,function(e){if(o.opened())o.positionDropdown()})})},close:function(){if(!this.opened())return;var e=this.containerEventName,t="scroll."+e,i="resize."+e,n="orientationchange."+e;this.container.parents().add(window).each(function(){E(this).off(t).off(i).off(n)});this.clearDropdownAlignmentPreference();E("#select2-drop-mask").hide();this.dropdown.removeAttr("id");this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();o.off("mousemove.select2Event");this.clearSearch();this.search.removeClass("select2-active");this.opts.element.trigger(E.Event("select2-close"))},externalSearch:function(e){this.open();this.search.val(e);this.updateResults(false)},clearSearch:function(){},getMaximumSelectionSize:function(){return N(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var e=this.results,t,i,n,r,o,a,s,l;i=this.highlight();if(i<0)return;if(i==0){e.scrollTop(0);return}t=this.findHighlightableChoices().find(".select2-result-label");n=E(t[i]);l=(n.offset()||{}).top||0;r=l+n.outerHeight(true);if(i===t.length-1){s=e.find("li.select2-more-results");if(s.length>0){r=s.offset().top+s.outerHeight(true)}}o=e.offset().top+e.outerHeight(false);if(r>o){e.scrollTop(e.scrollTop()+(r-o))}a=l-e.offset().top;if(a<0&&n.css("display")!="none"){e.scrollTop(e.scrollTop()+a)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(e){var t=this.findHighlightableChoices(),i=this.highlight();while(i>-1&&i<t.length){i+=e;var n=E(t[i]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(e){var t=this.findHighlightableChoices(),i,n;if(arguments.length===0){return d(t.filter(".select2-highlighted")[0],t.get())}if(e>=t.length)e=t.length-1;if(e<0)e=0;this.removeHighlight();i=E(t[e]);i.addClass("select2-highlighted");this.search.attr("aria-activedescendant",i.find(".select2-result-label").attr("id"));this.ensureHighlightVisible();this.liveRegion.text(i.text());n=i.data("select2-data");if(n){this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})}},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=true},clearTouchMoved:function(){this._touchMoved=false},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(e){var t=E(e.target).closest(".select2-result-selectable");if(t.length>0&&!t.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(t))}else if(t.length==0){this.removeHighlight()}},loadMoreIfNeeded:function(){var t=this.results,i=t.find("li.select2-more-results"),e,n=this.resultsPage+1,r=this,o=this.search.val(),a=this.context;if(i.length===0)return;e=i.offset().top-t.offset().top-t.height();if(e<=this.opts.loadMorePadding){i.addClass("select2-active");this.opts.query({element:this.opts.element,term:o,page:n,context:a,matcher:this.opts.matcher,callback:this.bind(function(e){if(!r.opened())return;r.opts.populateResults.call(this,t,e.results,{term:o,page:n,context:a});r.postprocessResults(e,false,false);if(e.more===true){i.detach().appendTo(t).html(r.opts.escapeMarkup(N(r.opts.formatLoadMore,r.opts.element,n+1)));window.setTimeout(function(){r.loadMoreIfNeeded()},10)}else{i.remove()}r.positionDropdown();r.resultsPage=n;r.context=e.context;this.opts.element.trigger({type:"select2-loaded",items:e})})})}},tokenize:function(){},updateResults:function(i){var n=this.search,r=this.results,o=this.opts,e,a=this,t,s=n.val(),l=E.data(this.container,"select2-last-term"),u;if(i!==true&&l&&p(s,l))return;E.data(this.container,"select2-last-term",s);if(i!==true&&(this.showSearchInput===false||!this.opened())){return}function c(){n.removeClass("select2-active");a.positionDropdown();if(r.find(".select2-no-results,.select2-selection-limit,.select2-searching").length){a.liveRegion.text(r.text())}else{a.liveRegion.text(a.opts.formatMatches(r.find('.select2-result-selectable:not(".select2-selected")').length))}}function d(e){r.html(e);c()}u=++this.queryCount;var f=this.getMaximumSelectionSize();if(f>=1){e=this.data();if(E.isArray(e)&&e.length>=f&&R(o.formatSelectionTooBig,"formatSelectionTooBig")){d("<li class='select2-selection-limit'>"+N(o.formatSelectionTooBig,o.element,f)+"</li>");return}}if(n.val().length<o.minimumInputLength){if(R(o.formatInputTooShort,"formatInputTooShort")){d("<li class='select2-no-results'>"+N(o.formatInputTooShort,o.element,n.val(),o.minimumInputLength)+"</li>")}else{d("")}if(i&&this.showSearch)this.showSearch(true);return}if(o.maximumInputLength&&n.val().length>o.maximumInputLength){if(R(o.formatInputTooLong,"formatInputTooLong")){d("<li class='select2-no-results'>"+N(o.formatInputTooLong,o.element,n.val(),o.maximumInputLength)+"</li>")}else{d("")}return}if(o.formatSearching&&this.findHighlightableChoices().length===0){d("<li class='select2-searching'>"+N(o.formatSearching,o.element)+"</li>")}n.addClass("select2-active");this.removeHighlight();t=this.tokenize();if(t!=_&&t!=null){n.val(t)}this.resultsPage=1;o.query({element:o.element,term:n.val(),page:this.resultsPage,context:null,matcher:o.matcher,callback:this.bind(function(e){var t;if(u!=this.queryCount){return}if(!this.opened()){this.search.removeClass("select2-active");return}if(e.hasError!==_&&R(o.formatAjaxError,"formatAjaxError")){d("<li class='select2-ajax-error'>"+N(o.formatAjaxError,o.element,e.jqXHR,e.textStatus,e.errorThrown)+"</li>");return}this.context=e.context===_?null:e.context;if(this.opts.createSearchChoice&&n.val()!==""){t=this.opts.createSearchChoice.call(a,n.val(),e.results);if(t!==_&&t!==null&&a.id(t)!==_&&a.id(t)!==null){if(E(e.results).filter(function(){return p(a.id(this),a.id(t))}).length===0){this.opts.createSearchChoicePosition(e.results,t)}}}if(e.results.length===0&&R(o.formatNoMatches,"formatNoMatches")){d("<li class='select2-no-results'>"+N(o.formatNoMatches,o.element,n.val())+"</li>");return}r.empty();a.opts.populateResults.call(this,r,e.results,{term:n.val(),page:this.resultsPage,context:null});if(e.more===true&&R(o.formatLoadMore,"formatLoadMore")){r.append("<li class='select2-more-results'>"+o.escapeMarkup(N(o.formatLoadMore,o.element,this.resultsPage))+"</li>");window.setTimeout(function(){a.loadMoreIfNeeded()},10)}this.postprocessResults(e,i);c();this.opts.element.trigger({type:"select2-loaded",items:e})})})},cancel:function(){this.close()},blur:function(){if(this.opts.selectOnBlur)this.selectHighlighted({noFocus:true});this.close();this.container.removeClass("select2-container-active");if(this.search[0]===document.activeElement){this.search.blur()}this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){L(this.search)},selectHighlighted:function(e){if(this._touchMoved){this.clearTouchMoved();return}var t=this.highlight(),i=this.results.find(".select2-highlighted"),n=i.closest(".select2-result").data("select2-data");if(n){this.highlight(t);this.onSelect(n,e)}else if(e&&e.noFocus){this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==_?e.text():_)},getPlaceholderOption:function(){if(this.select){var e=this.select.children("option").first();if(this.opts.placeholderOption!==_){return this.opts.placeholderOption==="first"&&e||typeof this.opts.placeholderOption==="function"&&this.opts.placeholderOption(this.select)}else if(E.trim(e.text())===""&&e.val()===""){return e}}},initContainerWidth:function(){function e(){var e,t,i,n,r,o;if(this.opts.width==="off"){return null}else if(this.opts.width==="element"){return this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px"}else if(this.opts.width==="copy"||this.opts.width==="resolve"){e=this.opts.element.attr("style");if(e!==_){t=e.split(";");for(n=0,r=t.length;n<r;n=n+1){o=t[n].replace(/\s/g,"");i=o.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(i!==null&&i.length>=1)return i[1]}}if(this.opts.width==="resolve"){e=this.opts.element.css("width");if(e.indexOf("%")>0)return e;return this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px"}return null}else if(E.isFunction(this.opts.width)){return this.opts.width()}else{return this.opts.width}}var t=e.call(this);if(t!==null){this.container.css("width",t)}}});t=M(e,{createContainer:function(){var e=E(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""));return e},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.focusser.prop("disabled",!this.isInterfaceEnabled())}},opening:function(){var e,t,i;if(this.opts.minimumResultsForSearch>=0){this.showSearch(true)}this.parent.opening.apply(this,arguments);if(this.showSearchInput!==false){this.search.val(this.focusser.val())}if(this.opts.shouldFocusInput(this)){this.search.focus();e=this.search.get(0);if(e.createTextRange){t=e.createTextRange();t.collapse(false);t.select()}else if(e.setSelectionRange){i=this.search.val().length;e.setSelectionRange(i,i)}}if(this.search.val()===""){if(this.nextSearchTerm!=_){this.search.val(this.nextSearchTerm);this.search.select()}}this.focusser.prop("disabled",true).val("");this.updateResults(true);this.opts.element.trigger(E.Event("select2-open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}},focus:function(){if(this.opened()){this.close()}else{this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}}},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}},destroy:function(){E("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);P.call(this,"selection","focusser")},initContainer:function(){var t,e=this.container,i=this.dropdown,n=w(),r;if(this.opts.minimumResultsForSearch<0){this.showSearch(false)}else{this.showSearch(true)}this.selection=t=e.find(".select2-choice");this.focusser=e.find(".select2-focusser");t.find(".select2-chosen").attr("id","select2-chosen-"+n);this.focusser.attr("aria-labelledby","select2-chosen-"+n);this.results.attr("id","select2-results-"+n);this.search.attr("aria-owns","select2-results-"+n);this.focusser.attr("id","s2id_autogen"+n);r=E("label[for='"+this.opts.element.attr("id")+"']");this.opts.element.focus(this.bind(function(){this.focus()}));this.focusser.prev().text(r.text()).attr("for",this.focusser.attr("id"));var o=this.opts.element.attr("title");this.opts.element.attr("title",o||r.text());this.focusser.attr("tabindex",this.elementTabIndex);this.search.attr("id",this.focusser.attr("id")+"_search");this.search.prev().text(E("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id"));this.search.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;if(229==e.keyCode)return;if(e.which===s.PAGE_UP||e.which===s.PAGE_DOWN){C(e);return}switch(e.which){case s.UP:case s.DOWN:this.moveHighlight(e.which===s.UP?-1:1);C(e);return;case s.ENTER:this.selectHighlighted();C(e);return;case s.TAB:this.selectHighlighted({noFocus:true});return;case s.ESC:this.cancel(e);C(e);return}}));this.search.on("blur",this.bind(function(e){if(document.activeElement===this.body.get(0)){window.setTimeout(this.bind(function(){if(this.opened()){this.search.focus()}}),0)}}));this.focusser.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;if(e.which===s.TAB||s.isControl(e)||s.isFunctionKey(e)||e.which===s.ESC){return}if(this.opts.openOnEnter===false&&e.which===s.ENTER){C(e);return}if(e.which==s.DOWN||e.which==s.UP||e.which==s.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;this.open();C(e);return}if(e.which==s.DELETE||e.which==s.BACKSPACE){if(this.opts.allowClear){this.clear()}C(e);return}}));v(this.focusser);this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){e.stopPropagation();if(this.opened())return;this.open()}}));t.on("mousedown touchstart","abbr",this.bind(function(e){if(!this.isInterfaceEnabled()){return}this.clear();G(e);this.close();if(this.selection){this.selection.focus()}}));t.on("mousedown touchstart",this.bind(function(e){u(t);if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(E.Event("select2-focus"))}if(this.opened()){this.close()}else if(this.isInterfaceEnabled()){this.open()}C(e)}));i.on("mousedown touchstart",this.bind(function(){if(this.opts.shouldFocusInput(this)){this.search.focus()}}));t.on("focus",this.bind(function(e){C(e)}));this.focusser.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(E.Event("select2-focus"))}this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active");this.opts.element.trigger(E.Event("select2-blur"))}}));this.search.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(E.Event("select2-focus"))}this.container.addClass("select2-container-active")}));this.initContainerWidth();this.opts.element.hide();this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");if(t){var i=E.Event("select2-clearing");this.opts.element.trigger(i);if(i.isDefaultPrevented()){return}var n=this.getPlaceholderOption();this.opts.element.val(n?n.val():"");this.selection.find(".select2-chosen").empty();this.selection.removeData("select2-data");this.setPlaceholder();if(e!==false){this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t});this.triggerChange({removed:t})}}},initSelection:function(){var e;if(this.isPlaceholderOptionSelected()){this.updateSelection(null);this.close();this.setPlaceholder()}else{var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){if(e!==_&&e!==null){t.updateSelection(e);t.close();t.setPlaceholder();t.nextSearchTerm=t.opts.nextSearchTerm(e,t.search.val())}})}},isPlaceholderOptionSelected:function(){var e;if(this.getPlaceholder()===_)return false;return(e=this.getPlaceholderOption())!==_&&e.prop("selected")||this.opts.element.val()===""||this.opts.element.val()===_||this.opts.element.val()===null},prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments),n=this;if(a.element.get(0).tagName.toLowerCase()==="select"){a.initSelection=function(e,t){var i=e.find("option").filter(function(){return this.selected&&!this.disabled});t(n.optionToData(i))}}else if("data"in a){a.initSelection=a.initSelection||function(e,t){var r=e.val();var o=null;a.query({matcher:function(e,t,i){var n=p(r,a.id(i));if(n){o=i}return n},callback:!E.isFunction(t)?E.noop:function(){t(o)}})}}return a},getPlaceholder:function(){if(this.select){if(this.getPlaceholderOption()===_){return _}}return this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==_){if(this.select&&this.getPlaceholderOption()===_)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e));this.selection.addClass("select2-default");this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var n=0,r=this,o=true;this.findHighlightableChoices().each2(function(e,t){if(p(r.id(t.data("select2-data")),r.opts.element.val())){n=e;return false}});if(i!==false){if(t===true&&n>=0){this.highlight(n)}else{this.highlight(0)}}if(t===true){var a=this.opts.minimumResultsForSearch;if(a>=0){this.showSearch(I(e.results)>=a)}}},showSearch:function(e){if(this.showSearchInput===e)return;this.showSearchInput=e;this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!e);this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!e);E(this.dropdown,this.container).toggleClass("select2-with-searchbox",e)},onSelect:function(e,t){if(!this.triggerSelect(e)){return}var i=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e));this.updateSelection(e);this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e});this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val());this.close();if((!t||!t.noFocus)&&this.opts.shouldFocusInput(this)){this.focusser.focus()}if(!p(i,this.id(e))){this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var t=this.selection.find(".select2-chosen"),i,n;this.selection.data("select2-data",e);t.empty();if(e!==null){i=this.opts.formatSelection(e,t,this.opts.escapeMarkup);t.prop("title",E(e.element).prop("title")||e.text)}if(i!==_){t.append(i)}n=this.opts.formatSelectionCssClass(e,t);if(n!==_){t.addClass(n)}this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==_){this.container.addClass("select2-allowclear")}},val:function(){var e,t=false,i=null,n=this,r=this.data();if(arguments.length===0){return this.opts.element.val()}e=arguments[0];if(arguments.length>1){t=arguments[1]}if(this.select){this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){i=n.optionToData(t);return false});this.updateSelection(i);this.setPlaceholder();if(t){this.triggerChange({added:i,removed:r})}}else{if(!e&&e!==0){this.clear(t);return}if(this.opts.initSelection===_){throw new Error("cannot call val() if initSelection() is not defined")}this.opts.element.val(e);this.opts.initSelection(this.opts.element,function(e){n.opts.element.val(!e?"":n.id(e));n.updateSelection(e);n.setPlaceholder();if(t){n.triggerChange({added:e,removed:r})}})}},clearSearch:function(){this.search.val("");this.focusser.val("")},data:function(e){var t,i=false;if(arguments.length===0){t=this.selection.data("select2-data");if(t==_)t=null;return t}else{if(arguments.length>1){i=arguments[1]}if(!e){this.clear(i)}else{t=this.data();this.opts.element.val(!e?"":this.id(e));this.updateSelection(e);if(i){this.triggerChange({added:e,removed:t})}}}}});i=M(e,{createContainer:function(){var e=E(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return e},prepareOpts:function(){var l=this.parent.prepareOpts.apply(this,arguments),n=this;if(l.element.get(0).tagName.toLowerCase()==="select"){l.initSelection=function(e,t){var i=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){i.push(n.optionToData(t))});t(i)}}else if("data"in l){l.initSelection=l.initSelection||function(e,o){var a=h(e.val(),l.separator,l.transformVal);var s=[];l.query({matcher:function(e,t,i){var n=E.grep(a,function(e){return p(e,l.id(i))}).length;if(n){s.push(i)}return n},callback:!E.isFunction(o)?E.noop:function(){var e=[];for(var t=0;t<a.length;t++){var i=a[t];for(var n=0;n<s.length;n++){var r=s[n];if(p(i,l.id(r))){e.push(r);s.splice(n,1);break}}}o(e)}})}}return l},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");if(t.length&&e&&e[0]==t[0]){}else{if(t.length){this.opts.element.trigger("choice-deselected",t)}t.removeClass("select2-search-choice-focus");if(e&&e.length){this.close();e.addClass("select2-search-choice-focus");this.opts.element.trigger("choice-selected",e)}}},destroy:function(){E("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);P.call(this,"searchContainer","selection")},initContainer:function(){var e=".select2-choices",a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(e);var t=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(e){t.search[0].focus();t.selectChoice(E(this))});this.search.attr("id","s2id_autogen"+w());this.search.prev().text(E("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id"));this.opts.element.focus(this.bind(function(){this.focus()}));this.search.on("input paste",this.bind(function(){if(this.search.attr("placeholder")&&this.search.val().length==0)return;if(!this.isInterfaceEnabled())return;if(!this.opened()){this.open()}}));this.search.attr("tabindex",this.elementTabIndex);this.keydowns=0;this.search.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;++this.keydowns;var t=a.find(".select2-search-choice-focus");var i=t.prev(".select2-search-choice:not(.select2-locked)");var n=t.next(".select2-search-choice:not(.select2-locked)");var r=F(this.search);if(t.length&&(e.which==s.LEFT||e.which==s.RIGHT||e.which==s.BACKSPACE||e.which==s.DELETE||e.which==s.ENTER)){var o=t;if(e.which==s.LEFT&&i.length){o=i}else if(e.which==s.RIGHT){o=n.length?n:null}else if(e.which===s.BACKSPACE){if(this.unselect(t.first())){this.search.width(10);o=i.length?i:n}}else if(e.which==s.DELETE){if(this.unselect(t.first())){this.search.width(10);o=n.length?n:null}}else if(e.which==s.ENTER){o=null}this.selectChoice(o);C(e);if(!o||!o.length){this.open()}return}else if((e.which===s.BACKSPACE&&this.keydowns==1||e.which==s.LEFT)&&(r.offset==0&&!r.length)){this.selectChoice(a.find(".select2-search-choice:not(.select2-locked)").last());C(e);return}else{this.selectChoice(null)}if(this.opened()){switch(e.which){case s.UP:case s.DOWN:this.moveHighlight(e.which===s.UP?-1:1);C(e);return;case s.ENTER:this.selectHighlighted();C(e);return;case s.TAB:this.selectHighlighted({noFocus:true});this.close();return;case s.ESC:this.cancel(e);C(e);return}}if(e.which===s.TAB||s.isControl(e)||s.isFunctionKey(e)||e.which===s.BACKSPACE||e.which===s.ESC){return}if(e.which===s.ENTER){if(this.opts.openOnEnter===false){return}else if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}}this.open();if(e.which===s.PAGE_UP||e.which===s.PAGE_DOWN){C(e)}if(e.which===s.ENTER){C(e)}}));this.search.on("keyup",this.bind(function(e){this.keydowns=0;this.resizeSearch()}));this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.selectChoice(null);if(!this.opened())this.clearSearch();e.stopImmediatePropagation();this.opts.element.trigger(E.Event("select2-blur"))}));this.container.on("click",e,this.bind(function(e){if(!this.isInterfaceEnabled())return;if(E(e.target).closest(".select2-search-choice").length>0){return}this.selectChoice(null);this.clearPlaceholder();if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(E.Event("select2-focus"))}this.open();this.focusSearch();e.preventDefault()}));this.container.on("focus",e,this.bind(function(){if(!this.isInterfaceEnabled())return;if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(E.Event("select2-focus"))}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder()}));this.initContainerWidth();this.opts.element.hide();this.clearSearch()},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.search.prop("disabled",!this.isInterfaceEnabled())}},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()===""){this.updateSelection([]);this.close();this.clearSearch()}if(this.select||this.opts.element.val()!==""){var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){if(e!==_&&e!==null){t.updateSelection(e);t.close();t.clearSearch()}})}},clearSearch:function(){var e=this.getPlaceholder(),t=this.getMaxSearchWidth();if(e!==_&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(e).addClass("select2-default");this.search.width(t>0?t:this.container.css("width"))}else{this.search.val("").width(10)}},clearPlaceholder:function(){if(this.search.hasClass("select2-default")){this.search.val("").removeClass("select2-default")}},opening:function(){this.clearPlaceholder();this.resizeSearch();this.parent.opening.apply(this,arguments);this.focusSearch();if(this.search.val()===""){if(this.nextSearchTerm!=_){this.search.val(this.nextSearchTerm);this.search.select()}}this.updateResults(true);if(this.opts.shouldFocusInput(this)){this.search.focus()}this.opts.element.trigger(E.Event("select2-open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(e){var t=[],i=[],n=this;E(e).each(function(){if(d(n.id(this),t)<0){t.push(n.id(this));i.push(this)}});e=i;this.selection.find(".select2-search-choice").remove();E(e).each(function(){n.addSelectedChoice(this)});n.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts);if(e!=null&&e!=_){this.search.val(e);if(e.length>0){this.open()}}},onSelect:function(e,t){if(!this.triggerSelect(e)||e.text===""){return}this.addSelectedChoice(e);this.opts.element.trigger({type:"selected",val:this.id(e),choice:e});this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val());this.clearSearch();this.updateResults();if(this.select||!this.opts.closeOnSelect)this.postprocessResults(e,false,this.opts.closeOnSelect===true);if(this.opts.closeOnSelect){this.close();this.search.width(10)}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch();if(this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()){this.updateResults(true)}else{if(this.nextSearchTerm!=_){this.search.val(this.nextSearchTerm);this.updateResults();this.search.select()}}this.positionDropdown()}else{this.close();this.search.width(10)}}this.triggerChange({added:e});if(!t||!t.noFocus)this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(e){var t=!e.locked,i=E("<li class='select2-search-choice'>"+"    <div></div>"+"    <a href='#' class='select2-search-choice-close' tabindex='-1'></a>"+"</li>"),n=E("<li class='select2-search-choice select2-locked'>"+"<div></div>"+"</li>");var r=t?i:n,o=this.id(e),a=this.getVal(),s,l;s=this.opts.formatSelection(e,r.find("div"),this.opts.escapeMarkup);if(s!=_){r.find("div").replaceWith(E("<div></div>").html(s))}if(this.opts.inlineTags){r.addClass("select2-search-choice-inlined")}l=this.opts.formatSelectionCssClass(e,r.find("div"));if(l!=_){r.addClass(l)}if(t){r.find(".select2-search-choice-close").on("mousedown",C).on("click dblclick",this.bind(function(e){if(!this.isInterfaceEnabled())return;this.unselect(E(e.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");C(e);this.close();this.focusSearch()})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled())return;this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active")}))}r.data("select2-data",e);r.insertBefore(this.searchContainer);a.push(o);this.setVal(a)},unselect:function(e){var t=this.getVal(),i,n;e=e.closest(".select2-search-choice");if(e.length===0){throw"Invalid argument: "+e+". Must be .select2-search-choice"}i=e.data("select2-data");if(!i){return}var r=E.Event("select2-removing");r.val=this.id(i);r.choice=i;this.opts.element.trigger(r);if(r.isDefaultPrevented()){return false}while((n=d(this.id(i),t))>=0){t.splice(n,1);this.setVal(t);if(this.select)this.postprocessResults()}e.remove();this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i});this.triggerChange({removed:i});return true},postprocessResults:function(e,t,i){var n=this.getVal(),r=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),a=this;r.each2(function(e,t){var i=a.id(t.data("select2-data"));if(d(i,n)>=0){if(t.is("optgroup")){t.addClass("select2-selected");t.find(".select2-result-selectable").addClass("select2-selected")}else{if(t.find(".select2-result-selectable").length>0){t.addClass("select2-disabled")}else{t.addClass("select2-selected")}}}});o.each2(function(e,t){if(t.find(".select2-result-selectable:not(.select2-selected)").length===0){if(!t.is(".select2-result-selectable")||t.is(".select2-disabled")){t.addClass("select2-selected")}}});if(this.highlight()==-1&&i!==false&&this.opts.closeOnSelect===true){a.highlight(0)}if(!this.opts.createSearchChoice&&!r.filter(".select2-result:not(.select2-selected)").length>0){if(!e||e&&!e.more&&this.results.find(".select2-no-results").length===0){if(R(a.opts.formatNoMatches,"formatNoMatches")){this.results.append("<li class='select2-no-results'>"+N(a.opts.formatNoMatches,a.opts.element,a.search.val())+"</li>")}}}},getMaxSearchWidth:function(){return this.selection.width()-g(this.search)},resizeSearch:function(){var e,t,i,n,r,o=g(this.search);e=$(this.search)+10;t=this.search.offset().left;i=this.selection.width();n=this.selection.offset().left;r=i-(t-n)-o;if(r<e){r=i-o}if(r<40){r=i-o}if(r<=0){r=e}this.search.width(Math.floor(r))},getVal:function(){var e;if(this.select){e=this.select.val();return e===null?[]:e}else{e=this.opts.element.val();return h(e,this.opts.separator,this.opts.transformVal)}},setVal:function(e){var t;if(this.select){this.select.val(e)}else{t=[];E(e).each(function(){if(d(this,t)<0)t.push(this)});this.opts.element.val(t.length===0?"":t.join(this.opts.separator))}},buildChangeDetails:function(e,t){var t=t.slice(0),e=e.slice(0);for(var i=0;i<t.length;i++){for(var n=0;n<e.length;n++){if(p(this.opts.id(t[i]),this.opts.id(e[n]))){t.splice(i,1);if(i>0){i--}e.splice(n,1);n--}}}return{added:t,removed:e}},val:function(e,i){var n,r=this;if(arguments.length===0){return this.getVal()}n=this.data();if(!n.length)n=[];if(!e&&e!==0){this.opts.element.val("");this.updateSelection([]);this.clearSearch();if(i){this.triggerChange({added:this.data(),removed:n})}return}this.setVal(e);if(this.select){this.opts.initSelection(this.select,this.bind(this.updateSelection));if(i){this.triggerChange(this.buildChangeDetails(n,this.data()))}}else{if(this.opts.initSelection===_){throw new Error("val() cannot be called if initSelection() is not defined")}this.opts.initSelection(this.opts.element,function(e){var t=E.map(e,r.id);r.setVal(t);r.updateSelection(e);r.clearSearch();if(i){r.triggerChange(r.buildChangeDetails(n,r.data()))}})}this.clearSearch()},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.")}this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var e=[],t=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){e.push(t.opts.id(E(this).data("select2-data")))});this.setVal(e);this.triggerChange()},data:function(e,t){var i=this,n,r;if(arguments.length===0){return this.selection.children(".select2-search-choice").map(function(){return E(this).data("select2-data")}).get()}else{r=this.data();if(!e){e=[]}n=E.map(e,function(e){return i.opts.id(e)});this.setVal(n);this.updateSelection(e);this.clearSearch();if(t){this.triggerChange(this.buildChangeDetails(r,this.data()))}}}});E.fn.select2=function(){var e=Array.prototype.slice.call(arguments,0),t,i,n,r,o,a=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],s=["opened","isFocused","container","dropdown"],l=["val","data"],u={search:"externalSearch"};this.each(function(){if(e.length===0||typeof e[0]==="object"){t=e.length===0?{}:E.extend({},e[0]);t.element=E(this);if(t.element.get(0).tagName.toLowerCase()==="select"){o=t.element.prop("multiple")}else{o=t.multiple||false;if("tags"in t){t.multiple=o=true}}i=o?new window.Select2["class"].multi:new window.Select2["class"].single;i.init(t)}else if(typeof e[0]==="string"){if(d(e[0],a)<0){throw"Unknown method: "+e[0]}r=_;i=E(this).data("select2");if(i===_)return;n=e[0];if(n==="container"){r=i.container}else if(n==="dropdown"){r=i.dropdown}else{if(u[n])n=u[n];r=i[n].apply(i,e.slice(1))}if(d(e[0],s)>=0||d(e[0],l)>=0&&e.length==1){return false}}else{throw"Invalid arguments to select2 plugin: "+e}});return r===_?this:r};E.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,i,n){var r=[];T(this.text(e),i.term,r,n);return r.join("")},transformVal:function(e){return E.trim(e)},formatSelection:function(e,t,i){return e?i(this.text(e)):_},sortResults:function(e,t,i){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,t){return _},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==_?null:e.id},text:function(e){if(e&&this.data&&this.data.text){if(E.isFunction(this.data.text)){return this.data.text(e)}else{return e[this.data.text]}}else{return e.text}},matcher:function(e,t){return c(""+t).toUpperCase().indexOf(c(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:W,escapeMarkup:S,blurOnChange:false,selectOnBlur:false,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,t){return _},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){var t="ontouchstart"in window||navigator.msMaxTouchPoints>0;if(!t){return true}if(e.opts.minimumResultsForSearch<0){return false}return true}};E.fn.select2.locales=[];E.fn.select2.locales["en"]={formatMatches:function(e){if(e===1){return"One result is available, press enter to select it."}return e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(e,t,i){return"Loading failed"},formatInputTooShort:function(e,t){var i=t-e.length;return"Please enter "+i+" or more character"+(i==1?"":"s")},formatInputTooLong:function(e,t){var i=e.length-t;return"Please delete "+i+" character"+(i==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatSearching:function(){return"Searching…"}};E.extend(E.fn.select2.defaults,E.fn.select2.locales["en"]);E.fn.select2.ajaxDefaults={transport:E.ajax,params:{type:"GET",cache:false,dataType:"json"}};window.Select2={query:{ajax:D,local:k,tags:O},util:{debounce:y,markMatch:T,escapeMarkup:S,stripDiacritics:c},class:{abstract:e,single:t,multi:i}}})(jQuery);var EndlessScroll;EndlessScroll=function(){var n;e.name="EndlessScroll";n={bottomPixels:50,fireOnce:true,fireDelay:150,loader:"Loading...",content:"",insertAfter:"div:last",intervalFrequency:250,resetCounter:function(){return false},callback:function(){return true},ceaseFire:function(){return false}};function e(e,t){var i=this;this.options=$.extend({},n,t);this.firing=true;this.fired=false;this.fireSequence=0;this.didScroll=false;this.isScrollable=true;this.target=e;this.targetId="";this.content="";this.innerWrap=$(".endless_scroll_inner_wrap",this.target);if(this.options.data){this.options.content=this.options.data}$(e).scroll(function(){i.didScroll=true;i.target=e;return i.targetId=$(i.target).attr("id")})}e.prototype.run=function(){var e=this;return setInterval(function(){if(e.shouldTryFiring()){e.didScroll=false;if(e.ceaseFireWhenNecessary()){return}if(e.shouldBeFiring()){e.resetFireSequenceWhenNecessary();e.acknowledgeFiring();e.insertLoader();if(e.hasContent()){e.showContent();e.fireCallback();e.delayFireingWhenNecessary()}return e.removeLoader()}}},this.options.intervalFrequency)};e.prototype.shouldTryFiring=function(){return this.didScroll&&this.firing===true};e.prototype.ceaseFireWhenNecessary=function(){if(this.options.ceaseFire.apply(this.target,[this.fireSequence])){this.firing=false;return true}else{return false}};e.prototype.wrapContainer=function(){if(this.innerWrap.length===0){return this.innerWrap=$(this.target).wrapInner('<div class="endless_scroll_inner_wrap" />').find(".endless_scroll_inner_wrap")}};e.prototype.isScrollableOrNot=function(){if(this.target===document||this.target===window){return this.isScrollable=$(document).height()-$(window).height()<=$(window).scrollTop()+this.options.bottomPixels}else{this.wrapContainer();return this.isScrollable=this.innerWrap.length>0&&this.innerWrap.height()-$(this.target).height()<=$(this.target).scrollTop()+this.options.bottomPixels}};e.prototype.shouldBeFiring=function(){this.isScrollableOrNot();return this.isScrollable&&(this.options.fireOnce===false||this.options.fireOnce===true&&this.fired!==true)};e.prototype.resetFireSequenceWhenNecessary=function(){if(this.options.resetCounter.apply(this.target)===true){return this.fireSequence=0}};e.prototype.acknowledgeFiring=function(){this.fired=true;return this.fireSequence++};e.prototype.insertLoader=function(){return $(this.options.insertAfter).after('<div class="endless_scroll_loader_'+this.targetId+' endless_scroll_loader">'+this.options.loader+"</div>")};e.prototype.removeLoader=function(){return $(".endless_scroll_loader_"+this.targetId).fadeOut(function(){return $(this).remove()})};e.prototype.hasContent=function(){if(typeof this.options.content==="function"){this.content=this.options.content.apply(this.target,[this.fireSequence])}else{this.content=this.options.content}return this.content!==false};e.prototype.showContent=function(){$(this.options.insertAfter).after('<div id="endless_scroll_content">'+this.content+"</div>");return $("#endless_scroll_content").hide().fadeIn(250,function(){return $(this).removeAttr("id")})};e.prototype.fireCallback=function(){return this.options.callback.apply(this.target,[this.fireSequence])};e.prototype.delayFireingWhenNecessary=function(){var e=this;if(this.options.fireDelay>0){$("body").after('<div id="endless_scroll_marker"></div>');return $("#endless_scroll_marker").fadeTo(this.options.fireDelay,1,function(){$("#endless_scroll_marker").remove();return e.fired=false})}else{return this.fired=false}};return e}();(function(e){return e.fn.endlessScroll=function(e){return new EndlessScroll(this,e).run()}})(jQuery);(function(u){var n=[];var e="dirty";var i="clean";var c="dirtyInitialValue";var l="isDirty";var r=function(t){var i;n.forEach(function(e){if(e.id===t){i=e}});return i};const o=function(t){n=n.filter(function(e){return e!==t});t.isDirty=false};var t=function(t){t.form.on("submit",function(){t.submitting=true});if(t.options.preventLeaving){u(window).on("beforeunload",function(e){if(t.isDirty&&!t.submitting){e.preventDefault();return t.options.leavingMessage}})}};var a=function(t){t.form.find("input, select, textarea").on("change.dirty click.dirty keyup.dirty keydown.dirty blur.dirty",function(e){t.checkValues(e)});t.form.on("dirty",function(){t.options.onDirty()});t.form.on("clean",function(){t.options.onClean()})};var s=function(e){e.form.find("input, select, textarea").off("change.dirty click.dirty keyup.dirty keydown.dirty blur.dirty");e.form.off("dirty");e.form.off("clean")};var d=function(e,t){this.form=e;this.isDirty=false;this.options=t;this.history=[i,i];this.id=u(e).attr("id");n.push(this)};d.prototype={init:function(){this.saveInitialValues();this.setEvents()},statuses:{dirty:e,clean:i,dataInitialValue:c,dataIsDirty:l},isRadioOrCheckbox:function(e){return u(e).is(":radio, :checkbox")},isFileInput:function(e){return u(e).is(":file")},saveInitialValues:function(){var o=this;this.form.find("input, select, textarea").each(function(e,t){var i=o.isRadioOrCheckbox(t);var n=o.isFileInput(t);if(i){var r=u(t).is(":checked")?"checked":"unchecked";u(t).data(c,r)}else if(n){u(t).data(c,JSON.stringify(t.files))}else{u(t).data(c,u(t).val()||"")}})},refreshEvents:function(){var e=this;s(e);a(e)},showDirtyFields:function(){var e=this;return e.form.find("input, select, textarea").filter(function(e,t){return u(t).data(l)})},setEvents:function(){var e=this;t(e);a(e)},isFieldDirty:function(e){var t=e.data(c);if(t==null){t=""}var i=e.val();if(i==null){i=""}var n=/^(true|false)$/i;var r=n.test(t)&&n.test(i);if(r){var o=new RegExp("^"+t+"$","i");return!o.test(i)}return i!==t},isFileInputDirty:function(e){var t=e.data(c);var i=e[0];var n=JSON.stringify(i.files);return n!==t},isCheckboxDirty:function(e){var t=e.data(c);var i=e.is(":checked")?"checked":"unchecked";return t!==i},checkValues:function(e){var a=this;var s=false;this.form.find("input, select, textarea").each(function(e,t){var i=a.isRadioOrCheckbox(t);var n=a.isFileInput(t);var r=u(t);var o;if(i){o=a.isCheckboxDirty(r)}else if(n){o=a.isFileInputDirty(r)}else{o=a.isFieldDirty(r)}r.data(l,o);s|=o});if(s){a.setDirty()}else{a.setClean()}},setDirty:function(){this.isDirty=true;this.history[0]=this.history[1];this.history[1]=e;if(this.options.fireEventsOnEachChange||this.wasJustClean()){this.form.trigger("dirty")}},setClean:function(){this.isDirty=false;this.history[0]=this.history[1];this.history[1]=i;if(this.options.fireEventsOnEachChange||this.wasJustDirty()){this.form.trigger("clean")}},wasJustDirty:function(){return this.history[0]===e},wasJustClean:function(){return this.history[0]===i},setAsClean:function(){this.saveInitialValues();this.setClean()},setAsDirty:function(){this.saveInitialValues();this.setDirty()},resetForm:function(){var l=this;this.form.find("input, select, textarea").each(function(e,t){var i=u(t);var n=l.isRadioOrCheckbox(t);var r=l.isFileInput(t);if(n){var o=i.data(c);var a=o==="checked";i.prop("checked",a)}if(r){t.value="";u(t).data(c,JSON.stringify(t.files))}else{var s=i.data(c);i.val(s)}});this.checkValues()}};u.fn.dirty=function(n){if(typeof n==="string"){var e=r(u(this).attr("id"));if(!e){return null}if(/^(isDirty|isClean|refreshEvents|resetForm|setAsClean|setAsDirty|showDirtyFields|destroy)$/i.test(n)){var t=n.toLowerCase();switch(t){case"isclean":return!e.isDirty;case"isdirty":return e.isDirty;case"refreshevents":return e.refreshEvents();case"resetform":return e.resetForm();case"setasclean":return e.setAsClean();case"setasdirty":return e.setAsDirty();case"showdirtyfields":return e.showDirtyFields();case"destroy":return o(e)}}else{return e[n].apply(e,Array.prototype.slice.call(arguments,1))}}else{return this.each(function(e,t){n=u.extend({},u.fn.dirty.defaults,n);var i=new d(u(t),n);i.init()})}};u.fn.dirty.singleton=r;u.fn.dirty.defaults={preventLeaving:false,leavingMessage:"There are unsaved changes on this page which will be discarded if you continue.",onDirty:u.noop,onClean:u.noop,fireEventsOnEachChange:false};u.fn.dirty.extend=function(e){u.extend(d.prototype,e)};u.fn.dirty.constructor=d;u.fn.dirty.prototype=d.prototype})(jQuery);+function(s){"use strict";var e=".dropdown-backdrop";var l='[data-toggle="dropdown"]';var n=function(e){s(e).on("click.bs.dropdown",this.toggle)};n.VERSION="3.4.1";function u(e){var t=e.attr("data-target");if(!t){t=e.attr("href");t=t&&/#[A-Za-z]/.test(t)&&t.replace(/.*(?=#[^\s]*$)/,"")}var i=t!=="#"?s(document).find(t):null;return i&&i.length?i:e.parent()}function o(n){if(n&&n.which===3)return;if(n.preventDropdownClose)return;s(e).remove();s(l).each(function(){var e=s(this);var t=u(e);var i={relatedTarget:this};if(!t.hasClass("open"))return;if(n&&n.type=="click"&&/input|textarea/i.test(n.target.tagName)&&s.contains(t[0],n.target))return;t.trigger(n=s.Event("hide.bs.dropdown",i));if(n.isDefaultPrevented())return;e.attr("aria-expanded","false");t.removeClass("open").trigger(s.Event("hidden.bs.dropdown",i))})}n.prototype.toggle=function(e){var t=s(this);if(t.is(".disabled, :disabled"))return;var i=u(t);var n=i.hasClass("open");o(e);if(!n){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length){s(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(s(this)).on("click",o)}var r={relatedTarget:this};i.trigger(e=s.Event("show.bs.dropdown",r));if(e.isDefaultPrevented())return;t.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(s.Event("shown.bs.dropdown",r))}return false};n.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return;var t=s(this);e.preventDefault();e.stopPropagation();if(t.is(".disabled, :disabled"))return;var i=u(t);var n=i.hasClass("open");if(!n&&e.which!=27||n&&e.which==27){if(e.which==27)i.find(l).trigger("focus");return t.trigger("click")}var r=" li:not(.disabled):visible a";var o=i.find(".dropdown-menu"+r);if(!o.length)return;var a=o.index(e.target);if(e.which==38&&a>0)a--;if(e.which==40&&a<o.length-1)a++;if(!~a)a=0;o.eq(a).trigger("focus")};function t(i){return this.each(function(){var e=s(this);var t=e.data("bs.dropdown");if(!t)e.data("bs.dropdown",t=new n(this));if(typeof i=="string")t[i].call(e)})}var i=s.fn.dropdown;s.fn.dropdown=t;s.fn.dropdown.Constructor=n;s.fn.dropdown.noConflict=function(){s.fn.dropdown=i;return this};s(document).on("click.bs.dropdown.data-api",o).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",l,n.prototype.toggle).on("keydown.bs.dropdown.data-api",l,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(jQuery);+function(a){"use strict";var o=function(e,t){this.options=t;this.$body=a(document.body);this.$element=a(e);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=false;this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom";if(this.options.remote){this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))}};o.VERSION="3.4.1";o.TRANSITION_DURATION=300;o.BACKDROP_TRANSITION_DURATION=150;o.DEFAULTS={backdrop:true,keyboard:true,show:true};o.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)};o.prototype.show=function(i){var n=this;var e=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(e);if(this.isShown||e.isDefaultPrevented())return;this.isShown=true;this.checkScrollbar();this.setScrollbar();this.$body.addClass("modal-open");this.escape();this.resize();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this));this.$dialog.on("mousedown.dismiss.bs.modal",function(){n.$element.one("mouseup.dismiss.bs.modal",function(e){if(a(e.target).is(n.$element))n.ignoreBackdropClick=true})});this.backdrop(function(){var e=a.support.transition&&n.$element.hasClass("fade");if(!n.$element.parent().length){n.$element.appendTo(n.$body)}n.$element.show().scrollTop(0);n.adjustDialog();if(e){n.$element[0].offsetWidth}n.$element.addClass("in");n.enforceFocus();var t=a.Event("shown.bs.modal",{relatedTarget:i});e?n.$dialog.one("bsTransitionEnd",function(){n.$element.trigger("focus").trigger(t)}).emulateTransitionEnd(o.TRANSITION_DURATION):n.$element.trigger("focus").trigger(t)})};o.prototype.hide=function(e){if(e)e.preventDefault();e=a.Event("hide.bs.modal");this.$element.trigger(e);if(!this.isShown||e.isDefaultPrevented())return;this.isShown=false;this.escape();this.resize();a(document).off("focusin.bs.modal");this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal");this.$dialog.off("mousedown.dismiss.bs.modal");a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(o.TRANSITION_DURATION):this.hideModal()};o.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(e){if(document!==e.target&&this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger("focus")}},this))};o.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off("keydown.dismiss.bs.modal")}};o.prototype.resize=function(){if(this.isShown){a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this))}else{a(window).off("resize.bs.modal")}};o.prototype.hideModal=function(){var e=this;this.$element.hide();this.backdrop(function(){e.$body.removeClass("modal-open");e.resetAdjustments();e.resetScrollbar();e.$element.trigger("hidden.bs.modal")})};o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};o.prototype.backdrop=function(e){var t=this;var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=a.support.transition&&i;this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",a.proxy(function(e){if(this.ignoreBackdropClick){this.ignoreBackdropClick=false;return}if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus():this.hide()},this));this.$backdrop.on("click.dismiss.bs.modal",a.proxy(function(e){this.hide.call(this)},this));if(n)this.$backdrop[0].offsetWidth;this.$backdrop.addClass("in");if(!e)return;n?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){t.removeBackdrop();e&&e()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):r()}else if(e){e()}};o.prototype.handleUpdate=function(){this.adjustDialog()};o.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})};o.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};o.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e;this.scrollbarWidth=this.measureScrollbar()};o.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var r=this.scrollbarWidth;if(this.bodyIsOverflowing){this.$body.css("padding-right",e+r);a(this.fixedContent).each(function(e,t){var i=t.style.paddingRight;var n=a(t).css("padding-right");a(t).data("padding-right",i).css("padding-right",parseFloat(n)+r+"px")})}};o.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad);a(this.fixedContent).each(function(e,t){var i=a(t).data("padding-right");a(t).removeData("padding-right");t.style.paddingRight=i?i:""})};o.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure";this.$body.append(e);var t=e.offsetWidth-e.clientWidth;this.$body[0].removeChild(e);return t};function s(n,r){return this.each(function(){var e=a(this);var t=e.data("bs.modal");var i=a.extend({},o.DEFAULTS,e.data(),typeof n=="object"&&n);if(!t)e.data("bs.modal",t=new o(this,i));if(typeof n=="string")t[n](r);else if(i.show)t.show(r)})}var e=a.fn.modal;a.fn.modal=s;a.fn.modal.Constructor=o;a.fn.modal.noConflict=function(){a.fn.modal=e;return this};a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var t=a(this);var i=t.attr("href");var n=t.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"");var r=a(document).find(n);var o=r.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},r.data(),t.data());if(t.is("a"))e.preventDefault();r.one("show.bs.modal",function(e){if(e.isDefaultPrevented())return;r.one("hidden.bs.modal",function(){t.is(":visible")&&t.trigger("focus")})});s.call(r,o,this)})}(jQuery);+function(g){"use strict";var n=["sanitize","whiteList","sanitizeFn"];var a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"];var e=/^aria-[\w-]*$/i;var t={"*":["class","dir","id","lang","role",e],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};var s=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;var l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function h(e,t){var i=e.nodeName.toLowerCase();if(g.inArray(i,t)!==-1){if(g.inArray(i,a)!==-1){return Boolean(e.nodeValue.match(s)||e.nodeValue.match(l))}return true}var n=g(t).filter(function(e,t){return t instanceof RegExp});for(var r=0,o=n.length;r<o;r++){if(i.match(n[r])){return true}}return false}function r(e,t,i){if(e.length===0){return e}if(i&&typeof i==="function"){return i(e)}if(!document.implementation||!document.implementation.createHTMLDocument){return e}var n=document.implementation.createHTMLDocument("sanitization");n.body.innerHTML=e;var r=g.map(t,function(e,t){return t});var o=g(n.body).find("*");for(var a=0,s=o.length;a<s;a++){var l=o[a];var u=l.nodeName.toLowerCase();if(g.inArray(u,r)===-1){l.parentNode.removeChild(l);continue}var c=g.map(l.attributes,function(e){return e});var d=[].concat(t["*"]||[],t[u]||[]);for(var f=0,p=c.length;f<p;f++){if(!h(c[f],d)){l.removeAttribute(c[f].nodeName)}}}return n.body.innerHTML}var v=function(e,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",e,t)};v.VERSION="3.4.1";v.TRANSITION_DURATION=150;v.DEFAULTS={animation:true,placement:"top",selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:false,container:false,viewport:{selector:"body",padding:0},sanitize:true,sanitizeFn:null,whiteList:t};v.prototype.init=function(e,t,i){this.enabled=true;this.type=e;this.$element=g(t);this.options=this.getOptions(i);this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport);this.inState={click:false,hover:false,focus:false};if(this.$element[0]instanceof document.constructor&&!this.options.selector){throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!")}var n=this.options.trigger.split(" ");for(var r=n.length;r--;){var o=n[r];if(o=="click"){this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this))}else if(o!="manual"){var a=o=="hover"?"mouseenter":"focusin";var s=o=="hover"?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};v.prototype.getDefaults=function(){return v.DEFAULTS};v.prototype.getOptions=function(e){var t=this.$element.data();for(var i in t){if(t.hasOwnProperty(i)&&g.inArray(i,n)!==-1){delete t[i]}}e=g.extend({},this.getDefaults(),t,e);if(e.delay&&typeof e.delay=="number"){e.delay={show:e.delay,hide:e.delay}}if(e.sanitize){e.template=r(e.template,e.whiteList,e.sanitizeFn)}return e};v.prototype.getDelegateOptions=function(){var i={};var n=this.getDefaults();this._options&&g.each(this._options,function(e,t){if(n[e]!=t)i[e]=t});return i};v.prototype.enter=function(e){var t=e instanceof this.constructor?e:g(e.currentTarget).data("bs."+this.type);if(!t){t=new this.constructor(e.currentTarget,this.getDelegateOptions());g(e.currentTarget).data("bs."+this.type,t)}if(e instanceof g.Event){t.inState[e.type=="focusin"?"focus":"hover"]=true}if(t.tip().hasClass("in")||t.hoverState=="in"){t.hoverState="in";return}clearTimeout(t.timeout);t.hoverState="in";if(!t.options.delay||!t.options.delay.show)return t.show();t.timeout=setTimeout(function(){if(t.hoverState=="in")t.show()},t.options.delay.show)};v.prototype.isInStateTrue=function(){for(var e in this.inState){if(this.inState[e])return true}return false};v.prototype.leave=function(e){var t=e instanceof this.constructor?e:g(e.currentTarget).data("bs."+this.type);if(!t){t=new this.constructor(e.currentTarget,this.getDelegateOptions());g(e.currentTarget).data("bs."+this.type,t)}if(e instanceof g.Event){t.inState[e.type=="focusout"?"focus":"hover"]=false}if(t.isInStateTrue())return;clearTimeout(t.timeout);t.hoverState="out";if(!t.options.delay||!t.options.delay.hide)return t.hide();t.timeout=setTimeout(function(){if(t.hoverState=="out")t.hide()},t.options.delay.hide)};v.prototype.show=function(){var e=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var t=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!t)return;var i=this;var n=this.tip();var r=this.getUID(this.type);this.setContent();n.attr("id",r);this.$element.attr("aria-describedby",r);if(this.options.animation)n.addClass("fade");n.detach().css({top:0,left:0,display:"block"}).data("bs."+this.type,this);this.options.container?n.appendTo(g(document).find(this.options.container)):n.insertAfter(this.$element);var o=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement;var a=/\s?auto?\s?/i;var s=a.test(o);if(s)o=o.replace(a,"")||"top";n.addClass(o);this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition();var u=n[0].offsetWidth;var c=n[0].offsetHeight;if(s){var d=o;var f=this.getPosition(this.$viewport);o=o=="bottom"&&l.bottom+c>f.bottom?"top":o=="top"&&l.top-c<f.top?"bottom":o=="right"&&l.right+u>f.width?"left":o=="left"&&l.left-u<f.left?"right":o;n.removeClass(d).addClass(o)}var p=this.getCalculatedOffset(o,l,u,c);this.applyPlacement(p,o);var h=function(){var e=i.hoverState;i.$element.trigger("shown.bs."+i.type);i.hoverState=null;if(e=="out")i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?n.one("bsTransitionEnd",h).emulateTransitionEnd(v.TRANSITION_DURATION):h()}};v.prototype.applyPlacement=function(e,t){var i=this.tip();var n=i[0].offsetWidth;var r=i[0].offsetHeight;var o=parseInt(i.css("margin-top"),10);var a=parseInt(i.css("margin-left"),10);if(isNaN(o))o=0;if(isNaN(a))a=0;e.top+=o;e.left+=a;g.offset.setOffset(i[0],g.extend({using:function(e){i.css({top:Math.round(e.top),left:Math.round(e.left)})}},e),0);i.addClass("in");var s=i[0].offsetWidth;var l=i[0].offsetHeight;if(t=="top"&&l!=r){e.top=e.top+r-l}var u=this.getViewportAdjustedDelta(t,e,s,l);if(u.left)e.left+=u.left;else e.top+=u.top;var c=/top|bottom/.test(t);var d=c?u.left*2-n+s:u.top*2-r+l;var f=c?"offsetWidth":"offsetHeight";i.offset(e);this.replaceArrow(d,i[0][f],c)};v.prototype.replaceArrow=function(e,t,i){this.arrow().css(i?"left":"top",50*(1-e/t)+"%").css(i?"top":"left","")};v.prototype.setContent=function(){var e=this.tip();var t=this.getTitle();if(this.options.html){if(this.options.sanitize){t=r(t,this.options.whiteList,this.options.sanitizeFn)}e.find(".tooltip-inner").html(t)}else{e.find(".tooltip-inner").text(t)}e.removeClass("fade in top bottom left right")};v.prototype.hide=function(e){var t=this;var i=g(this.$tip);var n=g.Event("hide.bs."+this.type);function r(){if(t.hoverState!="in")i.detach();if(t.$element){t.$element.removeAttr("aria-describedby").trigger("hidden.bs."+t.type)}e&&e()}this.$element.trigger(n);if(n.isDefaultPrevented())return;i.removeClass("in");g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",r).emulateTransitionEnd(v.TRANSITION_DURATION):r();this.hoverState=null;return this};v.prototype.fixTitle=function(){var e=this.$element;if(e.attr("title")||typeof e.attr("data-original-title")!="string"){e.attr("data-original-title",e.attr("title")||"").attr("title","")}};v.prototype.hasContent=function(){return this.getTitle()};v.prototype.getPosition=function(e){e=e||this.$element;var t=e[0];var i=t.tagName=="BODY";var n=t.getBoundingClientRect();if(n.width==null){n=g.extend({},n,{width:n.right-n.left,height:n.bottom-n.top})}var r=window.SVGElement&&t instanceof window.SVGElement;var o=i?{top:0,left:0}:r?null:e.offset();var a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()};var s=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},n,a,s,o)};v.prototype.getCalculatedOffset=function(e,t,i,n){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:e=="top"?{top:t.top-n,left:t.left+t.width/2-i/2}:e=="left"?{top:t.top+t.height/2-n/2,left:t.left-i}:{top:t.top+t.height/2-n/2,left:t.left+t.width}};v.prototype.getViewportAdjustedDelta=function(e,t,i,n){var r={top:0,left:0};if(!this.$viewport)return r;var o=this.options.viewport&&this.options.viewport.padding||0;var a=this.getPosition(this.$viewport);if(/right|left/.test(e)){var s=t.top-o-a.scroll;var l=t.top+o-a.scroll+n;if(s<a.top){r.top=a.top-s}else if(l>a.top+a.height){r.top=a.top+a.height-l}}else{var u=t.left-o;var c=t.left+o+i;if(u<a.left){r.left=a.left-u}else if(c>a.right){r.left=a.left+a.width-c}}return r};v.prototype.getTitle=function(){var e;var t=this.$element;var i=this.options;e=t.attr("data-original-title")||(typeof i.title=="function"?i.title.call(t[0]):i.title);return e};v.prototype.getUID=function(e){do{e+=~~(Math.random()*1e6)}while(document.getElementById(e));return e};v.prototype.tip=function(){if(!this.$tip){this.$tip=g(this.options.template);if(this.$tip.length!=1){throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!")}}return this.$tip};v.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};v.prototype.enable=function(){this.enabled=true};v.prototype.disable=function(){this.enabled=false};v.prototype.toggleEnabled=function(){this.enabled=!this.enabled};v.prototype.toggle=function(e){var t=this;if(e){t=g(e.currentTarget).data("bs."+this.type);if(!t){t=new this.constructor(e.currentTarget,this.getDelegateOptions());g(e.currentTarget).data("bs."+this.type,t)}}if(e){t.inState.click=!t.inState.click;if(t.isInStateTrue())t.enter(t);else t.leave(t)}else{t.tip().hasClass("in")?t.leave(t):t.enter(t)}};v.prototype.destroy=function(){var e=this;clearTimeout(this.timeout);this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type);if(e.$tip){e.$tip.detach()}e.$tip=null;e.$arrow=null;e.$viewport=null;e.$element=null})};v.prototype.sanitizeHtml=function(e){return r(e,this.options.whiteList,this.options.sanitizeFn)};function i(n){return this.each(function(){var e=g(this);var t=e.data("bs.tooltip");var i=typeof n=="object"&&n;if(!t&&/destroy|hide/.test(n))return;if(!t)e.data("bs.tooltip",t=new v(this,i));if(typeof n=="string")t[n]()})}var o=g.fn.bsTooltip;g.fn.bsTooltip=i;g.fn.bsTooltip.Constructor=v;g.fn.bsTooltip.noConflict=function(){g.fn.bsTooltip=o;return this}}(jQuery);+function(r){"use strict";var o=function(e,t){this.init("popover",e,t)};if(!r.fn.bsTooltip)throw new Error("Popover requires bootstrap-tooltip.js");o.VERSION="3.4.1";o.DEFAULTS=r.extend({},r.fn.bsTooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'});o.prototype=r.extend({},r.fn.bsTooltip.Constructor.prototype);o.prototype.constructor=o;o.prototype.getDefaults=function(){return o.DEFAULTS};o.prototype.setContent=function(){var e=this.tip();var t=this.getTitle();var i=this.getContent();if(this.options.html){var n=typeof i;if(this.options.sanitize){t=this.sanitizeHtml(t);if(n==="string"){i=this.sanitizeHtml(i)}}e.find(".popover-title").html(t);e.find(".popover-content").children().detach().end()[n==="string"?"html":"append"](i)}else{e.find(".popover-title").text(t);e.find(".popover-content").children().detach().end().text(i)}e.removeClass("fade top bottom left right in");if(!e.find(".popover-title").html())e.find(".popover-title").hide()};o.prototype.hasContent=function(){return this.getTitle()||this.getContent()};o.prototype.getContent=function(){var e=this.$element;var t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)};o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};function e(n){return this.each(function(){var e=r(this);var t=e.data("bs.popover");var i=typeof n=="object"&&n;if(!t&&/destroy|hide/.test(n))return;if(!t)e.data("bs.popover",t=new o(this,i));if(typeof n=="string")t[n]()})}var t=r.fn.popover;r.fn.popover=e;r.fn.popover.Constructor=o;r.fn.popover.noConflict=function(){r.fn.popover=t;return this}}(jQuery);(function(e,t){if(typeof define==="function"&&define.amd){define(["jquery"],function(e){return t(e)})}else if(typeof exports==="object"){module.exports=t(require("jquery"))}else if(jQuery&&!jQuery.fn.colorpicker){t(jQuery)}})(this,function(u){"use strict";var o=function(e,t,i,n,r){this.fallbackValue=i?typeof i==="string"?this.parse(i):i:null;this.fallbackFormat=n?n:"rgba";this.hexNumberSignPrefix=r===true;this.value=this.fallbackValue;this.origFormat=null;this.predefinedColors=t?t:{};this.colors=u.extend({},o.webColors,this.predefinedColors);if(e){if(typeof e.h!=="undefined"){this.value=e}else{this.setColor(String(e))}}if(!this.value){this.value={h:0,s:0,b:0,a:1}}};o.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"};o.prototype={constructor:o,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(e){this.value=e},_sanitizeNumber:function(e){if(typeof e==="number"){return e}if(isNaN(e)||e===null||e===""||e===undefined){return 1}if(e===""){return 0}if(typeof e.toLowerCase!=="undefined"){if(e.match(/^\./)){e="0"+e}return Math.ceil(parseFloat(e)*100)/100}return 1},isTransparent:function(e){if(!e||!(typeof e==="string"||e instanceof String)){return false}e=e.toLowerCase().trim();return e==="transparent"||e.match(/#?00000000/)||e.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/)},rgbaIsTransparent:function(e){return e.r===0&&e.g===0&&e.b===0&&e.a===0},setColor:function(e){e=e.toLowerCase().trim();if(e){if(this.isTransparent(e)){this.value={h:0,s:0,b:0,a:0};return true}else{var t=this.parse(e);if(t){this.value=this.value={h:t.h,s:t.s,b:t.b,a:t.a};if(!this.origFormat){this.origFormat=t.format}}else if(this.fallbackValue){this.value=this.fallbackValue}}}return false},setHue:function(e){this.value.h=1-e},setSaturation:function(e){this.value.s=e},setBrightness:function(e){this.value.b=1-e},setAlpha:function(e){this.value.a=Math.round(parseInt((1-e)*100,10)/100*100)/100},toRGB:function(e,t,i,n){if(arguments.length===0){e=this.value.h;t=this.value.s;i=this.value.b;n=this.value.a}e*=360;var r,o,a,s,l;e=e%360/60;l=i*t;s=l*(1-Math.abs(e%2-1));r=o=a=i-l;e=~~e;r+=[l,s,0,0,s,l][e];o+=[s,l,l,s,0,0][e];a+=[0,0,s,l,l,s][e];return{r:Math.round(r*255),g:Math.round(o*255),b:Math.round(a*255),a:n}},toHex:function(e,t,i,n,r){if(arguments.length<=1){t=this.value.h;i=this.value.s;n=this.value.b;r=this.value.a}var o="#";var a=this.toRGB(t,i,n,r);if(this.rgbaIsTransparent(a)){return"transparent"}if(!e){o=this.hexNumberSignPrefix?"#":""}var s=o+((1<<24)+(parseInt(a.r)<<16)+(parseInt(a.g)<<8)+parseInt(a.b)).toString(16).slice(1);return s},toHSL:function(e,t,i,n){if(arguments.length===0){e=this.value.h;t=this.value.s;i=this.value.b;n=this.value.a}var r=e,o=(2-t)*i,a=t*i;if(o>0&&o<=1){a/=o}else{a/=2-o}o/=2;if(a>1){a=1}return{h:isNaN(r)?0:r,s:isNaN(a)?0:a,l:isNaN(o)?0:o,a:isNaN(n)?0:n}},toAlias:function(e,t,i,n){var r,o=arguments.length===0?this.toHex(true):this.toHex(true,e,t,i,n);var a=this.origFormat==="alias"?o:this.toString(false,this.origFormat);for(var s in this.colors){r=this.colors[s].toLowerCase().trim();if(r===o||r===a){return s}}return false},RGBtoHSB:function(e,t,i,n){e/=255;t/=255;i/=255;var r,o,a,s;a=Math.max(e,t,i);s=a-Math.min(e,t,i);r=s===0?null:a===e?(t-i)/s:a===t?(i-e)/s+2:(e-t)/s+4;r=(r+360)%6*60/360;o=s===0?0:s/a;return{h:this._sanitizeNumber(r),s:o,b:a,a:this._sanitizeNumber(n)}},HueToRGB:function(e,t,i){if(i<0){i+=1}else if(i>1){i-=1}if(i*6<1){return e+(t-e)*i*6}else if(i*2<1){return t}else if(i*3<2){return e+(t-e)*(2/3-i)*6}else{return e}},HSLtoRGB:function(e,t,i,n){if(t<0){t=0}var r;if(i<=.5){r=i*(1+t)}else{r=i+t-i*t}var o=2*i-r;var a=e+1/3;var s=e;var l=e-1/3;var u=Math.round(this.HueToRGB(o,r,a)*255);var c=Math.round(this.HueToRGB(o,r,s)*255);var d=Math.round(this.HueToRGB(o,r,l)*255);return[u,c,d,this._sanitizeNumber(n)]},parse:function(n){if(typeof n!=="string"){return this.fallbackValue}if(arguments.length===0){return false}var r=this,o=false,a=typeof this.colors[n]!=="undefined",s,l;if(a){n=this.colors[n].toLowerCase().trim()}u.each(this.stringParsers,function(e,t){var i=t.re.exec(n);s=i&&t.parse.apply(r,[i]);if(s){o={};l=a?"alias":t.format?t.format:r.getValidFallbackFormat();if(l.match(/hsla?/)){o=r.RGBtoHSB.apply(r,r.HSLtoRGB.apply(r,s))}else{o=r.RGBtoHSB.apply(r,s)}if(o instanceof Object){o.format=l}return false}return true});return o},getValidFallbackFormat:function(){var e=["rgba","rgb","hex","hsla","hsl"];if(this.origFormat&&e.indexOf(this.origFormat)!==-1){return this.origFormat}if(this.fallbackFormat&&e.indexOf(this.fallbackFormat)!==-1){return this.fallbackFormat}return"rgba"},toString:function(e,t,i){t=t||this.origFormat||this.fallbackFormat;i=i||false;var n=false;switch(t){case"rgb":{n=this.toRGB();if(this.rgbaIsTransparent(n)){return"transparent"}return"rgb("+n.r+","+n.g+","+n.b+")"}break;case"rgba":{n=this.toRGB();return"rgba("+n.r+","+n.g+","+n.b+","+n.a+")"}break;case"hsl":{n=this.toHSL();return"hsl("+Math.round(n.h*360)+","+Math.round(n.s*100)+"%,"+Math.round(n.l*100)+"%)"}break;case"hsla":{n=this.toHSL();return"hsla("+Math.round(n.h*360)+","+Math.round(n.s*100)+"%,"+Math.round(n.l*100)+"%,"+n.a+")"}break;case"hex":{return this.toHex(e)}break;case"alias":{n=this.toAlias();if(n===false){return this.toString(e,this.getValidFallbackFormat())}if(i&&!(n in o.webColors)&&n in this.predefinedColors){return this.predefinedColors[n]}return n}default:{return n}break}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(e){return[e[1],e[2],e[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(e){return[e[1]/360,e[2]/100,e[3]/100,e[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(e){return[e[1]/360,e[2]/100,e[3]/100,e[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),1]}}],colorNameToHex:function(e){if(typeof this.colors[e.toLowerCase()]!=="undefined"){return this.colors[e.toLowerCase()]}return false}};var a={horizontal:false,inline:false,color:false,format:false,input:"input",container:false,component:".add-on, .input-group-addon",fallbackColor:false,fallbackFormat:"hex",hexNumberSignPrefix:true,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:false,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:false,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:false},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:false}},template:'<div class="colorpicker dropdown-menu">'+'<div class="colorpicker-saturation"><i><b></b></i></div>'+'<div class="colorpicker-hue"><i></i></div>'+'<div class="colorpicker-alpha"><i></i></div>'+'<div class="colorpicker-color"><div /></div>'+'<div class="colorpicker-selectors"></div>'+"</div>",align:"right",customClass:null,colorSelectors:null};var s=function(e,t){this.element=u(e).addClass("colorpicker-element");this.options=u.extend(true,{},a,this.element.data(),t);this.component=this.options.component;this.component=this.component!==false?this.element.find(this.component):false;if(this.component&&this.component.length===0){this.component=false}this.container=this.options.container===true?this.element:this.options.container;this.container=this.container!==false?u(this.container):false;this.input=this.element.is("input")?this.element:this.options.input?this.element.find(this.options.input):false;if(this.input&&this.input.length===0){this.input=false}this.color=this.createColor(this.options.color!==false?this.options.color:this.getValue());this.format=this.options.format!==false?this.options.format:this.color.origFormat;if(this.options.color!==false){this.updateInput(this.color);this.updateData(this.color)}this.disabled=false;var i=this.picker=u(this.options.template);if(this.options.customClass){i.addClass(this.options.customClass)}if(this.options.inline){i.addClass("colorpicker-inline colorpicker-visible")}else{i.addClass("colorpicker-hidden")}if(this.options.horizontal){i.addClass("colorpicker-horizontal")}if(["rgba","hsla","alias"].indexOf(this.format)!==-1||this.options.format===false||this.getValue()==="transparent"){i.addClass("colorpicker-with-alpha")}if(this.options.align==="right"){i.addClass("colorpicker-right")}if(this.options.inline===true){i.addClass("colorpicker-no-arrow")}if(this.options.colorSelectors){var n=this,r=n.picker.find(".colorpicker-selectors");if(r.length>0){u.each(this.options.colorSelectors,function(e,t){var i=u("<i />").addClass("colorpicker-selectors-color").css("background-color",t).data("class",e).data("alias",e);i.on("mousedown.colorpicker touchstart.colorpicker",function(e){e.preventDefault();n.setValue(n.format==="alias"?u(this).data("alias"):u(this).css("background-color"))});r.append(i)});r.show().addClass("colorpicker-visible")}}i.on("mousedown.colorpicker touchstart.colorpicker",u.proxy(function(e){if(e.target===e.currentTarget){e.preventDefault()}},this));i.find(".colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha").on("mousedown.colorpicker touchstart.colorpicker",u.proxy(this.mousedown,this));i.appendTo(this.container?this.container:u("body"));if(this.input!==false){this.input.on({"keyup.colorpicker":u.proxy(this.keyup,this)});this.input.on({"input.colorpicker":u.proxy(this.change,this)});if(this.component===false){this.element.on({"focus.colorpicker":u.proxy(this.show,this)})}if(this.options.inline===false){this.element.on({"focusout.colorpicker":u.proxy(this.hide,this)})}}if(this.component!==false){this.component.on({"click.colorpicker":u.proxy(this.show,this)})}if(this.input===false&&this.component===false){this.element.on({"click.colorpicker":u.proxy(this.show,this)})}if(this.input!==false&&this.component!==false&&this.input.attr("type")==="color"){this.input.on({"click.colorpicker":u.proxy(this.show,this),"focus.colorpicker":u.proxy(this.show,this)})}this.update();u(u.proxy(function(){this.element.trigger("create")},this))};s.Color=o;s.prototype={constructor:s,destroy:function(){this.picker.remove();this.element.removeData("colorpicker","color").off(".colorpicker");if(this.input!==false){this.input.off(".colorpicker")}if(this.component!==false){this.component.off(".colorpicker")}this.element.removeClass("colorpicker-element");this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==false||this.options.container){return false}var e=this.container&&this.container[0]!==window.document.body?"position":"offset";var t=this.component||this.element;var i=t[e]();if(this.options.align==="right"){i.left-=this.picker.outerWidth()-t.outerWidth()}this.picker.css({top:i.top+t.outerHeight(),left:i.left})},show:function(e){if(this.isDisabled()){return}this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden");this.reposition();u(window).on("resize.colorpicker",u.proxy(this.reposition,this));if(e&&(!this.hasInput()||this.input.attr("type")==="color")){if(e.stopPropagation&&e.preventDefault){e.stopPropagation();e.preventDefault()}}if((this.component||!this.input)&&this.options.inline===false){u(window.document).on({"mousedown.colorpicker":u.proxy(this.hide,this)})}this.element.trigger({type:"showPicker",color:this.color})},hide:function(e){if(typeof e!=="undefined"&&e.target){if(u(e.currentTarget).parents(".colorpicker").length>0||u(e.target).parents(".colorpicker").length>0){return false}}this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible");u(window).off("resize.colorpicker",this.reposition);u(window.document).off({"mousedown.colorpicker":this.hide});this.update();this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(e){e=e||this.color.toString(false,this.format);this.element.data("color",e);return e},updateInput:function(e){e=e||this.color.toString(false,this.format);if(this.input!==false){this.input.prop("value",e);this.input.trigger("change")}return e},updatePicker:function(e){if(typeof e!=="undefined"){this.color=this.createColor(e)}var t=this.options.horizontal===false?this.options.sliders:this.options.slidersHorz;var i=this.picker.find("i");if(i.length===0){return}if(this.options.horizontal===false){t=this.options.sliders;i.eq(1).css("top",t.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",t.alpha.maxTop*(1-this.color.value.a))}else{t=this.options.slidersHorz;i.eq(1).css("left",t.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",t.alpha.maxLeft*(1-this.color.value.a))}i.eq(0).css({top:t.saturation.maxTop-this.color.value.b*t.saturation.maxTop,left:this.color.value.s*t.saturation.maxLeft});this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(true,this.color.value.h,1,1,1));this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex(true));this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(true,this.format));return e},updateComponent:function(e){var t;if(typeof e!=="undefined"){t=this.createColor(e)}else{t=this.color}if(this.component!==false){var i=this.component.find("i").eq(0);if(i.length>0){i.css({backgroundColor:t.toString(true,this.format)})}else{this.component.css({backgroundColor:t.toString(true,this.format)})}}return t.toString(false,this.format)},update:function(e){var t;if(this.getValue(false)!==false||e===true){t=this.updateComponent();this.updateInput(t);this.updateData(t);this.updatePicker()}return t},setValue:function(e){this.color=this.createColor(e);this.update(true);this.element.trigger({type:"changeColor",color:this.color,value:e})},createColor:function(e){return new o(e?e:null,this.options.colorSelectors,this.options.fallbackColor?this.options.fallbackColor:this.color,this.options.fallbackFormat,this.options.hexNumberSignPrefix)},getValue:function(e){e=typeof e==="undefined"?this.options.fallbackColor:e;var t;if(this.hasInput()){t=this.input.val()}else{t=this.element.data("color")}if(t===undefined||t===""||t===null){t=e}return t},hasInput:function(){return this.input!==false},isDisabled:function(){return this.disabled},disable:function(){if(this.hasInput()){this.input.prop("disabled",true)}this.disabled=true;this.element.trigger({type:"disable",color:this.color,value:this.getValue()});return true},enable:function(){if(this.hasInput()){this.input.prop("disabled",false)}this.disabled=false;this.element.trigger({type:"enable",color:this.color,value:this.getValue()});return true},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(e){if(!e.pageX&&!e.pageY&&e.originalEvent&&e.originalEvent.touches){e.pageX=e.originalEvent.touches[0].pageX;e.pageY=e.originalEvent.touches[0].pageY}e.stopPropagation();e.preventDefault();var t=u(e.target);var i=t.closest("div");var n=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!i.is(".colorpicker")){if(i.is(".colorpicker-saturation")){this.currentSlider=u.extend({},n.saturation)}else if(i.is(".colorpicker-hue")){this.currentSlider=u.extend({},n.hue)}else if(i.is(".colorpicker-alpha")){this.currentSlider=u.extend({},n.alpha)}else{return false}var r=i.offset();this.currentSlider.guide=i.find("i")[0].style;this.currentSlider.left=e.pageX-r.left;this.currentSlider.top=e.pageY-r.top;this.mousePointer={left:e.pageX,top:e.pageY};u(window.document).on({"mousemove.colorpicker":u.proxy(this.mousemove,this),"touchmove.colorpicker":u.proxy(this.mousemove,this),"mouseup.colorpicker":u.proxy(this.mouseup,this),"touchend.colorpicker":u.proxy(this.mouseup,this)}).trigger("mousemove")}return false},mousemove:function(e){if(!e.pageX&&!e.pageY&&e.originalEvent&&e.originalEvent.touches){e.pageX=e.originalEvent.touches[0].pageX;e.pageY=e.originalEvent.touches[0].pageY}e.stopPropagation();e.preventDefault();var t=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((e.pageX||this.mousePointer.left)-this.mousePointer.left)));var i=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((e.pageY||this.mousePointer.top)-this.mousePointer.top)));this.currentSlider.guide.left=t+"px";this.currentSlider.guide.top=i+"px";if(this.currentSlider.callLeft){this.color[this.currentSlider.callLeft].call(this.color,t/this.currentSlider.maxLeft)}if(this.currentSlider.callTop){this.color[this.currentSlider.callTop].call(this.color,i/this.currentSlider.maxTop)}if(this.options.format===false&&(this.currentSlider.callTop==="setAlpha"||this.currentSlider.callLeft==="setAlpha")){if(this.color.value.a!==1){this.format="rgba";this.color.origFormat="rgba"}else{this.format="hex";this.color.origFormat="hex"}}this.update(true);this.element.trigger({type:"changeColor",color:this.color});return false},mouseup:function(e){e.stopPropagation();e.preventDefault();u(window.document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup});return false},change:function(e){this.color=this.createColor(this.input.val());if(this.color.origFormat&&this.options.format===false){this.format=this.color.origFormat}if(this.getValue(false)!==false){this.updateData();this.updateComponent();this.updatePicker()}this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})},keyup:function(e){if(e.keyCode===38){if(this.color.value.a<1){this.color.value.a=Math.round((this.color.value.a+.01)*100)/100}this.update(true)}else if(e.keyCode===40){if(this.color.value.a>0){this.color.value.a=Math.round((this.color.value.a-.01)*100)/100}this.update(true)}this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})}};u.colorpicker=s;u.fn.colorpicker=function(n){var r=Array.prototype.slice.call(arguments,1),e=this.length===1,o=null;var t=this.each(function(){var e=u(this),t=e.data("colorpicker"),i=typeof n==="object"?n:{};if(!t){t=new s(this,i);e.data("colorpicker",t)}if(typeof n==="string"){if(u.isFunction(t[n])){o=t[n].apply(t,r)}else{if(r.length){t[n]=r[0]}o=t[n]}}else{o=e}});return e?o:t};u.fn.colorpicker.constructor=s});!function(){var P={version:"3.5.5"};var g=[].slice,_=function(e){return g.call(e)};var M=this.document;function w(e){return e&&(e.ownerDocument||e.document||e).documentElement}function $(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(M){try{_(M.documentElement.childNodes)[0].nodeType}catch(e){_=function(e){var t=e.length,i=new Array(t);while(t--)i[t]=e[t];return i}}}if(!Date.now)Date.now=function(){return+new Date};if(M){try{M.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var A=this.Element.prototype,D=A.setAttribute,W=A.setAttributeNS,H=this.CSSStyleDeclaration.prototype,j=H.setProperty;A.setAttribute=function(e,t){D.call(this,e,t+"")};A.setAttributeNS=function(e,t,i){W.call(this,e,t,i+"")};H.setProperty=function(e,t,i){j.call(this,e,t+"",i)}}}P.ascending=B;function B(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}P.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN};P.min=function(e,t){var i=-1,n=e.length,r,o;if(arguments.length===1){while(++i<n)if((o=e[i])!=null&&o>=o){r=o;break}while(++i<n)if((o=e[i])!=null&&r>o)r=o}else{while(++i<n)if((o=t.call(e,e[i],i))!=null&&o>=o){r=o;break}while(++i<n)if((o=t.call(e,e[i],i))!=null&&r>o)r=o}return r};P.max=function(e,t){var i=-1,n=e.length,r,o;if(arguments.length===1){while(++i<n)if((o=e[i])!=null&&o>=o){r=o;break}while(++i<n)if((o=e[i])!=null&&o>r)r=o}else{while(++i<n)if((o=t.call(e,e[i],i))!=null&&o>=o){r=o;break}while(++i<n)if((o=t.call(e,e[i],i))!=null&&o>r)r=o}return r};P.extent=function(e,t){var i=-1,n=e.length,r,o,a;if(arguments.length===1){while(++i<n)if((o=e[i])!=null&&o>=o){r=a=o;break}while(++i<n)if((o=e[i])!=null){if(r>o)r=o;if(a<o)a=o}}else{while(++i<n)if((o=t.call(e,e[i],i))!=null&&o>=o){r=a=o;break}while(++i<n)if((o=t.call(e,e[i],i))!=null){if(r>o)r=o;if(a<o)a=o}}return[r,a]};function V(e){return e===null?NaN:+e}function u(e){return!isNaN(e)}P.sum=function(e,t){var i=0,n=e.length,r,o=-1;if(arguments.length===1){while(++o<n)if(u(r=+e[o]))i+=r}else{while(++o<n)if(u(r=+t.call(e,e[o],o)))i+=r}return i};P.mean=function(e,t){var i=0,n=e.length,r,o=-1,a=n;if(arguments.length===1){while(++o<n)if(u(r=V(e[o])))i+=r;else--a}else{while(++o<n)if(u(r=V(t.call(e,e[o],o))))i+=r;else--a}if(a)return i/a};P.quantile=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),r=+e[n-1],o=i-n;return o?r+o*(e[n]-r):r};P.median=function(e,t){var i=[],n=e.length,r,o=-1;if(arguments.length===1){while(++o<n)if(u(r=V(e[o])))i.push(r)}else{while(++o<n)if(u(r=V(t.call(e,e[o],o))))i.push(r)}if(i.length)return P.quantile(i.sort(B),.5)};P.variance=function(e,t){var i=e.length,n=0,r,o,a=0,s=-1,l=0;if(arguments.length===1){while(++s<i){if(u(r=V(e[s]))){o=r-n;n+=o/++l;a+=o*(r-n)}}}else{while(++s<i){if(u(r=V(t.call(e,e[s],s)))){o=r-n;n+=o/++l;a+=o*(r-n)}}}if(l>1)return a/(l-1)};P.deviation=function(){var e=P.variance.apply(this,arguments);return e?Math.sqrt(e):e};function z(o){return{left:function(e,t,i,n){if(arguments.length<3)i=0;if(arguments.length<4)n=e.length;while(i<n){var r=i+n>>>1;if(o(e[r],t)<0)i=r+1;else n=r}return i},right:function(e,t,i,n){if(arguments.length<3)i=0;if(arguments.length<4)n=e.length;while(i<n){var r=i+n>>>1;if(o(e[r],t)>0)n=r;else i=r+1}return i}}}var q=z(B);P.bisectLeft=q.left;P.bisect=P.bisectRight=q.right;P.bisector=function(i){return z(i.length===1?function(e,t){return B(i(e),t)}:i)};P.shuffle=function(e,t,i){if((n=arguments.length)<3){i=e.length;if(n<2)t=0}var n=i-t,r,o;while(n){o=Math.random()*n--|0;r=e[n+t],e[n+t]=e[o+t],e[o+t]=r}return e};P.permute=function(e,t){var i=t.length,n=new Array(i);while(i--)n[i]=e[t[i]];return n};P.pairs=function(e){var t=0,i=e.length-1,n,r=e[0],o=new Array(i<0?0:i);while(t<i)o[t]=[n=r,r=e[++t]];return o};P.zip=function(){if(!(r=arguments.length))return[];for(var e=-1,t=P.min(arguments,X),i=new Array(t);++e<t;){for(var n=-1,r,o=i[e]=new Array(r);++n<r;){o[n]=arguments[n][e]}}return i};function X(e){return e.length}P.transpose=function(e){return P.zip.apply(P,e)};P.keys=function(e){var t=[];for(var i in e)t.push(i);return t};P.values=function(e){var t=[];for(var i in e)t.push(e[i]);return t};P.entries=function(e){var t=[];for(var i in e)t.push({key:i,value:e[i]});return t};P.merge=function(e){var t=e.length,i,n=-1,r=0,o,a;while(++n<t)r+=e[n].length;o=new Array(r);while(--t>=0){a=e[t];i=a.length;while(--i>=0){o[--r]=a[i]}}return o};var I=Math.abs;P.range=function(e,t,i){if(arguments.length<3){i=1;if(arguments.length<2){t=e;e=0}}if((t-e)/i===Infinity)throw new Error("infinite range");var n=[],r=K(I(i)),o=-1,a;e*=r,t*=r,i*=r;if(i<0)while((a=e+i*++o)>t)n.push(a/r);else while((a=e+i*++o)<t)n.push(a/r);return n};function K(e){var t=1;while(e*t%1)t*=10;return t}function Q(e,t){for(var i in t){Object.defineProperty(e.prototype,i,{value:t[i],enumerable:false})}}P.map=function(e,t){var i=new y;if(e instanceof y){e.forEach(function(e,t){i.set(e,t)})}else if(Array.isArray(e)){var n=-1,r=e.length,o;if(arguments.length===1)while(++n<r)i.set(n,e[n]);else while(++n<r)i.set(t.call(e,o=e[n],n),o)}else{for(var a in e)i.set(a,e[a])}return i};function y(){this._=Object.create(null)}var Z="__proto__",J="\0";Q(y,{has:ie,get:function(e){return this._[ee(e)]},set:function(e,t){return this._[ee(e)]=t},remove:ne,keys:re,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:te(t),value:this._[t]});return e},size:oe,empty:ae,forEach:function(e){for(var t in this._)e.call(this,te(t),this._[t])}});function ee(e){return(e+="")===Z||e[0]===J?J+e:e}function te(e){return(e+="")[0]===J?e.slice(1):e}function ie(e){return ee(e)in this._}function ne(e){return(e=ee(e))in this._&&delete this._[e]}function re(){var e=[];for(var t in this._)e.push(te(t));return e}function oe(){var e=0;for(var t in this._)++e;return e}function ae(){for(var e in this._)return false;return true}P.nest=function(){var d={},f=[],t=[],p,h;function g(i,e,n){if(n>=f.length)return h?h.call(d,e):p?e.sort(p):e;var t=-1,r=e.length,o=f[n++],a,s,l,u=new y,c;while(++t<r){if(c=u.get(a=o(s=e[t]))){c.push(s)}else{u.set(a,[s])}}if(i){s=i();l=function(e,t){s.set(e,g(i,t,n))}}else{s={};l=function(e,t){s[e]=g(i,t,n)}}u.forEach(l);return s}function o(e,i){if(i>=f.length)return e;var n=[],r=t[i++];e.forEach(function(e,t){n.push({key:e,values:o(t,i)})});return r?n.sort(function(e,t){return r(e.key,t.key)}):n}d.map=function(e,t){return g(t,e,0)};d.entries=function(e){return o(g(P.map,e,0),0)};d.key=function(e){f.push(e);return d};d.sortKeys=function(e){t[f.length-1]=e;return d};d.sortValues=function(e){p=e;return d};d.rollup=function(e){h=e;return d};return d};P.set=function(e){var t=new se;if(e)for(var i=0,n=e.length;i<n;++i)t.add(e[i]);return t};function se(){this._=Object.create(null)}Q(se,{has:ie,add:function(e){this._[ee(e+="")]=true;return e},remove:ne,values:re,size:oe,empty:ae,forEach:function(e){for(var t in this._)e.call(this,te(t))}});P.behavior={};function L(e){return e}P.rebind=function(e,t){var i=1,n=arguments.length,r;while(++i<n)e[r=arguments[i]]=le(e,t,t[r]);return e};function le(t,i,n){return function(){var e=n.apply(i,arguments);return e===i?t:e}}function ue(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var i=0,n=ce.length;i<n;++i){var r=ce[i]+t;if(r in e)return r}}var ce=["webkit","ms","moz","Moz","o","O"];function c(){}P.dispatch=function(){var e=new de,t=-1,i=arguments.length;while(++t<i)e[arguments[t]]=fe(e);return e};function de(){}de.prototype.on=function(e,t){var i=e.indexOf("."),n="";if(i>=0){n=e.slice(i+1);e=e.slice(0,i)}if(e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(arguments.length===2){if(t==null)for(e in this){if(this.hasOwnProperty(e))this[e].on(n,null)}return this}};function fe(r){var o=[],a=new y;function e(){var e=o,t=-1,i=e.length,n;while(++t<i)if(n=e[t].on)n.apply(this,arguments);return r}e.on=function(e,t){var i=a.get(e),n;if(arguments.length<2)return i&&i.on;if(i){i.on=null;o=o.slice(0,n=o.indexOf(i)).concat(o.slice(n+1));a.remove(e)}if(t)o.push(a.set(e,{on:t}));return r};return e}P.event=null;function pe(){P.event.preventDefault()}function he(){var e=P.event,t;while(t=e.sourceEvent)e=t;return e}function ge(r){var o=new de,e=0,t=arguments.length;while(++e<t)o[arguments[e]]=fe(o);o.of=function(i,n){return function(e){try{var t=e.sourceEvent=P.event;e.target=r;P.event=e;o[e.type].apply(i,n)}finally{P.event=t}}};return o}P.requote=function(e){return e.replace(ve,"\\$&")};var ve=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;var me={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)e[i]=t[i]};function ye(e){me(e,i);return e}var be=function(e,t){return t.querySelector(e)},_e=function(e,t){return t.querySelectorAll(e)},we=function(e,t){var i=e.matches||e[ue(e,"matchesSelector")];we=function(e,t){return i.call(e,t)};return we(e,t)};if(typeof Sizzle==="function"){be=function(e,t){return Sizzle(e,t)[0]||null};_e=Sizzle;we=Sizzle.matchesSelector}P.selection=function(){return P.select(M.documentElement)};var i=P.selection.prototype=[];i.select=function(e){var t=[],i,n,r,o;e=Ce(e);for(var a=-1,s=this.length;++a<s;){t.push(i=[]);i.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;){if(o=r[l]){i.push(n=e.call(o,o.__data__,l,a));if(n&&"__data__"in o)n.__data__=o.__data__}else{i.push(null)}}}return ye(t)};function Ce(e){return typeof e==="function"?e:function(){return be(e,this)}}i.selectAll=function(e){var t=[],i,n;e=Ae(e);for(var r=-1,o=this.length;++r<o;){for(var a=this[r],s=-1,l=a.length;++s<l;){if(n=a[s]){t.push(i=_(e.call(n,n.__data__,s,r)));i.parentNode=n}}}return ye(t)};function Ae(e){return typeof e==="function"?e:function(){return _e(e,this)}}var Ee={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};P.ns={prefix:Ee,qualify:function(e){var t=e.indexOf(":"),i=e;if(t>=0){i=e.slice(0,t);e=e.slice(t+1)}return Ee.hasOwnProperty(i)?{space:Ee[i],local:e}:e}};i.attr=function(e,t){if(arguments.length<2){if(typeof e==="string"){var i=this.node();e=P.ns.qualify(e);return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}for(t in e)this.each(xe(t,e[t]));return this}return this.each(xe(e,t))};function xe(t,i){t=P.ns.qualify(t);function e(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function r(){this.setAttribute(t,i)}function o(){this.setAttributeNS(t.space,t.local,i)}function a(){var e=i.apply(this,arguments);if(e==null)this.removeAttribute(t);else this.setAttribute(t,e)}function s(){var e=i.apply(this,arguments);if(e==null)this.removeAttributeNS(t.space,t.local);else this.setAttributeNS(t.space,t.local,e)}return i==null?t.local?n:e:typeof i==="function"?t.local?s:a:t.local?o:r}function Te(e){return e.trim().replace(/\s+/g," ")}i.classed=function(e,t){if(arguments.length<2){if(typeof e==="string"){var i=this.node(),n=(e=De(e)).length,r=-1;if(t=i.classList){while(++r<n)if(!t.contains(e[r]))return false}else{t=i.getAttribute("class");while(++r<n)if(!Se(e[r]).test(t))return false}return true}for(t in e)this.each(ke(t,e[t]));return this}return this.each(ke(e,t))};function Se(e){return new RegExp("(?:^|\\s+)"+P.requote(e)+"(?:\\s+|$)","g")}function De(e){return(e+"").trim().split(/^|\s+/)}function ke(i,n){i=De(i).map(Oe);var r=i.length;function e(){var e=-1;while(++e<r)i[e](this,n)}function t(){var e=-1,t=n.apply(this,arguments);while(++e<r)i[e](this,t)}return typeof n==="function"?t:e}function Oe(n){var r=Se(n);return function(e,t){if(i=e.classList)return t?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";if(t){r.lastIndex=0;if(!r.test(i))e.setAttribute("class",Te(i+" "+n))}else{e.setAttribute("class",Te(i.replace(r," ")))}}}i.style=function(e,t,i){var n=arguments.length;if(n<3){if(typeof e!=="string"){if(n<2)t="";for(i in e)this.each(Re(i,e[i],t));return this}if(n<2){var r=this.node();return $(r).getComputedStyle(r,null).getPropertyValue(e)}i=""}return this.each(Re(e,t,i))};function Re(t,i,n){function e(){this.style.removeProperty(t)}function r(){this.style.setProperty(t,i,n)}function o(){var e=i.apply(this,arguments);if(e==null)this.style.removeProperty(t);else this.style.setProperty(t,e,n)}return i==null?e:typeof i==="function"?o:r}i.property=function(e,t){if(arguments.length<2){if(typeof e==="string")return this.node()[e];for(t in e)this.each(Ne(t,e[t]));return this}return this.each(Ne(e,t))};function Ne(t,i){function e(){delete this[t]}function n(){this[t]=i}function r(){var e=i.apply(this,arguments);if(e==null)delete this[t];else this[t]=e}return i==null?e:typeof i==="function"?r:n}i.text=function(t){return arguments.length?this.each(typeof t==="function"?function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}:t==null?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent};i.html=function(t){return arguments.length?this.each(typeof t==="function"?function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}:t==null?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML};i.append=function(e){e=Ie(e);return this.select(function(){return this.appendChild(e.apply(this,arguments))})};function Ie(i){function e(){var e=this.ownerDocument,t=this.namespaceURI;return t?e.createElementNS(t,i):e.createElement(i)}function t(){return this.ownerDocument.createElementNS(i.space,i.local)}return typeof i==="function"?i:(i=P.ns.qualify(i)).local?t:e}i.insert=function(e,t){e=Ie(e);t=Ce(t);return this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})};i.remove=function(){return this.each(Pe)};function Pe(){var e=this.parentNode;if(e)e.removeChild(this)}i.data=function(e,h){var t=-1,i=this.length,n,r;if(!arguments.length){e=new Array(i=(n=this[0]).length);while(++t<i){if(r=n[t]){e[t]=r.__data__}}return e}function o(e,t){var i,n=e.length,r=t.length,o=Math.min(n,r),a=new Array(r),s=new Array(r),l=new Array(n),u,c;if(h){var d=new y,f=new Array(n),p;for(i=-1;++i<n;){if(d.has(p=h.call(u=e[i],u.__data__,i))){l[i]=u}else{d.set(p,u)}f[i]=p}for(i=-1;++i<r;){if(!(u=d.get(p=h.call(t,c=t[i],i)))){s[i]=Me(c)}else if(u!==true){a[i]=u;u.__data__=c}d.set(p,true)}for(i=-1;++i<n;){if(d.get(f[i])!==true){l[i]=e[i]}}}else{for(i=-1;++i<o;){u=e[i];c=t[i];if(u){u.__data__=c;a[i]=u}else{s[i]=Me(c)}}for(;i<r;++i){s[i]=Me(t[i])}for(;i<n;++i){l[i]=e[i]}}s.update=a;s.parentNode=a.parentNode=l.parentNode=e.parentNode;g.push(s);v.push(a);m.push(l)}var g=Ge([]),v=ye([]),m=ye([]);if(typeof e==="function"){while(++t<i){o(n=this[t],e.call(n,n.parentNode.__data__,t))}}else{while(++t<i){o(n=this[t],e)}}v.enter=function(){return g};v.exit=function(){return m};return v};function Me(e){return{__data__:e}}i.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")};i.filter=function(e){var t=[],i,n,r;if(typeof e!=="function")e=Le(e);for(var o=0,a=this.length;o<a;o++){t.push(i=[]);i.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;s<l;s++){if((r=n[s])&&e.call(r,r.__data__,s,o)){i.push(r)}}}return ye(t)};function Le(e){return function(){return we(this,e)}}i.order=function(){for(var e=-1,t=this.length;++e<t;){for(var i=this[e],n=i.length-1,r=i[n],o;--n>=0;){if(o=i[n]){if(r&&r!==o.nextSibling)r.parentNode.insertBefore(o,r);r=o}}}return this};i.sort=function(e){e=Fe.apply(this,arguments);for(var t=-1,i=this.length;++t<i;)this[t].sort(e);return this.order()};function Fe(i){if(!arguments.length)i=B;return function(e,t){return e&&t?i(e.__data__,t.__data__):!e-!t}}i.each=function(n){return l(this,function(e,t,i){n.call(e,e.__data__,t,i)})};function l(e,t){for(var i=0,n=e.length;i<n;i++){for(var r=e[i],o=0,a=r.length,s;o<a;o++){if(s=r[o])t(s,o,i)}}return e}i.call=function(e){var t=_(arguments);e.apply(t[0]=this,t);return this};i.empty=function(){return!this.node()};i.node=function(){for(var e=0,t=this.length;e<t;e++){for(var i=this[e],n=0,r=i.length;n<r;n++){var o=i[n];if(o)return o}}return null};i.size=function(){var e=0;l(this,function(){++e});return e};function Ge(e){me(e,t);return e}var t=[];P.selection.enter=Ge;P.selection.enter.prototype=t;t.append=i.append;t.empty=i.empty;t.node=i.node;t.call=i.call;t.size=i.size;t.select=function(e){var t=[],i,n,r,o,a;for(var s=-1,l=this.length;++s<l;){r=(o=this[s]).update;t.push(i=[]);i.parentNode=o.parentNode;for(var u=-1,c=o.length;++u<c;){if(a=o[u]){i.push(r[u]=n=e.call(o.parentNode,a.__data__,u,s));n.__data__=a.__data__}else{i.push(null)}}}return ye(t)};t.insert=function(e,t){if(arguments.length<2)t=$e(this);return i.insert.call(this,e,t)};function $e(a){var s,l;return function(e,t,i){var n=a[i].update,r=n.length,o;if(i!=l)l=i,s=0;if(t>=s)s=t+1;while(!(o=n[s])&&++s<r);return o}}P.select=function(e){var t;if(typeof e==="string"){t=[be(e,M)];t.parentNode=M.documentElement}else{t=[e];t.parentNode=w(e)}return ye([t])};P.selectAll=function(e){var t;if(typeof e==="string"){t=_(_e(e,M));t.parentNode=M.documentElement}else{t=e;t.parentNode=null}return ye([t])};i.on=function(e,t,i){var n=arguments.length;if(n<3){if(typeof e!=="string"){if(n<2)t=false;for(i in e)this.each(We(i,e[i],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;i=false}return this.each(We(e,t,i))};function We(r,t,i){var n="__on"+r,e=r.indexOf("."),o=je;if(e>0)r=r.slice(0,e);var a=He.get(r);if(a)r=a,o=Be;function s(){var e=this[n];if(e){this.removeEventListener(r,e,e.$);delete this[n]}}function l(){var e=o(t,_(arguments));s.call(this);this.addEventListener(r,this[n]=e,e.$=i);e._=t}function u(){var e=new RegExp("^__on([^.]+)"+P.requote(r)+"$"),t;for(var i in this){if(t=i.match(e)){var n=this[i];this.removeEventListener(t[1],n,n.$);delete this[i]}}}return e?t?l:s:t?c:u}var He=P.map({mouseenter:"mouseover",mouseleave:"mouseout"});if(M){He.forEach(function(e){if("on"+e in M)He.remove(e)})}function je(i,n){return function(e){var t=P.event;P.event=e;n[0]=this.__data__;try{i.apply(this,n)}finally{P.event=t}}}function Be(e,t){var n=je(e,t);return function(e){var t=this,i=e.relatedTarget;if(!i||i!==t&&!(i.compareDocumentPosition(t)&8)){n.call(t,e)}}}var Ve,ze=0;function Ue(e){var i=".dragsuppress-"+ ++ze,n="click"+i,r=P.select($(e)).on("touchmove"+i,pe).on("dragstart"+i,pe).on("selectstart"+i,pe);if(Ve==null){Ve="onselectstart"in e?false:ue(e.style,"userSelect")}if(Ve){var o=w(e).style,a=o[Ve];o[Ve]="none"}return function(e){r.on(i,null);if(Ve)o[Ve]=a;if(e){var t=function(){r.on(n,null)};r.on(n,function(){pe();t()},true);setTimeout(t,0)}}}P.mouse=function(e){return qe(e,he())};var Ye=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function qe(e,t){if(t.changedTouches)t=t.changedTouches[0];var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();if(Ye<0){var r=$(e);if(r.scrollX||r.scrollY){i=P.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=i[0][0].getScreenCTM();Ye=!(o.f||o.e);i.remove()}}if(Ye)n.x=t.pageX,n.y=t.pageY;else n.x=t.clientX,n.y=t.clientY;n=n.matrixTransform(e.getScreenCTM().inverse());return[n.x,n.y]}var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}P.touch=function(e,t,i){if(arguments.length<3)i=t,t=he().changedTouches;if(t)for(var n=0,r=t.length,o;n<r;++n){if((o=t[n]).identifier===i){return qe(e,o)}}};P.behavior.drag=function(){var y=ge(i,"drag","dragstart","dragend"),b=null,e=n(c,P.mouse,$,"mousemove","mouseup"),t=n(Xe,P.touch,L,"touchmove","touchend");function i(){this.on("mousedown.drag",e).on("touchstart.drag",t)}function n(p,h,g,v,m){return function(){var e=this,t=P.event.target,n=e.parentNode,r=y.of(e,arguments),o=0,a=p(),i=".drag"+(a==null?"":"-"+a),s,l=P.select(g(t)).on(v+i,d).on(m+i,f),u=Ue(t),c=h(n,a);if(b){s=b.apply(e,arguments);s=[s.x-c[0],s.y-c[1]]}else{s=[0,0]}r({type:"dragstart"});function d(){var e=h(n,a),t,i;if(!e)return;t=e[0]-c[0];i=e[1]-c[1];o|=t|i;c=e;r({type:"drag",x:e[0]+s[0],y:e[1]+s[1],dx:t,dy:i})}function f(){if(!h(n,a))return;l.on(v+i,null).on(m+i,null);u(o&&P.event.target===t);r({type:"dragend"})}}}i.origin=function(e){if(!arguments.length)return b;b=e;return i};return P.rebind(i,y,"on")};function Xe(){return P.event.changedTouches[0].identifier}P.touches=function(i,e){if(arguments.length<2)e=he().touches;return e?_(e).map(function(e){var t=qe(i,e);t.identifier=e.identifier;return t}):[]};var F=1e-6,Ke=F*F,U=Math.PI,k=2*U,Qe=k-F,Y=U/2,E=U/180,x=180/U;function Ze(e){return e>0?1:e<0?-1:0}function Je(e,t,i){return(t[0]-e[0])*(i[1]-e[1])-(t[1]-e[1])*(i[0]-e[0])}function et(e){return e>1?0:e<-1?U:Math.acos(e)}function tt(e){return e>1?Y:e<-1?-Y:Math.asin(e)}function it(e){return((e=Math.exp(e))-1/e)/2}function nt(e){return((e=Math.exp(e))+1/e)/2}function rt(e){return((e=Math.exp(2*e))-1)/(e+1)}function ot(e){return(e=Math.sin(e/2))*e}var at=Math.SQRT2,st=2,lt=4;P.interpolateZoom=function(e,t){var r=e[0],o=e[1],a=e[2],i=t[0],n=t[1],s=t[2];var l=i-r,u=n-o,c=l*l+u*u,d=Math.sqrt(c),f=(s*s-a*a+lt*c)/(2*a*st*d),p=(s*s-a*a-lt*c)/(2*s*st*d),h=Math.log(Math.sqrt(f*f+1)-f),g=Math.log(Math.sqrt(p*p+1)-p),v=g-h,m=(v||Math.log(s/a))/at;function y(e){var t=e*m;if(v){var i=nt(h),n=a/(st*d)*(i*rt(at*t+h)-it(h));return[r+n*l,o+n*u,a*i/nt(at*t+h)]}return[r+e*l,o+e*u,a*Math.exp(at*t)]}y.duration=m*1e3;return y};P.behavior.zoom=function(){var _={x:0,y:0,k:1},t,l,i,u=[960,500],n=ut,r=250,o=0,s="mousedown.zoom",c="mousemove.zoom",d="mouseup.zoom",a,w="touchstart.zoom",C,A=ge(v,"zoomstart","zoom","zoomend"),f,p,h,g;if(!dt){dt="onwheel"in M?(ct=function(){return-P.event.deltaY*(P.event.deltaMode?120:1)},"wheel"):"onmousewheel"in M?(ct=function(){return P.event.wheelDelta},"mousewheel"):(ct=function(){return-P.event.detail},"MozMousePixelScroll")}function v(e){e.on(s,R).on(dt+".zoom",b).on("dblclick.zoom",I).on(w,N)}v.event=function(e){e.each(function(){var s=A.of(this,arguments),t=_;if(El){P.select(this).transition().each("start.zoom",function(){_=this.__chart__||{x:0,y:0,k:1};D(s)}).tween("zoom:zoom",function(){var n=u[0],e=u[1],r=l?l[0]:n/2,o=l?l[1]:e/2,a=P.interpolateZoom([(r-_.x)/_.k,(o-_.y)/_.k,n/_.k],[(r-t.x)/t.k,(o-t.y)/t.k,n/t.k]);return function(e){var t=a(e),i=n/t[2];this.__chart__=_={x:r-t[0]*i,y:o-t[1]*i,k:i};k(s)}}).each("interrupt.zoom",function(){O(s)}).each("end.zoom",function(){O(s)})}else{this.__chart__=_;D(s);k(s);O(s)}})};v.translate=function(e){if(!arguments.length)return[_.x,_.y];_={x:+e[0],y:+e[1],k:_.k};y();return v};v.scale=function(e){if(!arguments.length)return _.k;_={x:_.x,y:_.y,k:+e};y();return v};v.scaleExtent=function(e){if(!arguments.length)return n;n=e==null?ut:[+e[0],+e[1]];return v};v.center=function(e){if(!arguments.length)return i;i=e&&[+e[0],+e[1]];return v};v.size=function(e){if(!arguments.length)return u;u=e&&[+e[0],+e[1]];return v};v.duration=function(e){if(!arguments.length)return r;r=+e;return v};v.x=function(e){if(!arguments.length)return p;p=e;f=e.copy();_={x:0,y:0,k:1};return v};v.y=function(e){if(!arguments.length)return g;g=e;h=e.copy();_={x:0,y:0,k:1};return v};function E(e){return[(e[0]-_.x)/_.k,(e[1]-_.y)/_.k]}function m(e){return[e[0]*_.k+_.x,e[1]*_.k+_.y]}function x(e){_.k=Math.max(n[0],Math.min(n[1],e))}function T(e,t){t=m(t);_.x+=e[0]-t[0];_.y+=e[1]-t[1]}function S(e,t,i,n){e.__chart__={x:_.x,y:_.y,k:_.k};x(Math.pow(2,n));T(l=t,i);e=P.select(e);if(r>0)e=e.transition().duration(r);e.call(v.event)}function y(){if(p)p.domain(f.range().map(function(e){return(e-_.x)/_.k}).map(f.invert));if(g)g.domain(h.range().map(function(e){return(e-_.y)/_.k}).map(h.invert))}function D(e){if(!o++)e({type:"zoomstart"})}function k(e){y();e({type:"zoom",scale:_.k,translate:[_.x,_.y]})}function O(e){if(!--o)e({type:"zoomend"});l=null}function R(){var e=this,t=P.event.target,i=A.of(e,arguments),n=0,r=P.select($(e)).on(c,s).on(d,l),o=E(P.mouse(e)),a=Ue(e);_l.call(e);D(i);function s(){n=1;T(P.mouse(e),o);k(i)}function l(){r.on(c,null).on(d,null);a(n&&P.event.target===t);O(i)}}function N(){var c=this,u=A.of(c,arguments),d={},f=0,p,r=".zoom-"+P.event.changedTouches[0].identifier,h="touchmove"+r,g="touchend"+r,v=[],o=P.select(c),a=Ue(c);e();D(u);o.on(s,null).on(w,e);function m(){var e=P.touches(c);p=_.k;e.forEach(function(e){if(e.identifier in d)d[e.identifier]=E(e)});return e}function e(){var e=P.event.target;P.select(e).on(h,y).on(g,b);v.push(e);var t=P.event.changedTouches;for(var i=0,n=t.length;i<n;++i){d[t[i].identifier]=null}var r=m(),o=Date.now();if(r.length===1){if(o-C<500){var a=r[0];S(c,a,d[a.identifier],Math.floor(Math.log(_.k)/Math.LN2)+1);pe()}C=o}else if(r.length>1){var a=r[0],s=r[1],l=a[0]-s[0],u=a[1]-s[1];f=l*l+u*u}}function y(){var e=P.touches(c),t,i,n,r;_l.call(c);for(var o=0,a=e.length;o<a;++o,r=null){n=e[o];if(r=d[n.identifier]){if(i)break;t=n,i=r}}if(r){var s=(s=n[0]-t[0])*s+(s=n[1]-t[1])*s,l=f&&Math.sqrt(s/f);t=[(t[0]+n[0])/2,(t[1]+n[1])/2];i=[(i[0]+r[0])/2,(i[1]+r[1])/2];x(l*p)}C=null;T(t,i);k(u)}function b(){if(P.event.touches.length){var e=P.event.changedTouches;for(var t=0,i=e.length;t<i;++t){delete d[e[t].identifier]}for(var n in d){return void m()}}P.selectAll(v).on(r,null);o.on(s,R).on(w,N);a();O(u)}}function b(){var e=A.of(this,arguments);if(a)clearTimeout(a);else t=E(l=i||P.mouse(this)),_l.call(this),D(e);a=setTimeout(function(){a=null;O(e)},50);pe();x(Math.pow(2,ct()*.002)*_.k);T(l,t);k(e)}function I(){var e=P.mouse(this),t=Math.log(_.k)/Math.LN2;S(this,e,E(e),P.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return P.rebind(v,A,"on")};var ut=[0,Infinity],ct,dt;P.color=ft;function ft(){}ft.prototype.toString=function(){return this.rgb()+""};P.hsl=d;function d(e,t,i){return this instanceof d?void(this.h=+e,this.s=+t,this.l=+i):arguments.length<2?e instanceof d?new d(e.h,e.s,e.l):Rt(""+e,Nt,d):new d(e,t,i)}var pt=d.prototype=new ft;pt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);return new d(this.h,this.s,this.l/e)};pt.darker=function(e){e=Math.pow(.7,arguments.length?e:1);return new d(this.h,this.s,e*this.l)};pt.rgb=function(){return ht(this.h,this.s,this.l)};function ht(e,t,i){var n,r;e=isNaN(e)?0:(e%=360)<0?e+360:e;t=isNaN(t)?0:t<0?0:t>1?1:t;i=i<0?0:i>1?1:i;r=i<=.5?i*(1+t):i+t-i*t;n=2*i-r;function o(e){if(e>360)e-=360;else if(e<0)e+=360;if(e<60)return n+(r-n)*e/60;if(e<180)return r;if(e<240)return n+(r-n)*(240-e)/60;return n}function a(e){return Math.round(o(e)*255)}return new s(a(e+120),a(e),a(e-120))}P.hcl=n;function n(e,t,i){return this instanceof n?void(this.h=+e,this.c=+t,this.l=+i):arguments.length<2?e instanceof n?new n(e.h,e.c,e.l):e instanceof a?At(e.l,e.a,e.b):At((e=It((e=P.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new n(e,t,i)}var gt=n.prototype=new ft;gt.brighter=function(e){return new n(this.h,this.c,Math.min(100,this.l+mt*(arguments.length?e:1)))};gt.darker=function(e){return new n(this.h,this.c,Math.max(0,this.l-mt*(arguments.length?e:1)))};gt.rgb=function(){return vt(this.h,this.c,this.l).rgb()};function vt(e,t,i){if(isNaN(e))e=0;if(isNaN(t))t=0;return new a(i,Math.cos(e*=E)*t,Math.sin(e)*t)}P.lab=a;function a(e,t,i){return this instanceof a?void(this.l=+e,this.a=+t,this.b=+i):arguments.length<2?e instanceof a?new a(e.l,e.a,e.b):e instanceof n?vt(e.h,e.c,e.l):It((e=s(e)).r,e.g,e.b):new a(e,t,i)}var mt=18;var yt=.95047,bt=1,_t=1.08883;var wt=a.prototype=new ft;wt.brighter=function(e){return new a(Math.min(100,this.l+mt*(arguments.length?e:1)),this.a,this.b)};wt.darker=function(e){return new a(Math.max(0,this.l-mt*(arguments.length?e:1)),this.a,this.b)};wt.rgb=function(){return Ct(this.l,this.a,this.b)};function Ct(e,t,i){var n=(e+16)/116,r=n+t/500,o=n-i/200;r=Et(r)*yt;n=Et(n)*bt;o=Et(o)*_t;return new s(Tt(3.2404542*r-1.5371385*n-.4985314*o),Tt(-.969266*r+1.8760108*n+.041556*o),Tt(.0556434*r-.2040259*n+1.0572252*o))}function At(e,t,i){return e>0?new n(Math.atan2(i,t)*x,Math.sqrt(t*t+i*i),e):new n(NaN,NaN,e)}function Et(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function xt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Tt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}P.rgb=s;function s(e,t,i){return this instanceof s?void(this.r=~~e,this.g=~~t,this.b=~~i):arguments.length<2?e instanceof s?new s(e.r,e.g,e.b):Rt(""+e,s,ht):new s(e,t,i)}function St(e){return new s(e>>16,e>>8&255,e&255)}function Dt(e){return St(e)+""}var kt=s.prototype=new ft;kt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,i=this.g,n=this.b,r=30;if(!t&&!i&&!n)return new s(r,r,r);if(t&&t<r)t=r;if(i&&i<r)i=r;if(n&&n<r)n=r;return new s(Math.min(255,t/e),Math.min(255,i/e),Math.min(255,n/e))};kt.darker=function(e){e=Math.pow(.7,arguments.length?e:1);return new s(e*this.r,e*this.g,e*this.b)};kt.hsl=function(){return Nt(this.r,this.g,this.b)};kt.toString=function(){return"#"+Ot(this.r)+Ot(this.g)+Ot(this.b)};function Ot(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function Rt(e,t,i){var n=0,r=0,o=0,a,s,l;a=/([a-z]+)\((.*)\)/i.exec(e);if(a){s=a[2].split(",");switch(a[1]){case"hsl":{return i(parseFloat(s[0]),parseFloat(s[1])/100,parseFloat(s[2])/100)}case"rgb":{return t(Mt(s[0]),Mt(s[1]),Mt(s[2]))}}}if(l=Lt.get(e.toLowerCase())){return t(l.r,l.g,l.b)}if(e!=null&&e.charAt(0)==="#"&&!isNaN(l=parseInt(e.slice(1),16))){if(e.length===4){n=(l&3840)>>4;n=n>>4|n;r=l&240;r=r>>4|r;o=l&15;o=o<<4|o}else if(e.length===7){n=(l&16711680)>>16;r=(l&65280)>>8;o=l&255}}return t(n,r,o)}function Nt(e,t,i){var n=Math.min(e/=255,t/=255,i/=255),r=Math.max(e,t,i),o=r-n,a,s,l=(r+n)/2;if(o){s=l<.5?o/(r+n):o/(2-r-n);if(e==r)a=(t-i)/o+(t<i?6:0);else if(t==r)a=(i-e)/o+2;else a=(e-t)/o+4;a*=60}else{a=NaN;s=l>0&&l<1?0:a}return new d(a,s,l)}function It(e,t,i){e=Pt(e);t=Pt(t);i=Pt(i);var n=xt((.4124564*e+.3575761*t+.1804375*i)/yt),r=xt((.2126729*e+.7151522*t+.072175*i)/bt),o=xt((.0193339*e+.119192*t+.9503041*i)/_t);return a(116*r-16,500*(n-r),200*(r-o))}function Pt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Mt(e){var t=parseFloat(e);return e.charAt(e.length-1)==="%"?Math.round(t*2.55):t}var Lt=P.map({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});Lt.forEach(function(e,t){Lt.set(e,St(t))});function T(e){return typeof e==="function"?e:function(){return e}}P.functor=T;P.xhr=Ft(L);function Ft(n){return function(e,t,i){if(arguments.length===2&&typeof t==="function")i=t,t=null;return Gt(e,t,n,i)}}function Gt(r,o,i,e){var a={},s=P.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;if(this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(r))u=new XDomainRequest;"onload"in u?u.onload=u.onerror=t:u.onreadystatechange=function(){u.readyState>3&&t()};function t(){var e=u.status,t;if(!e&&Wt(u)||e>=200&&e<300||e===304){try{t=i.call(a,u)}catch(e){s.error.call(a,e);return}s.load.call(a,t)}else{s.error.call(a,u)}}u.onprogress=function(e){var t=P.event;P.event=e;try{s.progress.call(a,u)}finally{P.event=t}};a.header=function(e,t){e=(e+"").toLowerCase();if(arguments.length<2)return l[e];if(t==null)delete l[e];else l[e]=t+"";return a};a.mimeType=function(e){if(!arguments.length)return o;o=e==null?null:e+"";return a};a.responseType=function(e){if(!arguments.length)return c;c=e;return a};a.response=function(e){i=e;return a};["get","post"].forEach(function(e){a[e]=function(){return a.send.apply(a,[e].concat(_(arguments)))}});a.send=function(e,t,i){if(arguments.length===2&&typeof t==="function")i=t,t=null;u.open(e,r,true);if(o!=null&&!("accept"in l))l["accept"]=o+",*/*";if(u.setRequestHeader)for(var n in l)u.setRequestHeader(n,l[n]);if(o!=null&&u.overrideMimeType)u.overrideMimeType(o);if(c!=null)u.responseType=c;if(i!=null)a.on("error",i).on("load",function(e){i(null,e)});s.beforesend.call(a,u);u.send(t==null?null:t);return a};a.abort=function(){u.abort();return a};P.rebind(a,s,"on");return e==null?a:a.get($t(e))}function $t(i){return i.length===1?function(e,t){i(e==null?t:null)}:i}function Wt(e){var t=e.responseType;return t&&t!=="text"?e.response:e.responseText}P.dsv=function(r,o){var t=new RegExp('["'+r+"\n]"),f=r.charCodeAt(0);function a(e,t,i){if(arguments.length<3)i=t,t=null;var n=Gt(e,o,t==null?s:l(t),i);n.row=function(e){return arguments.length?n.response((t=e)==null?s:l(e)):t};return n}function s(e){return a.parse(e.responseText)}function l(t){return function(e){return a.parse(e.responseText,t)}}a.parse=function(e,n){var r;return a.parseRows(e,function(e,t){if(r)return r(e,t-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=n?function(e,t){return n(i(e),t)}:i})};a.parseRows=function(r,e){var o={},a={},t=[],s=r.length,l=0,i=0,n,u;function c(){if(l>=s)return a;if(u)return u=false,o;var e=l;if(r.charCodeAt(e)===34){var t=e;while(t++<s){if(r.charCodeAt(t)===34){if(r.charCodeAt(t+1)!==34)break;++t}}l=t+2;var i=r.charCodeAt(t+1);if(i===13){u=true;if(r.charCodeAt(t+2)===10)++l}else if(i===10){u=true}return r.slice(e+1,t).replace(/""/g,'"')}while(l<s){var i=r.charCodeAt(l++),n=1;if(i===10)u=true;else if(i===13){u=true;if(r.charCodeAt(l)===10)++l,++n}else if(i!==f)continue;return r.slice(e,l-n)}return r.slice(e)}while((n=c())!==a){var d=[];while(n!==o&&n!==a){d.push(n);n=c()}if(e&&(d=e(d,i++))==null)continue;t.push(d)}return t};a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var i=new se,n=[];e.forEach(function(e){for(var t in e){if(!i.has(t)){n.push(i.add(t))}}});return[n.map(u).join(r)].concat(e.map(function(t){return n.map(function(e){return u(t[e])}).join(r)})).join("\n")};a.formatRows=function(e){return e.map(i).join("\n")};function i(e){return e.map(u).join(r)}function u(e){return t.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a};P.csv=P.dsv(",","text/csv");P.tsv=P.dsv(" ","text/tab-separated-values");var Ht,jt,Bt,Vt,v,zt=this[ue(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};P.timer=function(e,t,i){var n=arguments.length;if(n<2)t=0;if(n<3)i=Date.now();var r=i+t,o={c:e,t:r,f:false,n:null};if(jt)jt.n=o;else Ht=o;jt=o;if(!Bt){Vt=clearTimeout(Vt);Bt=1;zt(Ut)}};function Ut(){var e=Yt(),t=qt()-e;if(t>24){if(isFinite(t)){clearTimeout(Vt);Vt=setTimeout(Ut,t)}Bt=0}else{Bt=1;zt(Ut)}}P.timer.flush=function(){Yt();qt()};function Yt(){var e=Date.now();v=Ht;while(v){if(e>=v.t)v.f=v.c(e-v.t);v=v.n}return e}function qt(){var e,t=Ht,i=Infinity;while(t){if(t.f){t=e?e.n=t.n:Ht=t.n}else{if(t.t<i)i=t.t;t=(e=t).n}}jt=e;return i}function Xt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}P.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Kt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Qt);P.formatPrefix=function(e,t){var i=0;if(e){if(e<0)e*=-1;if(t)e=P.round(e,Xt(e,t));i=1+Math.floor(1e-12+Math.log(e)/Math.LN10);i=Math.max(-24,Math.min(24,Math.floor((i-1)/3)*3))}return Kt[8+i/3]};function Qt(e,t){var i=Math.pow(10,I(8-t)*3);return{scale:t>8?function(e){return e/i}:function(e){return e*i},symbol:e}}function Zt(e){var E=e.decimal,s=e.thousands,l=e.grouping,n=e.currency,x=l&&s?function(e,t){var i=e.length,n=[],r=0,o=l[0],a=0;while(i>0&&o>0){if(a+o+1>t)o=Math.max(1,t-a);n.push(e.substring(i-=o,i+o));if((a+=o+1)>t)break;o=l[r=(r+1)%l.length]}return n.reverse().join(s)}:L;return function(e){var t=Jt.exec(e),c=t[1]||" ",d=t[2]||">",f=t[3]||"-",i=t[4]||"",p=t[5],h=+t[6],g=t[7],v=t[8],m=t[9],y=1,b="",_="",w=false,C=true;if(v)v=+v.substring(1);if(p||c==="0"&&d==="="){p=c="0";d="="}switch(m){case"n":g=true;m="g";break;case"%":y=100;_="%";m="f";break;case"p":y=100;_="%";m="r";break;case"b":case"o":case"x":case"X":if(i==="#")b="0"+m.toLowerCase();case"c":C=false;case"d":w=true;v=0;break;case"s":y=-1;m="r";break}if(i==="$")b=n[0],_=n[1];if(m=="r"&&!v)m="g";if(v!=null){if(m=="g")v=Math.max(1,Math.min(21,v));else if(m=="e"||m=="f")v=Math.max(0,Math.min(20,v))}m=ei.get(m)||ti;var A=p&&g;return function(e){var t=_;if(w&&e%1)return"";var i=e<0||e===0&&1/e<0?(e=-e,"-"):f==="-"?"":f;if(y<0){var n=P.formatPrefix(e,v);e=n.scale(e);t=n.symbol+_}else{e*=y}e=m(e,v);var r=e.lastIndexOf("."),o,a;if(r<0){var s=C?e.lastIndexOf("e"):-1;if(s<0)o=e,a="";else o=e.substring(0,s),a=e.substring(s)}else{o=e.substring(0,r);a=E+e.substring(r+1)}if(!p&&g)o=x(o,Infinity);var l=b.length+o.length+a.length+(A?0:i.length),u=l<h?new Array(l=h-l+1).join(c):"";if(A)o=x(u+o,u.length?h-a.length:Infinity);i+=b;e=o+a;return(d==="<"?i+e+u:d===">"?u+i+e:d==="^"?u.substring(0,l>>=1)+i+e+u.substring(l):i+(A?e:u+e))+t}}}var Jt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;var ei=P.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=P.round(e,Xt(e,t))).toFixed(Math.max(0,Math.min(20,Xt(e*(1+1e-15),t))))}});function ti(e){return e+""}var O=P.time={},R=Date;function N(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}N.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){e.setUTCDate.apply(this._,arguments)},setDay:function(){e.setUTCDay.apply(this._,arguments)},setFullYear:function(){e.setUTCFullYear.apply(this._,arguments)},setHours:function(){e.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){e.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){e.setUTCMinutes.apply(this._,arguments)},setMonth:function(){e.setUTCMonth.apply(this._,arguments)},setSeconds:function(){e.setUTCSeconds.apply(this._,arguments)},setTime:function(){e.setTime.apply(this._,arguments)}};var e=Date.prototype;function ii(n,o,a){function e(e){var t=n(e),i=r(t,1);return e-t<i-e?t:i}function s(e){o(e=n(new R(e-1)),1);return e}function r(e,t){o(e=new R(+e),t);return e}function l(e,t,i){var n=s(e),r=[];if(i>1){while(n<t){if(!(a(n)%i))r.push(new Date(+n));o(n,1)}}else{while(n<t)r.push(new Date(+n)),o(n,1)}return r}function t(e,t,i){try{R=N;var n=new N;n._=e;return l(n,t,i)}finally{R=Date}}n.floor=n;n.round=e;n.ceil=s;n.offset=r;n.range=l;var i=n.utc=ni(n);i.floor=i;i.round=ni(e);i.ceil=ni(s);i.offset=ni(r);i.range=t;return n}function ni(n){return function(e,t){try{R=N;var i=new N;i._=e;return n(i,t)._}finally{R=Date}}}O.year=ii(function(e){e=O.day(e);e.setMonth(0,1);return e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()});O.years=O.year.range;O.years.utc=O.year.utc.range;O.day=ii(function(e){var t=new R(2e3,0);t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate());return t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1});O.days=O.day.range;O.days.utc=O.day.utc.range;O.dayOfYear=function(e){var t=O.year(e);return Math.floor((e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,i){i=7-i;var t=O[e]=ii(function(e){(e=O.day(e)).setDate(e.getDate()-(e.getDay()+i)%7);return e},function(e,t){e.setDate(e.getDate()+Math.floor(t)*7)},function(e){var t=O.year(e).getDay();return Math.floor((O.dayOfYear(e)+(t+i)%7)/7)-(t!==i)});O[e+"s"]=t.range;O[e+"s"].utc=t.utc.range;O[e+"OfYear"]=function(e){var t=O.year(e).getDay();return Math.floor((O.dayOfYear(e)+(t+i)%7)/7)}});O.week=O.sunday;O.weeks=O.sunday.range;O.weeks.utc=O.sunday.utc.range;O.weekOfYear=O.sundayOfYear;function ri(e){var t=e.dateTime,i=e.date,n=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths;function u(s){var l=s.length;function e(e){var t=[],i=-1,n=0,r,o,a;while(++i<l){if(s.charCodeAt(i)===37){t.push(s.slice(n,i));if((o=oi[r=s.charAt(++i)])!=null)r=s.charAt(++i);if(a=_[r])r=a(e,o==null?r==="e"?" ":"0":o);t.push(r);n=i+1}}t.push(s.slice(n,i));return t.join("")}e.parse=function(e){var t={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=c(t,s,e,0);if(i!=e.length)return null;if("p"in t)t.H=t.H%12+t.p*12;var n=t.Z!=null&&R!==N,r=new(n?N:R);if("j"in t)r.setFullYear(t.y,0,t.j);else if("w"in t&&("W"in t||"U"in t)){r.setFullYear(t.y,0,1);r.setFullYear(t.y,0,"W"in t?(t.w+6)%7+t.W*7-(r.getDay()+5)%7:t.w+t.U*7-(r.getDay()+6)%7)}else r.setFullYear(t.y,t.m,t.d);r.setHours(t.H+(t.Z/100|0),t.M+t.Z%100,t.S,t.L);return n?r._:r};e.toString=function(){return s};return e}function c(e,t,i,n){var r,o,a,s=0,l=t.length,u=i.length;while(s<l){if(n>=u)return-1;r=t.charCodeAt(s++);if(r===37){a=t.charAt(s++);o=w[a in oi?t.charAt(s++):a];if(!o||(n=o(e,i,n))<0)return-1}else if(r!=i.charCodeAt(n++)){return-1}}return n}u.utc=function(e){var i=u(e);function t(e){try{R=N;var t=new R;t._=e;return i(t)}finally{R=Date}}t.parse=function(e){try{R=N;var t=i.parse(e);return t&&t._}finally{R=Date}};t.toString=i.toString;return t};u.multi=u.utc.multi=xi;var d=P.map(),f=si(o),p=li(o),h=si(a),g=li(a),v=si(s),m=li(s),y=si(l),b=li(l);r.forEach(function(e,t){d.set(e.toLowerCase(),t)});var _={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:u(t),d:function(e,t){return G(e.getDate(),t,2)},e:function(e,t){return G(e.getDate(),t,2)},H:function(e,t){return G(e.getHours(),t,2)},I:function(e,t){return G(e.getHours()%12||12,t,2)},j:function(e,t){return G(1+O.dayOfYear(e),t,3)},L:function(e,t){return G(e.getMilliseconds(),t,3)},m:function(e,t){return G(e.getMonth()+1,t,2)},M:function(e,t){return G(e.getMinutes(),t,2)},p:function(e){return r[+(e.getHours()>=12)]},S:function(e,t){return G(e.getSeconds(),t,2)},U:function(e,t){return G(O.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return G(O.mondayOfYear(e),t,2)},x:u(i),X:u(n),y:function(e,t){return G(e.getFullYear()%100,t,2)},Y:function(e,t){return G(e.getFullYear()%1e4,t,4)},Z:Ai,"%":function(){return"%"}};var w={a:C,A:A,b:E,B:x,c:T,d:mi,e:mi,H:bi,I:bi,j:yi,L:Ci,m:vi,M:_i,p:k,S:wi,U:ci,w:ui,W:di,x:S,X:D,y:pi,Y:fi,Z:hi,"%":Ei};function C(e,t,i){h.lastIndex=0;var n=h.exec(t.slice(i));return n?(e.w=g.get(n[0].toLowerCase()),i+n[0].length):-1}function A(e,t,i){f.lastIndex=0;var n=f.exec(t.slice(i));return n?(e.w=p.get(n[0].toLowerCase()),i+n[0].length):-1}function E(e,t,i){y.lastIndex=0;var n=y.exec(t.slice(i));return n?(e.m=b.get(n[0].toLowerCase()),i+n[0].length):-1}function x(e,t,i){v.lastIndex=0;var n=v.exec(t.slice(i));return n?(e.m=m.get(n[0].toLowerCase()),i+n[0].length):-1}function T(e,t,i){return c(e,_.c.toString(),t,i)}function S(e,t,i){return c(e,_.x.toString(),t,i)}function D(e,t,i){return c(e,_.X.toString(),t,i)}function k(e,t,i){var n=d.get(t.slice(i,i+=2).toLowerCase());return n==null?-1:(e.p=n,i)}return u}var oi={"-":"",_:" ",0:"0"},r=/^\s*\d+/,ai=/^%/;function G(e,t,i){var n=e<0?"-":"",r=(n?-e:e)+"",o=r.length;return n+(o<i?new Array(i-o+1).join(t)+r:r)}function si(e){return new RegExp("^(?:"+e.map(P.requote).join("|")+")","i")}function li(e){var t=new y,i=-1,n=e.length;while(++i<n)t.set(e[i].toLowerCase(),i);return t}function ui(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+1));return n?(e.w=+n[0],i+n[0].length):-1}function ci(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i));return n?(e.U=+n[0],i+n[0].length):-1}function di(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i));return n?(e.W=+n[0],i+n[0].length):-1}function fi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+4));return n?(e.y=+n[0],i+n[0].length):-1}function pi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.y=gi(+n[0]),i+n[0].length):-1}function hi(e,t,i){return/^[+-]\d{4}$/.test(t=t.slice(i,i+5))?(e.Z=-t,i+5):-1}function gi(e){return e+(e>68?1900:2e3)}function vi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.m=n[0]-1,i+n[0].length):-1}function mi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.d=+n[0],i+n[0].length):-1}function yi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+3));return n?(e.j=+n[0],i+n[0].length):-1}function bi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.H=+n[0],i+n[0].length):-1}function _i(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.M=+n[0],i+n[0].length):-1}function wi(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+2));return n?(e.S=+n[0],i+n[0].length):-1}function Ci(e,t,i){r.lastIndex=0;var n=r.exec(t.slice(i,i+3));return n?(e.L=+n[0],i+n[0].length):-1}function Ai(e){var t=e.getTimezoneOffset(),i=t>0?"-":"+",n=I(t)/60|0,r=I(t)%60;return i+G(n,"0",2)+G(r,"0",2)}function Ei(e,t,i){ai.lastIndex=0;var n=ai.exec(t.slice(i,i+1));return n?i+n[0].length:-1}function xi(n){var e=n.length,t=-1;while(++t<e)n[t][0]=this(n[t][0]);return function(e){var t=0,i=n[t];while(!i[1](e))i=n[++t];return i[0](e)}}P.locale=function(e){return{numberFormat:Zt(e),timeFormat:ri(e)}};var Ti=P.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});P.format=Ti.numberFormat;P.geo={};function Si(){}Si.prototype={s:0,t:0,add:function(e){ki(e,this.t,Di);ki(Di.s,this.s,this);if(this.s)this.t+=Di.t;else this.s=Di.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Di=new Si;function ki(e,t,i){var n=i.s=e+t,r=n-e,o=n-r;i.t=e-o+(t-r)}P.geo.stream=function(e,t){if(e&&Ri.hasOwnProperty(e.type)){Ri[e.type](e,t)}else{Oi(e,t)}};function Oi(e,t){if(e&&Ni.hasOwnProperty(e.type)){Ni[e.type](e,t)}}var Ri={Feature:function(e,t){Oi(e.geometry,t)},FeatureCollection:function(e,t){var i=e.features,n=-1,r=i.length;while(++n<r)Oi(i[n].geometry,t)}};var Ni={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates;t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){var i=e.coordinates,n=-1,r=i.length;while(++n<r)e=i[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ii(e.coordinates,t,0)},MultiLineString:function(e,t){var i=e.coordinates,n=-1,r=i.length;while(++n<r)Ii(i[n],t,0)},Polygon:function(e,t){Pi(e.coordinates,t)},MultiPolygon:function(e,t){var i=e.coordinates,n=-1,r=i.length;while(++n<r)Pi(i[n],t)},GeometryCollection:function(e,t){var i=e.geometries,n=-1,r=i.length;while(++n<r)Oi(i[n],t)}};function Ii(e,t,i){var n=-1,r=e.length-i,o;t.lineStart();while(++n<r)o=e[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function Pi(e,t){var i=-1,n=e.length;t.polygonStart();while(++i<n)Ii(e[i],t,1);t.polygonEnd()}P.geo.area=function(e){Mi=0;P.geo.stream(e,C);return Mi};var Mi,Li=new Si;var C={sphere:function(){Mi+=4*U},point:c,lineStart:c,lineEnd:c,polygonStart:function(){Li.reset();C.lineStart=Fi},polygonEnd:function(){var e=2*Li;Mi+=e<0?4*U+e:e;C.lineStart=C.lineEnd=C.point=c}};function Fi(){var i,n,c,d,f;C.point=function(e,t){C.point=r;c=(i=e)*E,d=Math.cos(t=(n=t)*E/2+U/4),f=Math.sin(t)};function r(e,t){e*=E;t=t*E/2+U/4;var i=e-c,n=i>=0?1:-1,r=n*i,o=Math.cos(t),a=Math.sin(t),s=f*a,l=d*o+s*Math.cos(r),u=s*n*Math.sin(r);Li.add(Math.atan2(u,l));c=e,d=o,f=a}C.lineEnd=function(){r(i,n)}}function Gi(e){var t=e[0],i=e[1],n=Math.cos(i);return[n*Math.cos(t),n*Math.sin(t),Math.sin(i)]}function $i(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Wi(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Hi(e,t){e[0]+=t[0];e[1]+=t[1];e[2]+=t[2]}function ji(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Bi(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t;e[1]/=t;e[2]/=t}function Vi(e){return[Math.atan2(e[1],e[0]),tt(e[2])]}function zi(e,t){return I(e[0]-t[0])<F&&I(e[1]-t[1])<F}P.geo.bounds=function(){var d,f,p,h,g,n,r,v,o,l,u;var c={point:m,lineStart:e,lineEnd:t,polygonStart:function(){c.point=i;c.lineStart=s;c.lineEnd=y;o=0;C.polygonStart()},polygonEnd:function(){C.polygonEnd();c.point=m;c.lineStart=e;c.lineEnd=t;if(Li<0)d=-(p=180),f=-(h=90);else if(o>F)h=90;else if(o<-F)f=-90;u[0]=d,u[1]=p}};function m(e,t){l.push(u=[d=e,p=e]);if(t<f)f=t;if(t>h)h=t}function a(e,t){var i=Gi([e*E,t*E]);if(v){var n=Wi(v,i),r=[n[1],-n[0],0],o=Wi(r,n);Bi(o);o=Vi(o);var a=e-g,s=a>0?1:-1,l=o[0]*x*s,u=I(a)>180;if(u^(s*g<l&&l<s*e)){var c=o[1]*x;if(c>h)h=c}else if(l=(l+360)%360-180,u^(s*g<l&&l<s*e)){var c=-o[1]*x;if(c<f)f=c}else{if(t<f)f=t;if(t>h)h=t}if(u){if(e<g){if(b(d,e)>b(d,p))p=e}else{if(b(e,p)>b(d,p))d=e}}else{if(p>=d){if(e<d)d=e;if(e>p)p=e}else{if(e>g){if(b(d,e)>b(d,p))p=e}else{if(b(e,p)>b(d,p))d=e}}}}else{m(e,t)}v=i,g=e}function e(){c.point=a}function t(){u[0]=d,u[1]=p;c.point=m;v=null}function i(e,t){if(v){var i=e-g;o+=I(i)>180?i+(i>0?360:-360):i}else n=e,r=t;C.point(e,t);a(e,t)}function s(){C.lineStart()}function y(){i(n,r);C.lineEnd();if(I(o)>F)d=-(p=180);u[0]=d,u[1]=p;v=null}function b(e,t){return(t-=e)<0?t+360:t}function _(e,t){return e[0]-t[0]}function w(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(e){h=p=-(d=f=Infinity);l=[];P.geo.stream(e,c);var t=l.length;if(t){l.sort(_);for(var i=1,n=l[0],r,o=[n];i<t;++i){r=l[i];if(w(r[0],n)||w(r[1],n)){if(b(n[0],r[1])>b(n[0],n[1]))n[1]=r[1];if(b(r[0],n[1])>b(n[0],n[1]))n[0]=r[0]}else{o.push(n=r)}}var a=-Infinity,s;for(var t=o.length-1,i=0,n=o[t],r;i<=t;n=r,++i){r=o[i];if((s=b(n[1],r[0]))>a)a=s,d=r[0],p=n[1]}}l=u=null;return d===Infinity||f===Infinity?[[NaN,NaN],[NaN,NaN]]:[[d,f],[p,h]]}}();P.geo.centroid=function(e){Ui=Yi=qi=Xi=Ki=Qi=Zi=m=Ji=en=tn=0;P.geo.stream(e,f);var t=Ji,i=en,n=tn,r=t*t+i*i+n*n;if(r<Ke){t=Qi,i=Zi,n=m;if(Yi<F)t=qi,i=Xi,n=Ki;r=t*t+i*i+n*n;if(r<Ke)return[NaN,NaN]}return[Math.atan2(i,t)*x,tt(n/Math.sqrt(r))*x]};var Ui,Yi,qi,Xi,Ki,Qi,Zi,m,Ji,en,tn;var f={sphere:c,point:nn,lineStart:on,lineEnd:an,polygonStart:function(){f.lineStart=sn},polygonEnd:function(){f.lineStart=on}};function nn(e,t){e*=E;var i=Math.cos(t*=E);rn(i*Math.cos(e),i*Math.sin(e),Math.sin(t))}function rn(e,t,i){++Ui;qi+=(e-qi)/Ui;Xi+=(t-Xi)/Ui;Ki+=(i-Ki)/Ui}function on(){var s,l,u;f.point=function(e,t){e*=E;var i=Math.cos(t*=E);s=i*Math.cos(e);l=i*Math.sin(e);u=Math.sin(t);f.point=n;rn(s,l,u)};function n(e,t){e*=E;var i=Math.cos(t*=E),n=i*Math.cos(e),r=i*Math.sin(e),o=Math.sin(t),a=Math.atan2(Math.sqrt((a=l*o-u*r)*a+(a=u*n-s*o)*a+(a=s*r-l*n)*a),s*n+l*r+u*o);Yi+=a;Qi+=a*(s+(s=n));Zi+=a*(l+(l=r));m+=a*(u+(u=o));rn(s,l,u)}}function an(){f.point=nn}function sn(){var n,r,p,h,g;f.point=function(e,t){n=e,r=t;f.point=o;e*=E;var i=Math.cos(t*=E);p=i*Math.cos(e);h=i*Math.sin(e);g=Math.sin(t);rn(p,h,g)};f.lineEnd=function(){o(n,r);f.lineEnd=an;f.point=nn};function o(e,t){e*=E;var i=Math.cos(t*=E),n=i*Math.cos(e),r=i*Math.sin(e),o=Math.sin(t),a=h*o-g*r,s=g*n-p*o,l=p*r-h*n,u=Math.sqrt(a*a+s*s+l*l),c=p*n+h*r+g*o,d=u&&-et(c)/u,f=Math.atan2(u,c);Ji+=d*a;en+=d*s;tn+=d*l;Yi+=f;Qi+=f*(p+(p=n));Zi+=f*(h+(h=r));m+=f*(g+(g=o));rn(p,h,g)}}function ln(i,n){function e(e,t){return e=i(e,t),n(e[0],e[1])}if(i.invert&&n.invert)e.invert=function(e,t){return e=n.invert(e,t),e&&i.invert(e[0],e[1])};return e}function un(){return true}function cn(e,t,i,n,s){var l=[],u=[];e.forEach(function(e){if((t=e.length-1)<=0)return;var t,i=e[0],n=e[t];if(zi(i,n)){s.lineStart();for(var r=0;r<t;++r)s.point((i=e[r])[0],i[1]);s.lineEnd();return}var o=new fn(i,e,null,true),a=new fn(i,null,o,false);o.o=a;l.push(o);u.push(a);o=new fn(n,e,null,false);a=new fn(n,null,o,true);o.o=a;l.push(o);u.push(a)});u.sort(t);dn(l);dn(u);if(!l.length)return;for(var r=0,o=i,a=u.length;r<a;++r){u[r].e=o=!o}var c=l[0],d,f;while(1){var p=c,h=true;while(p.v)if((p=p.n)===c)return;d=p.z;s.lineStart();do{p.v=p.o.v=true;if(p.e){if(h){for(var r=0,a=d.length;r<a;++r)s.point((f=d[r])[0],f[1])}else{n(p.x,p.n.x,1,s)}p=p.n}else{if(h){d=p.p.z;for(var r=d.length-1;r>=0;--r)s.point((f=d[r])[0],f[1])}else{n(p.x,p.p.x,-1,s)}p=p.p}p=p.o;d=p.z;h=!h}while(!p.v);s.lineEnd()}}function dn(e){if(!(t=e.length))return;var t,i=0,n=e[0],r;while(++i<t){n.n=r=e[i];r.p=n;n=r}n.n=r=e[0];r.p=n}function fn(e,t,i,n){this.x=e;this.z=t;this.o=i;this.e=n;this.v=false;this.n=this.p=null}function pn(y,b,_,w){return function(n,a){var r=b(a),t=n.invert(w[0],w[1]);var i={point:o,lineStart:s,lineEnd:l,polygonStart:function(){i.point=g;i.lineStart=v;i.lineEnd=m;u=[];p=[]},polygonEnd:function(){i.point=o;i.lineStart=s;i.lineEnd=l;u=P.merge(u);var e=wn(t,p);if(u.length){if(!f)a.polygonStart(),f=true;cn(u,vn,e,_,a)}else if(e){if(!f)a.polygonStart(),f=true;a.lineStart();_(null,null,1,a);a.lineEnd()}if(f)a.polygonEnd(),f=false;u=p=null},sphere:function(){a.polygonStart();a.lineStart();_(null,null,1,a);a.lineEnd();a.polygonEnd()}};function o(e,t){var i=n(e,t);if(y(e=i[0],t=i[1]))a.point(e,t)}function e(e,t){var i=n(e,t);r.point(i[0],i[1])}function s(){i.point=e;r.lineStart()}function l(){i.point=o;r.lineEnd()}var u;var c=gn(),d=b(c),f=false,p,h;function g(e,t){h.push([e,t]);var i=n(e,t);d.point(i[0],i[1])}function v(){d.lineStart();h=[]}function m(){g(h[0][0],h[0][1]);d.lineEnd();var e=d.clean(),t=c.buffer(),i,n=t.length;h.pop();p.push(h);h=null;if(!n)return;if(e&1){i=t[0];var n=i.length-1,r=-1,o;if(n>0){if(!f)a.polygonStart(),f=true;a.lineStart();while(++r<n)a.point((o=i[r])[0],o[1]);a.lineEnd()}return}if(n>1&&e&2)t.push(t.pop().concat(t.shift()));u.push(t.filter(hn))}return i}}function hn(e){return e.length>1}function gn(){var t=[],i;return{lineStart:function(){t.push(i=[])},point:function(e,t){i.push([e,t])},lineEnd:c,buffer:function(){var e=t;t=[];i=null;return e},rejoin:function(){if(t.length>1)t.push(t.pop().concat(t.shift()))}}}function vn(e,t){return((e=e.x)[0]<0?e[1]-Y-F:Y-e[1])-((t=t.x)[0]<0?t[1]-Y-F:Y-t[1])}var mn=pn(un,yn,_n,[-U,-U/2]);function yn(r){var o=NaN,a=NaN,s=NaN,l;return{lineStart:function(){r.lineStart();l=1},point:function(e,t){var i=e>0?U:-U,n=I(e-o);if(I(n-U)<F){r.point(o,a=(a+t)/2>0?Y:-Y);r.point(s,a);r.lineEnd();r.lineStart();r.point(i,a);r.point(e,a);l=0}else if(s!==i&&n>=U){if(I(o-s)<F)o-=s*F;if(I(e-i)<F)e-=i*F;a=bn(o,a,e,t);r.point(s,a);r.lineEnd();r.lineStart();r.point(i,a);l=0}r.point(o=e,a=t);s=i},lineEnd:function(){r.lineEnd();o=a=NaN},clean:function(){return 2-l}}}function bn(e,t,i,n){var r,o,a=Math.sin(e-i);return I(a)>F?Math.atan((Math.sin(t)*(o=Math.cos(n))*Math.sin(i)-Math.sin(n)*(r=Math.cos(t))*Math.sin(e))/(r*o*a)):(t+n)/2}function _n(e,t,i,n){var r;if(e==null){r=i*Y;n.point(-U,r);n.point(0,r);n.point(U,r);n.point(U,0);n.point(U,-r);n.point(0,-r);n.point(-U,-r);n.point(-U,0);n.point(-U,r)}else if(I(e[0]-t[0])>F){var o=e[0]<t[0]?U:-U;r=i*o/2;n.point(-o,r);n.point(0,r);n.point(o,r)}else{n.point(t[0],t[1])}}function wn(e,t){var i=e[0],n=e[1],r=[Math.sin(i),-Math.cos(i),0],o=0,a=0;Li.reset();for(var s=0,l=t.length;s<l;++s){var u=t[s],c=u.length;if(!c)continue;var d=u[0],f=d[0],p=d[1]/2+U/4,h=Math.sin(p),g=Math.cos(p),v=1;while(true){if(v===c)v=0;e=u[v];var m=e[0],y=e[1]/2+U/4,b=Math.sin(y),_=Math.cos(y),w=m-f,C=w>=0?1:-1,A=C*w,E=A>U,x=h*b;Li.add(Math.atan2(x*C*Math.sin(A),g*_+x*Math.cos(A)));o+=E?w+C*k:w;if(E^f>=i^m>=i){var T=Wi(Gi(d),Gi(e));Bi(T);var S=Wi(r,T);Bi(S);var D=(E^w>=0?-1:1)*tt(S[2]);if(n>D||n===D&&(T[0]||T[1])){a+=E^w>=0?1:-1}}if(!v++)break;f=m,h=b,g=_,d=e}}return(o<-F||o<F&&Li<0)^a&1}function Cn(r){var O=Math.cos(r),p=O>0,h=I(O)>F,e=rr(r,6*E);return pn(g,t,e,p?[0,-r]:[-U,r-U]);function g(e,t){return Math.cos(e)*Math.cos(t)>O}function t(s){var l,u,c,d,f;return{lineStart:function(){d=c=false;f=1},point:function(e,t){var i=[e,t],n,r=g(e,t),o=p?r?0:m(e,t):r?m(e+(e<0?U:-U),t):0;if(!l&&(d=c=r))s.lineStart();if(r!==c){n=v(l,i);if(zi(l,n)||zi(i,n)){i[0]+=F;i[1]+=F;r=g(i[0],i[1])}}if(r!==c){f=0;if(r){s.lineStart();n=v(i,l);s.point(n[0],n[1])}else{n=v(l,i);s.point(n[0],n[1]);s.lineEnd()}l=n}else if(h&&l&&p^r){var a;if(!(o&u)&&(a=v(i,l,true))){f=0;if(p){s.lineStart();s.point(a[0][0],a[0][1]);s.point(a[1][0],a[1][1]);s.lineEnd()}else{s.point(a[1][0],a[1][1]);s.lineEnd();s.lineStart();s.point(a[0][0],a[0][1])}}}if(r&&(!l||!zi(l,i))){s.point(i[0],i[1])}l=i,c=r,u=o},lineEnd:function(){if(c)s.lineEnd();l=null},clean:function(){return f|(d&&c)<<1}}}function v(e,t,i){var n=Gi(e),r=Gi(t);var o=[1,0,0],a=Wi(n,r),s=$i(a,a),l=a[0],u=s-l*l;if(!u)return!i&&e;var c=O*s/u,d=-O*l/u,f=Wi(o,a),p=ji(o,c),h=ji(a,d);Hi(p,h);var g=f,v=$i(p,g),m=$i(g,g),y=v*v-m*($i(p,p)-1);if(y<0)return;var b=Math.sqrt(y),_=ji(g,(-v-b)/m);Hi(_,p);_=Vi(_);if(!i)return _;var w=e[0],C=t[0],A=e[1],E=t[1],x;if(C<w)x=w,w=C,C=x;var T=C-w,S=I(T-U)<F,D=S||T<F;if(!S&&E<A)x=A,A=E,E=x;if(D?S?A+E>0^_[1]<(I(_[0]-w)<F?A:E):A<=_[1]&&_[1]<=E:T>U^(w<=_[0]&&_[0]<=C)){var k=ji(g,(-v+b)/m);Hi(k,p);return[_,Vi(k)]}}function m(e,t){var i=p?r:U-r,n=0;if(e<-i)n|=1;else if(e>i)n|=2;if(t<-i)n|=4;else if(t>i)n|=8;return n}}function An(f,p,h,g){return function(e){var t=e.a,i=e.b,n=t.x,r=t.y,o=i.x,a=i.y,s=0,l=1,u=o-n,c=a-r,d;d=f-n;if(!u&&d>0)return;d/=u;if(u<0){if(d<s)return;if(d<l)l=d}else if(u>0){if(d>l)return;if(d>s)s=d}d=h-n;if(!u&&d<0)return;d/=u;if(u<0){if(d>l)return;if(d>s)s=d}else if(u>0){if(d<s)return;if(d<l)l=d}d=p-r;if(!c&&d>0)return;d/=c;if(c<0){if(d<s)return;if(d<l)l=d}else if(c>0){if(d>l)return;if(d>s)s=d}d=g-r;if(!c&&d<0)return;d/=c;if(c<0){if(d>l)return;if(d>s)s=d}else if(c>0){if(d<s)return;if(d<l)l=d}if(s>0)e.a={x:n+s*u,y:r+s*c};if(l<1)e.b={x:n+l*u,y:r+l*c};return e}}var En=1e9;P.geo.clipExtent=function(){var t,i,n,r,o,a,s={stream:function(e){if(o)o.valid=false;o=a(e);o.valid=true;return o},extent:function(e){if(!arguments.length)return[[t,i],[n,r]];a=xn(t=+e[0][0],i=+e[0][1],n=+e[1][0],r=+e[1][1]);if(o)o.valid=false,o=null;return s}};return s.extent([[0,0],[960,500]])};function xn(A,E,x,T){return function(r){var n=r,e=gn(),o=An(A,E,x,T),a,c,s;var t={point:i,lineStart:_,lineEnd:w,polygonStart:function(){r=e;a=[];c=[];b=true},polygonEnd:function(){r=n;a=P.merge(a);var e=l([A,T]),t=b&&e,i=a.length;if(t||i){r.polygonStart();if(t){r.lineStart();u(null,null,1,r);r.lineEnd()}if(i){cn(a,D,e,u,r)}r.polygonEnd()}a=c=s=null}};function l(e){var t=0,i=c.length,n=e[1];for(var r=0;r<i;++r){for(var o=1,a=c[r],s=a.length,l=a[0],u;o<s;++o){u=a[o];if(l[1]<=n){if(u[1]>n&&Je(l,u,e)>0)++t}else{if(u[1]<=n&&Je(l,u,e)<0)--t}l=u}}return t!==0}function u(e,t,i,n){var r=0,o=0;if(e==null||(r=S(e,i))!==(o=S(t,i))||k(e,t)<0^i>0){do{n.point(r===0||r===3?A:x,r>1?T:E)}while((r=(r+i+4)%4)!==o)}else{n.point(t[0],t[1])}}function d(e,t){return A<=e&&e<=x&&E<=t&&t<=T}function i(e,t){if(d(e,t))r.point(e,t)}var f,p,h,g,v,m,y,b;function _(){t.point=C;if(c)c.push(s=[]);y=true;m=false;g=v=NaN}function w(){if(a){C(f,p);if(h&&m)e.rejoin();a.push(e.buffer())}t.point=i;if(m)r.lineEnd()}function C(e,t){e=Math.max(-En,Math.min(En,e));t=Math.max(-En,Math.min(En,t));var i=d(e,t);if(c)s.push([e,t]);if(y){f=e,p=t,h=i;y=false;if(i){r.lineStart();r.point(e,t)}}else{if(i&&m)r.point(e,t);else{var n={a:{x:g,y:v},b:{x:e,y:t}};if(o(n)){if(!m){r.lineStart();r.point(n.a.x,n.a.y)}r.point(n.b.x,n.b.y);if(!i)r.lineEnd();b=false}else if(i){r.lineStart();r.point(e,t);b=false}}}g=e,v=t,m=i}return t};function S(e,t){return I(e[0]-A)<F?t>0?0:3:I(e[0]-x)<F?t>0?2:1:I(e[1]-E)<F?t>0?1:0:t>0?3:2}function D(e,t){return k(e.x,t.x)}function k(e,t){var i=S(e,1),n=S(t,1);return i!==n?i-n:i===0?t[1]-e[1]:i===1?e[0]-t[0]:i===2?e[1]-t[1]:t[0]-e[0]}}function Tn(e){var t=0,i=U/3,n=Kn(e),r=n(t,i);r.parallels=function(e){if(!arguments.length)return[t/U*180,i/U*180];return n(t=e[0]*U/180,i=e[1]*U/180)};return r}function Sn(e,t){var i=Math.sin(e),n=(i+Math.sin(t))/2,r=1+i*(2*n-i),o=Math.sqrt(r)/n;function a(e,t){var i=Math.sqrt(r-2*n*Math.sin(t))/n;return[i*Math.sin(e*=n),o-i*Math.cos(e)]}a.invert=function(e,t){var i=o-t;return[Math.atan2(e,i)/n,tt((r-(e*e+i*i)*n*n)/(2*n))]};return a}(P.geo.conicEqualArea=function(){return Tn(Sn)}).raw=Sn;P.geo.albers=function(){return P.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};P.geo.albersUsa=function(){var o=P.geo.albers();var a=P.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]);var s=P.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]);var n,r={point:function(e,t){n=[e,t]}},l,u,c;function d(e){var t=e[0],i=e[1];n=null;(l(t,i),n)||(u(t,i),n)||c(t,i);return n}d.invert=function(e){var t=o.scale(),i=o.translate(),n=(e[0]-i[0])/t,r=(e[1]-i[1])/t;return(r>=.12&&r<.234&&n>=-.425&&n<-.214?a:r>=.166&&r<.234&&n>=-.214&&n<-.115?s:o).invert(e)};d.stream=function(e){var i=o.stream(e),n=a.stream(e),r=s.stream(e);return{point:function(e,t){i.point(e,t);n.point(e,t);r.point(e,t)},sphere:function(){i.sphere();n.sphere();r.sphere()},lineStart:function(){i.lineStart();n.lineStart();r.lineStart()},lineEnd:function(){i.lineEnd();n.lineEnd();r.lineEnd()},polygonStart:function(){i.polygonStart();n.polygonStart();r.polygonStart()},polygonEnd:function(){i.polygonEnd();n.polygonEnd();r.polygonEnd()}}};d.precision=function(e){if(!arguments.length)return o.precision();o.precision(e);a.precision(e);s.precision(e);return d};d.scale=function(e){if(!arguments.length)return o.scale();o.scale(e);a.scale(e*.35);s.scale(e);return d.translate(o.translate())};d.translate=function(e){if(!arguments.length)return o.translate();var t=o.scale(),i=+e[0],n=+e[1];l=o.translate(e).clipExtent([[i-.455*t,n-.238*t],[i+.455*t,n+.238*t]]).stream(r).point;u=a.translate([i-.307*t,n+.201*t]).clipExtent([[i-.425*t+F,n+.12*t+F],[i-.214*t-F,n+.234*t-F]]).stream(r).point;c=s.translate([i-.205*t,n+.212*t]).clipExtent([[i-.214*t+F,n+.166*t+F],[i-.115*t-F,n+.234*t-F]]).stream(r).point;return d};return d.scale(1070)};var Dn,kn,On={point:c,lineStart:c,lineEnd:c,polygonStart:function(){kn=0;On.lineStart=Rn},polygonEnd:function(){On.lineStart=On.lineEnd=On.point=c;Dn+=I(kn/2)}};function Rn(){var i,n,r,o;On.point=function(e,t){On.point=a;i=r=e,n=o=t};function a(e,t){kn+=o*e-r*t;r=e,o=t}On.lineEnd=function(){a(i,n)}}var Nn,In,Pn,Mn;var Ln={point:Fn,lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c};function Fn(e,t){if(e<Nn)Nn=e;if(e>Pn)Pn=e;if(t<In)In=t;if(t>Mn)Mn=t}function Gn(){var i=$n(4.5),n=[];var r={point:e,lineStart:function(){r.point=t},lineEnd:a,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=a;r.point=e},pointRadius:function(e){i=$n(e);return r},result:function(){if(n.length){var e=n.join("");n=[];return e}}};function e(e,t){n.push("M",e,",",t,i)}function t(e,t){n.push("M",e,",",t);r.point=o}function o(e,t){n.push("L",e,",",t)}function a(){r.point=e}function s(){n.push("Z")}return r}function $n(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var p={point:Wn,lineStart:Hn,lineEnd:jn,polygonStart:function(){p.lineStart=Bn},polygonEnd:function(){p.point=Wn;p.lineStart=Hn;p.lineEnd=jn}};function Wn(e,t){qi+=e;Xi+=t;++Ki}function Hn(){var o,a;p.point=function(e,t){p.point=i;Wn(o=e,a=t)};function i(e,t){var i=e-o,n=t-a,r=Math.sqrt(i*i+n*n);Qi+=r*(o+e)/2;Zi+=r*(a+t)/2;m+=r;Wn(o=e,a=t)}}function jn(){p.point=Wn}function Bn(){var i,n,o,a;p.point=function(e,t){p.point=r;Wn(i=o=e,n=a=t)};function r(e,t){var i=e-o,n=t-a,r=Math.sqrt(i*i+n*n);Qi+=r*(o+e)/2;Zi+=r*(a+t)/2;m+=r;r=a*e-o*t;Ji+=r*(o+e);en+=r*(a+t);tn+=r*3;Wn(o=e,a=t)}p.lineEnd=function(){r(i,n)}}function Vn(i){var n=4.5;var r={point:e,lineStart:function(){r.point=t},lineEnd:a,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=a;r.point=e},pointRadius:function(e){n=e;return r},result:c};function e(e,t){i.moveTo(e+n,t);i.arc(e,t,n,0,k)}function t(e,t){i.moveTo(e,t);r.point=o}function o(e,t){i.lineTo(e,t)}function a(){r.point=e}function s(){i.closePath()}return r}function zn(k){var O=.5,R=Math.cos(30*E),C=16;function t(e){return(C?n:i)(e)}function i(i){return qn(i,function(e,t){e=k(e,t);i.point(e[0],e[1])})}function n(r){var i,n,o,a,s,l,u,c,d,f,p,h,g;var v={point:e,lineStart:t,lineEnd:y,polygonStart:function(){r.polygonStart();v.lineStart=b},polygonEnd:function(){r.polygonEnd();v.lineStart=t}};function e(e,t){e=k(e,t);r.point(e[0],e[1])}function t(){d=NaN;v.point=m;r.lineStart()}function m(e,t){var i=Gi([e,t]),n=k(e,t);N(d,f,c,p,h,g,d=n[0],f=n[1],c=e,p=i[0],h=i[1],g=i[2],C,r);r.point(d,f)}function y(){v.point=e;r.lineEnd()}function b(){t();v.point=_;v.lineEnd=w}function _(e,t){m(i=e,n=t),o=d,a=f,s=p,l=h,u=g;v.point=m}function w(){N(d,f,c,p,h,g,o,a,i,s,l,u,C,r);v.lineEnd=y;y()}return v}function N(e,t,i,n,r,o,a,s,l,u,c,d,f,p){var h=a-e,g=s-t,v=h*h+g*g;if(v>4*O&&f--){var m=n+u,y=r+c,b=o+d,_=Math.sqrt(m*m+y*y+b*b),w=Math.asin(b/=_),C=I(I(b)-1)<F||I(i-l)<F?(i+l)/2:Math.atan2(y,m),A=k(C,w),E=A[0],x=A[1],T=E-e,S=x-t,D=g*T-h*S;if(D*D/v>O||I((h*T+g*S)/v-.5)>.3||n*u+r*c+o*d<R){N(e,t,i,n,r,o,E,x,C,m/=_,y/=_,b,f,p);p.point(E,x);N(E,x,C,m,y,b,a,s,l,u,c,d,f,p)}}}t.precision=function(e){if(!arguments.length)return Math.sqrt(O);C=(O=e*e)>0&&16;return t};return t}P.geo.path=function(){var t=4.5,i,n,r,o,a;function s(e){if(e){if(typeof t==="function")o.pointRadius(+t.apply(this,arguments));if(!a||!a.valid)a=r(o);P.geo.stream(e,a)}return o.result()}s.area=function(e){Dn=0;P.geo.stream(e,r(On));return Dn};s.centroid=function(e){qi=Xi=Ki=Qi=Zi=m=Ji=en=tn=0;P.geo.stream(e,r(p));return tn?[Ji/tn,en/tn]:m?[Qi/m,Zi/m]:Ki?[qi/Ki,Xi/Ki]:[NaN,NaN]};s.bounds=function(e){Pn=Mn=-(Nn=In=Infinity);P.geo.stream(e,r(Ln));return[[Nn,In],[Pn,Mn]]};s.projection=function(e){if(!arguments.length)return i;r=(i=e)?e.stream||Un(e):L;return l()};s.context=function(e){if(!arguments.length)return n;o=(n=e)==null?new Gn:new Vn(e);if(typeof t!=="function")o.pointRadius(t);return l()};s.pointRadius=function(e){if(!arguments.length)return t;t=typeof e==="function"?e:(o.pointRadius(+e),+e);return s};function l(){a=null;return s}return s.projection(P.geo.albersUsa()).context(null)};function Un(i){var t=zn(function(e,t){return i([e*x,t*x])});return function(e){return Qn(t(e))}}P.geo.transform=function(n){return{stream:function(e){var t=new Yn(e);for(var i in n)t[i]=n[i];return t}}};function Yn(e){this.stream=e}Yn.prototype={point:function(e,t){this.stream.point(e,t)},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()}};function qn(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}P.geo.projection=Xn;P.geo.projectionMutator=Kn;function Xn(e){return Kn(function(){return e})()}function Kn(e){var i,t,n,r=zn(function(e,t){e=i(e,t);return[e[0]*o+p,h-e[1]*o]}),o=150,a=480,s=250,l=0,u=0,c=0,d=0,f=0,p,h,g=mn,v=L,m=null,y=null,b;function _(e){e=n(e[0]*E,e[1]*E);return[e[0]*o+p,h-e[1]*o]}function w(e){e=n.invert((e[0]-p)/o,(h-e[1])/o);return e&&[e[0]*x,e[1]*x]}_.stream=function(e){if(b)b.valid=false;b=Qn(g(t,r(v(e))));b.valid=true;return b};_.clipAngle=function(e){if(!arguments.length)return m;g=e==null?(m=e,mn):Cn((m=+e)*E);return A()};_.clipExtent=function(e){if(!arguments.length)return y;y=e;v=e?xn(e[0][0],e[0][1],e[1][0],e[1][1]):L;return A()};_.scale=function(e){if(!arguments.length)return o;o=+e;return C()};_.translate=function(e){if(!arguments.length)return[a,s];a=+e[0];s=+e[1];return C()};_.center=function(e){if(!arguments.length)return[l*x,u*x];l=e[0]%360*E;u=e[1]%360*E;return C()};_.rotate=function(e){if(!arguments.length)return[c*x,d*x,f*x];c=e[0]%360*E;d=e[1]%360*E;f=e.length>2?e[2]%360*E:0;return C()};P.rebind(_,r,"precision");function C(){n=ln(t=er(c,d,f),i);var e=i(l,u);p=a-e[0]*o;h=s+e[1]*o;return A()}function A(){if(b)b.valid=false,b=null;return _}return function(){i=e.apply(this,arguments);_.invert=i.invert&&w;return C()}}function Qn(i){return qn(i,function(e,t){i.point(e*E,t*E)})}function Zn(e,t){return[e,t]}(P.geo.equirectangular=function(){return Xn(Zn)}).raw=Zn.invert=Zn;P.geo.rotation=function(t){t=er(t[0]%360*E,t[1]*E,t.length>2?t[2]*E:0);function e(e){e=t(e[0]*E,e[1]*E);return e[0]*=x,e[1]*=x,e}e.invert=function(e){e=t.invert(e[0]*E,e[1]*E);return e[0]*=x,e[1]*=x,e};return e};function Jn(e,t){return[e>U?e-k:e<-U?e+k:e,t]}Jn.invert=Zn;function er(e,t,i){return e?t||i?ln(ir(e),nr(t,i)):ir(e):t||i?nr(t,i):Jn}function tr(i){return function(e,t){return e+=i,[e>U?e-k:e<-U?e+k:e,t]}}function ir(e){var t=tr(e);t.invert=tr(-e);return t}function nr(e,t){var s=Math.cos(e),l=Math.sin(e),u=Math.cos(t),c=Math.sin(t);function i(e,t){var i=Math.cos(t),n=Math.cos(e)*i,r=Math.sin(e)*i,o=Math.sin(t),a=o*s+n*l;return[Math.atan2(r*u-a*c,n*s-o*l),tt(a*u+r*c)]}i.invert=function(e,t){var i=Math.cos(t),n=Math.cos(e)*i,r=Math.sin(e)*i,o=Math.sin(t),a=o*u-r*c;return[Math.atan2(r*u+o*c,n*s+a*l),tt(a*s-n*l)]};return i}P.geo.circle=function(){var t=[0,0],i,n=6,r;function o(){var e=typeof t==="function"?t.apply(this,arguments):t,i=er(-e[0]*E,-e[1]*E,0).invert,n=[];r(null,null,1,{point:function(e,t){n.push(e=i(e,t));e[0]*=x,e[1]*=x}});return{type:"Polygon",coordinates:[n]}}o.origin=function(e){if(!arguments.length)return t;t=e;return o};o.angle=function(e){if(!arguments.length)return i;r=rr((i=+e)*E,n*E);return o};o.precision=function(e){if(!arguments.length)return n;r=rr(i*E,(n=+e)*E);return o};return o.angle(90)};function rr(s,l){var u=Math.cos(s),c=Math.sin(s);return function(e,t,i,n){var r=i*l;if(e!=null){e=or(u,e);t=or(u,t);if(i>0?e<t:e>t)e+=i*k}else{e=s+i*k;t=s-.5*r}for(var o,a=e;i>0?a>t:a<t;a-=r){n.point((o=Vi([u,-c*Math.cos(a),-c*Math.sin(a)]))[0],o[1])}}}function or(e,t){var i=Gi(t);i[0]-=e;Bi(i);var n=et(-i[1]);return((-i[2]<0?-n:n)+2*Math.PI-F)%(2*Math.PI)}P.geo.distance=function(e,t){var i=(t[0]-e[0])*E,n=e[1]*E,r=t[1]*E,o=Math.sin(i),a=Math.cos(i),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),c=Math.cos(r),d;return Math.atan2(Math.sqrt((d=c*o)*d+(d=l*u-s*c*a)*d),s*u+l*c*a)};P.geo.graticule=function(){var t,i,n,r,o,a,s,l,u=10,c=u,d=90,f=360,p,h,g,v,m=2.5;function y(){return{type:"MultiLineString",coordinates:e()}}function e(){return P.range(Math.ceil(r/d)*d,n,d).map(g).concat(P.range(Math.ceil(l/f)*f,s,f).map(v)).concat(P.range(Math.ceil(i/u)*u,t,u).filter(function(e){return I(e%d)>F}).map(p)).concat(P.range(Math.ceil(a/c)*c,o,c).filter(function(e){return I(e%f)>F}).map(h))}y.lines=function(){return e().map(function(e){return{type:"LineString",coordinates:e}})};y.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(v(s).slice(1),g(n).reverse().slice(1),v(l).reverse().slice(1))]}};y.extent=function(e){if(!arguments.length)return y.minorExtent();return y.majorExtent(e).minorExtent(e)};y.majorExtent=function(e){if(!arguments.length)return[[r,l],[n,s]];r=+e[0][0],n=+e[1][0];l=+e[0][1],s=+e[1][1];if(r>n)e=r,r=n,n=e;if(l>s)e=l,l=s,s=e;return y.precision(m)};y.minorExtent=function(e){if(!arguments.length)return[[i,a],[t,o]];i=+e[0][0],t=+e[1][0];a=+e[0][1],o=+e[1][1];if(i>t)e=i,i=t,t=e;if(a>o)e=a,a=o,o=e;return y.precision(m)};y.step=function(e){if(!arguments.length)return y.minorStep();return y.majorStep(e).minorStep(e)};y.majorStep=function(e){if(!arguments.length)return[d,f];d=+e[0],f=+e[1];return y};y.minorStep=function(e){if(!arguments.length)return[u,c];u=+e[0],c=+e[1];return y};y.precision=function(e){if(!arguments.length)return m;m=+e;p=ar(a,o,90);h=sr(i,t,m);g=ar(l,s,90);v=sr(r,n,m);return y};return y.majorExtent([[-180,-90+F],[180,90-F]]).minorExtent([[-180,-80-F],[180,80+F]])};function ar(e,t,i){var n=P.range(e,t-F,i).concat(t);return function(t){return n.map(function(e){return[t,e]})}}function sr(e,t,i){var n=P.range(e,t-F,i).concat(t);return function(t){return n.map(function(e){return[e,t]})}}function lr(e){return e.source}function ur(e){return e.target}P.geo.greatArc=function(){var t=lr,i,n=ur,r;function o(){return{type:"LineString",coordinates:[i||t.apply(this,arguments),r||n.apply(this,arguments)]}}o.distance=function(){return P.geo.distance(i||t.apply(this,arguments),r||n.apply(this,arguments))};o.source=function(e){if(!arguments.length)return t;t=e,i=typeof e==="function"?null:e;return o};o.target=function(e){if(!arguments.length)return n;n=e,r=typeof e==="function"?null:e;return o};o.precision=function(){return arguments.length?o:0};return o};P.geo.interpolate=function(e,t){return cr(e[0]*E,e[1]*E,t[0]*E,t[1]*E)};function cr(e,t,i,n){var r=Math.cos(t),a=Math.sin(t),o=Math.cos(n),s=Math.sin(n),l=r*Math.cos(e),u=r*Math.sin(e),c=o*Math.cos(i),d=o*Math.sin(i),f=2*Math.asin(Math.sqrt(ot(n-t)+r*o*ot(i-e))),p=1/Math.sin(f);var h=f?function(e){var t=Math.sin(e*=f)*p,i=Math.sin(f-e)*p,n=i*l+t*c,r=i*u+t*d,o=i*a+t*s;return[Math.atan2(r,n)*x,Math.atan2(o,Math.sqrt(n*n+r*r))*x]}:function(){return[e*x,t*x]};h.distance=f;return h}P.geo.length=function(e){dr=0;P.geo.stream(e,fr);return dr};var dr;var fr={sphere:c,point:c,lineStart:pr,lineEnd:c,polygonStart:c,polygonEnd:c};function pr(){var a,s,l;fr.point=function(e,t){a=e*E,s=Math.sin(t*=E),l=Math.cos(t);fr.point=i};fr.lineEnd=function(){fr.point=fr.lineEnd=c};function i(e,t){var i=Math.sin(t*=E),n=Math.cos(t),r=I((e*=E)-a),o=Math.cos(r);dr+=Math.atan2(Math.sqrt((r=n*Math.sin(r))*r+(r=l*i-s*n*o)*r),s*i+l*n*o);a=e,s=i,l=n}}function hr(o,a){function e(e,t){var i=Math.cos(e),n=Math.cos(t),r=o(i*n);return[r*n*Math.sin(e),r*Math.sin(t)]}e.invert=function(e,t){var i=Math.sqrt(e*e+t*t),n=a(i),r=Math.sin(n),o=Math.cos(n);return[Math.atan2(e*r,i*o),Math.asin(i&&t*r/i)]};return e}var gr=hr(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(P.geo.azimuthalEqualArea=function(){return Xn(gr)}).raw=gr;var vr=hr(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},L);(P.geo.azimuthalEquidistant=function(){return Xn(vr)}).raw=vr;function mr(e,t){var i=Math.cos(e),n=function(e){return Math.tan(U/4+e/2)},r=e===t?Math.sin(e):Math.log(i/Math.cos(t))/Math.log(n(t)/n(e)),o=i*Math.pow(n(e),r)/r;if(!r)return _r;function a(e,t){if(o>0){if(t<-Y+F)t=-Y+F}else{if(t>Y-F)t=Y-F}var i=o/Math.pow(n(t),r);return[i*Math.sin(r*e),o-i*Math.cos(r*e)]}a.invert=function(e,t){var i=o-t,n=Ze(r)*Math.sqrt(e*e+i*i);return[Math.atan2(e,i)/r,2*Math.atan(Math.pow(o/n,1/r))-Y]};return a}(P.geo.conicConformal=function(){return Tn(mr)}).raw=mr;function yr(e,t){var i=Math.cos(e),n=e===t?Math.sin(e):(i-Math.cos(t))/(t-e),r=i/n+e;if(I(n)<F)return Zn;function o(e,t){var i=r-t;return[i*Math.sin(n*e),r-i*Math.cos(n*e)]}o.invert=function(e,t){var i=r-t;return[Math.atan2(e,i)/n,r-Ze(n)*Math.sqrt(e*e+i*i)]};return o}(P.geo.conicEquidistant=function(){return Tn(yr)}).raw=yr;var br=hr(function(e){return 1/e},Math.atan);(P.geo.gnomonic=function(){return Xn(br)}).raw=br;function _r(e,t){return[e,Math.log(Math.tan(U/4+t/2))]}_r.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Y]};function wr(e){var r=Xn(e),o=r.scale,a=r.translate,s=r.clipExtent,l;r.scale=function(){var e=o.apply(r,arguments);return e===r?l?r.clipExtent(null):r:e};r.translate=function(){var e=a.apply(r,arguments);return e===r?l?r.clipExtent(null):r:e};r.clipExtent=function(e){var t=s.apply(r,arguments);if(t===r){if(l=e==null){var i=U*o(),n=a();s([[n[0]-i,n[1]-i],[n[0]+i,n[1]+i]])}}else if(l){t=null}return t};return r.clipExtent(null)}(P.geo.mercator=function(){return wr(_r)}).raw=_r;var Cr=hr(function(){return 1},Math.asin);(P.geo.orthographic=function(){return Xn(Cr)}).raw=Cr;var Ar=hr(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(P.geo.stereographic=function(){return Xn(Ar)}).raw=Ar;function Er(e,t){return[Math.log(Math.tan(U/4+t/2)),-e]}Er.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Y]};(P.geo.transverseMercator=function(){var e=wr(Er),t=e.center,i=e.rotate;e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])};e.rotate=function(e){return e?i([e[0],e[1],e.length>2?e[2]+90:90]):(e=i(),[e[0],e[1],e[2]-90])};return i([0,0,90])}).raw=Er;P.geom={};function xr(e){return e[0]}function Tr(e){return e[1]}P.geom.hull=function(e){var f=xr,p=Tr;if(arguments.length)return t(e);function t(e){if(e.length<3)return[];var t=T(f),i=T(p),n,r=e.length,o=[],a=[];for(n=0;n<r;n++){o.push([+t.call(this,e[n],n),+i.call(this,e[n],n),n])}o.sort(Dr);for(n=0;n<r;n++)a.push([o[n][0],-o[n][1]]);var s=Sr(o),l=Sr(a);var u=l[0]===s[0],c=l[l.length-1]===s[s.length-1],d=[];for(n=s.length-1;n>=0;--n)d.push(e[o[s[n]][2]]);for(n=+u;n<l.length-c;++n)d.push(e[o[l[n]][2]]);return d}t.x=function(e){return arguments.length?(f=e,t):f};t.y=function(e){return arguments.length?(p=e,t):p};return t};function Sr(e){var t=e.length,i=[0,1],n=2;for(var r=2;r<t;r++){while(n>1&&Je(e[i[n-2]],e[i[n-1]],e[r])<=0)--n;i[n++]=r}return i.slice(0,n)}function Dr(e,t){return e[0]-t[0]||e[1]-t[1]}P.geom.polygon=function(e){me(e,kr);return e};var kr=P.geom.polygon.prototype=[];kr.area=function(){var e=-1,t=this.length,i,n=this[t-1],r=0;while(++e<t){i=n;n=this[e];r+=i[1]*n[0]-i[0]*n[1]}return r*.5};kr.centroid=function(e){var t=-1,i=this.length,n=0,r=0,o,a=this[i-1],s;if(!arguments.length)e=-1/(6*this.area());while(++t<i){o=a;a=this[t];s=o[0]*a[1]-a[0]*o[1];n+=(o[0]+a[0])*s;r+=(o[1]+a[1])*s}return[n*e,r*e]};kr.clip=function(e){var t,i=Nr(e),n=-1,r=this.length-Nr(this),o,a,s=this[r-1],l,u,c;while(++n<r){t=e.slice();e.length=0;l=this[n];u=t[(a=t.length-i)-1];o=-1;while(++o<a){c=t[o];if(Or(c,s,l)){if(!Or(u,s,l)){e.push(Rr(u,c,s,l))}e.push(c)}else if(Or(u,s,l)){e.push(Rr(u,c,s,l))}u=c}if(i)e.push(e[0]);s=l}return e};function Or(e,t,i){return(i[0]-t[0])*(e[1]-t[1])<(i[1]-t[1])*(e[0]-t[0])}function Rr(e,t,i,n){var r=e[0],o=i[0],a=t[0]-r,s=n[0]-o,l=e[1],u=i[1],c=t[1]-l,d=n[1]-u,f=(s*(l-u)-d*(r-o))/(d*a-s*c);return[r+f*a,l+f*c]}function Nr(e){var t=e[0],i=e[e.length-1];return!(t[0]-i[0]||t[1]-i[1])}var Ir,Pr,Mr,Lr=[],Fr,Gr,$r=[];function Wr(){so(this);this.edge=this.site=this.circle=null}function Hr(e){var t=Lr.pop()||new Wr;t.site=e;return t}function jr(e){Zr(e);Mr.remove(e);Lr.push(e);so(e)}function Br(e){var t=e.circle,i=t.x,n=t.cy,r={x:i,y:n},o=e.P,a=e.N,s=[e];jr(e);var l=o;while(l.circle&&I(i-l.circle.x)<F&&I(n-l.circle.cy)<F){o=l.P;s.unshift(l);jr(l);l=o}s.unshift(l);Zr(l);var u=a;while(u.circle&&I(i-u.circle.x)<F&&I(n-u.circle.cy)<F){a=u.N;s.push(u);jr(u);u=a}s.push(u);Zr(u);var c=s.length,d;for(d=1;d<c;++d){u=s[d];l=s[d-1];ro(u.edge,l.site,u.site,r)}l=s[0];u=s[c-1];u.edge=io(l.site,u.site,null,r);Qr(l);Qr(u)}function Vr(e){var t=e.x,i=e.y,n,r,o,a,s=Mr._;while(s){o=zr(s,i)-t;if(o>F)s=s.L;else{a=t-Ur(s,i);if(a>F){if(!s.R){n=s;break}s=s.R}else{if(o>-F){n=s.P;r=s}else if(a>-F){n=s;r=s.N}else{n=r=s}break}}}var l=Hr(e);Mr.insert(n,l);if(!n&&!r)return;if(n===r){Zr(n);r=Hr(n.site);Mr.insert(l,r);l.edge=r.edge=io(n.site,l.site);Qr(n);Qr(r);return}if(!r){l.edge=io(n.site,l.site);return}Zr(n);Zr(r);var u=n.site,c=u.x,d=u.y,f=e.x-c,p=e.y-d,h=r.site,g=h.x-c,v=h.y-d,m=2*(f*v-p*g),y=f*f+p*p,b=g*g+v*v,_={x:(v*y-p*b)/m+c,y:(f*b-g*y)/m+d};ro(r.edge,u,h,_);l.edge=io(u,e,null,_);r.edge=io(e,h,null,_);Qr(n);Qr(r)}function zr(e,t){var i=e.site,n=i.x,r=i.y,o=r-t;if(!o)return n;var a=e.P;if(!a)return-Infinity;i=a.site;var s=i.x,l=i.y,u=l-t;if(!u)return s;var c=s-n,d=1/o-1/u,f=c/u;if(d)return(-f+Math.sqrt(f*f-2*d*(c*c/(-2*u)-l+u/2+r-o/2)))/d+n;return(n+s)/2}function Ur(e,t){var i=e.N;if(i)return zr(i,t);var n=e.site;return n.y===t?n.x:Infinity}function Yr(e){this.site=e;this.edges=[]}Yr.prototype.prepare=function(){var e=this.edges,t=e.length,i;while(t--){i=e[t].edge;if(!i.b||!i.a)e.splice(t,1)}e.sort(Xr);return e.length};function qr(e){var t=e[0][0],i=e[1][0],n=e[0][1],r=e[1][1],o,a,s,l,u=Pr,c=u.length,d,f,p,h,g,v;while(c--){d=u[c];if(!d||!d.prepare())continue;p=d.edges;h=p.length;f=0;while(f<h){v=p[f].end(),s=v.x,l=v.y;g=p[++f%h].start(),o=g.x,a=g.y;if(I(s-o)>F||I(l-a)>F){p.splice(f,0,new oo(no(d.site,v,I(s-t)<F&&r-l>F?{x:t,y:I(o-t)<F?a:r}:I(l-r)<F&&i-s>F?{x:I(a-r)<F?o:i,y:r}:I(s-i)<F&&l-n>F?{x:i,y:I(o-i)<F?a:n}:I(l-n)<F&&s-t>F?{x:I(a-n)<F?o:t,y:n}:null),d.site,null));++h}}}}function Xr(e,t){return t.angle-e.angle}function Kr(){so(this);this.x=this.y=this.arc=this.site=this.cy=null}function Qr(e){var t=e.P,i=e.N;if(!t||!i)return;var n=t.site,r=e.site,o=i.site;if(n===o)return;var a=r.x,s=r.y,l=n.x-a,u=n.y-s,c=o.x-a,d=o.y-s;var f=2*(l*d-u*c);if(f>=-Ke)return;var p=l*l+u*u,h=c*c+d*d,g=(d*p-u*h)/f,v=(l*h-c*p)/f,d=v+s;var m=$r.pop()||new Kr;m.arc=e;m.site=r;m.x=g+a;m.y=d+Math.sqrt(g*g+v*v);m.cy=d;e.circle=m;var y=null,b=Gr._;while(b){if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(b.L)b=b.L;else{y=b.P;break}}else{if(b.R)b=b.R;else{y=b;break}}}Gr.insert(y,m);if(!y)Fr=m}function Zr(e){var t=e.circle;if(t){if(!t.P)Fr=t.N;Gr.remove(t);$r.push(t);so(t);e.circle=null}}function Jr(e){var t=Ir,i=An(e[0][0],e[0][1],e[1][0],e[1][1]),n=t.length,r;while(n--){r=t[n];if(!eo(r,e)||!i(r)||I(r.a.x-r.b.x)<F&&I(r.a.y-r.b.y)<F){r.a=r.b=null;t.splice(n,1)}}}function eo(e,t){var i=e.b;if(i)return true;var n=e.a,r=t[0][0],o=t[1][0],a=t[0][1],s=t[1][1],l=e.l,u=e.r,c=l.x,d=l.y,f=u.x,p=u.y,h=(c+f)/2,g=(d+p)/2,v,m;if(p===d){if(h<r||h>=o)return;if(c>f){if(!n)n={x:h,y:a};else if(n.y>=s)return;i={x:h,y:s}}else{if(!n)n={x:h,y:s};else if(n.y<a)return;i={x:h,y:a}}}else{v=(c-f)/(p-d);m=g-v*h;if(v<-1||v>1){if(c>f){if(!n)n={x:(a-m)/v,y:a};else if(n.y>=s)return;i={x:(s-m)/v,y:s}}else{if(!n)n={x:(s-m)/v,y:s};else if(n.y<a)return;i={x:(a-m)/v,y:a}}}else{if(d<p){if(!n)n={x:r,y:v*r+m};else if(n.x>=o)return;i={x:o,y:v*o+m}}else{if(!n)n={x:o,y:v*o+m};else if(n.x<r)return;i={x:r,y:v*r+m}}}}e.a=n;e.b=i;return true}function to(e,t){this.l=e;this.r=t;this.a=this.b=null}function io(e,t,i,n){var r=new to(e,t);Ir.push(r);if(i)ro(r,e,t,i);if(n)ro(r,t,e,n);Pr[e.i].edges.push(new oo(r,e,t));Pr[t.i].edges.push(new oo(r,t,e));return r}function no(e,t,i){var n=new to(e,null);n.a=t;n.b=i;Ir.push(n);return n}function ro(e,t,i,n){if(!e.a&&!e.b){e.a=n;e.l=t;e.r=i}else if(e.l===i){e.b=n}else{e.a=n}}function oo(e,t,i){var n=e.a,r=e.b;this.edge=e;this.site=t;this.angle=i?Math.atan2(i.y-t.y,i.x-t.x):e.l===t?Math.atan2(r.x-n.x,n.y-r.y):Math.atan2(n.x-r.x,r.y-n.y)}oo.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};function ao(){this._=null}function so(e){e.U=e.C=e.L=e.R=e.P=e.N=null}ao.prototype={insert:function(e,t){var i,n,r;if(e){t.P=e;t.N=e.N;if(e.N)e.N.P=t;e.N=t;if(e.R){e=e.R;while(e.L)e=e.L;e.L=t}else{e.R=t}i=e}else if(this._){e=co(this._);t.P=null;t.N=e;e.P=e.L=t;i=e}else{t.P=t.N=null;this._=t;i=null}t.L=t.R=null;t.U=i;t.C=true;e=t;while(i&&i.C){n=i.U;if(i===n.L){r=n.R;if(r&&r.C){i.C=r.C=false;n.C=true;e=n}else{if(e===i.R){lo(this,i);e=i;i=e.U}i.C=false;n.C=true;uo(this,n)}}else{r=n.L;if(r&&r.C){i.C=r.C=false;n.C=true;e=n}else{if(e===i.L){uo(this,i);e=i;i=e.U}i.C=false;n.C=true;lo(this,n)}}i=e.U}this._.C=false},remove:function(e){if(e.N)e.N.P=e.P;if(e.P)e.P.N=e.N;e.N=e.P=null;var t=e.U,i,n=e.L,r=e.R,o,a;if(!n)o=r;else if(!r)o=n;else o=co(r);if(t){if(t.L===e)t.L=o;else t.R=o}else{this._=o}if(n&&r){a=o.C;o.C=e.C;o.L=n;n.U=o;if(o!==r){t=o.U;o.U=e.U;e=o.R;t.L=e;o.R=r;r.U=o}else{o.U=t;t=o;e=o.R}}else{a=e.C;e=o}if(e)e.U=t;if(a)return;if(e&&e.C){e.C=false;return}do{if(e===this._)break;if(e===t.L){i=t.R;if(i.C){i.C=false;t.C=true;lo(this,t);i=t.R}if(i.L&&i.L.C||i.R&&i.R.C){if(!i.R||!i.R.C){i.L.C=false;i.C=true;uo(this,i);i=t.R}i.C=t.C;t.C=i.R.C=false;lo(this,t);e=this._;break}}else{i=t.L;if(i.C){i.C=false;t.C=true;uo(this,t);i=t.L}if(i.L&&i.L.C||i.R&&i.R.C){if(!i.L||!i.L.C){i.R.C=false;i.C=true;lo(this,i);i=t.L}i.C=t.C;t.C=i.L.C=false;uo(this,t);e=this._;break}}i.C=true;e=t;t=t.U}while(!e.C);if(e)e.C=false}};function lo(e,t){var i=t,n=t.R,r=i.U;if(r){if(r.L===i)r.L=n;else r.R=n}else{e._=n}n.U=r;i.U=n;i.R=n.L;if(i.R)i.R.U=i;n.L=i}function uo(e,t){var i=t,n=t.L,r=i.U;if(r){if(r.L===i)r.L=n;else r.R=n}else{e._=n}n.U=r;i.U=n;i.L=n.R;if(i.L)i.L.U=i;n.R=i}function co(e){while(e.L)e=e.L;return e}function fo(e,t){var i=e.sort(po).pop(),n,r,o;Ir=[];Pr=new Array(e.length);Mr=new ao;Gr=new ao;while(true){o=Fr;if(i&&(!o||i.y<o.y||i.y===o.y&&i.x<o.x)){if(i.x!==n||i.y!==r){Pr[i.i]=new Yr(i);Vr(i);n=i.x,r=i.y}i=e.pop()}else if(o){Br(o.arc)}else{break}}if(t)Jr(t),qr(t);var a={cells:Pr,edges:Ir};Mr=Gr=Ir=Pr=null;return a}function po(e,t){return t.y-e.y||t.x-e.x}P.geom.voronoi=function(e){var t=xr,i=Tr,n=t,r=i,d=ho;if(e)return o(e);function o(o){var a=new Array(o.length),s=d[0][0],l=d[0][1],u=d[1][0],c=d[1][1];fo(f(o),d).cells.forEach(function(e,t){var i=e.edges,n=e.site,r=a[t]=i.length?i.map(function(e){var t=e.start();return[t.x,t.y]}):n.x>=s&&n.x<=u&&n.y>=l&&n.y<=c?[[s,c],[u,c],[u,l],[s,l]]:[];r.point=o[t]});return a}function f(e){return e.map(function(e,t){return{x:Math.round(n(e,t)/F)*F,y:Math.round(r(e,t)/F)*F,i:t}})}o.links=function(t){return fo(f(t)).edges.filter(function(e){return e.l&&e.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})};o.triangles=function(c){var d=[];fo(f(c)).cells.forEach(function(e,t){var i=e.site,n=e.edges.sort(Xr),r=-1,o=n.length,a,s,l=n[o-1].edge,u=l.l===i?l.r:l.l;while(++r<o){a=l;s=u;l=n[r].edge;u=l.l===i?l.r:l.l;if(t<s.i&&t<u.i&&go(i,s,u)<0){d.push([c[t],c[s.i],c[u.i]])}}});return d};o.x=function(e){return arguments.length?(n=T(t=e),o):t};o.y=function(e){return arguments.length?(r=T(i=e),o):i};o.clipExtent=function(e){if(!arguments.length)return d===ho?null:d;d=e==null?ho:e;return o};o.size=function(e){if(!arguments.length)return d===ho?null:d&&d[1];return o.clipExtent(e&&[[0,0],e])};return o};var ho=[[-1e6,-1e6],[1e6,1e6]];function go(e,t,i){return(e.x-i.x)*(t.y-e.y)-(e.x-t.x)*(i.y-e.y)}P.geom.delaunay=function(e){return P.geom.voronoi().triangles(e)};P.geom.quadtree=function(e,b,_,w,C){var A=xr,E=Tr,x;if(x=arguments.length){A=vo;E=mo;if(x===3){C=_;w=b;_=b=0}return t(e)}function t(e){var t,i=T(A),n=T(E),r,o,a,s,l,u,c,d;if(b!=null){l=b,u=_,c=w,d=C}else{c=d=-(l=u=Infinity);r=[],o=[];s=e.length;if(x)for(a=0;a<s;++a){t=e[a];if(t.x<l)l=t.x;if(t.y<u)u=t.y;if(t.x>c)c=t.x;if(t.y>d)d=t.y;r.push(t.x);o.push(t.y)}else for(a=0;a<s;++a){var f=+i(t=e[a],a),p=+n(t,a);if(f<l)l=f;if(p<u)u=p;if(f>c)c=f;if(p>d)d=p;r.push(f);o.push(p)}}var h=c-l,g=d-u;if(h>g)d=u+h;else c=l+g;function v(e,t,i,n,r,o,a,s){if(isNaN(i)||isNaN(n))return;if(e.leaf){var l=e.x,u=e.y;if(l!=null){if(I(l-i)+I(u-n)<.01){m(e,t,i,n,r,o,a,s)}else{var c=e.point;e.x=e.y=e.point=null;m(e,c,l,u,r,o,a,s);m(e,t,i,n,r,o,a,s)}}else{e.x=i,e.y=n,e.point=t}}else{m(e,t,i,n,r,o,a,s)}}function m(e,t,i,n,r,o,a,s){var l=(r+a)*.5,u=(o+s)*.5,c=i>=l,d=n>=u,f=d<<1|c;e.leaf=false;e=e.nodes[f]||(e.nodes[f]=yo());if(c)r=l;else a=l;if(d)o=u;else s=u;v(e,t,i,n,r,o,a,s)}var y=yo();y.add=function(e){v(y,e,+i(e,++a),+n(e,a),l,u,c,d)};y.visit=function(e){bo(e,y,l,u,c,d)};y.find=function(e){return _o(y,e[0],e[1],l,u,c,d)};a=-1;if(b==null){while(++a<s){v(y,e[a],r[a],o[a],l,u,c,d)}--a}else e.forEach(y.add);r=o=e=t=null;return y}t.x=function(e){return arguments.length?(A=e,t):A};t.y=function(e){return arguments.length?(E=e,t):E};t.extent=function(e){if(!arguments.length)return b==null?null:[[b,_],[w,C]];if(e==null)b=_=w=C=null;else b=+e[0][0],_=+e[0][1],w=+e[1][0],C=+e[1][1];return t};t.size=function(e){if(!arguments.length)return b==null?null:[w-b,C-_];if(e==null)b=_=w=C=null;else b=_=0,w=+e[0],C=+e[1];return t};return t};function vo(e){return e.x}function mo(e){return e.y}function yo(){return{leaf:true,nodes:[],point:null,x:null,y:null}}function bo(e,t,i,n,r,o){if(!e(t,i,n,r,o)){var a=(i+r)*.5,s=(n+o)*.5,l=t.nodes;if(l[0])bo(e,l[0],i,n,a,s);if(l[1])bo(e,l[1],a,n,r,s);if(l[2])bo(e,l[2],i,s,a,o);if(l[3])bo(e,l[3],a,s,r,o)}}function _o(e,y,b,_,w,C,A){var E=Infinity,x;(function e(t,i,n,r,o){if(i>C||n>A||r<_||o<w)return;if(a=t.point){var a,s=y-t.x,l=b-t.y,u=s*s+l*l;if(u<E){var c=Math.sqrt(E=u);_=y-c,w=b-c;C=y+c,A=b+c;x=a}}var d=t.nodes,f=(i+r)*.5,p=(n+o)*.5,h=y>=f,g=b>=p;for(var v=g<<1|h,m=v+4;v<m;++v){if(t=d[v&3])switch(v&3){case 0:e(t,i,n,f,p);break;case 1:e(t,f,n,r,p);break;case 2:e(t,i,p,f,o);break;case 3:e(t,f,p,r,o);break}}})(e,_,w,C,A);return x}P.interpolateRgb=wo;function wo(e,t){e=P.rgb(e);t=P.rgb(t);var i=e.r,n=e.g,r=e.b,o=t.r-i,a=t.g-n,s=t.b-r;return function(e){return"#"+Ot(Math.round(i+o*e))+Ot(Math.round(n+a*e))+Ot(Math.round(r+s*e))}}P.interpolateObject=Co;function Co(e,t){var i={},n={},r;for(r in e){if(r in t){i[r]=So(e[r],t[r])}else{n[r]=e[r]}}for(r in t){if(!(r in e)){n[r]=t[r]}}return function(e){for(r in i)n[r]=i[r](e);return n}}P.interpolateNumber=Ao;function Ao(t,i){t=+t,i=+i;return function(e){return t*(1-e)+i*e}}P.interpolateString=Eo;function Eo(e,n){var t=xo.lastIndex=To.lastIndex=0,i,r,o,a=-1,s=[],l=[];e=e+"",n=n+"";while((i=xo.exec(e))&&(r=To.exec(n))){if((o=r.index)>t){o=n.slice(t,o);if(s[a])s[a]+=o;else s[++a]=o}if((i=i[0])===(r=r[0])){if(s[a])s[a]+=r;else s[++a]=r}else{s[++a]=null;l.push({i:a,x:Ao(i,r)})}t=To.lastIndex}if(t<n.length){o=n.slice(t);if(s[a])s[a]+=o;else s[++a]=o}return s.length<2?l[0]?(n=l[0].x,function(e){return n(e)+""}):function(){return n}:(n=l.length,function(e){for(var t=0,i;t<n;++t)s[(i=l[t]).i]=i.x(e);return s.join("")})}var xo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,To=new RegExp(xo.source,"g");P.interpolate=So;function So(e,t){var i=P.interpolators.length,n;while(--i>=0&&!(n=P.interpolators[i](e,t)));return n}P.interpolators=[function(e,t){var i=typeof t;return(i==="string"?Lt.has(t)||/^(#|rgb\(|hsl\()/.test(t)?wo:Eo:t instanceof ft?wo:Array.isArray(t)?Do:i==="object"&&isNaN(t)?Co:Ao)(e,t)}];P.interpolateArray=Do;function Do(e,t){var i=[],n=[],r=e.length,o=t.length,a=Math.min(e.length,t.length),s;for(s=0;s<a;++s)i.push(So(e[s],t[s]));for(;s<r;++s)n[s]=e[s];for(;s<o;++s)n[s]=t[s];return function(e){for(s=0;s<a;++s)n[s]=i[s](e);return n}}var ko=function(){return L};var Oo=P.map({linear:ko,poly:Go,quad:function(){return Mo},cubic:function(){return Lo},sin:function(){return $o},exp:function(){return Wo},circle:function(){return Ho},elastic:jo,back:Bo,bounce:function(){return Vo}});var Ro=P.map({in:L,out:Io,"in-out":Po,"out-in":function(e){return Po(Io(e))}});P.ease=function(e){var t=e.indexOf("-"),i=t>=0?e.slice(0,t):e,n=t>=0?e.slice(t+1):"in";i=Oo.get(i)||ko;n=Ro.get(n)||L;return No(n(i.apply(null,g.call(arguments,1))))};function No(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function Io(t){return function(e){return 1-t(1-e)}}function Po(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Mo(e){return e*e}function Lo(e){return e*e*e}function Fo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Go(t){return function(e){return Math.pow(e,t)}}function $o(e){return 1-Math.cos(e*Y)}function Wo(e){return Math.pow(2,10*(e-1))}function Ho(e){return 1-Math.sqrt(1-e*e)}function jo(t,i){var n;if(arguments.length<2)i=.45;if(arguments.length)n=i/k*Math.asin(1/t);else t=1,n=i/4;return function(e){return 1+t*Math.pow(2,-10*e)*Math.sin((e-n)*k/i)}}function Bo(t){if(!t)t=1.70158;return function(e){return e*e*((t+1)*e-t)}}function Vo(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}P.interpolateHcl=zo;function zo(e,t){e=P.hcl(e);t=P.hcl(t);var i=e.h,n=e.c,r=e.l,o=t.h-i,a=t.c-n,s=t.l-r;if(isNaN(a))a=0,n=isNaN(n)?t.c:n;if(isNaN(o))o=0,i=isNaN(i)?t.h:i;else if(o>180)o-=360;else if(o<-180)o+=360;return function(e){return vt(i+o*e,n+a*e,r+s*e)+""}}P.interpolateHsl=Uo;function Uo(e,t){e=P.hsl(e);t=P.hsl(t);var i=e.h,n=e.s,r=e.l,o=t.h-i,a=t.s-n,s=t.l-r;if(isNaN(a))a=0,n=isNaN(n)?t.s:n;if(isNaN(o))o=0,i=isNaN(i)?t.h:i;else if(o>180)o-=360;else if(o<-180)o+=360;return function(e){return ht(i+o*e,n+a*e,r+s*e)+""}}P.interpolateLab=Yo;function Yo(e,t){e=P.lab(e);t=P.lab(t);var i=e.l,n=e.a,r=e.b,o=t.l-i,a=t.a-n,s=t.b-r;return function(e){return Ct(i+o*e,n+a*e,r+s*e)+""}}P.interpolateRound=qo;function qo(t,i){i-=t;return function(e){return Math.round(t+i*e)}}P.transform=function(e){var i=M.createElementNS(P.ns.prefix.svg,"g");return(P.transform=function(e){if(e!=null){i.setAttribute("transform",e);var t=i.transform.baseVal.consolidate()}return new Xo(t?t.matrix:Jo)})(e)};function Xo(e){var t=[e.a,e.b],i=[e.c,e.d],n=Qo(t),r=Ko(t,i),o=Qo(Zo(i,t,-r))||0;if(t[0]*i[1]<i[0]*t[1]){t[0]*=-1;t[1]*=-1;n*=-1;r*=-1}this.rotate=(n?Math.atan2(t[1],t[0]):Math.atan2(-i[0],i[1]))*x;this.translate=[e.e,e.f];this.scale=[n,o];this.skew=o?Math.atan2(r,o)*x:0}Xo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Ko(e,t){return e[0]*t[0]+e[1]*t[1]}function Qo(e){var t=Math.sqrt(Ko(e,e));if(t){e[0]/=t;e[1]/=t}return t}function Zo(e,t,i){e[0]+=i*t[0];e[1]+=i*t[1];return e}var Jo={a:1,b:0,c:0,d:1,e:0,f:0};P.interpolateTransform=ea;function ea(e,t){var n=[],r=[],o,i=P.transform(e),a=P.transform(t),s=i.translate,l=a.translate,u=i.rotate,c=a.rotate,d=i.skew,f=a.skew,p=i.scale,h=a.scale;if(s[0]!=l[0]||s[1]!=l[1]){n.push("translate(",null,",",null,")");r.push({i:1,x:Ao(s[0],l[0])},{i:3,x:Ao(s[1],l[1])})}else if(l[0]||l[1]){n.push("translate("+l+")")}else{n.push("")}if(u!=c){if(u-c>180)c+=360;else if(c-u>180)u+=360;r.push({i:n.push(n.pop()+"rotate(",null,")")-2,x:Ao(u,c)})}else if(c){n.push(n.pop()+"rotate("+c+")")}if(d!=f){r.push({i:n.push(n.pop()+"skewX(",null,")")-2,x:Ao(d,f)})}else if(f){n.push(n.pop()+"skewX("+f+")")}if(p[0]!=h[0]||p[1]!=h[1]){o=n.push(n.pop()+"scale(",null,",",null,")");r.push({i:o-4,x:Ao(p[0],h[0])},{i:o-2,x:Ao(p[1],h[1])})}else if(h[0]!=1||h[1]!=1){n.push(n.pop()+"scale("+h+")")}o=r.length;return function(e){var t=-1,i;while(++t<o)n[(i=r[t]).i]=i.x(e);return n.join("")}}function ta(t,i){i=(i-=t=+t)||1/i;return function(e){return(e-t)/i}}function ia(t,i){i=(i-=t=+t)||1/i;return function(e){return Math.max(0,Math.min(1,(e-t)/i))}}P.layout={};P.layout.bundle=function(){return function(e){var t=[],i=-1,n=e.length;while(++i<n)t.push(na(e[i]));return t}};function na(e){var t=e.source,i=e.target,n=oa(t,i),r=[t];while(t!==n){t=t.parent;r.push(t)}var o=r.length;while(i!==n){r.splice(o,0,i);i=i.parent}return r}function ra(e){var t=[],i=e.parent;while(i!=null){t.push(e);e=i;i=i.parent}t.push(e);return t}function oa(e,t){if(e===t)return e;var i=ra(e),n=ra(t),r=i.pop(),o=n.pop(),a=null;while(r===o){a=r;r=i.pop();o=n.pop()}return a}P.layout.chord=function(){var t={},v,m,y,b,_=0,w,C,A;function e(){var e={},i=[],t=P.range(b),n=[],r,o,a,s,l;v=[];m=[];r=0,s=-1;while(++s<b){o=0,l=-1;while(++l<b){o+=y[s][l]}i.push(o);n.push(P.range(b));r+=o}if(w){t.sort(function(e,t){return w(i[e],i[t])})}if(C){n.forEach(function(e,i){e.sort(function(e,t){return C(y[i][e],y[i][t])})})}r=(k-_*b)/r;o=0,s=-1;while(++s<b){a=o,l=-1;while(++l<b){var u=t[s],c=n[u][l],d=y[u][c],f=o,p=o+=d*r;e[u+"-"+c]={index:u,subindex:c,startAngle:f,endAngle:p,value:d}}m[u]={index:u,startAngle:a,endAngle:o,value:(o-a)/r};o+=_}s=-1;while(++s<b){l=s-1;while(++l<b){var h=e[s+"-"+l],g=e[l+"-"+s];if(h.value||g.value){v.push(h.value<g.value?{source:g,target:h}:{source:h,target:g})}}}if(A)E()}function E(){v.sort(function(e,t){return A((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}t.matrix=function(e){if(!arguments.length)return y;b=(y=e)&&y.length;v=m=null;return t};t.padding=function(e){if(!arguments.length)return _;_=e;v=m=null;return t};t.sortGroups=function(e){if(!arguments.length)return w;w=e;v=m=null;return t};t.sortSubgroups=function(e){if(!arguments.length)return C;C=e;v=null;return t};t.sortChords=function(e){if(!arguments.length)return A;A=e;if(v)E();return t};t.chords=function(){if(!v)e();return v};t.groups=function(){if(!m)e();return m};return t};P.layout.force=function(){var r={},d=P.dispatch("start","tick","end"),f=[1,1],e,p,h=.9,o=da,a=fa,g=-30,c=pa,v=.1,m=.64,y=[],b=[],_,w,C;function A(u){return function(e,t,i,n){if(e.point!==u){var r=e.cx-u.x,o=e.cy-u.y,a=n-t,s=r*r+o*o;if(a*a/m<s){if(s<c){var l=e.charge/s;u.px-=r*l;u.py-=o*l}return true}if(e.point&&s&&s<c){var l=e.pointCharge/s;u.px-=r*l;u.py-=o*l}}return!e.charge}}r.tick=function(){if((p*=.99)<.005){d.end({type:"end",alpha:p=0});return true}var e=y.length,t=b.length,i,n,r,o,a,s,l,u,c;for(n=0;n<t;++n){r=b[n];o=r.source;a=r.target;u=a.x-o.x;c=a.y-o.y;if(s=u*u+c*c){s=p*w[n]*((s=Math.sqrt(s))-_[n])/s;u*=s;c*=s;a.x-=u*(l=o.weight/(a.weight+o.weight));a.y-=c*l;o.x+=u*(l=1-l);o.y+=c*l}}if(l=p*v){u=f[0]/2;c=f[1]/2;n=-1;if(l)while(++n<e){r=y[n];r.x+=(u-r.x)*l;r.y+=(c-r.y)*l}}if(g){ca(i=P.geom.quadtree(y),p,C);n=-1;while(++n<e){if(!(r=y[n]).fixed){i.visit(A(r))}}}n=-1;while(++n<e){r=y[n];if(r.fixed){r.x=r.px;r.y=r.py}else{r.x-=(r.px-(r.px=r.x))*h;r.y-=(r.py-(r.py=r.y))*h}}d.tick({type:"tick",alpha:p})};r.nodes=function(e){if(!arguments.length)return y;y=e;return r};r.links=function(e){if(!arguments.length)return b;b=e;return r};r.size=function(e){if(!arguments.length)return f;f=e;return r};r.linkDistance=function(e){if(!arguments.length)return o;o=typeof e==="function"?e:+e;return r};r.distance=r.linkDistance;r.linkStrength=function(e){if(!arguments.length)return a;a=typeof e==="function"?e:+e;return r};r.friction=function(e){if(!arguments.length)return h;h=+e;return r};r.charge=function(e){if(!arguments.length)return g;g=typeof e==="function"?e:+e;return r};r.chargeDistance=function(e){if(!arguments.length)return Math.sqrt(c);c=e*e;return r};r.gravity=function(e){if(!arguments.length)return v;v=+e;return r};r.theta=function(e){if(!arguments.length)return Math.sqrt(m);m=e*e;return r};r.alpha=function(e){if(!arguments.length)return p;e=+e;if(p){if(e>0)p=e;else p=0}else if(e>0){d.start({type:"start",alpha:p=e});P.timer(r.tick)}return r};r.start=function(){var s,l=y.length,u=b.length,e=f[0],t=f[1],c,i;for(s=0;s<l;++s){(i=y[s]).index=s;i.weight=0}for(s=0;s<u;++s){i=b[s];if(typeof i.source=="number")i.source=y[i.source];if(typeof i.target=="number")i.target=y[i.target];++i.source.weight;++i.target.weight}for(s=0;s<l;++s){i=y[s];if(isNaN(i.x))i.x=n("x",e);if(isNaN(i.y))i.y=n("y",t);if(isNaN(i.px))i.px=i.x;if(isNaN(i.py))i.py=i.y}_=[];if(typeof o==="function")for(s=0;s<u;++s)_[s]=+o.call(this,b[s],s);else for(s=0;s<u;++s)_[s]=o;w=[];if(typeof a==="function")for(s=0;s<u;++s)w[s]=+a.call(this,b[s],s);else for(s=0;s<u;++s)w[s]=a;C=[];if(typeof g==="function")for(s=0;s<l;++s)C[s]=+g.call(this,y[s],s);else for(s=0;s<l;++s)C[s]=g;function n(e,t){if(!c){c=new Array(l);for(r=0;r<l;++r){c[r]=[]}for(r=0;r<u;++r){var i=b[r];c[i.source.index].push(i.target);c[i.target.index].push(i.source)}}var n=c[s],r=-1,o=n.length,a;while(++r<o)if(!isNaN(a=n[r][e]))return a;return Math.random()*t}return r.resume()};r.resume=function(){return r.alpha(.1)};r.stop=function(){return r.alpha(0)};r.drag=function(){if(!e)e=P.behavior.drag().origin(L).on("dragstart.force",aa).on("drag.force",t).on("dragend.force",sa);if(!arguments.length)return e;this.on("mouseover.force",la).on("mouseout.force",ua).call(e)};function t(e){e.px=P.event.x,e.py=P.event.y;r.resume()}return P.rebind(r,d,"on")};function aa(e){e.fixed|=2}function sa(e){e.fixed&=~6}function la(e){e.fixed|=4;e.px=e.x,e.py=e.y}function ua(e){e.fixed&=~4}function ca(e,t,i){var n=0,r=0;e.charge=0;if(!e.leaf){var o=e.nodes,a=o.length,s=-1,l;while(++s<a){l=o[s];if(l==null)continue;ca(l,t,i);e.charge+=l.charge;n+=l.charge*l.cx;r+=l.charge*l.cy}}if(e.point){if(!e.leaf){e.point.x+=Math.random()-.5;e.point.y+=Math.random()-.5}var u=t*i[e.point.index];e.charge+=e.pointCharge=u;n+=u*e.point.x;r+=u*e.point.y}e.cx=n/e.charge;e.cy=r/e.charge}var da=20,fa=1,pa=Infinity;P.layout.hierarchy=function(){var s=ya,l=va,u=ma;function c(e){var t=[e],i=[],n;e.depth=0;while((n=t.pop())!=null){i.push(n);if((o=l.call(c,n,n.depth))&&(r=o.length)){var r,o,a;while(--r>=0){t.push(a=o[r]);a.parent=n;a.depth=n.depth+1}if(u)n.value=0;n.children=o}else{if(u)n.value=+u.call(c,n,n.depth)||0;delete n.children}}b(e,function(e){var t,i;if(s&&(t=e.children))t.sort(s);if(u&&(i=e.parent))i.value+=e.value});return i}c.sort=function(e){if(!arguments.length)return s;s=e;return c};c.children=function(e){if(!arguments.length)return l;l=e;return c};c.value=function(e){if(!arguments.length)return u;u=e;return c};c.revalue=function(e){if(u){ga(e,function(e){if(e.children)e.value=0});b(e,function(e){var t;if(!e.children)e.value=+u.call(c,e,e.depth)||0;if(t=e.parent)t.value+=e.value})}return e};return c};function ha(e,t){P.rebind(e,t,"sort","children","value");e.nodes=e;e.links=ba;return e}function ga(e,t){var i=[e];while((e=i.pop())!=null){t(e);if((r=e.children)&&(n=r.length)){var n,r;while(--n>=0)i.push(r[n])}}}function b(e,t){var i=[e],n=[];while((e=i.pop())!=null){n.push(e);if((a=e.children)&&(o=a.length)){var r=-1,o,a;while(++r<o)i.push(a[r])}}while((e=n.pop())!=null){t(e)}}function va(e){return e.children}function ma(e){return e.value}function ya(e,t){return t.value-e.value}function ba(e){return P.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}P.layout.partition=function(){var n=P.layout.hierarchy(),r=[1,1];function u(e,t,i,n){var r=e.children;e.x=t;e.y=e.depth*n;e.dx=i;e.dy=n;if(r&&(a=r.length)){var o=-1,a,s,l;i=e.value?i/e.value:0;while(++o<a){u(s=r[o],t,l=s.value*i,n);t+=l}}}function o(e){var t=e.children,i=0;if(t&&(r=t.length)){var n=-1,r;while(++n<r)i=Math.max(i,o(t[n]))}return 1+i}function t(e,t){var i=n.call(this,e,t);u(i[0],0,r[0],r[1]/o(i[0]));return i}t.size=function(e){if(!arguments.length)return r;r=e;return t};return ha(t,n)};P.layout.pie=function(){var d=Number,f=_a,p=0,h=k,g=0;function v(i){var e=i.length,n=i.map(function(e,t){return+d.call(v,e,t)}),t=+(typeof p==="function"?p.apply(this,arguments):p),r=(typeof h==="function"?h.apply(this,arguments):h)-t,o=Math.min(Math.abs(r)/e,+(typeof g==="function"?g.apply(this,arguments):g)),a=o*(r<0?-1:1),s=(r-e*a)/P.sum(n),l=P.range(e),u=[],c;if(f!=null)l.sort(f===_a?function(e,t){return n[t]-n[e]}:function(e,t){return f(i[e],i[t])});l.forEach(function(e){u[e]={data:i[e],value:c=n[e],startAngle:t,endAngle:t+=c*s+a,padAngle:o}});return u}v.value=function(e){if(!arguments.length)return d;d=e;return v};v.sort=function(e){if(!arguments.length)return f;f=e;return v};v.startAngle=function(e){if(!arguments.length)return p;p=e;return v};v.endAngle=function(e){if(!arguments.length)return h;h=e;return v};v.padAngle=function(e){if(!arguments.length)return g;g=e;return v};return v};var _a={};P.layout.stack=function(){var d=L,f=Ta,p=Sa,h=Aa,g=wa,v=Ca;function m(e,t){if(!(s=e.length))return e;var i=e.map(function(e,t){return d.call(m,e,t)});var n=i.map(function(e){return e.map(function(e,t){return[g.call(m,e,t),v.call(m,e,t)]})});var r=f.call(m,n,t);i=P.permute(i,r);n=P.permute(n,r);var o=p.call(m,n,t);var a=i[0].length,s,l,u,c;for(u=0;u<a;++u){h.call(m,i[0][u],c=o[u],n[0][u][1]);for(l=1;l<s;++l){h.call(m,i[l][u],c+=n[l-1][u][1],n[l][u][1])}}return e}m.values=function(e){if(!arguments.length)return d;d=e;return m};m.order=function(e){if(!arguments.length)return f;f=typeof e==="function"?e:Ea.get(e)||Ta;return m};m.offset=function(e){if(!arguments.length)return p;p=typeof e==="function"?e:xa.get(e)||Sa;return m};m.x=function(e){if(!arguments.length)return g;g=e;return m};m.y=function(e){if(!arguments.length)return v;v=e;return m};m.out=function(e){if(!arguments.length)return h;h=e;return m};return m};function wa(e){return e.x}function Ca(e){return e.y}function Aa(e,t,i){e.y0=t;e.y=i}var Ea=P.map({"inside-out":function(e){var t=e.length,i,n,r=e.map(Da),o=e.map(ka),a=P.range(t).sort(function(e,t){return r[e]-r[t]}),s=0,l=0,u=[],c=[];for(i=0;i<t;++i){n=a[i];if(s<l){s+=o[n];u.push(n)}else{l+=o[n];c.push(n)}}return c.reverse().concat(u)},reverse:function(e){return P.range(e.length).reverse()},default:Ta});var xa=P.map({silhouette:function(e){var t=e.length,i=e[0].length,n=[],r=0,o,a,s,l=[];for(a=0;a<i;++a){for(o=0,s=0;o<t;o++)s+=e[o][a][1];if(s>r)r=s;n.push(s)}for(a=0;a<i;++a){l[a]=(r-n[a])/2}return l},wiggle:function(e){var t=e.length,i=e[0],n=i.length,r,o,a,s,l,u,c,d,f,p=[];p[0]=d=f=0;for(o=1;o<n;++o){for(r=0,s=0;r<t;++r)s+=e[r][o][1];for(r=0,l=0,c=i[o][0]-i[o-1][0];r<t;++r){for(a=0,u=(e[r][o][1]-e[r][o-1][1])/(2*c);a<r;++a){u+=(e[a][o][1]-e[a][o-1][1])/c}l+=u*e[r][o][1]}p[o]=d-=s?l/s*c:0;if(d<f)f=d}for(o=0;o<n;++o)p[o]-=f;return p},expand:function(e){var t=e.length,i=e[0].length,n=1/t,r,o,a,s=[];for(o=0;o<i;++o){for(r=0,a=0;r<t;r++)a+=e[r][o][1];if(a)for(r=0;r<t;r++)e[r][o][1]/=a;else for(r=0;r<t;r++)e[r][o][1]=n}for(o=0;o<i;++o)s[o]=0;return s},zero:Sa});function Ta(e){return P.range(e.length)}function Sa(e){var t=-1,i=e[0].length,n=[];while(++t<i)n[t]=0;return n}function Da(e){var t=1,i=0,n=e[0][1],r,o=e.length;for(;t<o;++t){if((r=e[t][1])>n){i=t;n=r}}return i}function ka(e){return e.reduce(Oa,0)}function Oa(e,t){return e+t[1]}P.layout.histogram=function(){var d=true,f=Number,p=Ia,h=Ra;function i(e,t){var i=[],n=e.map(f,this),r=p.call(this,n,t),o=h.call(this,r,n,t),a,t=-1,s=n.length,l=o.length-1,u=d?1:1/s,c;while(++t<l){a=i[t]=[];a.dx=o[t+1]-(a.x=o[t]);a.y=0}if(l>0){t=-1;while(++t<s){c=n[t];if(c>=r[0]&&c<=r[1]){a=i[P.bisect(o,c,1,l)-1];a.y+=u;a.push(e[t])}}}return i}i.value=function(e){if(!arguments.length)return f;f=e;return i};i.range=function(e){if(!arguments.length)return p;p=T(e);return i};i.bins=function(t){if(!arguments.length)return h;h=typeof t==="number"?function(e){return Na(e,t)}:T(t);return i};i.frequency=function(e){if(!arguments.length)return d;d=!!e;return i};return i};function Ra(e,t){return Na(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Na(e,t){var i=-1,n=+e[0],r=(e[1]-n)/t,o=[];while(++i<=t)o[i]=r*i+n;return o}function Ia(e){return[P.min(e),P.max(e)]}P.layout.pack=function(){var l=P.layout.hierarchy().sort(Pa),u=0,c=[1,1],d;function t(e,t){var i=l.call(this,e,t),n=i[0],r=c[0],o=c[1],a=d==null?Math.sqrt:typeof d==="function"?d:function(){return d};n.x=n.y=0;b(n,function(e){e.r=+a(e.value)});b(n,Ga);if(u){var s=u*(d?1:Math.max(2*n.r/r,2*n.r/o))/2;b(n,function(e){e.r+=s});b(n,Ga);b(n,function(e){e.r-=s})}Ha(n,r/2,o/2,d?1:1/Math.max(2*n.r/r,2*n.r/o));return i}t.size=function(e){if(!arguments.length)return c;c=e;return t};t.radius=function(e){if(!arguments.length)return d;d=e==null||typeof e==="function"?e:+e;return t};t.padding=function(e){if(!arguments.length)return u;u=+e;return t};return ha(t,l)};function Pa(e,t){return e.value-t.value}function Ma(e,t){var i=e._pack_next;e._pack_next=t;t._pack_prev=e;t._pack_next=i;i._pack_prev=t}function La(e,t){e._pack_next=t;t._pack_prev=e}function Fa(e,t){var i=t.x-e.x,n=t.y-e.y,r=e.r+t.r;return.999*r*r>i*i+n*n}function Ga(e){if(!(t=e.children)||!(f=t.length))return;var t,i=Infinity,n=-Infinity,r=Infinity,o=-Infinity,a,s,l,u,c,d,f;function p(e){i=Math.min(e.x-e.r,i);n=Math.max(e.x+e.r,n);r=Math.min(e.y-e.r,r);o=Math.max(e.y+e.r,o)}t.forEach($a);a=t[0];a.x=-a.r;a.y=0;p(a);if(f>1){s=t[1];s.x=s.r;s.y=0;p(s);if(f>2){l=t[2];ja(a,s,l);p(l);Ma(a,l);a._pack_prev=l;Ma(l,s);s=a._pack_next;for(u=3;u<f;u++){ja(a,s,l=t[u]);var h=0,g=1,v=1;for(c=s._pack_next;c!==s;c=c._pack_next,g++){if(Fa(c,l)){h=1;break}}if(h==1){for(d=a._pack_prev;d!==c._pack_prev;d=d._pack_prev,v++){if(Fa(d,l)){break}}}if(h){if(g<v||g==v&&s.r<a.r)La(a,s=c);else La(a=d,s);u--}else{Ma(a,l);s=l;p(l)}}}}var m=(i+n)/2,y=(r+o)/2,b=0;for(u=0;u<f;u++){l=t[u];l.x-=m;l.y-=y;b=Math.max(b,l.r+Math.sqrt(l.x*l.x+l.y*l.y))}e.r=b;t.forEach(Wa)}function $a(e){e._pack_next=e._pack_prev=e}function Wa(e){delete e._pack_next;delete e._pack_prev}function Ha(e,t,i,n){var r=e.children;e.x=t+=n*e.x;e.y=i+=n*e.y;e.r*=n;if(r){var o=-1,a=r.length;while(++o<a)Ha(r[o],t,i,n)}}function ja(e,t,i){var n=e.r+i.r,r=t.x-e.x,o=t.y-e.y;if(n&&(r||o)){var a=t.r+i.r,s=r*r+o*o;a*=a;n*=n;var l=.5+(n-a)/(2*s),u=Math.sqrt(Math.max(0,2*a*(n+s)-(n-=s)*n-a*a))/(2*s);i.x=e.x+l*r+u*o;i.y=e.y+l*o-u*r}else{i.x=e.x+n;i.y=e.y}}P.layout.tree=function(){var d=P.layout.hierarchy().sort(null).value(null),f=Ba,p=[1,1],h=null;function t(e,t){var i=d.call(this,e,t),n=i[0],r=g(n);b(r,v),r.parent.m=-r.z;ga(r,m);if(h)ga(n,y);else{var o=n,a=n,s=n;ga(n,function(e){if(e.x<o.x)o=e;if(e.x>a.x)a=e;if(e.depth>s.depth)s=e});var l=f(o,a)/2-o.x,u=p[0]/(a.x+f(a,o)/2+l),c=p[1]/(s.depth||1);ga(n,function(e){e.x=(e.x+l)*u;e.y=e.depth*c})}return i}function g(e){var t={A:null,children:[e]},i=[t],n;while((n=i.pop())!=null){for(var r=n.children,o,a=0,s=r.length;a<s;++a){i.push((r[a]=o={_:r[a],parent:n,children:(o=r[a].children)&&o.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=o)}}return t.children[0]}function v(e){var t=e.children,i=e.parent.children,n=e.i?i[e.i-1]:null;if(t.length){Ya(e);var r=(t[0].z+t[t.length-1].z)/2;if(n){e.z=n.z+f(e._,n._);e.m=e.z-r}else{e.z=r}}else if(n){e.z=n.z+f(e._,n._)}e.parent.A=o(e,n,e.parent.A||i[0])}function m(e){e._.x=e.z+e.parent.m;e.m+=e.parent.m}function o(e,t,i){if(t){var n=e,r=e,o=t,a=n.parent.children[0],s=n.m,l=r.m,u=o.m,c=a.m,d;while(o=za(o),n=Va(n),o&&n){a=Va(a);r=za(r);r.a=e;d=o.z+u-n.z-s+f(o._,n._);if(d>0){Ua(qa(o,e,i),e,d);s+=d;l+=d}u+=o.m;s+=n.m;c+=a.m;l+=r.m}if(o&&!za(r)){r.t=o;r.m+=u-l}if(n&&!Va(a)){a.t=n;a.m+=s-c;i=e}}return i}function y(e){e.x*=p[0];e.y=e.depth*p[1]}t.separation=function(e){if(!arguments.length)return f;f=e;return t};t.size=function(e){if(!arguments.length)return h?null:p;h=(p=e)==null?y:null;return t};t.nodeSize=function(e){if(!arguments.length)return h?p:null;h=(p=e)==null?null:y;return t};return ha(t,d)};function Ba(e,t){return e.parent==t.parent?1:2}function Va(e){var t=e.children;return t.length?t[0]:e.t}function za(e){var t=e.children,i;return(i=t.length)?t[i-1]:e.t}function Ua(e,t,i){var n=i/(t.i-e.i);t.c-=n;t.s+=i;e.c+=n;t.z+=i;t.m+=i}function Ya(e){var t=0,i=0,n=e.children,r=n.length,o;while(--r>=0){o=n[r];o.z+=t;o.m+=t;t+=o.s+(i+=o.c)}}function qa(e,t,i){return e.a.parent===t.parent?e.a:i}P.layout.cluster=function(){var c=P.layout.hierarchy().sort(null).value(null),d=Ba,f=[1,1],p=false;function t(e,t){var i=c.call(this,e,t),n=i[0],r,o=0;b(n,function(e){var t=e.children;if(t&&t.length){e.x=Ka(t);e.y=Xa(t)}else{e.x=r?o+=d(e,r):0;e.y=0;r=e}});var a=Qa(n),s=Za(n),l=a.x-d(a,s)/2,u=s.x+d(s,a)/2;b(n,p?function(e){e.x=(e.x-n.x)*f[0];e.y=(n.y-e.y)*f[1]}:function(e){e.x=(e.x-l)/(u-l)*f[0];e.y=(1-(n.y?e.y/n.y:1))*f[1]});return i}t.separation=function(e){if(!arguments.length)return d;d=e;return t};t.size=function(e){if(!arguments.length)return p?null:f;p=(f=e)==null;return t};t.nodeSize=function(e){if(!arguments.length)return p?f:null;p=(f=e)!=null;return t};return ha(t,c)};function Xa(e){return 1+P.max(e,function(e){return e.y})}function Ka(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Qa(e){var t=e.children;return t&&t.length?Qa(t[0]):e}function Za(e){var t=e.children,i;return t&&(i=t.length)?Za(t[i-1]):e}P.layout.treemap=function(){var n=P.layout.hierarchy(),c=Math.round,r=[1,1],o=null,d=Ja,a=false,s,f="squarify",l=.5*(1+Math.sqrt(5));function p(e,t){var i=-1,n=e.length,r,o;while(++i<n){o=(r=e[i]).value*(t<0?0:t);r.area=isNaN(o)||o<=0?0:o}}function h(e){var t=e.children;if(t&&t.length){var i=d(e),n=[],r=t.slice(),o,a=Infinity,s,l=f==="slice"?i.dx:f==="dice"?i.dy:f==="slice-dice"?e.depth&1?i.dy:i.dx:Math.min(i.dx,i.dy),u;p(r,i.dx*i.dy/e.value);n.area=0;while((u=r.length)>0){n.push(o=r[u-1]);n.area+=o.area;if(f!=="squarify"||(s=g(n,l))<=a){r.pop();a=s}else{n.area-=n.pop().area;v(n,l,i,false);l=Math.min(i.dx,i.dy);n.length=n.area=0;a=Infinity}}if(n.length){v(n,l,i,true);n.length=n.area=0}t.forEach(h)}}function u(e){var t=e.children;if(t&&t.length){var i=d(e),n=t.slice(),r,o=[];p(n,i.dx*i.dy/e.value);o.area=0;while(r=n.pop()){o.push(r);o.area+=r.area;if(r.z!=null){v(o,r.z?i.dx:i.dy,i,!n.length);o.length=o.area=0}}t.forEach(u)}}function g(e,t){var i=e.area,n,r=0,o=Infinity,a=-1,s=e.length;while(++a<s){if(!(n=e[a].area))continue;if(n<o)o=n;if(n>r)r=n}i*=i;t*=t;return i?Math.max(t*r*l/i,i/(t*o*l)):Infinity}function v(e,t,i,n){var r=-1,o=e.length,a=i.x,s=i.y,l=t?c(e.area/t):0,u;if(t==i.dx){if(n||l>i.dy)l=i.dy;while(++r<o){u=e[r];u.x=a;u.y=s;u.dy=l;a+=u.dx=Math.min(i.x+i.dx-a,l?c(u.area/l):0)}u.z=true;u.dx+=i.x+i.dx-a;i.y+=l;i.dy-=l}else{if(n||l>i.dx)l=i.dx;while(++r<o){u=e[r];u.x=a;u.y=s;u.dx=l;s+=u.dy=Math.min(i.y+i.dy-s,l?c(u.area/l):0)}u.z=false;u.dy+=i.y+i.dy-s;i.x+=l;i.dx-=l}}function m(e){var t=s||n(e),i=t[0];i.x=0;i.y=0;i.dx=r[0];i.dy=r[1];if(s)n.revalue(i);p([i],i.dx*i.dy/i.value);(s?u:h)(i);if(a)s=t;return t}m.size=function(e){if(!arguments.length)return r;r=e;return m};m.padding=function(i){if(!arguments.length)return o;function e(e){var t=i.call(m,e,e.depth);return t==null?Ja(e):es(e,typeof t==="number"?[t,t,t,t]:t)}function t(e){return es(e,i)}var n;d=(o=i)==null?Ja:(n=typeof i)==="function"?e:n==="number"?(i=[i,i,i,i],t):t;return m};m.round=function(e){if(!arguments.length)return c!=Number;c=e?Math.round:Number;return m};m.sticky=function(e){if(!arguments.length)return a;a=e;s=null;return m};m.ratio=function(e){if(!arguments.length)return l;l=e;return m};m.mode=function(e){if(!arguments.length)return f;f=e+"";return m};return ha(m,n)};function Ja(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function es(e,t){var i=e.x+t[3],n=e.y+t[0],r=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];if(r<0){i+=r/2;r=0}if(o<0){n+=o/2;o=0}return{x:i,y:n,dx:r,dy:o}}P.random={normal:function(n,r){var e=arguments.length;if(e<2)r=1;if(e<1)n=0;return function(){var e,t,i;do{e=Math.random()*2-1;t=Math.random()*2-1;i=e*e+t*t}while(!i||i>1);return n+r*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=P.random.normal.apply(P,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=P.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(i){return function(){for(var e=0,t=0;t<i;t++)e+=Math.random();return e}}};P.scale={};function ts(e){var t=e[0],i=e[e.length-1];return t<i?[t,i]:[i,t]}function is(e){return e.rangeExtent?e.rangeExtent():ts(e.range())}function ns(e,t,i,n){var r=i(e[0],e[1]),o=n(t[0],t[1]);return function(e){return o(r(e))}}function rs(e,t){var i=0,n=e.length-1,r=e[i],o=e[n],a;if(o<r){a=i,i=n,n=a;a=r,r=o,o=a}e[i]=t.floor(r);e[n]=t.ceil(o);return e}function os(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:as}var as={floor:L,ceil:L};function ss(i,e,t,n){var r=[],o=[],a=0,s=Math.min(i.length,e.length)-1;if(i[s]<i[0]){i=i.slice().reverse();e=e.slice().reverse()}while(++a<=s){r.push(t(i[a-1],i[a]));o.push(n(e[a-1],e[a]))}return function(e){var t=P.bisect(i,e,1,s)-1;return o[t](r[t](e))}}P.scale.linear=function(){return ls([0,1],[0,1],So,false)};function ls(i,n,r,o){var a,s;function t(){var e=Math.min(i.length,n.length)>2?ss:ns,t=o?ia:ta;a=e(i,n,t,r);s=e(n,i,t,So);return l}function l(e){return a(e)}l.invert=function(e){return s(e)};l.domain=function(e){if(!arguments.length)return i;i=e.map(Number);return t()};l.range=function(e){if(!arguments.length)return n;n=e;return t()};l.rangeRound=function(e){return l.range(e).interpolate(qo)};l.clamp=function(e){if(!arguments.length)return o;o=e;return t()};l.interpolate=function(e){if(!arguments.length)return r;r=e;return t()};l.ticks=function(e){return fs(i,e)};l.tickFormat=function(e,t){return ps(i,e,t)};l.nice=function(e){cs(i,e);return t()};l.copy=function(){return ls(i,n,r,o)};return t()}function us(e,t){return P.rebind(e,t,"range","rangeRound","interpolate","clamp")}function cs(e,t){return rs(e,os(ds(e,t)[2]))}function ds(e,t){if(t==null)t=10;var i=ts(e),n=i[1]-i[0],r=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),o=t/n*r;if(o<=.15)r*=10;else if(o<=.35)r*=5;else if(o<=.75)r*=2;i[0]=Math.ceil(i[0]/r)*r;i[1]=Math.floor(i[1]/r)*r+r*.5;i[2]=r;return i}function fs(e,t){return P.range.apply(P,ds(e,t))}function ps(e,t,i){var n=ds(e,t);if(i){var r=Jt.exec(i);r.shift();if(r[8]==="s"){var o=P.formatPrefix(Math.max(I(n[0]),I(n[1])));if(!r[7])r[7]="."+gs(o.scale(n[2]));r[8]="f";i=P.format(r.join(""));return function(e){return i(o.scale(e))+o.symbol}}if(!r[7])r[7]="."+vs(r[8],n);i=r.join("")}else{i=",."+gs(n[2])+"f"}return P.format(i)}var hs={s:1,g:1,p:1,r:1,e:1};function gs(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function vs(e,t){var i=gs(t[2]);return e in hs?Math.abs(i-gs(Math.max(I(t[0]),I(t[1]))))+ +(e!=="e"):i-(e==="%")*2}P.scale.log=function(){return ms(P.scale.linear().domain([0,1]),10,true,[1,10])};function ms(t,l,u,c){function d(e){return(u?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(l)}function f(e){return u?Math.pow(l,e):-Math.pow(l,-e)}function o(e){return t(d(e))}o.invert=function(e){return f(t.invert(e))};o.domain=function(e){if(!arguments.length)return c;u=e[0]>=0;t.domain((c=e.map(Number)).map(d));return o};o.base=function(e){if(!arguments.length)return l;l=+e;t.domain(c.map(d));return o};o.nice=function(){var e=rs(c.map(d),u?Math:bs);t.domain(e);c=e.map(f);return o};o.ticks=function(){var e=ts(c),t=[],i=e[0],n=e[1],r=Math.floor(d(i)),o=Math.ceil(d(n)),a=l%1?2:l;if(isFinite(o-r)){if(u){for(;r<o;r++)for(var s=1;s<a;s++)t.push(f(r)*s);t.push(f(r))}else{t.push(f(r));for(;r++<o;)for(var s=a-1;s>0;s--)t.push(f(r)*s)}for(r=0;t[r]<i;r++){}for(o=t.length;t[o-1]>n;o--){}t=t.slice(r,o)}return t};o.tickFormat=function(e,t){if(!arguments.length)return ys;if(arguments.length<2)t=ys;else if(typeof t!=="function")t=P.format(t);var i=Math.max(.1,e/o.ticks().length),n=u?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor),r;return function(e){return e/f(n(d(e)+r))<=i?t(e):""}};o.copy=function(){return ms(t.copy(),l,u,c)};return us(o,t)}var ys=P.format(".0e"),bs={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};P.scale.pow=function(){return _s(P.scale.linear(),1,[0,1])};function _s(t,i,n){var r=ws(i),o=ws(1/i);function a(e){return t(r(e))}a.invert=function(e){return o(t.invert(e))};a.domain=function(e){if(!arguments.length)return n;t.domain((n=e.map(Number)).map(r));return a};a.ticks=function(e){return fs(n,e)};a.tickFormat=function(e,t){return ps(n,e,t)};a.nice=function(e){return a.domain(cs(n,e))};a.exponent=function(e){if(!arguments.length)return i;r=ws(i=e);o=ws(1/i);t.domain(n.map(r));return a};a.copy=function(){return _s(t.copy(),i,n)};return us(a,t)}function ws(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}P.scale.sqrt=function(){return P.scale.pow().exponent(.5)};P.scale.ordinal=function(){return Cs([],{t:"range",a:[[]]})};function Cs(s,l){var r,u,c;function d(e){return u[((r.get(e)||(l.t==="range"?r.set(e,s.push(e)):NaN))-1)%u.length]}function f(t,i){return P.range(s.length).map(function(e){return t+i*e})}d.domain=function(e){if(!arguments.length)return s;s=[];r=new y;var t=-1,i=e.length,n;while(++t<i)if(!r.has(n=e[t]))r.set(n,s.push(n));return d[l.t].apply(d,l.a)};d.range=function(e){if(!arguments.length)return u;u=e;c=0;l={t:"range",a:arguments};return d};d.rangePoints=function(e,t){if(arguments.length<2)t=0;var i=e[0],n=e[1],r=s.length<2?(i=(i+n)/2,0):(n-i)/(s.length-1+t);u=f(i+r*t/2,r);c=0;l={t:"rangePoints",a:arguments};return d};d.rangeRoundPoints=function(e,t){if(arguments.length<2)t=0;var i=e[0],n=e[1],r=s.length<2?(i=n=Math.round((i+n)/2),0):(n-i)/(s.length-1+t)|0;u=f(i+Math.round(r*t/2+(n-i-(s.length-1+t)*r)/2),r);c=0;l={t:"rangeRoundPoints",a:arguments};return d};d.rangeBands=function(e,t,i){if(arguments.length<2)t=0;if(arguments.length<3)i=t;var n=e[1]<e[0],r=e[n-0],o=e[1-n],a=(o-r)/(s.length-t+2*i);u=f(r+a*i,a);if(n)u.reverse();c=a*(1-t);l={t:"rangeBands",a:arguments};return d};d.rangeRoundBands=function(e,t,i){if(arguments.length<2)t=0;if(arguments.length<3)i=t;var n=e[1]<e[0],r=e[n-0],o=e[1-n],a=Math.floor((o-r)/(s.length-t+2*i));u=f(r+Math.round((o-r-(s.length-t)*a)/2),a);if(n)u.reverse();c=Math.round(a*(1-t));l={t:"rangeRoundBands",a:arguments};return d};d.rangeBand=function(){return c};d.rangeExtent=function(){return ts(l.a[0])};d.copy=function(){return Cs(s,l)};return d.domain(s)}P.scale.category10=function(){return P.scale.ordinal().range(As)};P.scale.category20=function(){return P.scale.ordinal().range(Es)};P.scale.category20b=function(){return P.scale.ordinal().range(xs)};P.scale.category20c=function(){return P.scale.ordinal().range(Ts)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Dt);var Es=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Dt);var xs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Dt);var Ts=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Dt);P.scale.quantile=function(){return Ss([],[])};function Ss(i,n){var r;function t(){var e=0,t=n.length;r=[];while(++e<t)r[e-1]=P.quantile(i,e/t);return o}function o(e){if(!isNaN(e=+e))return n[P.bisect(r,e)]}o.domain=function(e){if(!arguments.length)return i;i=e.map(V).filter(u).sort(B);return t()};o.range=function(e){if(!arguments.length)return n;n=e;return t()};o.quantiles=function(){return r};o.invertExtent=function(e){e=n.indexOf(e);return e<0?[NaN,NaN]:[e>0?r[e-1]:i[0],e<r.length?r[e]:i[i.length-1]]};o.copy=function(){return Ss(i,n)};return t()}P.scale.quantize=function(){return Ds(0,1,[0,1])};function Ds(t,i,n){var r,o;function e(e){return n[Math.max(0,Math.min(o,Math.floor(r*(e-t))))]}function a(){r=n.length/(i-t);o=n.length-1;return e}e.domain=function(e){if(!arguments.length)return[t,i];t=+e[0];i=+e[e.length-1];return a()};e.range=function(e){if(!arguments.length)return n;n=e;return a()};e.invertExtent=function(e){e=n.indexOf(e);e=e<0?NaN:e/r+t;return[e,e+1/r]};e.copy=function(){return Ds(t,i,n)};return a()}P.scale.threshold=function(){return ks([.5],[0,1])};function ks(t,i){function n(e){if(e<=e)return i[P.bisect(t,e)]}n.domain=function(e){if(!arguments.length)return t;t=e;return n};n.range=function(e){if(!arguments.length)return i;i=e;return n};n.invertExtent=function(e){e=i.indexOf(e);return[t[e-1],t[e]]};n.copy=function(){return ks(t,i)};return n}P.scale.identity=function(){return Os([0,1])};function Os(i){function t(e){return+e}t.invert=t;t.domain=t.range=function(e){if(!arguments.length)return i;i=e.map(t);return t};t.ticks=function(e){return fs(i,e)};t.tickFormat=function(e,t){return ps(i,e,t)};t.copy=function(){return Os(i)};return t}P.svg={};function Rs(){return 0}P.svg.arc=function(){var G=Is,$=Ps,W=Rs,H=Ns,j=Ms,B=Ls,V=Fs;function t(){var e=Math.max(0,+G.apply(this,arguments)),t=Math.max(0,+$.apply(this,arguments)),i=j.apply(this,arguments)-Y,n=B.apply(this,arguments)-Y,M=Math.abs(n-i),r=i>n?0:1;if(t<e)o=t,t=e,e=o;if(M>=Qe)return z(t,r)+(e?z(e,1-r):"")+"Z";var o,a,s,l,u=0,c=0,d,f,p,h,g,v,m,y,b=[];if(l=(+V.apply(this,arguments)||0)/2){s=H===Ns?Math.sqrt(e*e+t*t):+H.apply(this,arguments);if(!r)c*=-1;if(t)c=tt(s/t*Math.sin(l));if(e)u=tt(s/e*Math.sin(l))}if(t){d=t*Math.cos(i+c);f=t*Math.sin(i+c);p=t*Math.cos(n-c);h=t*Math.sin(n-c);var _=Math.abs(n-i-2*c)<=U?0:1;if(c&&Gs(d,f,p,h)===r^_){var w=(i+n)/2;d=t*Math.cos(w);f=t*Math.sin(w);p=h=null}}else{d=f=0}if(e){g=e*Math.cos(n-u);v=e*Math.sin(n-u);m=e*Math.cos(i+u);y=e*Math.sin(i+u);var C=Math.abs(i-n+2*u)<=U?0:1;if(u&&Gs(g,v,m,y)===1-r^C){var A=(i+n)/2;g=e*Math.cos(A);v=e*Math.sin(A);m=y=null}}else{g=v=0}if((o=Math.min(Math.abs(t-e)/2,+W.apply(this,arguments)))>.001){a=e<t^r?0:1;var E=m==null?[g,v]:p==null?[d,f]:Rr([d,f],[m,y],[p,h],[g,v]),x=d-E[0],T=f-E[1],S=p-E[0],D=h-E[1],L=1/Math.sin(Math.acos((x*S+T*D)/(Math.sqrt(x*x+T*T)*Math.sqrt(S*S+D*D)))/2),F=Math.sqrt(E[0]*E[0]+E[1]*E[1]);if(p!=null){var k=Math.min(o,(t-F)/(L+1)),O=$s(m==null?[g,v]:[m,y],[d,f],t,k,r),R=$s([p,h],[g,v],t,k,r);if(o===k){b.push("M",O[0],"A",k,",",k," 0 0,",a," ",O[1],"A",t,",",t," 0 ",1-r^Gs(O[1][0],O[1][1],R[1][0],R[1][1]),",",r," ",R[1],"A",k,",",k," 0 0,",a," ",R[0])}else{b.push("M",O[0],"A",k,",",k," 0 1,",a," ",R[0])}}else{b.push("M",d,",",f)}if(m!=null){var N=Math.min(o,(e-F)/(L-1)),I=$s([d,f],[m,y],e,-N,r),P=$s([g,v],p==null?[d,f]:[p,h],e,-N,r);if(o===N){b.push("L",P[0],"A",N,",",N," 0 0,",a," ",P[1],"A",e,",",e," 0 ",r^Gs(P[1][0],P[1][1],I[1][0],I[1][1]),",",1-r," ",I[1],"A",N,",",N," 0 0,",a," ",I[0])}else{b.push("L",P[0],"A",N,",",N," 0 0,",a," ",I[0])}}else{b.push("L",g,",",v)}}else{b.push("M",d,",",f);if(p!=null)b.push("A",t,",",t," 0 ",_,",",r," ",p,",",h);b.push("L",g,",",v);if(m!=null)b.push("A",e,",",e," 0 ",C,",",1-r," ",m,",",y)}b.push("Z");return b.join("")}function z(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}t.innerRadius=function(e){if(!arguments.length)return G;G=T(e);return t};t.outerRadius=function(e){if(!arguments.length)return $;$=T(e);return t};t.cornerRadius=function(e){if(!arguments.length)return W;W=T(e);return t};t.padRadius=function(e){if(!arguments.length)return H;H=e==Ns?Ns:T(e);return t};t.startAngle=function(e){if(!arguments.length)return j;j=T(e);return t};t.endAngle=function(e){if(!arguments.length)return B;B=T(e);return t};t.padAngle=function(e){if(!arguments.length)return V;V=T(e);return t};t.centroid=function(){var e=(+G.apply(this,arguments)+ +$.apply(this,arguments))/2,t=(+j.apply(this,arguments)+ +B.apply(this,arguments))/2-Y;return[Math.cos(t)*e,Math.sin(t)*e]};return t};var Ns="auto";function Is(e){return e.innerRadius}function Ps(e){return e.outerRadius}function Ms(e){return e.startAngle}function Ls(e){return e.endAngle}function Fs(e){return e&&e.padAngle}function Gs(e,t,i,n){return(e-i)*t-(t-n)*e>0?0:1}function $s(e,t,i,n,r){var o=e[0]-t[0],a=e[1]-t[1],s=(r?n:-n)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=e[0]+l,d=e[1]+u,f=t[0]+l,p=t[1]+u,h=(c+f)/2,g=(d+p)/2,v=f-c,m=p-d,y=v*v+m*m,b=i-n,_=c*p-f*d,w=(m<0?-1:1)*Math.sqrt(b*b*y-_*_),C=(_*m-v*w)/y,A=(-_*v-m*w)/y,E=(_*m+v*w)/y,x=(-_*v+m*w)/y,T=C-h,S=A-g,D=E-h,k=x-g;if(T*T+S*S>D*D+k*k)C=E,A=x;return[[C-l,A-u],[C*i/b,A*i/b]]}function Ws(u){var c=xr,d=Tr,f=un,p=S,t=p.key,h=.7;function i(e){var t=[],i=[],n=-1,r=e.length,o,a=T(c),s=T(d);function l(){t.push("M",p(u(i),h))}while(++n<r){if(f.call(this,o=e[n],n)){i.push([+a.call(this,o,n),+s.call(this,o,n)])}else if(i.length){l();i=[]}}if(i.length)l();return t.length?t.join(""):null}i.x=function(e){if(!arguments.length)return c;c=e;return i};i.y=function(e){if(!arguments.length)return d;d=e;return i};i.defined=function(e){if(!arguments.length)return f;f=e;return i};i.interpolate=function(e){if(!arguments.length)return t;if(typeof e==="function")t=p=e;else t=(p=Hs.get(e)||S).key;return i};i.tension=function(e){if(!arguments.length)return h;h=e;return i};return i}P.svg.line=function(){return Ws(L)};var Hs=P.map({linear:S,"linear-closed":js,step:Bs,"step-before":Vs,"step-after":zs,basis:Qs,"basis-open":Zs,"basis-closed":Js,bundle:el,cardinal:qs,"cardinal-open":Us,"cardinal-closed":Ys,monotone:ll});Hs.forEach(function(e,t){t.key=e;t.closed=/-closed$/.test(e)});function S(e){return e.join("L")}function js(e){return S(e)+"Z"}function Bs(e){var t=0,i=e.length,n=e[0],r=[n[0],",",n[1]];while(++t<i)r.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);if(i>1)r.push("H",n[0]);return r.join("")}function Vs(e){var t=0,i=e.length,n=e[0],r=[n[0],",",n[1]];while(++t<i)r.push("V",(n=e[t])[1],"H",n[0]);return r.join("")}function zs(e){var t=0,i=e.length,n=e[0],r=[n[0],",",n[1]];while(++t<i)r.push("H",(n=e[t])[0],"V",n[1]);return r.join("")}function Us(e,t){return e.length<4?S(e):e[1]+Xs(e.slice(1,-1),Ks(e,t))}function Ys(e,t){return e.length<3?S(e):e[0]+Xs((e.push(e[0]),e),Ks([e[e.length-2]].concat(e,[e[1]]),t))}function qs(e,t){return e.length<3?S(e):e[0]+Xs(e,Ks(e,t))}function Xs(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2){return S(e)}var i=e.length!=t.length,n="",r=e[0],o=e[1],a=t[0],s=a,l=1;if(i){n+="Q"+(o[0]-a[0]*2/3)+","+(o[1]-a[1]*2/3)+","+o[0]+","+o[1];r=e[1];l=2}if(t.length>1){s=t[1];o=e[l];l++;n+="C"+(r[0]+a[0])+","+(r[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<t.length;u++,l++){o=e[l];s=t[u];n+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}}if(i){var c=e[l];n+="Q"+(o[0]+s[0]*2/3)+","+(o[1]+s[1]*2/3)+","+c[0]+","+c[1]}return n}function Ks(e,t){var i=[],n=(1-t)/2,r,o=e[0],a=e[1],s=1,l=e.length;while(++s<l){r=o;o=a;a=e[s];i.push([n*(a[0]-r[0]),n*(a[1]-r[1])])}return i}function Qs(e){if(e.length<3)return S(e);var t=1,i=e.length,n=e[0],r=n[0],o=n[1],a=[r,r,r,(n=e[1])[0]],s=[o,o,o,n[1]],l=[r,",",o,"L",h(nl,a),",",h(nl,s)];e.push(e[i-1]);while(++t<=i){n=e[t];a.shift();a.push(n[0]);s.shift();s.push(n[1]);rl(l,a,s)}e.pop();l.push("L",n);return l.join("")}function Zs(e){if(e.length<4)return S(e);var t=[],i=-1,n=e.length,r,o=[0],a=[0];while(++i<3){r=e[i];o.push(r[0]);a.push(r[1])}t.push(h(nl,o)+","+h(nl,a));--i;while(++i<n){r=e[i];o.shift();o.push(r[0]);a.shift();a.push(r[1]);rl(t,o,a)}return t.join("")}function Js(e){var t,i=-1,n=e.length,r=n+4,o,a=[],s=[];while(++i<4){o=e[i%n];a.push(o[0]);s.push(o[1])}t=[h(nl,a),",",h(nl,s)];--i;while(++i<r){o=e[i%n];a.shift();a.push(o[0]);s.shift();s.push(o[1]);rl(t,a,s)}return t.join("")}function el(e,t){var i=e.length-1;if(i){var n=e[0][0],r=e[0][1],o=e[i][0]-n,a=e[i][1]-r,s=-1,l,u;while(++s<=i){l=e[s];u=s/i;l[0]=t*l[0]+(1-t)*(n+u*o);l[1]=t*l[1]+(1-t)*(r+u*a)}}return Qs(e)}function h(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}var tl=[0,2/3,1/3,0],il=[0,1/3,2/3,0],nl=[0,1/6,2/3,1/6];function rl(e,t,i){e.push("C",h(tl,t),",",h(tl,i),",",h(il,t),",",h(il,i),",",h(nl,t),",",h(nl,i))}function ol(e,t){return(t[1]-e[1])/(t[0]-e[0])}function al(e){var t=0,i=e.length-1,n=[],r=e[0],o=e[1],a=n[0]=ol(r,o);while(++t<i){n[t]=(a+(a=ol(r=o,o=e[t+1])))/2}n[t]=a;return n}function sl(e){var t=[],i,n,r,o,a=al(e),s=-1,l=e.length-1;while(++s<l){i=ol(e[s],e[s+1]);if(I(i)<F){a[s]=a[s+1]=0}else{n=a[s]/i;r=a[s+1]/i;o=n*n+r*r;if(o>9){o=i*3/Math.sqrt(o);a[s]=o*n;a[s+1]=o*r}}}s=-1;while(++s<=l){o=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s]));t.push([o||0,a[s]*o||0])}return t}function ll(e){return e.length<3?S(e):e[0]+Xs(e,sl(e))}P.svg.line.radial=function(){var e=Ws(ul);e.radius=e.x,delete e.x;e.angle=e.y,delete e.y;return e};function ul(e){var t,i=-1,n=e.length,r,o;while(++i<n){t=e[i];r=t[0];o=t[1]-Y;t[0]=r*Math.cos(o);t[1]=r*Math.sin(o)}return e}function cl(h){var g=xr,v=xr,m=0,y=Tr,b=un,_=S,t=_.key,w=_,C="L",A=.7;function i(e){var t=[],i=[],n=[],r=-1,o=e.length,a,s=T(g),l=T(m),u=g===v?function(){return d}:T(v),c=m===y?function(){return f}:T(y),d,f;function p(){t.push("M",_(h(n),A),C,w(h(i.reverse()),A),"Z")}while(++r<o){if(b.call(this,a=e[r],r)){i.push([d=+s.call(this,a,r),f=+l.call(this,a,r)]);n.push([+u.call(this,a,r),+c.call(this,a,r)])}else if(i.length){p();i=[];n=[]}}if(i.length)p();return t.length?t.join(""):null}i.x=function(e){if(!arguments.length)return v;g=v=e;return i};i.x0=function(e){if(!arguments.length)return g;g=e;return i};i.x1=function(e){if(!arguments.length)return v;v=e;return i};i.y=function(e){if(!arguments.length)return y;m=y=e;return i};i.y0=function(e){if(!arguments.length)return m;m=e;return i};i.y1=function(e){if(!arguments.length)return y;y=e;return i};i.defined=function(e){if(!arguments.length)return b;b=e;return i};i.interpolate=function(e){if(!arguments.length)return t;if(typeof e==="function")t=_=e;else t=(_=Hs.get(e)||S).key;w=_.reverse||_;C=_.closed?"M":"L";return i};i.tension=function(e){if(!arguments.length)return A;A=e;return i};return i}Vs.reverse=zs;zs.reverse=Vs;P.svg.area=function(){return cl(L)};P.svg.area.radial=function(){var e=cl(ul);e.radius=e.x,delete e.x;e.innerRadius=e.x0,delete e.x0;e.outerRadius=e.x1,delete e.x1;e.angle=e.y,delete e.y;e.startAngle=e.y0,delete e.y0;e.endAngle=e.y1,delete e.y1;return e};P.svg.chord=function(){var r=lr,o=ur,l=dl,u=Ms,c=Ls;function t(e,t){var i=a(this,r,e,t),n=a(this,o,e,t);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(s(i,n)?f(i.r,i.p1,i.r,i.p0):f(i.r,i.p1,n.r,n.p0)+d(n.r,n.p1,n.a1-n.a0)+f(n.r,n.p1,i.r,i.p0))+"Z"}function a(e,t,i,n){var r=t.call(e,i,n),o=l.call(e,r,n),a=u.call(e,r,n)-Y,s=c.call(e,r,n)-Y;return{r:o,a0:a,a1:s,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(s),o*Math.sin(s)]}}function s(e,t){return e.a0==t.a0&&e.a1==t.a1}function d(e,t,i){return"A"+e+","+e+" 0 "+ +(i>U)+",1 "+t}function f(e,t,i,n){return"Q 0,0 "+n}t.radius=function(e){if(!arguments.length)return l;l=T(e);return t};t.source=function(e){if(!arguments.length)return r;r=T(e);return t};t.target=function(e){if(!arguments.length)return o;o=T(e);return t};t.startAngle=function(e){if(!arguments.length)return u;u=T(e);return t};t.endAngle=function(e){if(!arguments.length)return c;c=T(e);return t};return t};function dl(e){return e.radius}P.svg.diagonal=function(){var a=lr,s=ur,l=fl;function t(e,t){var i=a.call(this,e,t),n=s.call(this,e,t),r=(i.y+n.y)/2,o=[i,{x:i.x,y:r},{x:n.x,y:r},n];o=o.map(l);return"M"+o[0]+"C"+o[1]+" "+o[2]+" "+o[3]}t.source=function(e){if(!arguments.length)return a;a=T(e);return t};t.target=function(e){if(!arguments.length)return s;s=T(e);return t};t.projection=function(e){if(!arguments.length)return l;l=e;return t};return t};function fl(e){return[e.x,e.y]}P.svg.diagonal.radial=function(){var e=P.svg.diagonal(),t=fl,i=e.projection;e.projection=function(e){return arguments.length?i(pl(t=e)):t};return e};function pl(n){return function(){var e=n.apply(this,arguments),t=e[0],i=e[1]-Y;return[t*Math.cos(i),t*Math.sin(i)]}}P.svg.symbol=function(){var i=gl,n=hl;function t(e,t){return(ml.get(i.call(this,e,t))||vl)(n.call(this,e,t))}t.type=function(e){if(!arguments.length)return i;i=T(e);return t};t.size=function(e){if(!arguments.length)return n;n=T(e);return t};return t};function hl(){return 64}function gl(){return"circle"}function vl(e){var t=Math.sqrt(e/U);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}var ml=P.map({circle:vl,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*bl)),i=t*bl;return"M0,"+-t+"L"+i+",0"+" 0,"+t+" "+-i+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/yl),i=t*yl/2;return"M0,"+i+"L"+t+","+-i+" "+-t+","+-i+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/yl),i=t*yl/2;return"M0,"+-i+"L"+t+","+i+" "+-t+","+i+"Z"}});P.svg.symbolTypes=ml.keys();var yl=Math.sqrt(3),bl=Math.tan(30*E);i.transition=function(e){var t=El||++Al,i=Dl(e),n=[],r,o,a=xl||{time:Date.now(),ease:Fo,delay:0,duration:250};for(var s=-1,l=this.length;++s<l;){n.push(r=[]);for(var u=this[s],c=-1,d=u.length;++c<d;){if(o=u[c])kl(o,c,i,t,a);r.push(o)}}return Cl(n,i,t)};i.interrupt=function(e){return this.each(e==null?_l:wl(Dl(e)))};var _l=wl(Dl());function wl(i){return function(){var e,t;if((e=this[i])&&(t=e[e.active])){if(--e.count)delete e[e.active];else delete this[i];e.active+=.5;t.event&&t.event.interrupt.call(this,this.__data__,t.index)}}}function Cl(e,t,i){me(e,o);e.namespace=t;e.id=i;return e}var o=[],Al=0,El,xl;o.call=i.call;o.empty=i.empty;o.node=i.node;o.size=i.size;P.transition=function(e,t){return e&&e.transition?El?e.transition(t):e:P.selection().transition(e)};P.transition.prototype=o;o.select=function(e){var t=this.id,i=this.namespace,n=[],r,o,a;e=Ce(e);for(var s=-1,l=this.length;++s<l;){n.push(r=[]);for(var u=this[s],c=-1,d=u.length;++c<d;){if((a=u[c])&&(o=e.call(a,a.__data__,c,s))){if("__data__"in a)o.__data__=a.__data__;kl(o,c,i,t,a[i][t]);r.push(o)}else{r.push(null)}}}return Cl(n,i,t)};o.selectAll=function(e){var t=this.id,i=this.namespace,n=[],r,o,a,s,l;e=Ae(e);for(var u=-1,c=this.length;++u<c;){for(var d=this[u],f=-1,p=d.length;++f<p;){if(a=d[f]){l=a[i][t];o=e.call(a,a.__data__,f,u);n.push(r=[]);for(var h=-1,g=o.length;++h<g;){if(s=o[h])kl(s,h,i,t,l);r.push(s)}}}}return Cl(n,i,t)};o.filter=function(e){var t=[],i,n,r;if(typeof e!=="function")e=Le(e);for(var o=0,a=this.length;o<a;o++){t.push(i=[]);for(var n=this[o],s=0,l=n.length;s<l;s++){if((r=n[s])&&e.call(r,r.__data__,s,o)){i.push(r)}}}return Cl(t,this.namespace,this.id)};o.tween=function(t,i){var n=this.id,r=this.namespace;if(arguments.length<2)return this.node()[r][n].tween.get(t);return l(this,i==null?function(e){e[r][n].tween.remove(t)}:function(e){e[r][n].tween.set(t,i)})};function Tl(e,n,r,o){var a=e.id,s=e.namespace;return l(e,typeof r==="function"?function(e,t,i){e[s][a].tween.set(n,o(r.call(e,e.__data__,t,i)))}:(r=o(r),function(e){e[s][a].tween.set(n,r)}))}o.attr=function(e,t){if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var n=e=="transform"?ea:So,r=P.ns.qualify(e);function o(){this.removeAttribute(r)}function a(){this.removeAttributeNS(r.space,r.local)}function i(i){return i==null?o:(i+="",function(){var e=this.getAttribute(r),t;return e!==i&&(t=n(e,i),function(e){this.setAttribute(r,t(e))})})}function s(i){return i==null?a:(i+="",function(){var e=this.getAttributeNS(r.space,r.local),t;return e!==i&&(t=n(e,i),function(e){this.setAttributeNS(r.space,r.local,t(e))})})}return Tl(this,"attr."+e,t,r.local?s:i)};o.attrTween=function(e,n){var r=P.ns.qualify(e);function t(e,t){var i=n.call(this,e,t,this.getAttribute(r));return i&&function(e){this.setAttribute(r,i(e))}}function i(e,t){var i=n.call(this,e,t,this.getAttributeNS(r.space,r.local));return i&&function(e){this.setAttributeNS(r.space,r.local,i(e))}}return this.tween("attr."+e,r.local?i:t)};o.style=function(n,e,r){var t=arguments.length;if(t<3){if(typeof n!=="string"){if(t<2)e="";for(r in n)this.style(r,n[r],e);return this}r=""}function o(){this.style.removeProperty(n)}function i(i){return i==null?o:(i+="",function(){var e=$(this).getComputedStyle(this,null).getPropertyValue(n),t;return e!==i&&(t=So(e,i),function(e){this.style.setProperty(n,t(e),r)})})}return Tl(this,"style."+n,e,i)};o.styleTween=function(n,r,o){if(arguments.length<3)o="";function e(e,t){var i=r.call(this,e,t,$(this).getComputedStyle(this,null).getPropertyValue(n));return i&&function(e){this.style.setProperty(n,i(e),o)}}return this.tween("style."+n,e)};o.text=function(e){return Tl(this,"text",e,Sl)};function Sl(e){if(e==null)e="";return function(){this.textContent=e}}o.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;if(this[t].count<2&&(e=this.parentNode))e.removeChild(this)})};o.ease=function(t){var i=this.id,n=this.namespace;if(arguments.length<1)return this.node()[n][i].ease;if(typeof t!=="function")t=P.ease.apply(P,arguments);return l(this,function(e){e[n][i].ease=t})};o.delay=function(n){var r=this.id,o=this.namespace;if(arguments.length<1)return this.node()[o][r].delay;return l(this,typeof n==="function"?function(e,t,i){e[o][r].delay=+n.call(e,e.__data__,t,i)}:(n=+n,function(e){e[o][r].delay=n}))};o.duration=function(n){var r=this.id,o=this.namespace;if(arguments.length<1)return this.node()[o][r].duration;return l(this,typeof n==="function"?function(e,t,i){e[o][r].duration=Math.max(1,n.call(e,e.__data__,t,i))}:(n=Math.max(1,n),function(e){e[o][r].duration=n}))};o.each=function(n,i){var r=this.id,o=this.namespace;if(arguments.length<2){var e=xl,t=El;try{El=r;l(this,function(e,t,i){xl=e[o][r];n.call(e,e.__data__,t,i)})}finally{xl=e;El=t}}else{l(this,function(e){var t=e[o][r];(t.event||(t.event=P.dispatch("start","end","interrupt"))).on(n,i)})}return this};o.transition=function(){var e=this.id,t=++Al,i=this.namespace,n=[],r,o,a,s;for(var l=0,u=this.length;l<u;l++){n.push(r=[]);for(var o=this[l],c=0,d=o.length;c<d;c++){if(a=o[c]){s=a[i][e];kl(a,c,i,t,{time:s.time,ease:s.ease,delay:s.delay+s.duration,duration:s.duration})}r.push(a)}}return Cl(n,i,t)};function Dl(e){return e==null?"__transition__":"__transition_"+e+"__"}function kl(u,c,d,f,e){var p=u[d]||(u[d]={active:0,count:0}),h=p[f];if(!h){var g=e.time;h=p[f]={tween:new y,time:g,delay:e.delay,duration:e.duration,ease:e.ease,index:c};e=null;++p.count;P.timer(function(e){var t=h.delay,r,o,i=v,a=[];i.t=t+g;if(t<=e)return n(e-t);i.c=n;function n(e){if(p.active>f)return l();var t=p[p.active];if(t){--p.count;delete p[p.active];t.event&&t.event.interrupt.call(u,u.__data__,t.index)}p.active=f;h.event&&h.event.start.call(u,u.__data__,c);h.tween.forEach(function(e,t){if(t=t.call(u,u.__data__,c)){a.push(t)}});o=h.ease;r=h.duration;P.timer(function(){i.c=s(e||1)?un:s;return 1},0,g)}function s(e){if(p.active!==f)return 1;var t=e/r,i=o(t),n=a.length;while(n>0){a[--n].call(u,i)}if(t>=1){h.event&&h.event.end.call(u,u.__data__,c);return l()}}function l(){if(--p.count)delete p[f];else delete u[d];return 1}},0,g)}}P.svg.axis=function(){var T=P.scale.linear(),S=Ol,D=6,k=6,O=3,R=[10],N=null,I;function i(e){e.each(function(){var e=P.select(this);var t=this.__chart__||T,i=this.__chart__=T.copy();var n=N==null?i.ticks?i.ticks.apply(i,R):i.domain():N,r=I==null?i.tickFormat?i.tickFormat.apply(i,R):L:I,o=e.selectAll(".tick").data(n,i),a=o.enter().insert("g",".domain").attr("class","tick").style("opacity",F),s=P.transition(o.exit()).style("opacity",F).remove(),l=P.transition(o.order()).style("opacity",1),u=Math.max(D,0)+O,c;var d=is(i),f=e.selectAll(".domain").data([0]),p=(f.enter().append("path").attr("class","domain"),P.transition(f));a.append("line");a.append("text");var h=a.select("line"),g=l.select("line"),v=o.select("text").text(r),m=a.select("text"),y=l.select("text"),b=S==="top"||S==="left"?-1:1,_,w,C,A;if(S==="bottom"||S==="top"){c=Nl,_="x",C="y",w="x2",A="y2";v.attr("dy",b<0?"0em":".71em").style("text-anchor","middle");p.attr("d","M"+d[0]+","+b*k+"V0H"+d[1]+"V"+b*k)}else{c=Il,_="y",C="x",w="y2",A="x2";v.attr("dy",".32em").style("text-anchor",b<0?"end":"start");p.attr("d","M"+b*k+","+d[0]+"H0V"+d[1]+"H"+b*k)}h.attr(A,b*D);m.attr(C,b*u);g.attr(w,0).attr(A,b*D);y.attr(_,0).attr(C,b*u);if(i.rangeBand){var E=i,x=E.rangeBand()/2;t=i=function(e){return E(e)+x}}else if(t.rangeBand){t=i}else{s.call(c,i,t)}a.call(c,t,i);l.call(c,i,i)})}i.scale=function(e){if(!arguments.length)return T;T=e;return i};i.orient=function(e){if(!arguments.length)return S;S=e in Rl?e+"":Ol;return i};i.ticks=function(){if(!arguments.length)return R;R=arguments;return i};i.tickValues=function(e){if(!arguments.length)return N;N=e;return i};i.tickFormat=function(e){if(!arguments.length)return I;I=e;return i};i.tickSize=function(e){var t=arguments.length;if(!t)return D;D=+e;k=+arguments[t-1];return i};i.innerTickSize=function(e){if(!arguments.length)return D;D=+e;return i};i.outerTickSize=function(e){if(!arguments.length)return k;k=+e;return i};i.tickPadding=function(e){if(!arguments.length)return O;O=+e;return i};i.tickSubdivide=function(){return arguments.length&&i};return i};var Ol="bottom",Rl={top:1,right:1,bottom:1,left:1};function Nl(e,i,n){e.attr("transform",function(e){var t=i(e);return"translate("+(isFinite(t)?t:n(e))+",0)"})}function Il(e,i,n){e.attr("transform",function(e){var t=i(e);return"translate(0,"+(isFinite(t)?t:n(e))+")"})}P.svg.brush=function(){var _=ge(k,"brushstart","brush","brushend"),w=null,C=null,A=[0,0],E=[0,0],x,T,S=true,D=true,a=Ml[0];function k(e){e.each(function(){var e=P.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",s).on("touchstart.brush",s);var t=e.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var i=e.selectAll(".resize").data(a,L);i.exit().remove();i.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Pl[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");i.style("display",k.empty()?"none":null);var n=P.transition(e),r=P.transition(t),o;if(w){o=is(w);r.attr("x",o[0]).attr("width",o[1]-o[0]);R(n)}if(C){o=is(C);r.attr("y",o[0]).attr("height",o[1]-o[0]);N(n)}O(n)})}k.event=function(e){e.each(function(){var n=_.of(this,arguments),r={x:A,y:E,i:x,j:T},e=this.__chart__||r;this.__chart__=r;if(El){P.select(this).transition().each("start.brush",function(){x=e.i;T=e.j;A=e.x;E=e.y;n({type:"brushstart"})}).tween("brush:brush",function(){var t=Do(A,r.x),i=Do(E,r.y);x=T=null;return function(e){A=r.x=t(e);E=r.y=i(e);n({type:"brush",mode:"resize"})}}).each("end.brush",function(){x=r.i;T=r.j;n({type:"brush",mode:"resize"});n({type:"brushend"})})}else{n({type:"brushstart"});n({type:"brush",mode:"resize"});n({type:"brushend"})}})};function O(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+A[+/e$/.test(e)]+","+E[+/^s/.test(e)]+")"})}function R(e){e.select(".extent").attr("x",A[0]);e.selectAll(".extent,.n>rect,.s>rect").attr("width",A[1]-A[0])}function N(e){e.select(".extent").attr("y",E[0]);e.selectAll(".extent,.e>rect,.w>rect").attr("height",E[1]-E[0])}function s(){var i=this,e=P.select(P.event.target),n=_.of(i,arguments),r=P.select(i),t=e.datum(),o=!/^(n|s)$/.test(t)&&w,a=!/^(e|w)$/.test(t)&&C,d=e.classed("extent"),s=Ue(i),f,p=P.mouse(i),l;var u=P.select($(i)).on("keydown.brush",g).on("keyup.brush",v);if(P.event.changedTouches){u.on("touchmove.brush",m).on("touchend.brush",b)}else{u.on("mousemove.brush",m).on("mouseup.brush",b)}r.interrupt().selectAll("*").interrupt();if(d){p[0]=A[0]-p[0];p[1]=E[0]-p[1]}else if(t){var c=+/w$/.test(t),h=+/^n/.test(t);l=[A[1-c]-p[0],E[1-h]-p[1]];p[0]=A[c];p[1]=E[h]}else if(P.event.altKey)f=p.slice();r.style("pointer-events","none").selectAll(".resize").style("display",null);P.select("body").style("cursor",e.style("cursor"));n({type:"brushstart"});m();function g(){if(P.event.keyCode==32){if(!d){f=null;p[0]-=A[1];p[1]-=E[1];d=2}pe()}}function v(){if(P.event.keyCode==32&&d==2){p[0]+=A[1];p[1]+=E[1];d=0;pe()}}function m(){var e=P.mouse(i),t=false;if(l){e[0]+=l[0];e[1]+=l[1]}if(!d){if(P.event.altKey){if(!f)f=[(A[0]+A[1])/2,(E[0]+E[1])/2];p[0]=A[+(e[0]<f[0])];p[1]=E[+(e[1]<f[1])]}else f=null}if(o&&y(e,w,0)){R(r);t=true}if(a&&y(e,C,1)){N(r);t=true}if(t){O(r);n({type:"brush",mode:d?"move":"resize"})}}function y(e,t,i){var n=is(t),r=n[0],o=n[1],a=p[i],s=i?E:A,l=s[1]-s[0],u,c;if(d){r-=a;o-=l+a}u=(i?D:S)?Math.max(r,Math.min(o,e[i])):e[i];if(d){c=(u+=a)+l}else{if(f)a=Math.max(r,Math.min(o,2*f[i]-u));if(a<u){c=u;u=a}else{c=a}}if(s[0]!=u||s[1]!=c){if(i)T=null;else x=null;s[0]=u;s[1]=c;return true}}function b(){m();r.style("pointer-events","all").selectAll(".resize").style("display",k.empty()?"none":null);P.select("body").style("cursor",null);u.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);s();n({type:"brushend"})}}k.x=function(e){if(!arguments.length)return w;w=e;a=Ml[!w<<1|!C];return k};k.y=function(e){if(!arguments.length)return C;C=e;a=Ml[!w<<1|!C];return k};k.clamp=function(e){if(!arguments.length)return w&&C?[S,D]:w?S:C?D:null;if(w&&C)S=!!e[0],D=!!e[1];else if(w)S=!!e;else if(C)D=!!e;return k};k.extent=function(e){var t,i,n,r,o;if(!arguments.length){if(w){if(x){t=x[0],i=x[1]}else{t=A[0],i=A[1];if(w.invert)t=w.invert(t),i=w.invert(i);if(i<t)o=t,t=i,i=o}}if(C){if(T){n=T[0],r=T[1]}else{n=E[0],r=E[1];if(C.invert)n=C.invert(n),r=C.invert(r);if(r<n)o=n,n=r,r=o}}return w&&C?[[t,n],[i,r]]:w?[t,i]:C&&[n,r]}if(w){t=e[0],i=e[1];if(C)t=t[0],i=i[0];x=[t,i];if(w.invert)t=w(t),i=w(i);if(i<t)o=t,t=i,i=o;if(t!=A[0]||i!=A[1])A=[t,i]}if(C){n=e[0],r=e[1];if(w)n=n[1],r=r[1];T=[n,r];if(C.invert)n=C(n),r=C(r);if(r<n)o=n,n=r,r=o;if(n!=E[0]||r!=E[1])E=[n,r]}return k};k.clear=function(){if(!k.empty()){A=[0,0],E=[0,0];x=T=null}return k};k.empty=function(){return!!w&&A[0]==A[1]||!!C&&E[0]==E[1]};return P.rebind(k,_,"on")};var Pl={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 Ml=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];var Ll=O.format=Ti.timeFormat;var Fl=Ll.utc;var Gl=Fl("%Y-%m-%dT%H:%M:%S.%LZ");Ll.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?$l:Gl;function $l(e){return e.toISOString()}$l.parse=function(e){var t=new Date(e);return isNaN(t)?null:t};$l.toString=Gl.toString;O.second=ii(function(e){return new R(Math.floor(e/1e3)*1e3)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*1e3)},function(e){return e.getSeconds()});O.seconds=O.second.range;O.seconds.utc=O.second.utc.range;O.minute=ii(function(e){return new R(Math.floor(e/6e4)*6e4)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*6e4)},function(e){return e.getMinutes()});O.minutes=O.minute.range;O.minutes.utc=O.minute.utc.range;O.hour=ii(function(e){var t=e.getTimezoneOffset()/60;return new R((Math.floor(e/36e5-t)+t)*36e5)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()});O.hours=O.hour.range;O.hours.utc=O.hour.utc.range;O.month=ii(function(e){e=O.day(e);e.setDate(1);return e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()});O.months=O.month.range;O.months.utc=O.month.utc.range;function Wl(t,o,e){function a(e){return t(e)}a.invert=function(e){return Hl(t.invert(e))};a.domain=function(e){if(!arguments.length)return t.domain().map(Hl);t.domain(e);return a};function s(e,t){var i=e[1]-e[0],n=i/t,r=P.bisect(jl,n);return r==jl.length?[o.year,ds(e.map(function(e){return e/31536e6}),t)[2]]:!r?[zl,ds(e,t)[2]]:o[n/jl[r-1]<jl[r]/n?r-1:r]}a.nice=function(t,i){var e=a.domain(),n=ts(e),r=t==null?s(n,10):typeof t==="number"&&s(n,t);if(r)t=r[0],i=r[1];function o(e){return!isNaN(e)&&!t.range(e,Hl(+e+1),i).length}return a.domain(rs(e,i>1?{floor:function(e){while(o(e=t.floor(e)))e=Hl(e-1);return e},ceil:function(e){while(o(e=t.ceil(e)))e=Hl(+e+1);return e}}:t))};a.ticks=function(e,t){var i=ts(a.domain()),n=e==null?s(i,10):typeof e==="number"?s(i,e):!e.range&&[{range:e},t];if(n)e=n[0],t=n[1];return e.range(i[0],Hl(+i[1]+1),t<1?1:t)};a.tickFormat=function(){return e};a.copy=function(){return Wl(t.copy(),o,e)};return us(a,t)}function Hl(e){return new Date(e)}var jl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6];var Bl=[[O.second,1],[O.second,5],[O.second,15],[O.second,30],[O.minute,1],[O.minute,5],[O.minute,15],[O.minute,30],[O.hour,1],[O.hour,3],[O.hour,6],[O.hour,12],[O.day,1],[O.day,2],[O.week,1],[O.month,1],[O.month,3],[O.year,1]];var Vl=Ll.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&e.getDate()!=1}],["%b %d",function(e){return e.getDate()!=1}],["%B",function(e){return e.getMonth()}],["%Y",un]]);var zl={range:function(e,t,i){return P.range(Math.ceil(e/i)*i,+t,i).map(Hl)},floor:L,ceil:L};Bl.year=O.year;O.scale=function(){return Wl(P.scale.linear(),Bl,Vl)};var Ul=Bl.map(function(e){return[e[0].utc,e[1]]});var Yl=Fl.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],["%b %d",function(e){return e.getUTCDate()!=1}],["%B",function(e){return e.getUTCMonth()}],["%Y",un]]);Ul.year=O.year.utc;O.scale.utc=function(){return Wl(P.scale.linear(),Ul,Yl)};P.text=Ft(function(e){return e.responseText});P.json=function(e,t){return Gt(e,"application/json",ql,t)};function ql(e){return JSON.parse(e.responseText)}P.html=function(e,t){return Gt(e,"text/html",Xl,t)};function Xl(e){var t=M.createRange();t.selectNode(M.body);return t.createContextualFragment(e.responseText)}P.xml=Ft(function(e){return e.responseXML});if(typeof define==="function"&&define.amd)define(P);else if(typeof module==="object"&&module.exports)module.exports=P;this.d3=P}();(function(c){"use strict";var e={version:"0.4.10"};var i,d,t;function n(e){this.owner=e}function r(e,t){if(Object.create){t.prototype=Object.create(e.prototype)}else{var i=function e(){};i.prototype=e.prototype;t.prototype=new i}t.prototype.constructor=t;return t}function o(e){var t=this.internal=new a(this);t.loadConfig(e);t.init();(function t(i,n,r){Object.keys(i).forEach(function(e){n[e]=i[e].bind(r);if(Object.keys(i[e]).length>0){t(i[e],n[e],r)}})})(i,this,this)}function a(e){var t=this;t.d3=c.d3?c.d3:typeof require!=="undefined"?require("d3"):undefined;t.api=e;t.config=t.getDefaultConfig();t.data={};t.cache={};t.axes={}}e.generate=function(e){return new o(e)};e.chart={fn:o.prototype,internal:{fn:a.prototype,axis:{fn:s.prototype}}};i=e.chart.fn;d=e.chart.internal.fn;t=e.chart.internal.axis.fn;d.init=function(){var e=this,t=e.config;e.initParams();if(t.data_url){e.convertUrlToData(t.data_url,t.data_mimeType,t.data_keys,e.initWithData)}else if(t.data_json){e.initWithData(e.convertJsonToData(t.data_json,t.data_keys))}else if(t.data_rows){e.initWithData(e.convertRowsToData(t.data_rows))}else if(t.data_columns){e.initWithData(e.convertColumnsToData(t.data_columns))}else{throw Error("url or json or rows or columns is required.")}};d.initParams=function(){var e=this,t=e.d3,i=e.config;e.clipId="c3-"+ +new Date+"-clip",e.clipIdForXAxis=e.clipId+"-xaxis",e.clipIdForYAxis=e.clipId+"-yaxis",e.clipIdForGrid=e.clipId+"-grid",e.clipIdForSubchart=e.clipId+"-subchart",e.clipPath=e.getClipPath(e.clipId),e.clipPathForXAxis=e.getClipPath(e.clipIdForXAxis),e.clipPathForYAxis=e.getClipPath(e.clipIdForYAxis);e.clipPathForGrid=e.getClipPath(e.clipIdForGrid),e.clipPathForSubchart=e.getClipPath(e.clipIdForSubchart),e.dragStart=null;e.dragging=false;e.flowing=false;e.cancelClick=false;e.mouseover=false;e.transiting=false;e.color=e.generateColor();e.levelColor=e.generateLevelColor();e.dataTimeFormat=i.data_xLocaltime?t.time.format:t.time.format.utc;e.axisTimeFormat=i.axis_x_localtime?t.time.format:t.time.format.utc;e.defaultAxisTimeFormat=e.axisTimeFormat.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%-m/%-d",function(e){return e.getDay()&&e.getDate()!==1}],["%-m/%-d",function(e){return e.getDate()!==1}],["%-m/%-d",function(e){return e.getMonth()}],["%Y/%-m/%-d",function(){return true}]]);e.hiddenTargetIds=[];e.hiddenLegendIds=[];e.focusedTargetIds=[];e.defocusedTargetIds=[];e.xOrient=i.axis_rotated?"left":"bottom";e.yOrient=i.axis_rotated?i.axis_y_inner?"top":"bottom":i.axis_y_inner?"right":"left";e.y2Orient=i.axis_rotated?i.axis_y2_inner?"bottom":"top":i.axis_y2_inner?"left":"right";e.subXOrient=i.axis_rotated?"left":"bottom";e.isLegendRight=i.legend_position==="right";e.isLegendInset=i.legend_position==="inset";e.isLegendTop=i.legend_inset_anchor==="top-left"||i.legend_inset_anchor==="top-right";e.isLegendLeft=i.legend_inset_anchor==="top-left"||i.legend_inset_anchor==="bottom-left";e.legendStep=0;e.legendItemWidth=0;e.legendItemHeight=0;e.currentMaxTickWidths={x:0,y:0,y2:0};e.rotated_padding_left=30;e.rotated_padding_right=i.axis_rotated&&!i.axis_x_show?0:30;e.rotated_padding_top=5;e.withoutFadeIn={};e.intervalForObserveInserted=undefined;e.axes.subx=t.selectAll([])};d.initChartElements=function(){if(this.initBar){this.initBar()}if(this.initLine){this.initLine()}if(this.initArc){this.initArc()}if(this.initGauge){this.initGauge()}if(this.initText){this.initText()}};d.initWithData=function(e){var t=this,i=t.d3,n=t.config;var r,o,a=true;t.axis=new s(t);if(t.initPie){t.initPie()}if(t.initBrush){t.initBrush()}if(t.initZoom){t.initZoom()}if(!n.bindto){t.selectChart=i.selectAll([])}else if(typeof n.bindto.node==="function"){t.selectChart=n.bindto}else{t.selectChart=i.select(n.bindto)}if(t.selectChart.empty()){t.selectChart=i.select(document.createElement("div")).style("opacity",0);t.observeInserted(t.selectChart);a=false}t.selectChart.html("").classed("c3",true);t.data.xs={};t.data.targets=t.convertDataToTargets(e);if(n.data_filter){t.data.targets=t.data.targets.filter(n.data_filter)}if(n.data_hide){t.addHiddenTargetIds(n.data_hide===true?t.mapToIds(t.data.targets):n.data_hide)}if(n.legend_hide){t.addHiddenLegendIds(n.legend_hide===true?t.mapToIds(t.data.targets):n.legend_hide)}if(t.hasType("gauge")){n.legend_show=false}t.updateSizes();t.updateScales();t.x.domain(i.extent(t.getXDomain(t.data.targets)));t.y.domain(t.getYDomain(t.data.targets,"y"));t.y2.domain(t.getYDomain(t.data.targets,"y2"));t.subX.domain(t.x.domain());t.subY.domain(t.y.domain());t.subY2.domain(t.y2.domain());t.orgXDomain=t.x.domain();if(t.brush){t.brush.scale(t.subX)}if(n.zoom_enabled){t.zoom.scale(t.x)}t.svg=t.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return n.onmouseover.call(t)}).on("mouseleave",function(){return n.onmouseout.call(t)});r=t.svg.append("defs");t.clipChart=t.appendClip(r,t.clipId);t.clipXAxis=t.appendClip(r,t.clipIdForXAxis);t.clipYAxis=t.appendClip(r,t.clipIdForYAxis);t.clipGrid=t.appendClip(r,t.clipIdForGrid);t.clipSubchart=t.appendClip(r,t.clipIdForSubchart);t.updateSvgSize();o=t.main=t.svg.append("g").attr("transform",t.getTranslate("main"));if(t.initSubchart){t.initSubchart()}if(t.initTooltip){t.initTooltip()}if(t.initLegend){t.initLegend()}o.append("text").attr("class",$.text+" "+$.empty).attr("text-anchor","middle").attr("dominant-baseline","middle");t.initRegion();t.initGrid();o.append("g").attr("clip-path",t.clipPath).attr("class",$.chart);if(n.grid_lines_front){t.initGridLines()}t.initEventRect();t.initChartElements();o.insert("rect",n.zoom_privileged?null:"g."+$.regions).attr("class",$.zoomRect).attr("width",t.width).attr("height",t.height).style("opacity",0).on("dblclick.zoom",null);if(n.axis_x_extent){t.brush.extent(t.getDefaultExtent())}t.axis.init();t.updateTargets(t.data.targets);if(a){t.updateDimension();t.config.oninit.call(t);t.redraw({withTransition:false,withTransform:true,withUpdateXDomain:true,withUpdateOrgXDomain:true,withTransitionForAxis:false})}if(c.onresize==null){c.onresize=t.generateResize()}if(c.onresize.add){c.onresize.add(function(){n.onresize.call(t)});c.onresize.add(function(){t.api.flush()});c.onresize.add(function(){n.onresized.call(t)})}t.api.element=t.selectChart.node()};d.smoothLines=function(e,t){var o=this;if(t==="grid"){e.each(function(){var e=o.d3.select(this),t=e.attr("x1"),i=e.attr("x2"),n=e.attr("y1"),r=e.attr("y2");e.attr({x1:Math.ceil(t),x2:Math.ceil(i),y1:Math.ceil(n),y2:Math.ceil(r)})})}};d.updateSizes=function(){var e=this,t=e.config;var i=e.legend?e.getLegendHeight():0,n=e.legend?e.getLegendWidth():0,r=e.isLegendRight||e.isLegendInset?0:i,o=e.hasArcType(),a=t.axis_rotated||o?0:e.getHorizontalAxisHeight("x"),s=t.subchart_show&&!o?t.subchart_size_height+a:0;e.currentWidth=e.getCurrentWidth();e.currentHeight=e.getCurrentHeight();e.margin=t.axis_rotated?{top:e.getHorizontalAxisHeight("y2")+e.getCurrentPaddingTop(),right:o?0:e.getCurrentPaddingRight(),bottom:e.getHorizontalAxisHeight("y")+r+e.getCurrentPaddingBottom(),left:s+(o?0:e.getCurrentPaddingLeft())}:{top:4+e.getCurrentPaddingTop(),right:o?0:e.getCurrentPaddingRight(),bottom:a+s+r+e.getCurrentPaddingBottom(),left:o?0:e.getCurrentPaddingLeft()};e.margin2=t.axis_rotated?{top:e.margin.top,right:NaN,bottom:20+r,left:e.rotated_padding_left}:{top:e.currentHeight-s-r,right:NaN,bottom:a+r,left:e.margin.left};e.margin3={top:0,right:NaN,bottom:0,left:0};if(e.updateSizeForLegend){e.updateSizeForLegend(i,n)}e.width=e.currentWidth-e.margin.left-e.margin.right;e.height=e.currentHeight-e.margin.top-e.margin.bottom;if(e.width<0){e.width=0}if(e.height<0){e.height=0}e.width2=t.axis_rotated?e.margin.left-e.rotated_padding_left-e.rotated_padding_right:e.width;e.height2=t.axis_rotated?e.height:e.currentHeight-e.margin2.top-e.margin2.bottom;if(e.width2<0){e.width2=0}if(e.height2<0){e.height2=0}e.arcWidth=e.width-(e.isLegendRight?n+10:0);e.arcHeight=e.height-(e.isLegendRight?0:10);if(e.hasType("gauge")){e.arcHeight+=e.height-e.getGaugeLabelHeight()}if(e.updateRadius){e.updateRadius()}if(e.isLegendRight&&o){e.margin3.left=e.arcWidth/2+e.radiusExpanded*1.1}};d.updateTargets=function(e){var t=this;t.updateTargetsForText(e);t.updateTargetsForBar(e);t.updateTargetsForLine(e);if(t.hasArcType()&&t.updateTargetsForArc){t.updateTargetsForArc(e)}if(t.updateTargetsForSubchart){t.updateTargetsForSubchart(e)}t.showTargets()};d.showTargets=function(){var t=this;t.svg.selectAll("."+$.target).filter(function(e){return t.isTargetToShow(e.id)}).transition().duration(t.config.transition_duration).style("opacity",1)};d.redraw=function(e,t){var i=this,n=i.main,s=i.d3,l=i.config;var r=i.getShapeIndices(i.isAreaType),o=i.getShapeIndices(i.isBarType),a=i.getShapeIndices(i.isLineType);var u,c,d,f,p,h,g,v,m,y,b,_,w;var L=i.hasArcType();var C,A,E,x,T;var S,D,F;var k,O;var R=i.filterTargetsToShow(i.data.targets),N,I;var G=i.xv.bind(i),P,M;e=e||{};u=W(e,"withY",true);c=W(e,"withSubchart",true);d=W(e,"withTransition",true);h=W(e,"withTransform",false);g=W(e,"withUpdateXDomain",false);v=W(e,"withUpdateOrgXDomain",false);m=W(e,"withTrimXDomain",true);w=W(e,"withUpdateXAxis",g);y=W(e,"withLegend",false);b=W(e,"withEventRect",true);_=W(e,"withDimension",true);f=W(e,"withTransitionForExit",d);p=W(e,"withTransitionForAxis",d);S=d?l.transition_duration:0;D=f?S:0;F=p?S:0;t=t||i.axis.generateTransitions(F);if(y&&l.legend_show){i.updateLegend(i.mapToIds(i.data.targets),e,t)}else if(_){i.updateDimension(true)}if(i.isCategorized()&&R.length===0){i.x.domain([0,i.axes.x.selectAll(".tick").size()])}if(R.length){i.updateXDomain(R,g,v,m);if(!l.axis_x_tick_values){N=i.axis.updateXAxisTickValues(R)}}else{i.xAxis.tickValues([]);i.subXAxis.tickValues([])}if(l.zoom_rescale&&!e.flow){I=i.x.orgDomain()}i.y.domain(i.getYDomain(R,"y",I));i.y2.domain(i.getYDomain(R,"y2",I));if(!l.axis_y_tick_values&&l.axis_y_tick_count){i.yAxis.tickValues(i.axis.generateTickValues(i.y.domain(),l.axis_y_tick_count))}if(!l.axis_y2_tick_values&&l.axis_y2_tick_count){i.y2Axis.tickValues(i.axis.generateTickValues(i.y2.domain(),l.axis_y2_tick_count))}i.axis.redraw(t,L);i.axis.updateLabels(d);if((g||w)&&R.length){if(l.axis_x_tick_culling&&N){i.svg.selectAll("."+$.axisX).each(function(){var e=s.select(this);var n=e.select("path.domain").node().getTotalLength()-(l.axis_x_tick_outer?12:0);var i=[];e.selectAll(".tick text").each(function(e){var t=N.indexOf(e);if(t>=0){i.push({e:this,index:t})}});i.sort(function(e,t){return e.index-t.index});if(!l.axis_x_tick_rotate){i.forEach(function(e){var t=e.e.getBoundingClientRect().width/2;var i=s.transform(s.select(e.e.parentNode).attr("transform"));s.select(e.e).style("text-anchor",function(){if(i.translate[0]<t){return"start"}if(i.translate[0]+t>n){return"end"}return"middle"})})}if(i.length>l.axis_x_tick_culling_max){if(l.axis_x_tick_culling_max>1){var t=l.axis_x_tick_culling_max;var r=Math.floor(i.length/t);while(i.length/r>=t+1){t--;r=Math.floor(i.length/t)}var o=Math.floor((i.length-r*(t-1)-1)/2);i.forEach(function(e,t){s.select(e.e).style("display",(t+r-o)%r?"none":"block")})}else{var a=Math.round(i.length/2);i.forEach(function(e,t){s.select(e.e).style("display",t==a?"block":"none")})}}else{i.forEach(function(e){s.select(e.e).style("display","block")})}})}else{i.svg.selectAll("."+$.axisX+" .tick text").style("display","block")}}C=i.generateDrawArea?i.generateDrawArea(r,false):undefined;A=i.generateDrawBar?i.generateDrawBar(o):undefined;E=i.generateDrawLine?i.generateDrawLine(a,false):undefined;x=i.generateXYForText(r,o,a,true);T=i.generateXYForText(r,o,a,false);if(u){i.subY.domain(i.getYDomain(R,"y"));i.subY2.domain(i.getYDomain(R,"y2"))}i.tooltip.style("display","none");i.updateXgridFocus();n.select("text."+$.text+"."+$.empty).attr("x",i.width/2).attr("y",i.height/2).text(l.data_empty_label_text).transition().style("opacity",R.length?0:1);i.updateGrid(S);i.updateRegion(S);i.updateBar(D);i.updateLine(D);i.updateArea(D);i.updateCircle();if(i.hasDataLabel()){i.updateText(D)}if(i.redrawArc){i.redrawArc(S,D,h)}if(i.redrawSubchart){i.redrawSubchart(c,t,S,D,r,o,a)}n.selectAll("."+$.selectedCircles).filter(i.isBarType.bind(i)).selectAll("circle").remove();if(l.interaction_enabled&&!e.flow&&b){i.redrawEventRect();if(i.updateZoom){i.updateZoom()}}i.updateCircleY();P=(i.config.axis_rotated?i.circleY:i.circleX).bind(i);M=(i.config.axis_rotated?i.circleX:i.circleY).bind(i);if(e.flow){O=i.generateFlow({targets:R,flow:e.flow,duration:e.flow.duration,drawBar:A,drawLine:E,drawArea:C,cx:P,cy:M,xv:G,xForText:x,yForText:T})}if((S||O)&&i.isTabVisible()){s.transition().duration(S).each(function(){var t=[];[i.redrawBar(A,true),i.redrawLine(E,true),i.redrawArea(C,true),i.redrawCircle(P,M,true),i.redrawText(x,T,e.flow,true),i.redrawRegion(true),i.redrawGrid(true)].forEach(function(e){e.forEach(function(e){t.push(e)})});k=i.generateWait();t.forEach(function(e){k.add(e)})}).call(k,function(){if(O){O()}if(l.onrendered){l.onrendered.call(i)}})}else{i.redrawBar(A);i.redrawLine(E);i.redrawArea(C);i.redrawCircle(P,M);i.redrawText(x,T,e.flow);i.redrawRegion();i.redrawGrid();if(l.onrendered){l.onrendered.call(i)}}i.mapToIds(i.data.targets).forEach(function(e){i.withoutFadeIn[e]=true})};d.updateAndRedraw=function(e){var t=this,i=t.config,n;e=e||{};e.withTransition=W(e,"withTransition",true);e.withTransform=W(e,"withTransform",false);e.withLegend=W(e,"withLegend",false);e.withUpdateXDomain=true;e.withUpdateOrgXDomain=true;e.withTransitionForExit=false;e.withTransitionForTransform=W(e,"withTransitionForTransform",e.withTransition);t.updateSizes();if(!(e.withLegend&&i.legend_show)){n=t.axis.generateTransitions(e.withTransitionForAxis?i.transition_duration:0);t.updateScales();t.updateSvgSize();t.transformAll(e.withTransitionForTransform,n)}t.redraw(e,n)};d.redrawWithoutRescale=function(){this.redraw({withY:false,withSubchart:false,withEventRect:false,withTransitionForAxis:false})};d.isTimeSeries=function(){return this.config.axis_x_type==="timeseries"};d.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0};d.isCustomX=function(){var e=this,t=e.config;return!e.isTimeSeries()&&(t.data_x||D(t.data_xs))};d.isTimeSeriesY=function(){return this.config.axis_y_type==="timeseries"};d.getTranslate=function(e){var t=this,i=t.config,n,r;if(e==="main"){n=p(t.margin.left);r=p(t.margin.top)}else if(e==="context"){n=p(t.margin2.left);r=p(t.margin2.top)}else if(e==="legend"){n=t.margin3.left;r=t.margin3.top}else if(e==="x"){n=0;r=i.axis_rotated?0:t.height}else if(e==="y"){n=0;r=i.axis_rotated?t.height:0}else if(e==="y2"){n=i.axis_rotated?0:t.width;r=i.axis_rotated?1:0}else if(e==="subx"){n=0;r=i.axis_rotated?0:t.height2}else if(e==="arc"){n=t.arcWidth/2;r=t.arcHeight/2}return"translate("+n+","+r+")"};d.initialOpacity=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?1:0};d.initialOpacityForCircle=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?this.opacityForCircle(e):0};d.opacityForCircle=function(e){var t=this.config.point_show?1:0;return S(e.value)?this.isScatterType(e)?.5:t:0};d.opacityForText=function(){return this.hasDataLabel()?1:0};d.xx=function(e){return e?this.x(e.x):null};d.xv=function(e){var t=this,i=e.value;if(t.isTimeSeries()){i=t.parseDate(e.value)}else if(t.isCategorized()&&typeof e.value==="string"){i=t.config.axis_x_categories.indexOf(e.value)}return Math.ceil(t.x(i))};d.yv=function(e){var t=this,i=e.axis&&e.axis==="y2"?t.y2:t.y;return Math.ceil(i(e.value))};d.subxx=function(e){return e?this.subX(e.x):null};d.transformMain=function(e,t){var i=this,n,r,o;if(t&&t.axisX){n=t.axisX}else{n=i.main.select("."+$.axisX);if(e){n=n.transition()}}if(t&&t.axisY){r=t.axisY}else{r=i.main.select("."+$.axisY);if(e){r=r.transition()}}if(t&&t.axisY2){o=t.axisY2}else{o=i.main.select("."+$.axisY2);if(e){o=o.transition()}}(e?i.main.transition():i.main).attr("transform",i.getTranslate("main"));n.attr("transform",i.getTranslate("x"));r.attr("transform",i.getTranslate("y"));o.attr("transform",i.getTranslate("y2"));i.main.select("."+$.chartArcs).attr("transform",i.getTranslate("arc"))};d.transformAll=function(e,t){var i=this;i.transformMain(e,t);if(i.config.subchart_show){i.transformContext(e,t)}if(i.legend){i.transformLegend(e)}};d.updateSvgSize=function(){var e=this,t=e.svg.select(".c3-brush .background");e.svg.attr("width",e.currentWidth).attr("height",e.currentHeight);e.svg.selectAll(["#"+e.clipId,"#"+e.clipIdForGrid]).select("rect").attr("width",e.width).attr("height",e.height);e.svg.select("#"+e.clipIdForXAxis).select("rect").attr("x",e.getXAxisClipX.bind(e)).attr("y",e.getXAxisClipY.bind(e)).attr("width",e.getXAxisClipWidth.bind(e)).attr("height",e.getXAxisClipHeight.bind(e));e.svg.select("#"+e.clipIdForYAxis).select("rect").attr("x",e.getYAxisClipX.bind(e)).attr("y",e.getYAxisClipY.bind(e)).attr("width",e.getYAxisClipWidth.bind(e)).attr("height",e.getYAxisClipHeight.bind(e));e.svg.select("#"+e.clipIdForSubchart).select("rect").attr("width",e.width).attr("height",t.size()?t.attr("height"):0);e.svg.select("."+$.zoomRect).attr("width",e.width).attr("height",e.height);e.selectChart.style("max-height",e.currentHeight+"px")};d.updateDimension=function(e){var t=this;if(!e){if(t.config.axis_rotated){t.axes.x.call(t.xAxis);t.axes.subx.call(t.subXAxis)}else{t.axes.y.call(t.yAxis);t.axes.y2.call(t.y2Axis)}}t.updateSizes();t.updateScales();t.updateSvgSize();t.transformAll(false)};d.observeInserted=function(t){var i=this,n;if(typeof MutationObserver==="undefined"){c.console.error("MutationObserver not defined.");return}n=new MutationObserver(function(e){e.forEach(function(e){if(e.type==="childList"&&e.previousSibling){n.disconnect();i.intervalForObserveInserted=c.setInterval(function(){if(t.node().parentNode){c.clearInterval(i.intervalForObserveInserted);i.updateDimension();i.config.oninit.call(i);i.redraw({withTransform:true,withUpdateXDomain:true,withUpdateOrgXDomain:true,withTransition:false,withTransitionForTransform:false,withLegend:true});t.transition().style("opacity",1)}},10)}})});n.observe(t.node(),{attributes:true,childList:true,characterData:true})};d.generateResize=function(){var t=[];function e(){t.forEach(function(e){e()})}e.add=function(e){t.push(e)};return e};d.endall=function(e,t){var i=0;e.each(function(){++i}).each("end",function(){if(!--i){t.apply(this,arguments)}})};d.generateWait=function(){var r=[],e=function(e,i){var n=setInterval(function(){var t=0;r.forEach(function(e){if(e.empty()){t+=1;return}try{e.transition()}catch(e){t+=1}});if(t===r.length){clearInterval(n);if(i){i()}}},10)};e.add=function(e){r.push(e)};return e};d.parseDate=function(e){var t=this,i;if(e instanceof Date){i=e}else if(typeof e==="string"){i=t.dataTimeFormat(t.config.data_xFormat).parse(e)}else if(typeof e==="number"||!isNaN(e)){i=new Date(+e)}if(!i||isNaN(+i)){c.console.error("Failed to parse x '"+e+"' to Date object")}return i};d.isTabVisible=function(){var e;if(typeof document.hidden!=="undefined"){e="hidden"}else if(typeof document.mozHidden!=="undefined"){e="mozHidden"}else if(typeof document.msHidden!=="undefined"){e="msHidden"}else if(typeof document.webkitHidden!=="undefined"){e="webkitHidden"}return document[e]?false:true};d.getDefaultConfig=function(){var t={bindto:"#chart",size_width:undefined,size_height:undefined,padding_left:undefined,padding_right:undefined,padding_top:undefined,padding_bottom:undefined,zoom_enabled:false,zoom_extent:undefined,zoom_privileged:false,zoom_rescale:false,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},interaction_enabled:true,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:undefined,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:true,data_xSort:true,data_idConverter:function(e){return e},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:undefined,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:undefined,data_colors:{},data_hide:false,data_filter:undefined,data_selection_enabled:false,data_selection_grouped:false,data_selection_isselectable:function(){return true},data_selection_multiple:true,data_selection_draggable:false,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:undefined,data_json:undefined,data_rows:undefined,data_columns:undefined,data_mimeType:undefined,data_keys:undefined,data_empty_label_text:"",subchart_show:false,subchart_size_height:60,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:true,legend_hide:false,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:undefined,legend_item_onclick:undefined,legend_item_onmouseover:undefined,legend_item_onmouseout:undefined,legend_equally:false,axis_rotated:false,axis_x_show:true,axis_x_type:"indexed",axis_x_localtime:true,axis_x_categories:[],axis_x_tick_centered:false,axis_x_tick_format:undefined,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:undefined,axis_x_tick_fit:true,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:true,axis_x_tick_multiline:true,axis_x_tick_width:null,axis_x_max:undefined,axis_x_min:undefined,axis_x_padding:{},axis_x_height:undefined,axis_x_extent:undefined,axis_x_label:{},axis_y_show:true,axis_y_type:undefined,axis_y_max:undefined,axis_y_min:undefined,axis_y_inverted:false,axis_y_center:undefined,axis_y_inner:undefined,axis_y_label:{},axis_y_tick_format:undefined,axis_y_tick_outer:true,axis_y_tick_values:null,axis_y_tick_count:undefined,axis_y_tick_time_value:undefined,axis_y_tick_time_interval:undefined,axis_y_padding:{},axis_y_default:undefined,axis_y2_show:false,axis_y2_max:undefined,axis_y2_min:undefined,axis_y2_inverted:false,axis_y2_center:undefined,axis_y2_inner:undefined,axis_y2_label:{},axis_y2_tick_format:undefined,axis_y2_tick_outer:true,axis_y2_tick_values:null,axis_y2_tick_count:undefined,axis_y2_padding:{},axis_y2_default:undefined,grid_x_show:false,grid_x_type:"tick",grid_x_lines:[],grid_y_show:false,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:true,grid_lines_front:true,point_show:true,point_r:2.5,point_focus_expand_enabled:true,point_focus_expand_r:undefined,point_select_r:undefined,line_connectNull:false,line_step_type:"step",bar_width:undefined,bar_width_ratio:.6,bar_width_max:undefined,bar_zerobased:true,area_zerobased:true,pie_label_show:true,pie_label_format:undefined,pie_label_threshold:.05,pie_expand:true,gauge_label_show:true,gauge_label_format:undefined,gauge_expand:true,gauge_min:0,gauge_max:100,gauge_units:undefined,gauge_width:undefined,donut_label_show:true,donut_label_format:undefined,donut_label_threshold:.05,donut_width:undefined,donut_expand:true,donut_title:"",regions:[],tooltip_show:true,tooltip_grouped:true,tooltip_format_title:undefined,tooltip_format_name:undefined,tooltip_format_value:undefined,tooltip_position:undefined,tooltip_contents:function(e,t,i,n){return this.getTooltipContent?this.getTooltipContent(e,t,i,n):""},tooltip_init_show:false,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"}};Object.keys(this.additionalConfig).forEach(function(e){t[e]=this.additionalConfig[e]},this);return t};d.additionalConfig={};d.loadConfig=function(t){var i=this.config,n,r,o;function a(){var e=r.shift();if(e&&n&&typeof n==="object"&&e in n){n=n[e];return a()}else if(!e){return n}else{return undefined}}Object.keys(i).forEach(function(e){n=t;r=e.split("_");o=a();if(I(o)){i[e]=o}})};d.getScale=function(e,t,i){return(i?this.d3.time.scale():this.d3.scale.linear()).range([e,t])};d.getX=function(e,t,i,n){var r=this,o=r.getScale(e,t,r.isTimeSeries()),a=i?o.domain(i):o,s;if(r.isCategorized()){n=n||function(){return 0};o=function(e,t){var i=a(e)+n(e);return t?i:Math.ceil(i)}}else{o=function(e,t){var i=a(e);return t?i:Math.ceil(i)}}for(s in a){o[s]=a[s]}o.orgDomain=function(){return a.domain()};if(r.isCategorized()){o.domain=function(e){if(!arguments.length){e=this.orgDomain();return[e[0],e[1]+1]}a.domain(e);return o}}return o};d.getY=function(e,t,i){var n=this.getScale(e,t,this.isTimeSeriesY());if(i){n.domain(i)}return n};d.getYScale=function(e){return this.axis.getId(e)==="y2"?this.y2:this.y};d.getSubYScale=function(e){return this.axis.getId(e)==="y2"?this.subY2:this.subY};d.updateScales=function(){var t=this,e=t.config,i=!t.x;t.xMin=e.axis_rotated?1:0;t.xMax=e.axis_rotated?t.height:t.width;t.yMin=e.axis_rotated?0:t.height;t.yMax=e.axis_rotated?t.width:1;t.subXMin=t.xMin;t.subXMax=t.xMax;t.subYMin=e.axis_rotated?0:t.height2;t.subYMax=e.axis_rotated?t.width2:1;t.x=t.getX(t.xMin,t.xMax,i?undefined:t.x.orgDomain(),function(){return t.xAxis.tickOffset()});t.y=t.getY(t.yMin,t.yMax,i?e.axis_y_default:t.y.domain());t.y2=t.getY(t.yMin,t.yMax,i?e.axis_y2_default:t.y2.domain());t.subX=t.getX(t.xMin,t.xMax,t.orgXDomain,function(e){return e%1?0:t.subXAxis.tickOffset()});t.subY=t.getY(t.subYMin,t.subYMax,i?e.axis_y_default:t.subY.domain());t.subY2=t.getY(t.subYMin,t.subYMax,i?e.axis_y2_default:t.subY2.domain());t.xAxisTickFormat=t.axis.getXAxisTickFormat();t.xAxisTickValues=t.axis.getXAxisTickValues();t.yAxisTickValues=t.axis.getYAxisTickValues();t.y2AxisTickValues=t.axis.getY2AxisTickValues();t.xAxis=t.axis.getXAxis(t.x,t.xOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer);t.subXAxis=t.axis.getXAxis(t.subX,t.subXOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer);t.yAxis=t.axis.getYAxis(t.y,t.yOrient,e.axis_y_tick_format,t.yAxisTickValues,e.axis_y_tick_outer);t.y2Axis=t.axis.getYAxis(t.y2,t.y2Orient,e.axis_y2_tick_format,t.y2AxisTickValues,e.axis_y2_tick_outer);if(!i){if(t.brush){t.brush.scale(t.subX)}if(e.zoom_enabled){t.zoom.scale(t.x)}}if(t.updateArc){t.updateArc()}};d.getYDomainMin=function(e){var i=this,t=i.config,n=i.mapToIds(e),r=i.getValuesAsIdKeyed(e),o,a,s,l,u,c;if(t.data_groups.length>0){c=i.hasNegativeValueInTargets(e);for(o=0;o<t.data_groups.length;o++){l=t.data_groups[o].filter(function(e){return n.indexOf(e)>=0});if(l.length===0){continue}s=l[0];if(c&&r[s]){r[s].forEach(function(e,t){r[s][t]=e<0?e:0})}for(a=1;a<l.length;a++){u=l[a];if(!r[u]){continue}r[u].forEach(function(e,t){if(i.axis.getId(u)===i.axis.getId(s)&&r[s]&&!(c&&+e>0)){r[s][t]+=+e}})}}}return i.d3.min(Object.keys(r).map(function(e){return i.d3.min(r[e])}))};d.getYDomainMax=function(e){var i=this,t=i.config,n=i.mapToIds(e),r=i.getValuesAsIdKeyed(e),o,a,s,l,u,c;if(t.data_groups.length>0){c=i.hasPositiveValueInTargets(e);for(o=0;o<t.data_groups.length;o++){l=t.data_groups[o].filter(function(e){return n.indexOf(e)>=0});if(l.length===0){continue}s=l[0];if(c&&r[s]){r[s].forEach(function(e,t){r[s][t]=e>0?e:0})}for(a=1;a<l.length;a++){u=l[a];if(!r[u]){continue}r[u].forEach(function(e,t){if(i.axis.getId(u)===i.axis.getId(s)&&r[s]&&!(c&&+e<0)){r[s][t]+=+e}})}}}return i.d3.max(Object.keys(r).map(function(e){return i.d3.max(r[e])}))};d.getYDomain=function(e,t,i){var n=this,r=n.config,o=e.filter(function(e){return n.axis.getId(e.id)===t}),a=i?n.filterByXDomain(o,i):o,s=t==="y2"?r.axis_y2_min:r.axis_y_min,l=t==="y2"?r.axis_y2_max:r.axis_y_max,u=n.getYDomainMin(a),c=n.getYDomainMax(a),d,f,p,h,g,v=t==="y2"?r.axis_y2_center:r.axis_y_center,m,y,b,_,w,C,A=n.hasType("bar",a)&&r.bar_zerobased||n.hasType("area",a)&&r.area_zerobased,E=t==="y2"?r.axis_y2_inverted:r.axis_y_inverted,x=n.hasDataLabel()&&r.axis_rotated,T=n.hasDataLabel()&&!r.axis_rotated;u=S(s)?s:S(l)?u<l?u:l-10:u;c=S(l)?l:S(s)?s<c?c:s+10:c;if(a.length===0){return t==="y2"?n.y2.domain():n.y.domain()}if(isNaN(u)){u=0}if(isNaN(c)){c=u}if(u===c){u<0?c=0:u=0}w=u>=0&&c>=0;C=u<=0&&c<=0;if(S(s)&&w||S(l)&&C){A=false}if(A){if(w){u=0}if(C){c=0}}f=Math.abs(c-u);p=h=g=f*.1;if(typeof v!=="undefined"){m=Math.max(Math.abs(u),Math.abs(c));c=v+m;u=v-m}if(x){y=n.getDataLabelLength(u,c,"width");b=M(n.y.range());_=[y[0]/b,y[1]/b];h+=f*(_[1]/(1-_[0]-_[1]));g+=f*(_[0]/(1-_[0]-_[1]))}else if(T){y=n.getDataLabelLength(u,c,"height");h+=n.axis.convertPixelsToAxisPadding(y[1],f);g+=n.axis.convertPixelsToAxisPadding(y[0],f)}if(t==="y"&&D(r.axis_y_padding)){h=n.axis.getPadding(r.axis_y_padding,"top",h,f);g=n.axis.getPadding(r.axis_y_padding,"bottom",g,f)}if(t==="y2"&&D(r.axis_y2_padding)){h=n.axis.getPadding(r.axis_y2_padding,"top",h,f);g=n.axis.getPadding(r.axis_y2_padding,"bottom",g,f)}if(A){if(w){g=u}if(C){h=-c}}d=n.config.axis_rotated?[u,c]:[u-g,c+h];return E?d.reverse():d};d.getXDomainMin=function(e){var t=this,i=t.config;return I(i.axis_x_min)?t.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:t.d3.min(e,function(e){return t.d3.min(e.values,function(e){return e.x})})};d.getXDomainMax=function(e){var t=this,i=t.config;return I(i.axis_x_max)?t.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:t.d3.max(e,function(e){return t.d3.max(e.values,function(e){return e.x})})};d.getXDomainPadding=function(e){var t=this,i=t.config,n=e[1]-e[0],r,o,a,s;if(t.isCategorized()){o=0}else if(t.hasType("bar")){r=t.getMaxDataCount();o=r>1?n/(r-1)/2:.5}else{o=n*.01}if(typeof i.axis_x_padding==="object"&&D(i.axis_x_padding)){a=S(i.axis_x_padding.left)?i.axis_x_padding.left:o;s=S(i.axis_x_padding.right)?i.axis_x_padding.right:o}else if(typeof i.axis_x_padding==="number"){a=s=i.axis_x_padding}else{a=s=o}return{left:a,right:s}};d.getXDomain=function(e){var t=this,i=[t.getXDomainMin(e),t.getXDomainMax(e)],n=i[0],r=i[1],o=t.getXDomainPadding(i),a=0,s=0;if(n-r===0&&!t.isCategorized()){if(t.isTimeSeries()){n=new Date(n.getTime()*.5);r=new Date(r.getTime()*1.5)}else{n=n===0?1:n*.5;r=r===0?-1:r*1.5}}if(n||n===0){a=t.isTimeSeries()?new Date(n.getTime()-o.left):n-o.left}if(r||r===0){s=t.isTimeSeries()?new Date(r.getTime()+o.right):r+o.right}return[a,s]};d.updateXDomain=function(e,t,i,n,r){var o=this,a=o.config;if(i){o.x.domain(r?r:o.d3.extent(o.getXDomain(e)));o.orgXDomain=o.x.domain();if(a.zoom_enabled){o.zoom.scale(o.x).updateScaleExtent()}o.subX.domain(o.x.domain());if(o.brush){o.brush.scale(o.subX)}}if(t){o.x.domain(r?r:!o.brush||o.brush.empty()?o.orgXDomain:o.brush.extent());if(a.zoom_enabled){o.zoom.scale(o.x).updateScaleExtent()}}if(n){o.x.domain(o.trimXDomain(o.x.orgDomain()))}return o.x.domain()};d.trimXDomain=function(e){var t=this;if(e[0]<=t.orgXDomain[0]){e[1]=+e[1]+(t.orgXDomain[0]-e[0]);e[0]=t.orgXDomain[0]}if(t.orgXDomain[1]<=e[1]){e[0]=+e[0]-(e[1]-t.orgXDomain[1]);e[1]=t.orgXDomain[1]}return e};d.isX=function(e){var t=this,i=t.config;return i.data_x&&e===i.data_x||D(i.data_xs)&&g(i.data_xs,e)};d.isNotX=function(e){return!this.isX(e)};d.getXKey=function(e){var t=this,i=t.config;return i.data_x?i.data_x:D(i.data_xs)?i.data_xs[e]:null};d.getXValuesOfXKey=function(t,e){var i=this,n,r=e&&D(e)?i.mapToIds(e):[];r.forEach(function(e){if(i.getXKey(e)===t){n=i.data.xs[e]}});return n};d.getIndexByX=function(e){var t=this,i=t.filterByX(t.data.targets,e);return i.length?i[0].index:null};d.getXValue=function(e,t){var i=this;return e in i.data.xs&&i.data.xs[e]&&S(i.data.xs[e][t])?i.data.xs[e][t]:t};d.getOtherTargetXs=function(){var e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null};d.getOtherTargetX=function(e){var t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null};d.addXs=function(t){var i=this;Object.keys(t).forEach(function(e){i.config.data_xs[e]=t[e]})};d.hasMultipleX=function(t){return this.d3.set(Object.keys(t).map(function(e){return t[e]})).size()>1};d.isMultipleX=function(){return D(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")};d.addName=function(e){var t=this,i;if(e){i=t.config.data_names[e.id];e.name=i?i:e.id}return e};d.getValueOnIndex=function(e,t){var i=e.filter(function(e){return e.index===t});return i.length?i[0]:null};d.updateTargetX=function(e,n){var r=this;e.forEach(function(i){i.values.forEach(function(e,t){e.x=r.generateTargetX(n[t],i.id,t)});r.data.xs[i.id]=n})};d.updateTargetXs=function(e,t){var i=this;e.forEach(function(e){if(t[e.id]){i.updateTargetX([e],t[e.id])}})};d.generateTargetX=function(e,t,i){var n=this,r;if(n.isTimeSeries()){r=e?n.parseDate(e):n.parseDate(n.getXValue(t,i))}else if(n.isCustomX()&&!n.isCategorized()){r=S(e)?+e:n.getXValue(t,i)}else{r=i}return r};d.cloneTarget=function(e){return{id:e.id,id_org:e.id_org,values:e.values.map(function(e){return{x:e.x,value:e.value,id:e.id}})}};d.updateXs=function(){var t=this;if(t.data.targets.length){t.xs=[];t.data.targets[0].values.forEach(function(e){t.xs[e.index]=e.x})}};d.getPrevX=function(e){var t=this.xs[e-1];return typeof t!=="undefined"?t:null};d.getNextX=function(e){var t=this.xs[e+1];return typeof t!=="undefined"?t:null};d.getMaxDataCount=function(){var e=this;return e.d3.max(e.data.targets,function(e){return e.values.length})};d.getMaxDataCountTarget=function(e){var t=e.length,i=0,n;if(t>1){e.forEach(function(e){if(e.values.length>i){n=e;i=e.values.length}})}else{n=t?e[0]:null}return n};d.getEdgeX=function(e){var t=this;return!e.length?[0,0]:[t.d3.min(e,function(e){return e.values[0].x}),t.d3.max(e,function(e){return e.values[e.values.length-1].x})]};d.mapToIds=function(e){return e.map(function(e){return e.id})};d.mapToTargetIds=function(e){var t=this;return e?l(e)?[e]:e:t.mapToIds(t.data.targets)};d.hasTarget=function(e,t){var i=this.mapToIds(e),n;for(n=0;n<i.length;n++){if(i[n]===t){return true}}return false};d.isTargetToShow=function(e){return this.hiddenTargetIds.indexOf(e)<0};d.isLegendToShow=function(e){return this.hiddenLegendIds.indexOf(e)<0};d.filterTargetsToShow=function(e){var t=this;return e.filter(function(e){return t.isTargetToShow(e.id)})};d.mapTargetsToUniqueXs=function(e){var t=this;var i=t.d3.set(t.d3.merge(e.map(function(e){return e.values.map(function(e){return+e.x})}))).values();return t.isTimeSeries()?i.map(function(e){return new Date(+e)}):i.map(function(e){return+e})};d.addHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.concat(e)};d.removeHiddenTargetIds=function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(e){return t.indexOf(e)<0})};d.addHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.concat(e)};d.removeHiddenLegendIds=function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(e){return t.indexOf(e)<0})};d.getValuesAsIdKeyed=function(e){var i={};e.forEach(function(t){i[t.id]=[];t.values.forEach(function(e){i[t.id].push(e.value)})});return i};d.checkValueInTargets=function(e,t){var i=Object.keys(e),n,r,o;for(n=0;n<i.length;n++){o=e[i[n]].values;for(r=0;r<o.length;r++){if(t(o[r].value)){return true}}}return false};d.hasNegativeValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e<0})};d.hasPositiveValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e>0})};d.isOrderDesc=function(){var e=this.config;return typeof e.data_order==="string"&&e.data_order.toLowerCase()==="desc"};d.isOrderAsc=function(){var e=this.config;return typeof e.data_order==="string"&&e.data_order.toLowerCase()==="asc"};d.orderTargets=function(e){var t=this,i=t.config,o=t.isOrderAsc(),n=t.isOrderDesc();if(o||n){e.sort(function(e,t){var i=function(e,t){return e+Math.abs(t.value)};var n=e.values.reduce(i,0),r=t.values.reduce(i,0);return o?r-n:n-r})}else if(f(i.data_order)){e.sort(i.data_order)}return e};d.filterByX=function(e,t){return this.d3.merge(e.map(function(e){return e.values})).filter(function(e){return e.x-t===0})};d.filterRemoveNull=function(e){return e.filter(function(e){return S(e.value)})};d.filterByXDomain=function(e,t){return e.map(function(e){return{id:e.id,id_org:e.id_org,values:e.values.filter(function(e){return t[0]<=e.x&&e.x<=t[1]})}})};d.hasDataLabel=function(){var e=this.config;if(typeof e.data_labels==="boolean"&&e.data_labels){return true}else if(typeof e.data_labels==="object"&&D(e.data_labels)){return true}return false};d.getDataLabelLength=function(e,t,i){var n=this,r=[0,0],o=1.3;n.selectChart.select("svg").selectAll(".dummy").data([e,t]).enter().append("text").text(function(e){return n.dataLabelFormat(e.id)(e)}).each(function(e,t){r[t]=this.getBoundingClientRect()[i]*o}).remove();return r};d.isNoneArc=function(e){return this.hasTarget(this.data.targets,e.id)},d.isArc=function(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)};d.findSameXOfValues=function(e,t){var i,n=e[t].x,r=[];for(i=t-1;i>=0;i--){if(n!==e[i].x){break}r.push(e[i])}for(i=t;i<e.length;i++){if(n!==e[i].x){break}r.push(e[i])}return r};d.findClosestFromTargets=function(e,t){var i=this,n;n=e.map(function(e){return i.findClosest(e.values,t)});return i.findClosest(n,t)};d.findClosest=function(e,i){var n=this,r=100,o;e.filter(function(e){return e&&n.isBarType(e.id)}).forEach(function(e){var t=n.main.select("."+$.bars+n.getTargetSelectorSuffix(e.id)+" ."+$.bar+"-"+e.index).node();if(!o&&n.isWithinBar(t)){o=e}});e.filter(function(e){return e&&!n.isBarType(e.id)}).forEach(function(e){var t=n.dist(e,i);if(t<r){r=t;o=e}});return o};d.dist=function(e,t){var i=this,n=i.config,r=n.axis_rotated?1:0,o=n.axis_rotated?0:1,a=i.circleY(e,e.index),s=i.x(e.x);return Math.pow(s-t[r],2)+Math.pow(a-t[o],2)};d.convertValuesToStep=function(e){var t=[].concat(e),i;if(!this.isCategorized()){return e}for(i=e.length+1;0<i;i--){t[i]=t[i-1]}t[0]={x:t[0].x-1,value:t[0].value,id:t[0].id};t[e.length+1]={x:t[e.length].x+1,value:t[e.length].value,id:t[e.length].id};return t};d.updateDataAttributes=function(e,t){var i=this,n=i.config,r=n["data_"+e];if(typeof t==="undefined"){return r}Object.keys(t).forEach(function(e){r[e]=t[e]});i.redraw({withLegend:true});return r};d.convertUrlToData=function(e,t,n,r){var o=this,a=t?t:"csv";o.d3.xhr(e,function(e,t){var i;if(!t){throw new Error(e.responseURL+" "+e.status+" ("+e.statusText+")")}if(a==="json"){i=o.convertJsonToData(JSON.parse(t.response),n)}else if(a==="tsv"){i=o.convertTsvToData(t.response)}else{i=o.convertCsvToData(t.response)}r.call(o,i)})};d.convertXsvToData=function(e,t){var i=t.parseRows(e),n;if(i.length===1){n=[{}];i[0].forEach(function(e){n[0][e]=null})}else{n=t.parse(e)}return n};d.convertCsvToData=function(e){return this.convertXsvToData(e,this.d3.csv)};d.convertTsvToData=function(e){return this.convertXsvToData(e,this.d3.tsv)};d.convertJsonToData=function(t,e){var i=this,r=[],o,n;if(e){if(e.x){o=e.value.concat(e.x);i.config.data_x=e.x}else{o=e.value}r.push(o);t.forEach(function(i){var n=[];o.forEach(function(e){var t=E(i[e])?null:i[e];n.push(t)});r.push(n)});n=i.convertRowsToData(r)}else{Object.keys(t).forEach(function(e){r.push([e].concat(t[e]))});n=i.convertColumnsToData(r)}return n};d.convertRowsToData=function(e){var t=e[0],i={},n=[],r,o;for(r=1;r<e.length;r++){i={};for(o=0;o<e[r].length;o++){if(E(e[r][o])){throw new Error("Source data is missing a component at ("+r+","+o+")!")}i[t[o]]=e[r][o]}n.push(i)}return n};d.convertColumnsToData=function(e){var t=[],i,n,r;for(i=0;i<e.length;i++){r=e[i][0];for(n=1;n<e[i].length;n++){if(E(t[n-1])){t[n-1]={}}if(E(e[i][n])){throw new Error("Source data is missing a component at ("+i+","+n+")!")}t[n-1][r]=e[i][n]}}return t};d.convertDataToTargets=function(e,n){var l=this,u=l.config,t=l.d3.keys(e[0]).filter(l.isNotX,l),r=l.d3.keys(e[0]).filter(l.isX,l),i;t.forEach(function(i){var t=l.getXKey(i);if(l.isCustomX()||l.isTimeSeries()){if(r.indexOf(t)>=0){l.data.xs[i]=(n&&l.data.xs[i]?l.data.xs[i]:[]).concat(e.map(function(e){return e[t]}).filter(S).map(function(e,t){return l.generateTargetX(e,i,t)}))}else if(u.data_x){l.data.xs[i]=l.getOtherTargetXs()}else if(D(u.data_xs)){l.data.xs[i]=l.getXValuesOfXKey(t,l.data.targets)}}else{l.data.xs[i]=e.map(function(e,t){return t})}});t.forEach(function(e){if(!l.data.xs[e]){throw new Error('x is not defined for id = "'+e+'".')}});i=t.map(function(o,a){var s=u.data_idConverter(o);return{id:s,id_org:o,values:e.map(function(e,t){var i=l.getXKey(o),n=e[i],r=l.generateTargetX(n,o,t);if(l.isCustomX()&&l.isCategorized()&&a===0&&n){if(t===0){u.axis_x_categories=[]}u.axis_x_categories.push(n)}if(E(e[o])||l.data.xs[o].length<=t){r=undefined}return{x:r,value:e[o]!==null&&!isNaN(e[o])?+e[o]:null,id:s}}).filter(function(e){return I(e.x)})}});i.forEach(function(e){var t;if(u.data_xSort){e.values=e.values.sort(function(e,t){var i=e.x||e.x===0?e.x:Infinity,n=t.x||t.x===0?t.x:Infinity;return i-n})}t=0;e.values.forEach(function(e){e.index=t++});l.data.xs[e.id].sort(function(e,t){return e-t})});if(u.data_type){l.setTargetType(l.mapToIds(i).filter(function(e){return!(e in u.data_types)}),u.data_type)}i.forEach(function(e){l.addCache(e.id_org,e)});return i};d.load=function(i,n){var r=this;if(i){if(n.filter){i=i.filter(n.filter)}if(n.type||n.types){i.forEach(function(e){var t=n.types&&n.types[e.id]?n.types[e.id]:n.type;r.setTargetType(e.id,t)})}r.data.targets.forEach(function(e){for(var t=0;t<i.length;t++){if(e.id===i[t].id){e.values=i[t].values;i.splice(t,1);break}}});r.data.targets=r.data.targets.concat(i)}r.updateTargets(r.data.targets);r.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true,withLegend:true});if(n.done){n.done()}};d.loadFromArgs=function(t){var i=this;if(t.data){i.load(i.convertDataToTargets(t.data),t)}else if(t.url){i.convertUrlToData(t.url,t.mimeType,t.keys,function(e){i.load(i.convertDataToTargets(e),t)})}else if(t.json){i.load(i.convertDataToTargets(i.convertJsonToData(t.json,t.keys)),t)}else if(t.rows){i.load(i.convertDataToTargets(i.convertRowsToData(t.rows)),t)}else if(t.columns){i.load(i.convertDataToTargets(i.convertColumnsToData(t.columns)),t)}else{i.load(null,t)}};d.unload=function(e,t){var i=this;if(!t){t=function(){}}e=e.filter(function(e){return i.hasTarget(i.data.targets,e)});if(!e||e.length===0){t();return}i.svg.selectAll(e.map(function(e){return i.selectorTarget(e)})).transition().style("opacity",0).remove().call(i.endall,t);e.forEach(function(t){i.withoutFadeIn[t]=false;if(i.legend){i.legend.selectAll("."+$.legendItem+i.getTargetSelectorSuffix(t)).remove()}i.data.targets=i.data.targets.filter(function(e){return e.id!==t})})};d.categoryName=function(e){var t=this.config;return e<t.axis_x_categories.length?t.axis_x_categories[e]:e};d.initEventRect=function(){var e=this;e.main.select("."+$.chart).append("g").attr("class",$.eventRects).style("fill-opacity",0)};d.redrawEventRect=function(){var e=this,t=e.config,i,n,r=e.isMultipleX();var o=e.main.select("."+$.eventRects).style("cursor",t.zoom_enabled?t.axis_rotated?"ns-resize":"ew-resize":null).classed($.eventRectsMultiple,r).classed($.eventRectsSingle,!r);o.selectAll("."+$.eventRect).remove();e.eventRect=o.selectAll("."+$.eventRect);if(r){i=e.eventRect.data([0]);e.generateEventRectsForMultipleXs(i.enter());e.updateEventRect(i)}else{n=e.getMaxDataCountTarget(e.data.targets);o.datum(n?n.values:[]);e.eventRect=o.selectAll("."+$.eventRect);i=e.eventRect.data(function(e){return e});e.generateEventRectsForSingleX(i.enter());e.updateEventRect(i);i.exit().remove()}};d.updateEventRect=function(e){var r=this,n=r.config,t,i,o,a,s,l;e=e||r.eventRect.data(function(e){return e});if(r.isMultipleX()){t=0;i=0;o=r.width;a=r.height}else{if((r.isCustomX()||r.isTimeSeries())&&!r.isCategorized()){r.updateXs();s=function(e){var t=r.getPrevX(e.index),i=r.getNextX(e.index);if(t===null&&i===null){return n.axis_rotated?r.height:r.width}if(t===null){t=r.x.domain()[0]}if(i===null){i=r.x.domain()[1]}return Math.max(0,(r.x(i)-r.x(t))/2)};l=function(e){var t=r.getPrevX(e.index),i=r.getNextX(e.index),n=r.data.xs[e.id][e.index];if(t===null&&i===null){return 0}if(t===null){t=r.x.domain()[0]}return(r.x(n)+r.x(t))/2}}else{s=r.getEventRectWidth();l=function(e){return r.x(e.x)-s/2}}t=n.axis_rotated?0:l;i=n.axis_rotated?l:0;o=n.axis_rotated?r.width:s;a=n.axis_rotated?s:r.height}e.attr("class",r.classEvent.bind(r)).attr("x",t).attr("y",i).attr("width",o).attr("height",a)};d.generateEventRectsForSingleX=function(e){var r=this,o=r.d3,a=r.config;e.append("rect").attr("class",r.classEvent.bind(r)).style("cursor",a.data_selection_enabled&&a.data_selection_grouped?"pointer":null).on("mouseover",function(e){var t=e.index;if(r.dragging||r.flowing){return}if(r.hasArcType()){return}if(a.point_focus_expand_enabled){r.expandCircles(t,null,true)}r.expandBars(t,null,true);r.main.selectAll("."+$.shape+"-"+t).each(function(e){a.data_onmouseover.call(r.api,e)})}).on("mouseout",function(e){var t=e.index;if(!r.config){return}if(r.hasArcType()){return}r.hideXGridFocus();r.hideTooltip();r.unexpandCircles();r.unexpandBars();r.main.selectAll("."+$.shape+"-"+t).each(function(e){a.data_onmouseout.call(r.api,e)})}).on("mousemove",function(e){var t,i=e.index,n=r.svg.select("."+$.eventRect+"-"+i);if(r.dragging||r.flowing){return}if(r.hasArcType()){return}if(r.isStepType(e)&&r.config.line_step_type==="step-after"&&o.mouse(this)[0]<r.x(r.getXValue(e.id,i))){i-=1}t=r.filterTargetsToShow(r.data.targets).map(function(e){return r.addName(r.getValueOnIndex(e.values,i))});if(a.tooltip_grouped){r.showTooltip(t,this);r.showXGridFocus(t)}if(a.tooltip_grouped&&(!a.data_selection_enabled||a.data_selection_grouped)){return}r.main.selectAll("."+$.shape+"-"+i).each(function(){o.select(this).classed($.EXPANDED,true);if(a.data_selection_enabled){n.style("cursor",a.data_selection_grouped?"pointer":null)}if(!a.tooltip_grouped){r.hideXGridFocus();r.hideTooltip();if(!a.data_selection_grouped){r.unexpandCircles(i);r.unexpandBars(i)}}}).filter(function(e){return r.isWithinShape(this,e)}).each(function(e){if(a.data_selection_enabled&&(a.data_selection_grouped||a.data_selection_isselectable(e))){n.style("cursor","pointer")}if(!a.tooltip_grouped){r.showTooltip([e],this);r.showXGridFocus([e]);if(a.point_focus_expand_enabled){r.expandCircles(i,e.id,true)}r.expandBars(i,e.id,true)}})}).on("click",function(e){var t=e.index;if(r.hasArcType()||!r.toggleShape){return}if(r.cancelClick){r.cancelClick=false;return}if(r.isStepType(e)&&a.line_step_type==="step-after"&&o.mouse(this)[0]<r.x(r.getXValue(e.id,t))){t-=1}r.main.selectAll("."+$.shape+"-"+t).each(function(e){if(a.data_selection_grouped||r.isWithinShape(this,e)){r.toggleShape(this,e,t);r.config.data_onclick.call(r.api,e,this)}})}).call(a.data_selection_draggable&&r.drag?o.behavior.drag().origin(Object).on("drag",function(){r.drag(o.mouse(this))}).on("dragstart",function(){r.dragstart(o.mouse(this))}).on("dragend",function(){r.dragend()}):function(){})};d.generateEventRectsForMultipleXs=function(e){var o=this,a=o.d3,s=o.config;function l(){o.svg.select("."+$.eventRect).style("cursor",null);o.hideXGridFocus();o.hideTooltip();o.unexpandCircles();o.unexpandBars()}e.append("rect").attr("x",0).attr("y",0).attr("width",o.width).attr("height",o.height).attr("class",$.eventRect).on("mouseout",function(){if(!o.config){return}if(o.hasArcType()){return}l()}).on("mousemove",function(){var e=o.filterTargetsToShow(o.data.targets);var t,i,n,r;if(o.dragging){return}if(o.hasArcType(e)){return}t=a.mouse(this);i=o.findClosestFromTargets(e,t);if(o.mouseover&&(!i||i.id!==o.mouseover.id)){s.data_onmouseout.call(o.api,o.mouseover);o.mouseover=undefined}if(!i){l();return}if(o.isScatterType(i)||!s.tooltip_grouped){n=[i]}else{n=o.filterByX(e,i.x)}r=n.map(function(e){return o.addName(e)});o.showTooltip(r,this);if(s.point_focus_expand_enabled){o.expandCircles(i.index,i.id,true)}o.expandBars(i.index,i.id,true);o.showXGridFocus(r);if(o.isBarType(i.id)||o.dist(i,t)<100){o.svg.select("."+$.eventRect).style("cursor","pointer");if(!o.mouseover){s.data_onmouseover.call(o.api,i);o.mouseover=i}}}).on("click",function(){var e=o.filterTargetsToShow(o.data.targets);var t,i;if(o.hasArcType(e)){return}t=a.mouse(this);i=o.findClosestFromTargets(e,t);if(!i){return}if(o.isBarType(i.id)||o.dist(i,t)<100){o.main.selectAll("."+$.shapes+o.getTargetSelectorSuffix(i.id)).selectAll("."+$.shape+"-"+i.index).each(function(){if(s.data_selection_grouped||o.isWithinShape(this,i)){o.toggleShape(this,i,i.index);o.config.data_onclick.call(o.api,i,this)}})}}).call(s.data_selection_draggable&&o.drag?a.behavior.drag().origin(Object).on("drag",function(){o.drag(a.mouse(this))}).on("dragstart",function(){o.dragstart(a.mouse(this))}).on("dragend",function(){o.dragend()}):function(){})};d.dispatchEvent=function(e,t,i){var n=this,r="."+$.eventRect+(!n.isMultipleX()?"-"+t:""),o=n.main.select(r).node(),a=o.getBoundingClientRect(),s=a.left+(i?i[0]:0),l=a.top+(i?i[1]:0),u=document.createEvent("MouseEvents");u.initMouseEvent(e,true,true,c,0,s,l,s,l,false,false,false,false,0,null);o.dispatchEvent(u)};d.getCurrentWidth=function(){var e=this,t=e.config;return t.size_width?t.size_width:e.getParentWidth()};d.getCurrentHeight=function(){var e=this,t=e.config,i=t.size_height?t.size_height:e.getParentHeight();return i>0?i:320/(e.hasType("gauge")?2:1)};d.getCurrentPaddingTop=function(){var e=this.config;return S(e.padding_top)?e.padding_top:0};d.getCurrentPaddingBottom=function(){var e=this.config;return S(e.padding_bottom)?e.padding_bottom:0};d.getCurrentPaddingLeft=function(e){var t=this,i=t.config;if(S(i.padding_left)){return i.padding_left}else if(i.axis_rotated){return!i.axis_x_show?1:Math.max(u(t.getAxisWidthByAxisId("x",e)),40)}else if(!i.axis_y_show||i.axis_y_inner){return t.axis.getYAxisLabelPosition().isOuter?30:1}else{return u(t.getAxisWidthByAxisId("y",e))}};d.getCurrentPaddingRight=function(){var e=this,t=e.config,i=10,n=e.isLegendRight?e.getLegendWidth()+20:0;if(S(t.padding_right)){return t.padding_right+1}else if(t.axis_rotated){return i+n}else if(!t.axis_y2_show||t.axis_y2_inner){return 2+n+(e.axis.getY2AxisLabelPosition().isOuter?20:0)}else{return u(e.getAxisWidthByAxisId("y2"))+n}};d.getParentRectValue=function(t){var i=this.selectChart.node(),n;while(i&&i.tagName!=="BODY"){try{n=i.getBoundingClientRect()[t]}catch(e){if(t==="width"){n=i.offsetWidth}}if(n){break}i=i.parentNode}return n};d.getParentWidth=function(){return this.getParentRectValue("width")};d.getParentHeight=function(){var e=this.selectChart.style("height");return e.indexOf("px")>0?+e.replace("px",""):0};d.getSvgLeft=function(e){var t=this,i=t.config,n=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,r=i.axis_rotated?$.axisX:$.axisY,o=t.main.select("."+r).node(),a=o&&n?o.getBoundingClientRect():{right:0},s=t.selectChart.node().getBoundingClientRect(),l=t.hasArcType(),u=a.right-s.left-(l?0:t.getCurrentPaddingLeft(e));return u>0?u:0};d.getAxisWidthByAxisId=function(e,t){var i=this,n=i.axis.getLabelPositionById(e);return i.axis.getMaxTickWidth(e,t)+(n.isInner?20:40)};d.getHorizontalAxisHeight=function(e){var t=this,i=t.config,n=30;if(e==="x"&&!i.axis_x_show){return 8}if(e==="x"&&i.axis_x_height){return i.axis_x_height}if(e==="y"&&!i.axis_y_show){return i.legend_show&&!t.isLegendRight&&!t.isLegendInset?10:1}if(e==="y2"&&!i.axis_y2_show){return t.rotated_padding_top}if(e==="x"&&!i.axis_rotated&&i.axis_x_tick_rotate){n=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-i.axis_x_tick_rotate)/180)}return n+(t.axis.getLabelPositionById(e).isInner?0:10)+(e==="y2"?-10:0)};d.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())};d.getShapeIndices=function(e){var t=this,i=t.config,n={},r=0,o,a;t.filterTargetsToShow(t.data.targets.filter(e,t)).forEach(function(e){for(o=0;o<i.data_groups.length;o++){if(i.data_groups[o].indexOf(e.id)<0){continue}for(a=0;a<i.data_groups[o].length;a++){if(i.data_groups[o][a]in n){n[e.id]=n[i.data_groups[o][a]];break}}}if(E(n[e.id])){n[e.id]=r++}});n.__max__=r-1;return n};d.getShapeX=function(i,n,r,e){var t=this,o=e?t.subX:t.x;return function(e){var t=e.id in r?r[e.id]:0;return e.x||e.x===0?o(e.x)-i*(n/2-t):0}};d.getShapeY=function(i){var n=this;return function(e){var t=i?n.getSubYScale(e.id):n.getYScale(e.id);return t(e.value)}};d.getShapeOffset=function(e,s,t){var l=this,u=l.orderTargets(l.filterTargetsToShow(l.data.targets.filter(e,l))),c=u.map(function(e){return e.id});return function(i,n){var r=t?l.getSubYScale(i.id):l.getYScale(i.id),o=r(0),a=o;u.forEach(function(e){var t=l.isStepType(i)?l.convertValuesToStep(e.values):e.values;if(e.id===i.id||s[e.id]!==s[i.id]){return}if(c.indexOf(e.id)<c.indexOf(i.id)){if(t[n].value*i.value>=0){a+=r(t[n].value)-o}}});return a}};d.isWithinShape=function(e,t){var i=this,n=i.d3.select(e),r;if(!i.isTargetToShow(t.id)){r=false}else if(e.nodeName==="circle"){r=i.isStepType(t)?i.isWithinStep(e,i.getYScale(t.id)(t.value)):i.isWithinCircle(e,i.pointSelectR(t)*1.5)}else if(e.nodeName==="path"){r=n.classed($.bar)?i.isWithinBar(e):true}return r};d.getInterpolate=function(e){var t=this;return t.isSplineType(e)?"cardinal":t.isStepType(e)?t.config.line_step_type:"linear"};d.initLine=function(){var e=this;e.main.select("."+$.chart).append("g").attr("class",$.chartLines)};d.updateTargetsForLine=function(e){var i=this,t=i.config,n,r,o=i.classChartLine.bind(i),a=i.classLines.bind(i),s=i.classAreas.bind(i),l=i.classCircles.bind(i),u=i.classFocus.bind(i);n=i.main.select("."+$.chartLines).selectAll("."+$.chartLine).data(e).attr("class",function(e){return o(e)+u(e)});r=n.enter().append("g").attr("class",o).style("opacity",0).style("pointer-events","none");r.append("g").attr("class",a);r.append("g").attr("class",s);r.append("g").attr("class",function(e){return i.generateClass($.selectedCircles,e.id)});r.append("g").attr("class",l).style("cursor",function(e){return t.data_selection_isselectable(e)?"pointer":null});e.forEach(function(t){i.main.selectAll("."+$.selectedCircles+i.getTargetSelectorSuffix(t.id)).selectAll("."+$.selectedCircle).each(function(e){e.value=t.values[e.index].value})})};d.updateLine=function(e){var t=this;t.mainLine=t.main.selectAll("."+$.lines).selectAll("."+$.line).data(t.lineData.bind(t));t.mainLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color);t.mainLine.style("opacity",t.initialOpacity.bind(t)).style("shape-rendering",function(e){return t.isStepType(e)?"crispEdges":""}).attr("transform",null);t.mainLine.exit().transition().duration(e).style("opacity",0).remove()};d.redrawLine=function(e,t){return[(t?this.mainLine.transition():this.mainLine).attr("d",e).style("stroke",this.color).style("opacity",1)]};d.generateDrawLine=function(e,s){var l=this,u=l.config,c=l.d3.svg.line(),i=l.generateGetLinePoints(e,s),d=s?l.getSubYScale:l.getYScale,t=function(e){return(s?l.subxx:l.xx).call(l,e)},n=function(e,t){return u.data_groups.length>0?i(e,t)[0][1]:d.call(l,e.id)(e.value)};c=u.axis_rotated?c.x(n).y(t):c.x(t).y(n);if(!u.line_connectNull){c=c.defined(function(e){return e.value!=null})}return function(e){var t=u.line_connectNull?l.filterRemoveNull(e.values):e.values,i=s?l.x:l.subX,n=d.call(l,e.id),r=0,o=0,a;if(l.isLineType(e)){if(u.data_regions[e.id]){a=l.lineWithRegions(t,i,n,u.data_regions[e.id])}else{if(l.isStepType(e)){t=l.convertValuesToStep(t)}a=c.interpolate(l.getInterpolate(e))(t)}}else{if(t[0]){r=i(t[0].x);o=n(t[0].value)}a=u.axis_rotated?"M "+o+" "+r:"M "+r+" "+o}return a?a:"M 0 0"}};d.generateGetLinePoints=function(e,t){var a=this,s=a.config,i=e.__max__+1,l=a.getShapeX(0,i,e,!!t),u=a.getShapeY(!!t),c=a.getShapeOffset(a.isLineType,e,!!t),d=t?a.getSubYScale:a.getYScale;return function(e,t){var i=d.call(a,e.id)(0),n=c(e,t)||i,r=l(e),o=u(e);if(s.axis_rotated){if(0<e.value&&o<i||e.value<0&&i<o){o=i}}return[[r,o-(i-n)],[r,o-(i-n)],[r,o-(i-n)],[r,o-(i-n)]]}};d.lineWithRegions=function(e,u,c,t){var i=this,d=i.config,n=-1,r,o,a="M",s,l,f,p,h,g,v,m,y=i.isCategorized()?.5:0,b,_,w=[];function C(e,t){var i;for(i=0;i<t.length;i++){if(t[i].start<e&&e<=t[i].end){return true}}return false}if(I(t)){for(r=0;r<t.length;r++){w[r]={};if(E(t[r].start)){w[r].start=e[0].x}else{w[r].start=i.isTimeSeries()?i.parseDate(t[r].start):t[r].start}if(E(t[r].end)){w[r].end=e[e.length-1].x}else{w[r].end=i.isTimeSeries()?i.parseDate(t[r].end):t[r].end}}}b=d.axis_rotated?function(e){return c(e.value)}:function(e){return u(e.x)};_=d.axis_rotated?function(e){return u(e.x)}:function(e){return c(e.value)};function A(e){return"M"+e[0][0]+" "+e[0][1]+" "+e[1][0]+" "+e[1][1]}if(i.isTimeSeries()){s=function(e,t,i,n){var r=e.x.getTime(),o=t.x-e.x,a=new Date(r+o*i),s=new Date(r+o*(i+n)),l;if(d.axis_rotated){l=[[c(f(i)),u(a)],[c(f(i+n)),u(s)]]}else{l=[[u(a),c(f(i))],[u(s),c(f(i+n))]]}return A(l)}}else{s=function(e,t,i,n){var r;if(d.axis_rotated){r=[[c(f(i),true),u(l(i))],[c(f(i+n),true),u(l(i+n))]]}else{r=[[u(l(i),true),c(f(i))],[u(l(i+n),true),c(f(i+n))]]}return A(r)}}for(r=0;r<e.length;r++){if(E(w)||!C(e[r].x,w)){a+=" "+b(e[r])+" "+_(e[r])}else{l=i.getScale(e[r-1].x+y,e[r].x+y,i.isTimeSeries());f=i.getScale(e[r-1].value,e[r].value);p=u(e[r].x)-u(e[r-1].x);h=c(e[r].value)-c(e[r-1].value);g=Math.sqrt(Math.pow(p,2)+Math.pow(h,2));v=2/g;m=v*2;for(o=v;o<=1;o+=m){a+=s(e[r-1],e[r],o,v)}}n=e[r].x}return a};d.updateArea=function(e){var t=this,i=t.d3;t.mainArea=t.main.selectAll("."+$.areas).selectAll("."+$.area).data(t.lineData.bind(t));t.mainArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){t.orgAreaOpacity=+i.select(this).style("opacity");return 0});t.mainArea.style("opacity",t.orgAreaOpacity);t.mainArea.exit().transition().duration(e).style("opacity",0).remove()};d.redrawArea=function(e,t){return[(t?this.mainArea.transition():this.mainArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)]};d.generateDrawArea=function(e,t){var o=this,a=o.config,s=o.d3.svg.area(),i=o.generateGetAreaPoints(e,t),n=t?o.getSubYScale:o.getYScale,r=function(e){return(t?o.subxx:o.xx).call(o,e)},l=function(e,t){return a.data_groups.length>0?i(e,t)[0][1]:n.call(o,e.id)(o.getAreaBaseValue(e.id))},u=function(e,t){return a.data_groups.length>0?i(e,t)[1][1]:n.call(o,e.id)(e.value)};s=a.axis_rotated?s.x0(l).x1(u).y(r):s.x(r).y0(l).y1(u);if(!a.line_connectNull){s=s.defined(function(e){return e.value!==null})}return function(e){var t=a.line_connectNull?o.filterRemoveNull(e.values):e.values,i=0,n=0,r;if(o.isAreaType(e)){if(o.isStepType(e)){t=o.convertValuesToStep(t)}r=s.interpolate(o.getInterpolate(e))(t)}else{if(t[0]){i=o.x(t[0].x);n=o.getYScale(e.id)(t[0].value)}r=a.axis_rotated?"M "+n+" "+i:"M "+i+" "+n}return r?r:"M 0 0"}};d.getAreaBaseValue=function(){return 0};d.generateGetAreaPoints=function(e,t){var a=this,s=a.config,i=e.__max__+1,l=a.getShapeX(0,i,e,!!t),u=a.getShapeY(!!t),c=a.getShapeOffset(a.isAreaType,e,!!t),d=t?a.getSubYScale:a.getYScale;return function(e,t){var i=d.call(a,e.id)(0),n=c(e,t)||i,r=l(e),o=u(e);if(s.axis_rotated){if(0<e.value&&o<i||e.value<0&&i<o){o=i}}return[[r,n],[r,o-(i-n)],[r,o-(i-n)],[r,n]]}};d.updateCircle=function(){var e=this;e.mainCircle=e.main.selectAll("."+$.circles).selectAll("."+$.circle).data(e.lineOrScatterData.bind(e));e.mainCircle.enter().append("circle").attr("class",e.classCircle.bind(e)).attr("r",e.pointR.bind(e)).style("fill",e.color);e.mainCircle.style("opacity",e.initialOpacityForCircle.bind(e));e.mainCircle.exit().remove()};d.redrawCircle=function(e,t,i){var n=this.main.selectAll("."+$.selectedCircle);return[(i?this.mainCircle.transition():this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",e).attr("cy",t),(i?n.transition():n).attr("cx",e).attr("cy",t)]};d.circleX=function(e){return e.x||e.x===0?this.x(e.x):null};d.updateCircleY=function(){var t=this,e,i;if(t.config.data_groups.length>0){e=t.getShapeIndices(t.isLineType),i=t.generateGetLinePoints(e);t.circleY=function(e,t){return i(e,t)[0][1]}}else{t.circleY=function(e){return t.getYScale(e.id)(e.value)}}};d.getCircles=function(e,t){var i=this;return(t?i.main.selectAll("."+$.circles+i.getTargetSelectorSuffix(t)):i.main).selectAll("."+$.circle+(S(e)?"-"+e:""))};d.expandCircles=function(e,t,i){var n=this,r=n.pointExpandedR.bind(n);if(i){n.unexpandCircles()}n.getCircles(e,t).classed($.EXPANDED,true).attr("r",r)};d.unexpandCircles=function(e){var t=this,i=t.pointR.bind(t);t.getCircles(e).filter(function(){return t.d3.select(this).classed($.EXPANDED)}).classed($.EXPANDED,false).attr("r",i)};d.pointR=function(e){var t=this,i=t.config;return t.isStepType(e)?0:f(i.point_r)?i.point_r(e):i.point_r};d.pointExpandedR=function(e){var t=this,i=t.config;return i.point_focus_expand_enabled?i.point_focus_expand_r?i.point_focus_expand_r:t.pointR(e)*1.75:t.pointR(e)};d.pointSelectR=function(e){var t=this,i=t.config;return i.point_select_r?i.point_select_r:t.pointR(e)*4};d.isWithinCircle=function(e,t){var i=this.d3,n=i.mouse(e),r=i.select(e),o=+r.attr("cx"),a=+r.attr("cy");return Math.sqrt(Math.pow(o-n[0],2)+Math.pow(a-n[1],2))<t};d.isWithinStep=function(e,t){return Math.abs(t-this.d3.mouse(e)[1])<30};d.initBar=function(){var e=this;e.main.select("."+$.chart).append("g").attr("class",$.chartBars)};d.updateTargetsForBar=function(e){var t=this,i=t.config,n,r,o=t.classChartBar.bind(t),a=t.classBars.bind(t),s=t.classFocus.bind(t);n=t.main.select("."+$.chartBars).selectAll("."+$.chartBar).data(e).attr("class",function(e){return o(e)+s(e)});r=n.enter().append("g").attr("class",o).style("opacity",0).style("pointer-events","none");r.append("g").attr("class",a).style("cursor",function(e){return i.data_selection_isselectable(e)?"pointer":null})};d.updateBar=function(e){var t=this,i=t.barData.bind(t),n=t.classBar.bind(t),r=t.initialOpacity.bind(t),o=function(e){return t.color(e.id)};t.mainBar=t.main.selectAll("."+$.bars).selectAll("."+$.bar).data(i);t.mainBar.enter().append("path").attr("class",n).style("stroke",o).style("fill",o);t.mainBar.style("opacity",r);t.mainBar.exit().transition().duration(e).style("opacity",0).remove()};d.redrawBar=function(e,t){return[(t?this.mainBar.transition():this.mainBar).attr("d",e).style("fill",this.color).style("opacity",1)]};d.getBarW=function(e,t){var i=this,n=i.config,r=typeof n.bar_width==="number"?n.bar_width:t?e.tickInterval()*n.bar_width_ratio/t:0;return n.bar_width_max&&r>n.bar_width_max?n.bar_width_max:r};d.getBars=function(e,t){var i=this;return(t?i.main.selectAll("."+$.bars+i.getTargetSelectorSuffix(t)):i.main).selectAll("."+$.bar+(S(e)?"-"+e:""))};d.expandBars=function(e,t,i){var n=this;if(i){n.unexpandBars()}n.getBars(e,t).classed($.EXPANDED,true)};d.unexpandBars=function(e){var t=this;t.getBars(e).classed($.EXPANDED,false)};d.generateDrawBar=function(e,t){var i=this,a=i.config,s=i.generateGetBarPoints(e,t);return function(e,t){var i=s(e,t);var n=a.axis_rotated?1:0;var r=a.axis_rotated?0:1;var o="M "+i[0][n]+","+i[0][r]+" "+"L"+i[1][n]+","+i[1][r]+" "+"L"+i[2][n]+","+i[2][r]+" "+"L"+i[3][n]+","+i[3][r]+" "+"z";return o}};d.generateGetBarPoints=function(e,t){var a=this,i=t?a.subXAxis:a.xAxis,n=e.__max__+1,s=a.getBarW(i,n),l=a.getShapeX(s,n,e,!!t),u=a.getShapeY(!!t),c=a.getShapeOffset(a.isBarType,e,!!t),d=t?a.getSubYScale:a.getYScale;return function(e,t){var i=d.call(a,e.id)(0),n=c(e,t)||i,r=l(e),o=u(e);if(a.config.axis_rotated){if(0<e.value&&o<i||e.value<0&&i<o){o=i}}return[[r,n],[r,o-(i-n)],[r+s,o-(i-n)],[r+s,n]]}};d.isWithinBar=function(e){var t=this.d3.mouse(e),i=e.getBoundingClientRect(),n=e.pathSegList.getItem(0),r=e.pathSegList.getItem(1),o=Math.min(n.x,r.x),a=Math.min(n.y,r.y),s=i.width,l=i.height,u=2,c=o-u,d=o+s+u,f=a+l+u,p=a-u;return c<t[0]&&t[0]<d&&p<t[1]&&t[1]<f};d.initText=function(){var e=this;e.main.select("."+$.chart).append("g").attr("class",$.chartTexts);e.mainText=e.d3.selectAll([])};d.updateTargetsForText=function(e){var t=this,i,n,r=t.classChartText.bind(t),o=t.classTexts.bind(t),a=t.classFocus.bind(t);i=t.main.select("."+$.chartTexts).selectAll("."+$.chartText).data(e).attr("class",function(e){return r(e)+a(e)});n=i.enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none");n.append("g").attr("class",o)};d.updateText=function(e){var n=this,t=n.config,i=n.barOrLineData.bind(n),r=n.classText.bind(n);n.mainText=n.main.selectAll("."+$.texts).selectAll("."+$.text).data(i);n.mainText.enter().append("text").attr("class",r).attr("text-anchor",function(e){return t.axis_rotated?e.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(e){return n.color(e)}).style("fill-opacity",0);n.mainText.text(function(e,t,i){return n.dataLabelFormat(e.id)(e.value,e.id,t,i)});n.mainText.exit().transition().duration(e).style("fill-opacity",0).remove()};d.redrawText=function(e,t,i,n){return[(n?this.mainText.transition():this.mainText).attr("x",e).attr("y",t).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]};d.getTextRect=function(e,t){var i=this.d3.select("body").append("div").classed("c3",true),n=i.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),r;n.selectAll(".dummy").data([e]).enter().append("text").classed(t?t:"",true).text(e).each(function(){r=this.getBoundingClientRect()});i.remove();return r};d.generateXYForText=function(e,t,i,n){var r=this,o=r.generateGetAreaPoints(e,false),a=r.generateGetBarPoints(t,false),s=r.generateGetLinePoints(i,false),l=n?r.getXForText:r.getYForText;return function(e,t){var i=r.isAreaType(e)?o:r.isBarType(e)?a:s;return l.call(r,i(e,t),e,this)}};d.getXForText=function(e,t,i){var n=this,r=i.getBoundingClientRect(),o,a;if(n.config.axis_rotated){a=n.isBarType(t)?4:6;o=e[2][1]+a*(t.value<0?-1:1)}else{o=n.hasType("bar")?(e[2][0]+e[0][0])/2:e[0][0]}if(t.value===null){if(o>n.width){o=n.width-r.width}else if(o<0){o=4}}return o};d.getYForText=function(e,t,i){var n=this,r=i.getBoundingClientRect(),o;if(n.config.axis_rotated){o=(e[0][0]+e[2][0]+r.height*.6)/2}else{o=e[2][1];if(t.value<0){o+=r.height;if(n.isBarType(t)&&n.isSafari()){o-=3}else if(!n.isBarType(t)&&n.isChrome()){o+=3}}else{o+=n.isBarType(t)?-3:-6}}if(t.value===null&&!n.config.axis_rotated){if(o<r.height){o=r.height}else if(o>this.height){o=this.height-4}}return o};d.setTargetType=function(e,t){var i=this,n=i.config;i.mapToTargetIds(e).forEach(function(e){i.withoutFadeIn[e]=t===n.data_types[e];n.data_types[e]=t});if(!e){n.data_type=t}};d.hasType=function(i,e){var t=this,n=t.config.data_types,r=false;e=e||t.data.targets;if(e&&e.length){e.forEach(function(e){var t=n[e.id];if(t&&t.indexOf(i)>=0||!t&&i==="line"){r=true}})}else if(Object.keys(n).length){Object.keys(n).forEach(function(e){if(n[e]===i){r=true}})}else{r=t.config.data_type===i}return r};d.hasArcType=function(e){return this.hasType("pie",e)||this.hasType("donut",e)||this.hasType("gauge",e)};d.isLineType=function(e){var t=this.config,i=l(e)?e:e.id;return!t.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(t.data_types[i])>=0};d.isStepType=function(e){var t=l(e)?e:e.id;return["step","area-step"].indexOf(this.config.data_types[t])>=0};d.isSplineType=function(e){var t=l(e)?e:e.id;return["spline","area-spline"].indexOf(this.config.data_types[t])>=0};d.isAreaType=function(e){var t=l(e)?e:e.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[t])>=0};d.isBarType=function(e){var t=l(e)?e:e.id;return this.config.data_types[t]==="bar"};d.isScatterType=function(e){var t=l(e)?e:e.id;return this.config.data_types[t]==="scatter"};d.isPieType=function(e){var t=l(e)?e:e.id;return this.config.data_types[t]==="pie"};d.isGaugeType=function(e){var t=l(e)?e:e.id;return this.config.data_types[t]==="gauge"};d.isDonutType=function(e){var t=l(e)?e:e.id;return this.config.data_types[t]==="donut"};d.isArcType=function(e){return this.isPieType(e)||this.isDonutType(e)||this.isGaugeType(e)};d.lineData=function(e){return this.isLineType(e)?[e]:[]};d.arcData=function(e){return this.isArcType(e.data)?[e]:[]};d.barData=function(e){return this.isBarType(e)?e.values:[]};d.lineOrScatterData=function(e){return this.isLineType(e)||this.isScatterType(e)?e.values:[]};d.barOrLineData=function(e){return this.isBarType(e)||this.isLineType(e)?e.values:[]};d.initGrid=function(){var e=this,t=e.config,i=e.d3;e.grid=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",$.grid);if(t.grid_x_show){e.grid.append("g").attr("class",$.xgrids)}if(t.grid_y_show){e.grid.append("g").attr("class",$.ygrids)}if(t.grid_focus_show){e.grid.append("g").attr("class",$.xgridFocus).append("line").attr("class",$.xgridFocus)}e.xgrid=i.selectAll([]);if(!t.grid_lines_front){e.initGridLines()}};d.initGridLines=function(){var e=this,t=e.d3;e.gridLines=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",$.grid+" "+$.gridLines);e.gridLines.append("g").attr("class",$.xgridLines);e.gridLines.append("g").attr("class",$.ygridLines);e.xgridLines=t.selectAll([])};d.updateXGrid=function(e){var t=this,i=t.config,n=t.d3,r=t.generateGridData(i.grid_x_type,t.x),o=t.isCategorized()?t.xAxis.tickOffset():0;t.xgridAttr=i.axis_rotated?{x1:0,x2:t.width,y1:function(e){return t.x(e)-o},y2:function(e){return t.x(e)-o}}:{x1:function(e){return t.x(e)+o},x2:function(e){return t.x(e)+o},y1:0,y2:t.height};t.xgrid=t.main.select("."+$.xgrids).selectAll("."+$.xgrid).data(r);t.xgrid.enter().append("line").attr("class",$.xgrid);if(!e){t.xgrid.attr(t.xgridAttr).style("opacity",function(){return+n.select(this).attr(i.axis_rotated?"y1":"x1")===(i.axis_rotated?t.height:0)?0:1})}t.xgrid.exit().remove()};d.updateYGrid=function(){var e=this,t=e.config,i=e.yAxis.tickValues()||e.y.ticks(t.grid_y_ticks);e.ygrid=e.main.select("."+$.ygrids).selectAll("."+$.ygrid).data(i);e.ygrid.enter().append("line").attr("class",$.ygrid);e.ygrid.attr("x1",t.axis_rotated?e.y:0).attr("x2",t.axis_rotated?e.y:e.width).attr("y1",t.axis_rotated?0:e.y).attr("y2",t.axis_rotated?e.height:e.y);e.ygrid.exit().remove();e.smoothLines(e.ygrid,"grid")};d.gridTextAnchor=function(e){return e.position?e.position:"end"};d.gridTextDx=function(e){return e.position==="start"?4:e.position==="middle"?0:-4};d.xGridTextX=function(e){return e.position==="start"?-this.height:e.position==="middle"?-this.height/2:0};d.yGridTextX=function(e){return e.position==="start"?0:e.position==="middle"?this.width/2:this.width};d.updateGrid=function(e){var t=this,i=t.main,n=t.config,r,o,a;t.grid.style("visibility",t.hasArcType()?"hidden":"visible");i.select("line."+$.xgridFocus).style("visibility","hidden");if(n.grid_x_show){t.updateXGrid()}t.xgridLines=i.select("."+$.xgridLines).selectAll("."+$.xgridLine).data(n.grid_x_lines);r=t.xgridLines.enter().append("g").attr("class",function(e){return $.xgridLine+(e["class"]?" "+e["class"]:"")});r.append("line").style("opacity",0);r.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",n.axis_rotated?"":"rotate(-90)").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0);t.xgridLines.exit().transition().duration(e).style("opacity",0).remove();if(n.grid_y_show){t.updateYGrid()}t.ygridLines=i.select("."+$.ygridLines).selectAll("."+$.ygridLine).data(n.grid_y_lines);o=t.ygridLines.enter().append("g").attr("class",function(e){return $.ygridLine+(e["class"]?" "+e["class"]:"")});o.append("line").style("opacity",0);o.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",n.axis_rotated?"rotate(-90)":"").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0);a=t.yv.bind(t);t.ygridLines.select("line").transition().duration(e).attr("x1",n.axis_rotated?a:0).attr("x2",n.axis_rotated?a:t.width).attr("y1",n.axis_rotated?0:a).attr("y2",n.axis_rotated?t.height:a).style("opacity",1);t.ygridLines.select("text").transition().duration(e).attr("x",n.axis_rotated?t.xGridTextX.bind(t):t.yGridTextX.bind(t)).attr("y",a).text(function(e){return e.text}).style("opacity",1);t.ygridLines.exit().transition().duration(e).style("opacity",0).remove()};d.redrawGrid=function(e){var t=this,i=t.config,n=t.xv.bind(t),r=t.xgridLines.select("line"),o=t.xgridLines.select("text");return[(e?r.transition():r).attr("x1",i.axis_rotated?0:n).attr("x2",i.axis_rotated?t.width:n).attr("y1",i.axis_rotated?n:0).attr("y2",i.axis_rotated?n:t.height).style("opacity",1),(e?o.transition():o).attr("x",i.axis_rotated?t.yGridTextX.bind(t):t.xGridTextX.bind(t)).attr("y",n).text(function(e){return e.text}).style("opacity",1)]};d.showXGridFocus=function(e){var t=this,i=t.config,n=e.filter(function(e){return e&&S(e.value)}),r=t.main.selectAll("line."+$.xgridFocus),o=t.xx.bind(t);if(!i.tooltip_show){return}if(t.hasType("scatter")||t.hasArcType()){return}r.style("visibility","visible").data([n[0]]).attr(i.axis_rotated?"y1":"x1",o).attr(i.axis_rotated?"y2":"x2",o);t.smoothLines(r,"grid")};d.hideXGridFocus=function(){this.main.select("line."+$.xgridFocus).style("visibility","hidden")};d.updateXgridFocus=function(){var e=this,t=e.config;e.main.select("line."+$.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?e.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:e.height)};d.generateGridData=function(e,t){var i=this,n=[],r,o,a,s,l=i.main.select("."+$.axisX).selectAll(".tick").size();if(e==="year"){r=i.getXDomain();o=r[0].getFullYear();a=r[1].getFullYear();for(s=o;s<=a;s++){n.push(new Date(s+"-01-01 00:00:00"))}}else{n=t.ticks(10);if(n.length>l){n=n.filter(function(e){return(""+e).indexOf(".")<0})}}return n};d.getGridFilterToRemove=function(e){return e?function(t){var i=false;[].concat(e).forEach(function(e){if("value"in e&&t.value===e.value||"class"in e&&t["class"]===e["class"]){i=true}});return i}:function(){return true}};d.removeGridLines=function(e,t){var i=this,n=i.config,r=i.getGridFilterToRemove(e),o=function(e){return!r(e)},a=t?$.xgridLines:$.ygridLines,s=t?$.xgridLine:$.ygridLine;i.main.select("."+a).selectAll("."+s).filter(r).transition().duration(n.transition_duration).style("opacity",0).remove();if(t){n.grid_x_lines=n.grid_x_lines.filter(o)}else{n.grid_y_lines=n.grid_y_lines.filter(o)}};d.initTooltip=function(){var t=this,i=t.config,e;t.tooltip=t.selectChart.style("position","relative").append("div").attr("class",$.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none");if(i.tooltip_init_show){if(t.isTimeSeries()&&l(i.tooltip_init_x)){i.tooltip_init_x=t.parseDate(i.tooltip_init_x);for(e=0;e<t.data.targets[0].values.length;e++){if(t.data.targets[0].values[e].x-i.tooltip_init_x===0){break}}i.tooltip_init_x=e}t.tooltip.html(i.tooltip_contents.call(t,t.data.targets.map(function(e){return t.addName(e.values[i.tooltip_init_x])}),t.axis.getXAxisTickFormat(),t.getYFormat(t.hasArcType()),t.color));t.tooltip.style("top",i.tooltip_init_position.top).style("left",i.tooltip_init_position.left).style("display","block")}};d.getTooltipContent=function(e,t,i,n){var r=this,o=r.config,a=o.tooltip_format_title||t,s=o.tooltip_format_name||function(e){return e},l=o.tooltip_format_value||i,u,c,d,f,p,h;for(c=0;c<e.length;c++){if(!(e[c]&&(e[c].value||e[c].value===0))){continue}if(!u){d=a?a(e[c].x):e[c].x;u="<table class='"+$.tooltip+"'>"+(d||d===0?"<tr><th colspan='2'>"+d+"</th></tr>":"")}f=l(e[c].value,e[c].ratio,e[c].id,e[c].index);if(f!==undefined){p=s(e[c].name,e[c].ratio,e[c].id,e[c].index);h=r.levelColor?r.levelColor(e[c].value):n(e[c].id);u+="<tr class='"+$.tooltipName+"-"+e[c].id+"'>";u+="<td class='name'><span style='background-color:"+h+"'></span>"+p+"</td>";u+="<td class='value'>"+f+"</td>";u+="</tr>"}}return u+"</table>"};d.tooltipPosition=function(e,t,i,n){var r=this,o=r.config,a=r.d3;var s,l,u,c,d;var f=r.hasArcType(),p=a.mouse(n);if(f){l=(r.width-(r.isLegendRight?r.getLegendWidth():0))/2+p[0];c=r.height/2+p[1]+20}else{s=r.getSvgLeft(true);if(o.axis_rotated){l=s+p[0]+100;u=l+t;d=r.currentWidth-r.getCurrentPaddingRight();c=r.x(e[0].x)+20}else{l=s+r.getCurrentPaddingLeft(true)+r.x(e[0].x)+20;u=l+t;d=s+r.currentWidth-r.getCurrentPaddingRight();c=p[1]+15}if(u>d){l-=u-d+20}if(c+i>r.currentHeight){c-=i+30}}if(c<0){c=0}return{top:c,left:l}};d.showTooltip=function(e,t){var i=this,n=i.config;var r,o,a;var s=i.hasArcType(),l=e.filter(function(e){return e&&S(e.value)}),u=n.tooltip_position||d.tooltipPosition;if(l.length===0||!n.tooltip_show){return}i.tooltip.html(n.tooltip_contents.call(i,e,i.axis.getXAxisTickFormat(),i.getYFormat(s),i.color)).style("display","block");r=i.tooltip.property("offsetWidth");o=i.tooltip.property("offsetHeight");a=u.call(this,l,r,o,t);i.tooltip.style("top",a.top+"px").style("left",a.left+"px")};d.hideTooltip=function(){this.tooltip.style("display","none")};d.initLegend=function(){var e=this;e.legendItemTextBox={};e.legendHasRendered=false;e.legend=e.svg.append("g").attr("transform",e.getTranslate("legend"));if(!e.config.legend_show){e.legend.style("visibility","hidden");e.hiddenLegendIds=e.mapToIds(e.data.targets);return}e.updateLegendWithDefaults()};d.updateLegendWithDefaults=function(){var e=this;e.updateLegend(e.mapToIds(e.data.targets),{withTransform:false,withTransitionForTransform:false,withTransition:false})};d.updateSizeForLegend=function(e,t){var i=this,n=i.config,r={top:i.isLegendTop?i.getCurrentPaddingTop()+n.legend_inset_y+5.5:i.currentHeight-e-i.getCurrentPaddingBottom()-n.legend_inset_y,left:i.isLegendLeft?i.getCurrentPaddingLeft()+n.legend_inset_x+.5:i.currentWidth-t-i.getCurrentPaddingRight()-n.legend_inset_x+.5};i.margin3={top:i.isLegendRight?0:i.isLegendInset?r.top:i.currentHeight-e,right:NaN,bottom:0,left:i.isLegendRight?i.currentWidth-t:i.isLegendInset?r.left:0}};d.transformLegend=function(e){var t=this;(e?t.legend.transition():t.legend).attr("transform",t.getTranslate("legend"))};d.updateLegendStep=function(e){this.legendStep=e};d.updateLegendItemWidth=function(e){this.legendItemWidth=e};d.updateLegendItemHeight=function(e){this.legendItemHeight=e};d.getLegendWidth=function(){var e=this;return e.config.legend_show?e.isLegendRight||e.isLegendInset?e.legendItemWidth*(e.legendStep+1):e.currentWidth:0};d.getLegendHeight=function(){var e=this,t=0;if(e.config.legend_show){if(e.isLegendRight){t=e.currentHeight}else{t=Math.max(20,e.legendItemHeight)*(e.legendStep+1)}}return t};d.opacityForLegend=function(e){return e.classed($.legendItemHidden)?null:1};d.opacityForUnfocusedLegend=function(e){return e.classed($.legendItemHidden)?null:.3};d.toggleFocusLegend=function(t,i){var n=this;t=n.mapToTargetIds(t);n.legend.selectAll("."+$.legendItem).filter(function(e){return t.indexOf(e)>=0}).classed($.legendItemFocused,i).transition().duration(100).style("opacity",function(){var e=i?n.opacityForLegend:n.opacityForUnfocusedLegend;return e.call(n,n.d3.select(this))})};d.revertLegend=function(){var e=this,t=e.d3;e.legend.selectAll("."+$.legendItem).classed($.legendItemFocused,false).transition().duration(100).style("opacity",function(){return e.opacityForLegend(t.select(this))})};d.showLegend=function(e){var t=this,i=t.config;if(!i.legend_show){i.legend_show=true;t.legend.style("visibility","visible");if(!t.legendHasRendered){t.updateLegendWithDefaults()}}t.removeHiddenLegendIds(e);t.legend.selectAll(t.selectorLegends(e)).style("visibility","visible").transition().style("opacity",function(){return t.opacityForLegend(t.d3.select(this))})};d.hideLegend=function(e){var t=this,i=t.config;if(i.legend_show&&h(e)){i.legend_show=false;t.legend.style("visibility","hidden")}t.addHiddenLegendIds(e);t.legend.selectAll(t.selectorLegends(e)).style("opacity",0).style("visibility","hidden")};d.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}};d.updateLegend=function(p,e,t){var h=this,g=h.config;var i,n,r,o,a,s;var v=4,m=10,y=0,b=0,_=10,w=15;var l,C=0,A={},E={},x={},T=[0],S={},D=0;var u,c;var d,f,k,O;e=e||{};u=W(e,"withTransition",true);c=W(e,"withTransitionForTransform",true);function R(e,t){if(!h.legendItemTextBox[t]){h.legendItemTextBox[t]=h.getTextRect(e.textContent,$.legendItem)}return h.legendItemTextBox[t]}function N(e,t,i){var n=i===0,r=i===p.length-1,o=R(e,t),a=o.width+w+(r&&!(h.isLegendRight||h.isLegendInset)?0:m),s=o.height+v,l=h.isLegendRight||h.isLegendInset?s:a,u=h.isLegendRight||h.isLegendInset?h.getLegendHeight():h.getLegendWidth(),c,d;function f(e,t){if(!t){c=(u-C-l)/2;if(c<_){c=(u-l)/2;C=0;D++}}S[e]=D;T[D]=h.isLegendInset?10:c;A[e]=C;C+=l}if(n){C=0;D=0;y=0;b=0}if(g.legend_show&&!h.isLegendToShow(t)){E[t]=x[t]=S[t]=A[t]=0;return}E[t]=a;x[t]=s;if(!y||a>=y){y=a}if(!b||s>=b){b=s}d=h.isLegendRight||h.isLegendInset?b:y;if(g.legend_equally){Object.keys(E).forEach(function(e){E[e]=y});Object.keys(x).forEach(function(e){x[e]=b});c=(u-d*p.length)/2;if(c<_){C=0;D=0;p.forEach(function(e){f(e)})}else{f(t,true)}}else{f(t)}}if(h.isLegendInset){D=g.legend_inset_step?g.legend_inset_step:p.length;h.updateLegendStep(D)}if(h.isLegendRight){i=function(e){return y*S[e]};o=function(e){return T[S[e]]+A[e]}}else if(h.isLegendInset){i=function(e){return y*S[e]+10};o=function(e){return T[S[e]]+A[e]}}else{i=function(e){return T[S[e]]+A[e]};o=function(e){return b*S[e]}}n=function(e,t){return i(e,t)+14};a=function(e,t){return o(e,t)+9};r=function(e,t){return i(e,t)};s=function(e,t){return o(e,t)-5};l=h.legend.selectAll("."+$.legendItem).data(p).enter().append("g").attr("class",function(e){return h.generateClass($.legendItem,e)}).style("visibility",function(e){return h.isLegendToShow(e)?"visible":"hidden"}).style("cursor","pointer").on("click",function(e){if(g.legend_item_onclick){g.legend_item_onclick.call(h,e)}else{if(h.d3.event.altKey){h.api.hide();h.api.show(e)}else{h.api.toggle(e);h.isTargetToShow(e)?h.api.focus(e):h.api.revert()}}}).on("mouseover",function(e){h.d3.select(this).classed($.legendItemFocused,true);if(!h.transiting&&h.isTargetToShow(e)){h.api.focus(e)}if(g.legend_item_onmouseover){g.legend_item_onmouseover.call(h,e)}}).on("mouseout",function(e){h.d3.select(this).classed($.legendItemFocused,false);h.api.revert();if(g.legend_item_onmouseout){g.legend_item_onmouseout.call(h,e)}});l.append("text").text(function(e){return I(g.data_names[e])?g.data_names[e]:e}).each(function(e,t){N(this,e,t)}).style("pointer-events","none").attr("x",h.isLegendRight||h.isLegendInset?n:-200).attr("y",h.isLegendRight||h.isLegendInset?-200:a);l.append("rect").attr("class",$.legendItemEvent).style("fill-opacity",0).attr("x",h.isLegendRight||h.isLegendInset?r:-200).attr("y",h.isLegendRight||h.isLegendInset?-200:s);l.append("rect").attr("class",$.legendItemTile).style("pointer-events","none").style("fill",h.color).attr("x",h.isLegendRight||h.isLegendInset?n:-200).attr("y",h.isLegendRight||h.isLegendInset?-200:o).attr("width",10).attr("height",10);O=h.legend.select("."+$.legendBackground+" rect");if(h.isLegendInset&&y>0&&O.size()===0){O=h.legend.insert("g","."+$.legendItem).attr("class",$.legendBackground).append("rect")}d=h.legend.selectAll("text").data(p).text(function(e){return I(g.data_names[e])?g.data_names[e]:e}).each(function(e,t){N(this,e,t)});(u?d.transition():d).attr("x",n).attr("y",a);f=h.legend.selectAll("rect."+$.legendItemEvent).data(p);(u?f.transition():f).attr("width",function(e){return E[e]}).attr("height",function(e){return x[e]}).attr("x",r).attr("y",s);k=h.legend.selectAll("rect."+$.legendItemTile).data(p);(u?k.transition():k).style("fill",h.color).attr("x",i).attr("y",o);if(O){(u?O.transition():O).attr("height",h.getLegendHeight()-12).attr("width",y*(D+1)+10)}h.legend.selectAll("."+$.legendItem).classed($.legendItemHidden,function(e){return!h.isTargetToShow(e)});h.updateLegendItemWidth(y);h.updateLegendItemHeight(b);h.updateLegendStep(D);h.updateSizes();h.updateScales();h.updateSvgSize();h.transformAll(c,t);h.legendHasRendered=true};function s(e){n.call(this,e)}r(n,s);s.prototype.init=function e(){var t=this.owner,i=t.config,n=t.main;t.axes.x=n.append("g").attr("class",$.axis+" "+$.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",i.axis_x_show?"visible":"hidden");t.axes.x.append("text").attr("class",$.axisXLabel).attr("transform",i.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this));t.axes.y=n.append("g").attr("class",$.axis+" "+$.axisY).attr("clip-path",i.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",i.axis_y_show?"visible":"hidden");t.axes.y.append("text").attr("class",$.axisYLabel).attr("transform",i.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this));t.axes.y2=n.append("g").attr("class",$.axis+" "+$.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",i.axis_y2_show?"visible":"hidden");t.axes.y2.append("text").attr("class",$.axisY2Label).attr("transform",i.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))};s.prototype.getXAxis=function e(t,i,n,r,o,a,s){var l=this.owner,u=l.config,c={isCategory:l.isCategorized(),withOuterTick:o,tickMultiline:u.axis_x_tick_multiline,tickWidth:u.axis_x_tick_width,tickTextRotate:s?0:u.axis_x_tick_rotate,withoutTransition:a},d=m(l.d3,c).scale(t).orient(i);if(l.isTimeSeries()&&r){r=r.map(function(e){return l.parseDate(e)})}d.tickFormat(n).tickValues(r);if(l.isCategorized()){d.tickCentered(u.axis_x_tick_centered);if(h(u.axis_x_tick_culling)){u.axis_x_tick_culling=false}}return d};s.prototype.updateXAxisTickValues=function e(t,i){var n=this.owner,r=n.config,o;if(r.axis_x_tick_fit||r.axis_x_tick_count){o=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())}if(i){i.tickValues(o)}else{n.xAxis.tickValues(o);n.subXAxis.tickValues(o)}return o};s.prototype.getYAxis=function e(t,i,n,r,o,a){var s={withOuterTick:o,withoutTransition:a},l=this.owner,u=l.d3,c=l.config,d=m(u,s).scale(t).orient(i).tickFormat(n);if(l.isTimeSeriesY()){d.ticks(u.time[c.axis_y_tick_time_value],c.axis_y_tick_time_interval)}else{d.tickValues(r)}return d};s.prototype.getId=function e(t){var i=this.owner.config;return t in i.data_axes?i.data_axes[t]:"y"};s.prototype.getXAxisTickFormat=function e(){var t=this.owner,i=t.config,n=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(e){return e<0?e.toFixed(0):e};if(i.axis_x_tick_format){if(f(i.axis_x_tick_format)){n=i.axis_x_tick_format}else if(t.isTimeSeries()){n=function(e){return e?t.axisTimeFormat(i.axis_x_tick_format)(e):""}}}return f(n)?function(e){return n.call(t,e)}:n};s.prototype.getTickValues=function e(t,i){return t?t:i?i.tickValues():undefined};s.prototype.getXAxisTickValues=function e(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)};s.prototype.getYAxisTickValues=function e(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)};s.prototype.getY2AxisTickValues=function e(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)};s.prototype.getLabelOptionByAxisId=function e(t){var i=this.owner,n=i.config,r;if(t==="y"){r=n.axis_y_label}else if(t==="y2"){r=n.axis_y2_label}else if(t==="x"){r=n.axis_x_label}return r};s.prototype.getLabelText=function e(t){var i=this.getLabelOptionByAxisId(t);return l(i)?i:i?i.text:null};s.prototype.setLabelText=function e(t,i){var n=this.owner,r=n.config,o=this.getLabelOptionByAxisId(t);if(l(o)){if(t==="y"){r.axis_y_label=i}else if(t==="y2"){r.axis_y2_label=i}else if(t==="x"){r.axis_x_label=i}}else if(o){o.text=i}};s.prototype.getLabelPosition=function e(t,i){var n=this.getLabelOptionByAxisId(t),r=n&&typeof n==="object"&&n.position?n.position:i;return{isInner:r.indexOf("inner")>=0,isOuter:r.indexOf("outer")>=0,isLeft:r.indexOf("left")>=0,isCenter:r.indexOf("center")>=0,isRight:r.indexOf("right")>=0,isTop:r.indexOf("top")>=0,isMiddle:r.indexOf("middle")>=0,isBottom:r.indexOf("bottom")>=0}};s.prototype.getXAxisLabelPosition=function e(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")};s.prototype.getYAxisLabelPosition=function e(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")};s.prototype.getY2AxisLabelPosition=function e(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")};s.prototype.getLabelPositionById=function e(t){return t==="y2"?this.getY2AxisLabelPosition():t==="y"?this.getYAxisLabelPosition():this.getXAxisLabelPosition()};s.prototype.textForXAxisLabel=function e(){return this.getLabelText("x")};s.prototype.textForYAxisLabel=function e(){return this.getLabelText("y")};s.prototype.textForY2AxisLabel=function e(){return this.getLabelText("y2")};s.prototype.xForAxisLabel=function e(t,i){var n=this.owner;if(t){return i.isLeft?0:i.isCenter?n.width/2:n.width}else{return i.isBottom?-n.height:i.isMiddle?-n.height/2:0}};s.prototype.dxForAxisLabel=function e(t,i){if(t){return i.isLeft?"0.5em":i.isRight?"-0.5em":"0"}else{return i.isTop?"-0.5em":i.isBottom?"0.5em":"0"}};s.prototype.textAnchorForAxisLabel=function e(t,i){if(t){return i.isLeft?"start":i.isCenter?"middle":"end"}else{return i.isBottom?"start":i.isMiddle?"middle":"end"}};s.prototype.xForXAxisLabel=function e(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())};s.prototype.xForYAxisLabel=function e(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())};s.prototype.xForY2AxisLabel=function e(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())};s.prototype.dxForXAxisLabel=function e(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())};s.prototype.dxForYAxisLabel=function e(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())};s.prototype.dxForY2AxisLabel=function e(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())};s.prototype.dyForXAxisLabel=function e(){var t=this.owner,i=t.config,n=this.getXAxisLabelPosition();if(i.axis_rotated){return n.isInner?"1.2em":-25-this.getMaxTickWidth("x")}else{return n.isInner?"-0.5em":i.axis_x_height?i.axis_x_height-10:"3em"}};s.prototype.dyForYAxisLabel=function e(){var t=this.owner,i=this.getYAxisLabelPosition();if(t.config.axis_rotated){return i.isInner?"-0.5em":"3em"}else{return i.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)}};s.prototype.dyForY2AxisLabel=function e(){var t=this.owner,i=this.getY2AxisLabelPosition();if(t.config.axis_rotated){return i.isInner?"1.2em":"-2.2em"}else{return i.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)}};s.prototype.textAnchorForXAxisLabel=function e(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())};s.prototype.textAnchorForYAxisLabel=function e(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())};s.prototype.textAnchorForY2AxisLabel=function e(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())};s.prototype.getMaxTickWidth=function e(t,i){var n=this.owner,r=n.config,o=0,a,s,l,u,c;if(i&&n.currentMaxTickWidths[t]){return n.currentMaxTickWidths[t]}if(n.svg){a=n.filterTargetsToShow(n.data.targets);if(t==="y"){s=n.y.copy().domain(n.getYDomain(a,"y"));l=this.getYAxis(s,n.yOrient,r.axis_y_tick_format,n.yAxisTickValues,false,true)}else if(t==="y2"){s=n.y2.copy().domain(n.getYDomain(a,"y2"));l=this.getYAxis(s,n.y2Orient,r.axis_y2_tick_format,n.y2AxisTickValues,false,true)}else{s=n.x.copy().domain(n.getXDomain(a));l=this.getXAxis(s,n.xOrient,n.xAxisTickFormat,n.xAxisTickValues,false,true,true);this.updateXAxisTickValues(a,l)}u=n.d3.select("body").append("div").classed("c3",true);c=u.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),c.append("g").call(l).each(function(){n.d3.select(this).selectAll("text").each(function(){var e=this.getBoundingClientRect();if(o<e.width){o=e.width}});u.remove()})}n.currentMaxTickWidths[t]=o<=0?n.currentMaxTickWidths[t]:o;return n.currentMaxTickWidths[t]};s.prototype.updateLabels=function e(t){var i=this.owner;var n=i.main.select("."+$.axisX+" ."+$.axisXLabel),r=i.main.select("."+$.axisY+" ."+$.axisYLabel),o=i.main.select("."+$.axisY2+" ."+$.axisY2Label);(t?n.transition():n).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this));(t?r.transition():r).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this));(t?o.transition():o).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))};s.prototype.getPadding=function e(t,i,n,r){if(!S(t[i])){return n}if(t.unit==="ratio"){return t[i]*r}return this.convertPixelsToAxisPadding(t[i],r)};s.prototype.convertPixelsToAxisPadding=function e(t,i){var n=this.owner,r=n.config.axis_rotated?n.width:n.height;return i*(t/r)};s.prototype.generateTickValues=function e(t,i,n){var r=t,o,a,s,l,u,c,d;if(i){o=f(i)?i():i;if(o===1){r=[t[0]]}else if(o===2){r=[t[0],t[t.length-1]]}else if(o>2){l=o-2;a=t[0];s=t[t.length-1];u=(s-a)/(l+1);r=[a];for(c=0;c<l;c++){d=+a+u*(c+1);r.push(n?new Date(d):d)}r.push(s)}}if(!n){r=r.sort(function(e,t){return e-t})}return r};s.prototype.generateTransitions=function e(t){var i=this.owner,n=i.axes;return{axisX:t?n.x.transition().duration(t):n.x,axisY:t?n.y.transition().duration(t):n.y,axisY2:t?n.y2.transition().duration(t):n.y2,axisSubX:t?n.subx.transition().duration(t):n.subx}};s.prototype.redraw=function e(t,i){var n=this.owner;n.axes.x.style("opacity",i?0:1);n.axes.y.style("opacity",i?0:1);n.axes.y2.style("opacity",i?0:1);n.axes.subx.style("opacity",i?0:1);t.axisX.call(n.xAxis);t.axisY.call(n.yAxis);t.axisY2.call(n.y2Axis);t.axisSubX.call(n.subXAxis)};d.getClipPath=function(e){var t=c.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(t?"":document.URL.split("#")[0])+"#"+e+")"};d.appendClip=function(e,t){return e.append("clipPath").attr("id",t).append("rect")};d.getAxisClipX=function(e){var t=Math.max(30,this.margin.left);return e?-(1+t):-(t-1)};d.getAxisClipY=function(e){return e?-20:-this.margin.top};d.getXAxisClipX=function(){var e=this;return e.getAxisClipX(!e.config.axis_rotated)};d.getXAxisClipY=function(){var e=this;return e.getAxisClipY(!e.config.axis_rotated)};d.getYAxisClipX=function(){var e=this;return e.config.axis_y_inner?-1:e.getAxisClipX(e.config.axis_rotated)};d.getYAxisClipY=function(){var e=this;return e.getAxisClipY(e.config.axis_rotated)};d.getAxisClipWidth=function(e){var t=this,i=Math.max(30,t.margin.left),n=Math.max(30,t.margin.right);return e?t.width+2+i+n:t.margin.left+20};d.getAxisClipHeight=function(e){return(e?this.margin.bottom:this.margin.top+this.height)+20};d.getXAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(!e.config.axis_rotated)};d.getXAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(!e.config.axis_rotated)};d.getYAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(e.config.axis_rotated)+(e.config.axis_y_inner?20:0)};d.getYAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(e.config.axis_rotated)};d.initPie=function(){var e=this,t=e.d3,i=e.config;e.pie=t.layout.pie().value(function(e){return e.values.reduce(function(e,t){return e+t.value},0)});if(!i.data_order){e.pie.sort(null)}};d.updateRadius=function(){var e=this,t=e.config,i=t.gauge_width||t.donut_width;e.radiusExpanded=Math.min(e.arcWidth,e.arcHeight)/2;e.radius=e.radiusExpanded*.95;e.innerRadiusRatio=i?(e.radius-i)/e.radius:.6;e.innerRadius=e.hasType("donut")||e.hasType("gauge")?e.radius*e.innerRadiusRatio:0};d.updateArc=function(){var e=this;e.svgArc=e.getSvgArc();e.svgArcExpanded=e.getSvgArcExpanded();e.svgArcExpandedSub=e.getSvgArcExpanded(.98)};d.updateAngle=function(t){var e=this,i=e.config,n=false,r=0,o=i.gauge_min,a=i.gauge_max,s,l;e.pie(e.filterTargetsToShow(e.data.targets)).forEach(function(e){if(!n&&e.data.id===t.data.id){n=true;t=e;t.index=r}r++});if(isNaN(t.startAngle)){t.startAngle=0}if(isNaN(t.endAngle)){t.endAngle=t.startAngle}if(e.isGaugeType(t.data)){s=Math.PI/(a-o);l=t.value<o?0:t.value<a?t.value-o:a-o;t.startAngle=-1*(Math.PI/2);t.endAngle=t.startAngle+s*l}return n?t:null};d.getSvgArc=function(){var n=this,r=n.d3.svg.arc().outerRadius(n.radius).innerRadius(n.innerRadius),e=function(e,t){var i;if(t){return r(e)}i=n.updateAngle(e);return i?r(i):"M 0 0"};e.centroid=r.centroid;return e};d.getSvgArcExpanded=function(e){var i=this,n=i.d3.svg.arc().outerRadius(i.radiusExpanded*(e?e:1)).innerRadius(i.innerRadius);return function(e){var t=i.updateAngle(e);return t?n(t):"M 0 0"}};d.getArc=function(e,t,i){return i||this.isArcType(e.data)?this.svgArc(e,t):"M 0 0"};d.transformForArcLabel=function(e){var t=this,i=t.updateAngle(e),n,r,o,a,s,l="";if(i&&!t.hasType("gauge")){n=this.svgArc.centroid(i);r=isNaN(n[0])?0:n[0];o=isNaN(n[1])?0:n[1];a=Math.sqrt(r*r+o*o);s=t.radius&&a?(36/t.radius>.375?1.175-36/t.radius:.8)*t.radius/a:0;l="translate("+r*s+","+o*s+")"}return l};d.getArcRatio=function(e){var t=this,i=t.hasType("gauge")?Math.PI:Math.PI*2;return e?(e.endAngle-e.startAngle)/i:null};d.convertToArcData=function(e){return this.addName({id:e.data.id,value:e.value,ratio:this.getArcRatio(e),index:e.index})};d.textForArcLabel=function(e){var t=this,i,n,r,o,a;if(!t.shouldShowArcLabel()){return""}i=t.updateAngle(e);n=i?i.value:null;r=t.getArcRatio(i);o=e.data.id;if(!t.hasType("gauge")&&!t.meetsArcLabelThreshold(r)){return""}a=t.getArcLabelFormat();return a?a(n,r,o):t.defaultArcValueFormat(n,r)};d.expandArc=function(e){var t=this,i;if(t.transiting){i=c.setInterval(function(){if(!t.transiting){c.clearInterval(i);if(t.legend.selectAll(".c3-legend-item-focused").size()>0){t.expandArc(e)}}},10);return}e=t.mapToTargetIds(e);t.svg.selectAll(t.selectorTargets(e,"."+$.chartArc)).each(function(e){if(!t.shouldExpand(e.data.id)){return}t.d3.select(this).selectAll("path").transition().duration(50).attr("d",t.svgArcExpanded).transition().duration(100).attr("d",t.svgArcExpandedSub).each(function(e){if(t.isDonutType(e.data)){}})})};d.unexpandArc=function(e){var t=this;if(t.transiting){return}e=t.mapToTargetIds(e);t.svg.selectAll(t.selectorTargets(e,"."+$.chartArc)).selectAll("path").transition().duration(50).attr("d",t.svgArc);t.svg.selectAll("."+$.arc).style("opacity",1)};d.shouldExpand=function(e){var t=this,i=t.config;return t.isDonutType(e)&&i.donut_expand||t.isGaugeType(e)&&i.gauge_expand||t.isPieType(e)&&i.pie_expand};d.shouldShowArcLabel=function(){var e=this,t=e.config,i=true;if(e.hasType("donut")){i=t.donut_label_show}else if(e.hasType("pie")){i=t.pie_label_show}return i};d.meetsArcLabelThreshold=function(e){var t=this,i=t.config,n=t.hasType("donut")?i.donut_label_threshold:i.pie_label_threshold;return e>=n};d.getArcLabelFormat=function(){var e=this,t=e.config,i=t.pie_label_format;if(e.hasType("gauge")){i=t.gauge_label_format}else if(e.hasType("donut")){i=t.donut_label_format}return i};d.getArcTitle=function(){var e=this;return e.hasType("donut")?e.config.donut_title:""};d.updateTargetsForArc=function(e){var t=this,i=t.main,n,r,o=t.classChartArc.bind(t),a=t.classArcs.bind(t),s=t.classFocus.bind(t);n=i.select("."+$.chartArcs).selectAll("."+$.chartArc).data(t.pie(e)).attr("class",function(e){return o(e)+s(e.data)});r=n.enter().append("g").attr("class",o);r.append("g").attr("class",a);r.append("text").attr("dy",t.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")};d.initArc=function(){var e=this;e.arcs=e.main.select("."+$.chart).append("g").attr("class",$.chartArcs).attr("transform",e.getTranslate("arc"));e.arcs.append("text").attr("class",$.chartArcsTitle).style("text-anchor","middle").text(e.getArcTitle())};d.redrawArc=function(e,t,i){var r=this,o=r.d3,n=r.config,a=r.main,s;s=a.selectAll("."+$.arcs).selectAll("."+$.arc).data(r.arcData.bind(r));s.enter().append("path").attr("class",r.classArc.bind(r)).style("fill",function(e){return r.color(e.data)}).style("cursor",function(e){return n.interaction_enabled&&n.data_selection_isselectable(e)?"pointer":null}).style("opacity",0).each(function(e){if(r.isGaugeType(e.data)){e.startAngle=e.endAngle=-1*(Math.PI/2)}this._current=e});s.attr("transform",function(e){return!r.isGaugeType(e.data)&&i?"scale(0)":""}).style("opacity",function(e){return e===this._current?0:1}).on("mouseover",n.interaction_enabled?function(e){var t,i;if(r.transiting){return}t=r.updateAngle(e);i=r.convertToArcData(t);r.expandArc(t.data.id);r.api.focus(t.data.id);r.toggleFocusLegend(t.data.id,true);r.config.data_onmouseover(i,this)}:null).on("mousemove",n.interaction_enabled?function(e){var t=r.updateAngle(e),i=r.convertToArcData(t),n=[i];r.showTooltip(n,this)}:null).on("mouseout",n.interaction_enabled?function(e){var t,i;if(r.transiting){return}t=r.updateAngle(e);i=r.convertToArcData(t);r.unexpandArc(t.data.id);r.api.revert();r.revertLegend();r.hideTooltip();r.config.data_onmouseout(i,this)}:null).on("click",n.interaction_enabled?function(e,t){var i=r.updateAngle(e),n=r.convertToArcData(i);if(r.toggleShape){r.toggleShape(this,n,t)}r.config.data_onclick.call(r.api,n,this)}:null).each(function(){r.transiting=true}).transition().duration(e).attrTween("d",function(i){var e=r.updateAngle(i),n;if(!e){return function(){return"M 0 0"}}if(isNaN(this._current.startAngle)){this._current.startAngle=0}if(isNaN(this._current.endAngle)){this._current.endAngle=this._current.startAngle}n=o.interpolate(this._current,e);this._current=n(0);return function(e){var t=n(e);t.data=i.data;return r.getArc(t,true)}}).attr("transform",i?"scale(1)":"").style("fill",function(e){return r.levelColor?r.levelColor(e.data.values[0].value):r.color(e.data.id)}).style("opacity",1).call(r.endall,function(){r.transiting=false});s.exit().transition().duration(t).style("opacity",0).remove();a.selectAll("."+$.chartArc).select("text").style("opacity",0).attr("class",function(e){return r.isGaugeType(e.data)?$.gaugeValue:""}).text(r.textForArcLabel.bind(r)).attr("transform",r.transformForArcLabel.bind(r)).style("font-size",function(e){return r.isGaugeType(e.data)?Math.round(r.radius/5)+"px":""}).transition().duration(e).style("opacity",function(e){return r.isTargetToShow(e.data.id)&&r.isArcType(e.data)?1:0});a.select("."+$.chartArcsTitle).style("opacity",r.hasType("donut")||r.hasType("gauge")?1:0);if(r.hasType("gauge")){r.arcs.select("."+$.chartArcsBackground).attr("d",function(){var e={data:[{value:n.gauge_max}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return r.getArc(e,true,true)});r.arcs.select("."+$.chartArcsGaugeUnit).attr("dy",".75em").text(n.gauge_label_show?n.gauge_units:"");r.arcs.select("."+$.chartArcsGaugeMin).attr("dx",-1*(r.innerRadius+(r.radius-r.innerRadius)/2)+"px").attr("dy","1.2em").text(n.gauge_label_show?n.gauge_min:"");r.arcs.select("."+$.chartArcsGaugeMax).attr("dx",r.innerRadius+(r.radius-r.innerRadius)/2+"px").attr("dy","1.2em").text(n.gauge_label_show?n.gauge_max:"")}};d.initGauge=function(){var e=this.arcs;if(this.hasType("gauge")){e.append("path").attr("class",$.chartArcsBackground);e.append("text").attr("class",$.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none");e.append("text").attr("class",$.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none");e.append("text").attr("class",$.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none")}};d.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0};d.initRegion=function(){var e=this;e.region=e.main.append("g").attr("clip-path",e.clipPath).attr("class",$.regions)};d.updateRegion=function(e){var t=this,i=t.config;t.region.style("visibility",t.hasArcType()?"hidden":"visible");t.mainRegion=t.main.select("."+$.regions).selectAll("."+$.region).data(i.regions);t.mainRegion.enter().append("g").attr("class",t.classRegion.bind(t)).append("rect").style("fill-opacity",0);t.mainRegion.exit().transition().duration(e).style("opacity",0).remove()};d.redrawRegion=function(e){var t=this,i=t.mainRegion.selectAll("rect"),n=t.regionX.bind(t),r=t.regionY.bind(t),o=t.regionWidth.bind(t),a=t.regionHeight.bind(t);return[(e?i.transition():i).attr("x",n).attr("y",r).attr("width",o).attr("height",a).style("fill-opacity",function(e){return S(e.opacity)?e.opacity:.1})]};d.regionX=function(e){var t=this,i=t.config,n,r=e.axis==="y"?t.y:t.y2;if(e.axis==="y"||e.axis==="y2"){n=i.axis_rotated?"start"in e?r(e.start):0:0}else{n=i.axis_rotated?0:"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0}return n};d.regionY=function(e){var t=this,i=t.config,n,r=e.axis==="y"?t.y:t.y2;if(e.axis==="y"||e.axis==="y2"){n=i.axis_rotated?0:"end"in e?r(e.end):0}else{n=i.axis_rotated?"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0:0}return n};d.regionWidth=function(e){var t=this,i=t.config,n=t.regionX(e),r,o=e.axis==="y"?t.y:t.y2;if(e.axis==="y"||e.axis==="y2"){r=i.axis_rotated?"end"in e?o(e.end):t.width:t.width}else{r=i.axis_rotated?t.width:"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.width}return r<n?0:r-n};d.regionHeight=function(e){var t=this,i=t.config,n=this.regionY(e),r,o=e.axis==="y"?t.y:t.y2;if(e.axis==="y"||e.axis==="y2"){r=i.axis_rotated?t.height:"start"in e?o(e.start):t.height}else{r=i.axis_rotated?"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.height:t.height}return r<n?0:r-n};d.isRegionOnX=function(e){return!e.axis||e.axis==="x"};d.drag=function(e){var f=this,t=f.config,i=f.main,p=f.d3;var n,r,o,a,h,g,v,m;if(f.hasArcType()){return}if(!t.data_selection_enabled){return}if(t.zoom_enabled&&!f.zoom.altDomain){return}if(!t.data_selection_multiple){return}n=f.dragStart[0];r=f.dragStart[1];o=e[0];a=e[1];h=Math.min(n,o);g=Math.max(n,o);v=t.data_selection_grouped?f.margin.top:Math.min(r,a);m=t.data_selection_grouped?f.height:Math.max(r,a);i.select("."+$.dragarea).attr("x",h).attr("y",v).attr("width",g-h).attr("height",m-v);i.selectAll("."+$.shapes).selectAll("."+$.shape).filter(function(e){return t.data_selection_isselectable(e)}).each(function(e,t){var i=p.select(this),n=i.classed($.SELECTED),r=i.classed($.INCLUDED),o,a,s,l,u,c=false,d;if(i.classed($.circle)){o=i.attr("cx")*1;a=i.attr("cy")*1;u=f.togglePoint;c=h<o&&o<g&&v<a&&a<m}else if(i.classed($.bar)){d=y(this);o=d.x;a=d.y;s=d.width;l=d.height;u=f.togglePath;c=!(g<o||o+s<h)&&!(m<a||a+l<v)}else{return}if(c^r){i.classed($.INCLUDED,!r);i.classed($.SELECTED,!n);u.call(f,!n,i,e,t)}})};d.dragstart=function(e){var t=this,i=t.config;if(t.hasArcType()){return}if(!i.data_selection_enabled){return}t.dragStart=e;t.main.select("."+$.chart).append("rect").attr("class",$.dragarea).style("opacity",.1);t.dragging=true};d.dragend=function(){var e=this,t=e.config;if(e.hasArcType()){return}if(!t.data_selection_enabled){return}e.main.select("."+$.dragarea).transition().duration(100).style("opacity",0).remove();e.main.selectAll("."+$.shape).classed($.INCLUDED,false);e.dragging=false};d.selectPoint=function(e,t,i){var n=this,r=n.config,o=(r.axis_rotated?n.circleY:n.circleX).bind(n),a=(r.axis_rotated?n.circleX:n.circleY).bind(n),s=n.pointSelectR.bind(n);r.data_onselected.call(n.api,t,e.node());n.main.select("."+$.selectedCircles+n.getTargetSelectorSuffix(t.id)).selectAll("."+$.selectedCircle+"-"+i).data([t]).enter().append("circle").attr("class",function(){return n.generateClass($.selectedCircle,i)}).attr("cx",o).attr("cy",a).attr("stroke",function(){return n.color(t)}).attr("r",function(e){return n.pointSelectR(e)*1.4}).transition().duration(100).attr("r",s)};d.unselectPoint=function(e,t,i){var n=this;n.config.data_onunselected(t,e.node());n.main.select("."+$.selectedCircles+n.getTargetSelectorSuffix(t.id)).selectAll("."+$.selectedCircle+"-"+i).transition().duration(100).attr("r",0).remove()};d.togglePoint=function(e,t,i,n){e?this.selectPoint(t,i,n):this.unselectPoint(t,i,n)};d.selectPath=function(e,t){var i=this;i.config.data_onselected.call(i,t,e.node());e.transition().duration(100).style("fill",function(){return i.d3.rgb(i.color(t)).brighter(.75)})};d.unselectPath=function(e,t){var i=this;i.config.data_onunselected.call(i,t,e.node());e.transition().duration(100).style("fill",function(){return i.color(t)})};d.togglePath=function(e,t,i,n){e?this.selectPath(t,i,n):this.unselectPath(t,i,n)};d.getToggle=function(e,t){var i=this,n;if(e.nodeName==="circle"){if(i.isStepType(t)){n=function(){}}else{n=i.togglePoint}}else if(e.nodeName==="path"){n=i.togglePath}return n};d.toggleShape=function(e,t,i){var n=this,r=n.d3,o=n.config,a=r.select(e),s=a.classed($.SELECTED),l=n.getToggle(e,t).bind(n);if(o.data_selection_enabled&&o.data_selection_isselectable(t)){if(!o.data_selection_multiple){n.main.selectAll("."+$.shapes+(o.data_selection_grouped?n.getTargetSelectorSuffix(t.id):"")).selectAll("."+$.shape).each(function(e,t){var i=r.select(this);if(i.classed($.SELECTED)){l(false,i.classed($.SELECTED,false),e,t)}})}a.classed($.SELECTED,!s);l(!s,a,t,i)}};d.initBrush=function(){var t=this,e=t.d3;t.brush=e.svg.brush().on("brush",function(){t.redrawForBrush()});t.brush.update=function(){if(t.context){t.context.select("."+$.brush).call(this)}return this};t.brush.scale=function(e){return t.config.axis_rotated?this.y(e):this.x(e)}};d.initSubchart=function(){var e=this,t=e.config,i=e.context=e.svg.append("g").attr("transform",e.getTranslate("context"));i.style("visibility",t.subchart_show?"visible":"hidden");i.append("g").attr("clip-path",e.clipPathForSubchart).attr("class",$.chart);i.select("."+$.chart).append("g").attr("class",$.chartBars);i.select("."+$.chart).append("g").attr("class",$.chartLines);i.append("g").attr("clip-path",e.clipPath).attr("class",$.brush).call(e.brush);e.axes.subx=i.append("g").attr("class",$.axisX).attr("transform",e.getTranslate("subx")).attr("clip-path",t.axis_rotated?"":e.clipPathForXAxis)};d.updateTargetsForSubchart=function(e){var t=this,i=t.context,n=t.config,r,o,a,s,l=t.classChartBar.bind(t),u=t.classBars.bind(t),c=t.classChartLine.bind(t),d=t.classLines.bind(t),f=t.classAreas.bind(t);if(n.subchart_show){s=i.select("."+$.chartBars).selectAll("."+$.chartBar).data(e).attr("class",l);a=s.enter().append("g").style("opacity",0).attr("class",l);a.append("g").attr("class",u);o=i.select("."+$.chartLines).selectAll("."+$.chartLine).data(e).attr("class",c);r=o.enter().append("g").style("opacity",0).attr("class",c);r.append("g").attr("class",d);r.append("g").attr("class",f);i.selectAll("."+$.brush+" rect").attr(n.axis_rotated?"width":"height",n.axis_rotated?t.width2:t.height2)}};d.updateBarForSubchart=function(e){var t=this;t.contextBar=t.context.selectAll("."+$.bars).selectAll("."+$.bar).data(t.barData.bind(t));t.contextBar.enter().append("path").attr("class",t.classBar.bind(t)).style("stroke","none").style("fill",t.color);t.contextBar.style("opacity",t.initialOpacity.bind(t));t.contextBar.exit().transition().duration(e).style("opacity",0).remove()};d.redrawBarForSubchart=function(e,t,i){(t?this.contextBar.transition().duration(i):this.contextBar).attr("d",e).style("opacity",1)};d.updateLineForSubchart=function(e){var t=this;t.contextLine=t.context.selectAll("."+$.lines).selectAll("."+$.line).data(t.lineData.bind(t));t.contextLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color);t.contextLine.style("opacity",t.initialOpacity.bind(t));t.contextLine.exit().transition().duration(e).style("opacity",0).remove()};d.redrawLineForSubchart=function(e,t,i){(t?this.contextLine.transition().duration(i):this.contextLine).attr("d",e).style("opacity",1)};d.updateAreaForSubchart=function(e){var t=this,i=t.d3;t.contextArea=t.context.selectAll("."+$.areas).selectAll("."+$.area).data(t.lineData.bind(t));t.contextArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){t.orgAreaOpacity=+i.select(this).style("opacity");return 0});t.contextArea.style("opacity",0);t.contextArea.exit().transition().duration(e).style("opacity",0).remove()};d.redrawAreaForSubchart=function(e,t,i){(t?this.contextArea.transition().duration(i):this.contextArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)};d.redrawSubchart=function(e,t,i,n,r,o,a){var s=this,l=s.d3,u=s.config,c,d,f;s.context.style("visibility",u.subchart_show?"visible":"hidden");if(u.subchart_show){if(l.event&&l.event.type==="zoom"){s.brush.extent(s.x.orgDomain()).update()}if(e){if(!s.brush.empty()){s.brush.extent(s.x.orgDomain()).update()}c=s.generateDrawArea(r,true);d=s.generateDrawBar(o,true);f=s.generateDrawLine(a,true);s.updateBarForSubchart(i);s.updateLineForSubchart(i);s.updateAreaForSubchart(i);s.redrawBarForSubchart(d,i,i);s.redrawLineForSubchart(f,i,i);s.redrawAreaForSubchart(c,i,i)}}};d.redrawForBrush=function(){var e=this,t=e.x;e.redraw({withTransition:false,withY:e.config.zoom_rescale,withSubchart:false,withUpdateXDomain:true,withDimension:false});e.config.subchart_onbrush.call(e.api,t.orgDomain())};d.transformContext=function(e,t){var i=this,n;if(t&&t.axisSubX){n=t.axisSubX}else{n=i.context.select("."+$.axisX);if(e){n=n.transition()}}i.context.attr("transform",i.getTranslate("context"));n.attr("transform",i.getTranslate("subx"))};d.getDefaultExtent=function(){var e=this,t=e.config,i=f(t.axis_x_extent)?t.axis_x_extent(e.getXDomain(e.data.targets)):t.axis_x_extent;if(e.isTimeSeries()){i=[e.parseDate(i[0]),e.parseDate(i[1])]}return i};d.initZoom=function(){var i=this,t=i.d3,n=i.config,r;i.zoom=t.behavior.zoom().on("zoomstart",function(){r=t.event.sourceEvent;i.zoom.altDomain=t.event.sourceEvent.altKey?i.x.orgDomain():null;n.zoom_onzoomstart.call(i.api,t.event.sourceEvent)}).on("zoom",function(){i.redrawForZoom.call(i)}).on("zoomend",function(){var e=t.event.sourceEvent;if(e&&r.clientX===e.clientX&&r.clientY===e.clientY){return}i.redrawEventRect();i.updateZoom();n.zoom_onzoomend.call(i.api,i.x.orgDomain())});i.zoom.scale=function(e){return n.axis_rotated?this.y(e):this.x(e)};i.zoom.orgScaleExtent=function(){var e=n.zoom_extent?n.zoom_extent:[1,10];return[e[0],Math.max(i.getMaxDataCount()/e[1],e[1])]};i.zoom.updateScaleExtent=function(){var e=M(i.x.orgDomain())/M(i.orgXDomain),t=this.orgScaleExtent();this.scaleExtent([t[0]*e,t[1]*e]);return this}};d.updateZoom=function(){var e=this,t=e.config.zoom_enabled?e.zoom:function(){};e.main.select("."+$.zoomRect).call(t).on("dblclick.zoom",null);e.main.selectAll("."+$.eventRect).call(t).on("dblclick.zoom",null)};d.redrawForZoom=function(){var e=this,t=e.d3,i=e.config,n=e.zoom,r=e.x;if(!i.zoom_enabled){return}if(e.filterTargetsToShow(e.data.targets).length===0){return}if(t.event.sourceEvent.type==="mousemove"&&n.altDomain){r.domain(n.altDomain);n.scale(r).updateScaleExtent();return}if(e.isCategorized()&&r.orgDomain()[0]===e.orgXDomain[0]){r.domain([e.orgXDomain[0]-1e-10,r.orgDomain()[1]])}e.redraw({withTransition:false,withY:i.zoom_rescale,withSubchart:false,withEventRect:false,withDimension:false});if(t.event.sourceEvent.type==="mousemove"){e.cancelClick=true}i.zoom_onzoom.call(e.api,r.orgDomain())};d.generateColor=function(){var e=this,t=e.config,i=e.d3,n=t.data_colors,r=D(t.color_pattern)?t.color_pattern:i.scale.category10().range(),o=t.data_color,a=[];return function(e){var t=e.id||e.data&&e.data.id||e,i;if(n[t]instanceof Function){i=n[t](e)}else if(n[t]){i=n[t]}else{if(a.indexOf(t)<0){a.push(t)}i=r[a.indexOf(t)%r.length];n[t]=i}return o instanceof Function?o(i,e):i}};d.generateLevelColor=function(){var e=this,t=e.config,r=t.color_pattern,i=t.color_threshold,o=i.unit==="value",a=i.values&&i.values.length?i.values:[],s=i.max||100;return D(t.color_threshold)?function(e){var t,i,n=r[r.length-1];for(t=0;t<a.length;t++){i=o?e:e*100/s;if(i<a[t]){n=r[t];break}}return n}:null};d.getYFormat=function(e){var r=this,o=e&&!r.hasType("gauge")?r.defaultArcValueFormat:r.yFormat,a=e&&!r.hasType("gauge")?r.defaultArcValueFormat:r.y2Format;return function(e,t,i){var n=r.axis.getId(i)==="y2"?a:o;return n.call(r,e,t)}};d.yFormat=function(e){var t=this,i=t.config,n=i.axis_y_tick_format?i.axis_y_tick_format:t.defaultValueFormat;return n(e)};d.y2Format=function(e){var t=this,i=t.config,n=i.axis_y2_tick_format?i.axis_y2_tick_format:t.defaultValueFormat;return n(e)};d.defaultValueFormat=function(e){return S(e)?+e:""};d.defaultArcValueFormat=function(e,t){return(t*100).toFixed(1)+"%"};d.dataLabelFormat=function(e){var t=this,i=t.config.data_labels,n,r=function(e){return S(e)?+e:""};if(typeof i.format==="function"){n=i.format}else if(typeof i.format==="object"){if(i.format[e]){n=i.format[e]===true?r:i.format[e]}else{n=function(){return""}}}else{n=r}return n};d.hasCaches=function(e){for(var t=0;t<e.length;t++){if(!(e[t]in this.cache)){return false}}return true};d.addCache=function(e,t){this.cache[e]=this.cloneTarget(t)};d.getCaches=function(e){var t=[],i;for(i=0;i<e.length;i++){if(e[i]in this.cache){t.push(this.cloneTarget(this.cache[e[i]]))}}return t};var $=d.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};d.generateClass=function(e,t){return" "+e+" "+e+this.getTargetSelectorSuffix(t)};d.classText=function(e){return this.generateClass($.text,e.index)};d.classTexts=function(e){return this.generateClass($.texts,e.id)};d.classShape=function(e){return this.generateClass($.shape,e.index)};d.classShapes=function(e){return this.generateClass($.shapes,e.id)};d.classLine=function(e){return this.classShape(e)+this.generateClass($.line,e.id)};d.classLines=function(e){return this.classShapes(e)+this.generateClass($.lines,e.id)};d.classCircle=function(e){return this.classShape(e)+this.generateClass($.circle,e.index)};d.classCircles=function(e){return this.classShapes(e)+this.generateClass($.circles,e.id)};d.classBar=function(e){return this.classShape(e)+this.generateClass($.bar,e.index)};d.classBars=function(e){return this.classShapes(e)+this.generateClass($.bars,e.id)};d.classArc=function(e){return this.classShape(e.data)+this.generateClass($.arc,e.data.id)};d.classArcs=function(e){return this.classShapes(e.data)+this.generateClass($.arcs,e.data.id)};d.classArea=function(e){return this.classShape(e)+this.generateClass($.area,e.id)};d.classAreas=function(e){return this.classShapes(e)+this.generateClass($.areas,e.id)};d.classRegion=function(e,t){return this.generateClass($.region,t)+" "+("class"in e?e["class"]:"")};d.classEvent=function(e){return this.generateClass($.eventRect,e.index)};d.classTarget=function(e){var t=this;var i=t.config.data_classes[e],n="";if(i){n=" "+$.target+"-"+i}return t.generateClass($.target,e)+n};d.classFocus=function(e){return this.classFocused(e)+this.classDefocused(e)};d.classFocused=function(e){return" "+(this.focusedTargetIds.indexOf(e.id)>=0?$.focused:"")};d.classDefocused=function(e){return" "+(this.defocusedTargetIds.indexOf(e.id)>=0?$.defocused:"")};d.classChartText=function(e){return $.chartText+this.classTarget(e.id)};d.classChartLine=function(e){return $.chartLine+this.classTarget(e.id)};d.classChartBar=function(e){return $.chartBar+this.classTarget(e.id)};d.classChartArc=function(e){return $.chartArc+this.classTarget(e.data.id)};d.getTargetSelectorSuffix=function(e){return e||e===0?("-"+e).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""};d.selectorTarget=function(e,t){return(t||"")+"."+$.target+this.getTargetSelectorSuffix(e)};d.selectorTargets=function(e,t){var i=this;e=e||[];return e.length?e.map(function(e){return i.selectorTarget(e,t)}):null};d.selectorLegend=function(e){return"."+$.legendItem+this.getTargetSelectorSuffix(e)};d.selectorLegends=function(e){var t=this;return e&&e.length?e.map(function(e){return t.selectorLegend(e)}):null};var S=d.isValue=function(e){return e||e===0},f=d.isFunction=function(e){return typeof e==="function"},l=d.isString=function(e){return typeof e==="string"},E=d.isUndefined=function(e){return typeof e==="undefined"},I=d.isDefined=function(e){return typeof e!=="undefined"},u=d.ceil10=function(e){return Math.ceil(e/10)*10},p=d.asHalfPixel=function(e){return Math.ceil(e)+.5},M=d.diffDomain=function(e){return e[1]-e[0]},h=d.isEmpty=function(e){return!e||l(e)&&e.length===0||typeof e==="object"&&Object.keys(e).length===0},D=d.notEmpty=function(e){return Object.keys(e).length>0},W=d.getOption=function(e,t,i){return I(e[t])?e[t]:i},g=d.hasValue=function(t,i){var n=false;Object.keys(t).forEach(function(e){if(t[e]===i){n=true}});return n},y=d.getPathBox=function(e){var t=e.getBoundingClientRect(),i=[e.pathSegList.getItem(0),e.pathSegList.getItem(1)],n=i[0].x,r=Math.min(i[0].y,i[1].y);return{x:n,y:r,width:t.width,height:t.height}};i.focus=function(t){var e=this.internal,i;t=e.mapToTargetIds(t);i=e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))),this.revert();this.defocus();i.classed($.focused,true).classed($.defocused,false);if(e.hasArcType()){e.expandArc(t)}e.toggleFocusLegend(t,true);e.focusedTargetIds=t;e.defocusedTargetIds=e.defocusedTargetIds.filter(function(e){return t.indexOf(e)<0})};i.defocus=function(t){var e=this.internal,i;t=e.mapToTargetIds(t);i=e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))),i.classed($.focused,false).classed($.defocused,true);if(e.hasArcType()){e.unexpandArc(t)}e.toggleFocusLegend(t,false);e.focusedTargetIds=e.focusedTargetIds.filter(function(e){return t.indexOf(e)<0});e.defocusedTargetIds=t};i.revert=function(e){var t=this.internal,i;e=t.mapToTargetIds(e);i=t.svg.selectAll(t.selectorTargets(e));i.classed($.focused,false).classed($.defocused,false);if(t.hasArcType()){t.unexpandArc(e)}if(t.config.legend_show){t.showLegend(e.filter(t.isLegendToShow.bind(t)));t.legend.selectAll(t.selectorLegends(e)).filter(function(){return t.d3.select(this).classed($.legendItemFocused)}).classed($.legendItemFocused,false)}t.focusedTargetIds=[];t.defocusedTargetIds=[]};i.show=function(e,t){var i=this.internal,n;e=i.mapToTargetIds(e);t=t||{};i.removeHiddenTargetIds(e);n=i.svg.selectAll(i.selectorTargets(e));n.transition().style("opacity",1,"important").call(i.endall,function(){n.style("opacity",null).style("opacity",1)});if(t.withLegend){i.showLegend(e)}i.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true,withLegend:true})};i.hide=function(e,t){var i=this.internal,n;e=i.mapToTargetIds(e);t=t||{};i.addHiddenTargetIds(e);n=i.svg.selectAll(i.selectorTargets(e));n.transition().style("opacity",0,"important").call(i.endall,function(){n.style("opacity",null).style("opacity",0)});if(t.withLegend){i.hideLegend(e)}i.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true,withLegend:true})};i.toggle=function(e,t){var i=this,n=this.internal;n.mapToTargetIds(e).forEach(function(e){n.isTargetToShow(e)?i.hide(e,t):i.show(e,t)})};i.zoom=function(e){var t=this.internal;if(e){if(t.isTimeSeries()){e=e.map(function(e){return t.parseDate(e)})}t.brush.extent(e);t.redraw({withUpdateXDomain:true,withY:t.config.zoom_rescale});t.config.zoom_onzoom.call(this,t.x.orgDomain())}return t.brush.extent()};i.zoom.enable=function(e){var t=this.internal;t.config.zoom_enabled=e;t.updateAndRedraw()};i.unzoom=function(){var e=this.internal;e.brush.clear().update();e.redraw({withUpdateXDomain:true})};i.load=function(t){var e=this.internal,i=e.config;if(t.xs){e.addXs(t.xs)}if("classes"in t){Object.keys(t.classes).forEach(function(e){i.data_classes[e]=t.classes[e]})}if("categories"in t&&e.isCategorized()){i.axis_x_categories=t.categories}if("axes"in t){Object.keys(t.axes).forEach(function(e){i.data_axes[e]=t.axes[e]})}if("colors"in t){Object.keys(t.colors).forEach(function(e){i.data_colors[e]=t.colors[e]})}if("cacheIds"in t&&e.hasCaches(t.cacheIds)){e.load(e.getCaches(t.cacheIds),t.done);return}if("unload"in t){e.unload(e.mapToTargetIds(typeof t.unload==="boolean"&&t.unload?null:t.unload),function(){e.loadFromArgs(t)})}else{e.loadFromArgs(t)}};i.unload=function(e){var t=this.internal;e=e||{};if(e instanceof Array){e={ids:e}}else if(typeof e==="string"){e={ids:[e]}}t.unload(t.mapToTargetIds(e.ids),function(){t.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true,withLegend:true});if(e.done){e.done()}})};i.flow=function(e){var r=this.internal,o,t,a=[],i=r.getMaxDataCount(),n,s,l,u,c=0,d=0,f,p;if(e.json){t=r.convertJsonToData(e.json,e.keys)}else if(e.rows){t=r.convertRowsToData(e.rows)}else if(e.columns){t=r.convertColumnsToData(e.columns)}else{return}o=r.convertDataToTargets(t,true);r.data.targets.forEach(function(e){var t=false,i,n;for(i=0;i<o.length;i++){if(e.id===o[i].id){t=true;if(e.values[e.values.length-1]){d=e.values[e.values.length-1].index+1}c=o[i].values.length;for(n=0;n<c;n++){o[i].values[n].index=d+n;if(!r.isTimeSeries()){o[i].values[n].x=d+n}}e.values=e.values.concat(o[i].values);o.splice(i,1);break}}if(!t){a.push(e.id)}});r.data.targets.forEach(function(e){var t,i;for(t=0;t<a.length;t++){if(e.id===a[t]){d=e.values[e.values.length-1].index+1;for(i=0;i<c;i++){e.values.push({id:e.id,index:d+i,x:r.isTimeSeries()?r.getOtherTargetX(d+i):d+i,value:null})}}}});if(r.data.targets.length){o.forEach(function(e){var t,i=[];for(t=r.data.targets[0].values[0].index;t<d;t++){i.push({id:e.id,index:t,x:r.isTimeSeries()?r.getOtherTargetX(t):t,value:null})}e.values.forEach(function(e){e.index+=d;if(!r.isTimeSeries()){e.x+=d}});e.values=i.concat(e.values)})}r.data.targets=r.data.targets.concat(o);n=r.getMaxDataCount();l=r.data.targets[0];u=l.values[0];if(I(e.to)){c=0;p=r.isTimeSeries()?r.parseDate(e.to):e.to;l.values.forEach(function(e){if(e.x<p){c++}})}else if(I(e.length)){c=e.length}if(!i){if(r.isTimeSeries()){if(l.values.length>1){f=l.values[l.values.length-1].x-u.x}else{f=u.x-r.getXDomain(r.data.targets)[0]}}else{f=1}s=[u.x-f,u.x];r.updateXDomain(null,true,true,false,s)}else if(i===1){if(r.isTimeSeries()){f=(l.values[l.values.length-1].x-u.x)/2;s=[new Date(+u.x-f),new Date(+u.x+f)];r.updateXDomain(null,true,true,false,s)}}r.updateTargets(r.data.targets);r.redraw({flow:{index:u.index,length:c,duration:S(e.duration)?e.duration:r.config.transition_duration,done:e.done,orgDataCount:i},withLegend:true,withTransition:i>1,withTrimXDomain:false,withUpdateXAxis:true})};d.generateFlow=function(R){var N=this,I=N.config,P=N.d3;return function(){var e=R.targets,t=R.flow,r=R.drawBar,o=R.drawLine,a=R.drawArea,s=R.cx,l=R.cy,u=R.xv,c=R.xForText,d=R.yForText,i=R.duration;var n,f=1,p,h=t.index,g=t.length,v=N.getValueOnIndex(N.data.targets[0].values,h),m=N.getValueOnIndex(N.data.targets[0].values,h+g),y=N.x.domain(),b,_=t.duration||i,w=t.done||function(){},C=N.generateWait();var A=N.xgrid||P.selectAll([]),E=N.xgridLines||P.selectAll([]),x=N.mainRegion||P.selectAll([]),T=N.mainText||P.selectAll([]),S=N.mainBar||P.selectAll([]),D=N.mainLine||P.selectAll([]),k=N.mainArea||P.selectAll([]),O=N.mainCircle||P.selectAll([]);N.flowing=true;N.data.targets.forEach(function(e){e.values.splice(0,g)});b=N.updateXDomain(e,true,true);if(N.updateXGrid){N.updateXGrid(true)}if(!t.orgDataCount){if(N.data.targets[0].values.length!==1){n=N.x(y[0])-N.x(b[0])}else{if(N.isTimeSeries()){v=N.getValueOnIndex(N.data.targets[0].values,0);m=N.getValueOnIndex(N.data.targets[0].values,N.data.targets[0].values.length-1);n=N.x(v.x)-N.x(m.x)}else{n=M(b)/2}}}else if(t.orgDataCount===1||v.x===m.x){n=N.x(y[0])-N.x(b[0])}else{if(N.isTimeSeries()){n=N.x(y[0])-N.x(b[0])}else{n=N.x(v.x)-N.x(m.x)}}f=M(y)/M(b);p="translate("+n+",0) scale("+f+",1)";N.hideXGridFocus();N.hideTooltip();P.transition().ease("linear").duration(_).each(function(){C.add(N.axes.x.transition().call(N.xAxis));C.add(S.transition().attr("transform",p));C.add(D.transition().attr("transform",p));C.add(k.transition().attr("transform",p));C.add(O.transition().attr("transform",p));C.add(T.transition().attr("transform",p));C.add(x.filter(N.isRegionOnX).transition().attr("transform",p));C.add(A.transition().attr("transform",p));C.add(E.transition().attr("transform",p))}).call(C,function(){var e,t=[],i=[],n=[];if(g){for(e=0;e<g;e++){t.push("."+$.shape+"-"+(h+e));i.push("."+$.text+"-"+(h+e));n.push("."+$.eventRect+"-"+(h+e))}N.svg.selectAll("."+$.shapes).selectAll(t).remove();N.svg.selectAll("."+$.texts).selectAll(i).remove();N.svg.selectAll("."+$.eventRects).selectAll(n).remove();N.svg.select("."+$.xgrid).remove()}A.attr("transform",null).attr(N.xgridAttr);E.attr("transform",null);E.select("line").attr("x1",I.axis_rotated?0:u).attr("x2",I.axis_rotated?N.width:u);E.select("text").attr("x",I.axis_rotated?N.width:0).attr("y",u);S.attr("transform",null).attr("d",r);D.attr("transform",null).attr("d",o);k.attr("transform",null).attr("d",a);O.attr("transform",null).attr("cx",s).attr("cy",l);T.attr("transform",null).attr("x",c).attr("y",d).style("fill-opacity",N.opacityForText.bind(N));x.attr("transform",null);x.select("rect").filter(N.isRegionOnX).attr("x",N.regionX.bind(N)).attr("width",N.regionWidth.bind(N));if(I.interaction_enabled){N.redrawEventRect()}w();N.flowing=false})}};i.selected=function(e){var t=this.internal,i=t.d3;return i.merge(t.main.selectAll("."+$.shapes+t.getTargetSelectorSuffix(e)).selectAll("."+$.shape).filter(function(){return i.select(this).classed($.SELECTED)}).map(function(e){return e.map(function(e){var t=e.__data__;return t.data?t.data:t})}))};i.select=function(l,u,c){var d=this.internal,f=d.d3,p=d.config;if(!p.data_selection_enabled){return}d.main.selectAll("."+$.shapes).selectAll("."+$.shape).each(function(e,t){var i=f.select(this),n=e.data?e.data.id:e.id,r=d.getToggle(this,e).bind(d),o=p.data_selection_grouped||!l||l.indexOf(n)>=0,a=!u||u.indexOf(t)>=0,s=i.classed($.SELECTED);if(i.classed($.line)||i.classed($.area)){return}if(o&&a){if(p.data_selection_isselectable(e)&&!s){r(true,i.classed($.SELECTED,true),e,t)}}else if(I(c)&&c){if(s){r(false,i.classed($.SELECTED,false),e,t)}}})};i.unselect=function(l,u){var c=this.internal,d=c.d3,f=c.config;if(!f.data_selection_enabled){return}c.main.selectAll("."+$.shapes).selectAll("."+$.shape).each(function(e,t){var i=d.select(this),n=e.data?e.data.id:e.id,r=c.getToggle(this,e).bind(c),o=f.data_selection_grouped||!l||l.indexOf(n)>=0,a=!u||u.indexOf(t)>=0,s=i.classed($.SELECTED);if(i.classed($.line)||i.classed($.area)){return}if(o&&a){if(f.data_selection_isselectable(e)){if(s){r(false,i.classed($.SELECTED,false),e,t)}}}})};i.transform=function(e,t){var i=this.internal,n=["pie","donut"].indexOf(e)>=0?{withTransform:true}:null;i.transformTo(t,e,n)};d.transformTo=function(e,t,i){var n=this,r=!n.hasArcType(),o=i||{withTransitionForAxis:r};o.withTransitionForTransform=false;n.transiting=false;n.setTargetType(e,t);n.updateTargets(n.data.targets);n.updateAndRedraw(o)};i.groups=function(e){var t=this.internal,i=t.config;if(E(e)){return i.data_groups}i.data_groups=e;t.redraw();return i.data_groups};i.xgrids=function(e){var t=this.internal,i=t.config;if(!e){return i.grid_x_lines}i.grid_x_lines=e;t.redrawWithoutRescale();return i.grid_x_lines};i.xgrids.add=function(e){var t=this.internal;return this.xgrids(t.config.grid_x_lines.concat(e?e:[]))};i.xgrids.remove=function(e){var t=this.internal;t.removeGridLines(e,true)};i.ygrids=function(e){var t=this.internal,i=t.config;if(!e){return i.grid_y_lines}i.grid_y_lines=e;t.redrawWithoutRescale();return i.grid_y_lines};i.ygrids.add=function(e){var t=this.internal;return this.ygrids(t.config.grid_y_lines.concat(e?e:[]))};i.ygrids.remove=function(e){var t=this.internal;t.removeGridLines(e,false)};i.regions=function(e){var t=this.internal,i=t.config;if(!e){return i.regions}i.regions=e;t.redrawWithoutRescale();return i.regions};i.regions.add=function(e){var t=this.internal,i=t.config;if(!e){return i.regions}i.regions=i.regions.concat(e);t.redrawWithoutRescale();return i.regions};i.regions.remove=function(e){var t=this.internal,i=t.config,n,r,o;e=e||{};n=t.getOption(e,"duration",i.transition_duration);r=t.getOption(e,"classes",[$.region]);o=t.main.select("."+$.regions).selectAll(r.map(function(e){return"."+e}));(n?o.transition().duration(n):o).style("opacity",0).remove();i.regions=i.regions.filter(function(e){var t=false;if(!e["class"]){return true}e["class"].split(" ").forEach(function(e){if(r.indexOf(e)>=0){t=true}});return!t});return i.regions};i.data=function(t){var e=this.internal.data.targets;return typeof t==="undefined"?e:e.filter(function(e){return[].concat(t).indexOf(e.id)>=0})};i.data.shown=function(e){return this.internal.filterTargetsToShow(this.data(e))};i.data.values=function(e){var t,i=null;if(e){t=this.data(e);i=t[0]?t[0].values.map(function(e){return e.value}):null}return i};i.data.names=function(e){this.internal.clearLegendItemTextBoxCache();return this.internal.updateDataAttributes("names",e)};i.data.colors=function(e){return this.internal.updateDataAttributes("colors",e)};i.data.axes=function(e){return this.internal.updateDataAttributes("axes",e)};i.category=function(e,t){var i=this.internal,n=i.config;if(arguments.length>1){n.axis_x_categories[e]=t;i.redraw()}return n.axis_x_categories[e]};i.categories=function(e){var t=this.internal,i=t.config;if(!arguments.length){return i.axis_x_categories}i.axis_x_categories=e;t.redraw();return i.axis_x_categories};i.color=function(e){var t=this.internal;return t.color(e)};i.x=function(e){var t=this.internal;if(arguments.length){t.updateTargetX(t.data.targets,e);t.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true})}return t.data.xs};i.xs=function(e){var t=this.internal;if(arguments.length){t.updateTargetXs(t.data.targets,e);t.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true})}return t.data.xs};i.axis=function(){};i.axis.labels=function(t){var i=this.internal;if(arguments.length){Object.keys(t).forEach(function(e){i.axis.setLabelText(e,t[e])});i.axis.updateLabels()}};i.axis.max=function(e){var t=this.internal,i=t.config;if(arguments.length){if(typeof e==="object"){if(S(e.x)){i.axis_x_max=e.x}if(S(e.y)){i.axis_y_max=e.y}if(S(e.y2)){i.axis_y2_max=e.y2}}else{i.axis_y_max=i.axis_y2_max=e}t.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true})}else{return{x:i.axis_x_max,y:i.axis_y_max,y2:i.axis_y2_max}}};i.axis.min=function(e){var t=this.internal,i=t.config;if(arguments.length){if(typeof e==="object"){if(S(e.x)){i.axis_x_min=e.x}if(S(e.y)){i.axis_y_min=e.y}if(S(e.y2)){i.axis_y2_min=e.y2}}else{i.axis_y_min=i.axis_y2_min=e}t.redraw({withUpdateOrgXDomain:true,withUpdateXDomain:true})}else{return{x:i.axis_x_min,y:i.axis_y_min,y2:i.axis_y2_min}}};i.axis.range=function(e){if(arguments.length){if(I(e.max)){this.axis.max(e.max)}if(I(e.min)){this.axis.min(e.min)}}else{return{max:this.axis.max(),min:this.axis.min()}}};i.legend=function(){};i.legend.show=function(e){var t=this.internal;t.showLegend(t.mapToTargetIds(e));t.updateAndRedraw({withLegend:true})};i.legend.hide=function(e){var t=this.internal;t.hideLegend(t.mapToTargetIds(e));t.updateAndRedraw({withLegend:true})};i.resize=function(e){var t=this.internal,i=t.config;i.size_width=e?e.width:null;i.size_height=e?e.height:null;this.flush()};i.flush=function(){var e=this.internal;e.updateAndRedraw({withLegend:true,withTransition:false,withTransitionForTransform:false})};i.destroy=function(){var t=this.internal;c.clearInterval(t.intervalForObserveInserted);c.onresize=null;t.selectChart.classed("c3",false).html("");Object.keys(t).forEach(function(e){t[e]=null});return null};i.tooltip=function(){};i.tooltip.show=function(e){var t=this.internal,i,n;if(e.mouse){n=e.mouse}if(e.data){if(t.isMultipleX()){n=[t.x(e.data.x),t.getYScale(e.data.id)(e.data.value)];i=null}else{i=S(e.data.index)?e.data.index:t.getIndexByX(e.data.x)}}else if(typeof e.x!=="undefined"){i=t.getIndexByX(e.x)}else if(typeof e.index!=="undefined"){i=e.index}t.dispatchEvent("mouseover",i,n);t.dispatchEvent("mousemove",i,n)};i.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0)};var v;function m(P,M){var L=P.scale.linear(),F="bottom",G=6,$,W=3,H=null,i,r;var j=0,t=true,B;M=M||{};$=M.withOuterTick?6:0;function V(e,t){e.attr("transform",function(e){return"translate("+Math.ceil(t(e)+j)+", 0)"})}function z(e,t){e.attr("transform",function(e){return"translate(0,"+Math.ceil(t(e))+")"})}function U(e){var t=e[0],i=e[e.length-1];return t<i?[t,i]:[i,t]}function Y(e){var t,i,n=[];if(e.ticks){return e.ticks.apply(e,r)}i=e.domain();for(t=Math.ceil(i[0]);t<i[1];t++){n.push(t)}if(n.length>0&&n[0]>0){n.unshift(n[0]-(n[1]-n[0]))}return n}function q(){var e=L.copy(),t;if(M.isCategory){t=L.domain();e.domain([t[0],t[1]-1])}return e}function X(e){var t=i?i(e):e;return typeof t!=="undefined"?t:""}function K(e){if(v){return v}var o={h:11.5,w:5.5};e.select("text").text(X).each(function(e){var t=this.getBoundingClientRect(),i=X(e),n=t.height,r=i?t.width/i.length:undefined;if(n&&r){o.h=n;o.w=r}}).text("");v=o;return o}function Q(e){return M.withoutTransition?e:P.transition(e)}function Z(e){e.each(function(){var e=Z.g=P.select(this);var t=this.__chart__||L,l=this.__chart__=q();var u=H?H:Y(l),i=e.selectAll(".tick").data(u,l),n=i.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),r=i.exit().remove(),o=Q(i).style("opacity",1),a,s,c;var d=L.rangeExtent?L.rangeExtent():U(L.range()),f=e.selectAll(".domain").data([0]),p=(f.enter().append("path").attr("class","domain"),Q(f));n.append("line");n.append("text");var h=n.select("line"),g=o.select("line"),v=n.select("text"),m=o.select("text");if(M.isCategory){j=Math.ceil((l(1)-l(0))/2);s=B?0:j;c=B?j:0}else{j=s=0}var y,b,_=K(e.select(".tick")),w=[];var C=Math.max(G,0)+W,A=F==="left"||F==="right";function E(e,n){var t=X(e),r,o,a,i=[];if(Object.prototype.toString.call(t)==="[object Array]"){return t}if(!n||n<=0){n=A?95:M.isCategory?Math.ceil(l(u[1])-l(u[0]))-12:110}function s(e,t){o=undefined;for(var i=1;i<t.length;i++){if(t.charAt(i)===" "){o=i}r=t.substr(0,i+1);a=_.w*r.length;if(n<a){return s(e.concat(t.substr(0,o?o:i)),t.slice(o?o+1:i))}}return e.concat(t)}return s(i,t+"")}function x(e,t){var i=_.h;if(t===0){if(F==="left"||F==="right"){i=-((w[e.index]-1)*(_.h/2)-3)}else{i=".71em"}}return i}function T(e){var t=L(e)+(B?0:j);return d[0]<t&&t<d[1]?G:0}y=i.select("text");b=y.selectAll("tspan").data(function(e,t){var i=M.tickMultiline?E(e,M.tickWidth):[].concat(X(e));w[t]=i.length;return i.map(function(e){return{index:t,splitted:e}})});b.enter().append("tspan");b.exit().remove();b.text(function(e){return e.splitted});var S=M.tickTextRotate;function D(e){if(!e){return"middle"}return e>0?"start":"end"}function k(e){if(!e){return""}return"rotate("+e+")"}function O(e){if(!e){return 0}return 8*Math.sin(Math.PI*(e/180))}function R(e){if(!e){return C}return 11.5-2.5*(e/15)*(e>0?1:-1)}switch(F){case"bottom":{a=V;h.attr("y2",G);v.attr("y",C);g.attr("x1",s).attr("x2",s).attr("y2",T);m.attr("x",0).attr("y",R(S)).style("text-anchor",D(S)).attr("transform",k(S));b.attr("x",0).attr("dy",x).attr("dx",O(S));p.attr("d","M"+d[0]+","+$+"V0H"+d[1]+"V"+$);break}case"top":{a=V;h.attr("y2",-G);v.attr("y",-C);g.attr("x2",0).attr("y2",-G);m.attr("x",0).attr("y",-C);y.style("text-anchor","middle");b.attr("x",0).attr("dy","0em");p.attr("d","M"+d[0]+","+-$+"V0H"+d[1]+"V"+-$);break}case"left":{a=z;h.attr("x2",-G);v.attr("x",-C);g.attr("x2",-G).attr("y1",c).attr("y2",c);m.attr("x",-C).attr("y",j);y.style("text-anchor","end");b.attr("x",-C).attr("dy",x);p.attr("d","M"+-$+","+d[0]+"H0V"+d[1]+"H"+-$);break}case"right":{a=z;h.attr("x2",G);v.attr("x",C);g.attr("x2",G).attr("y2",0);m.attr("x",C).attr("y",0);y.style("text-anchor","start");b.attr("x",C).attr("dy",x);p.attr("d","M"+$+","+d[0]+"H0V"+d[1]+"H"+$);break}}if(l.rangeBand){var N=l,I=N.rangeBand()/2;t=l=function(e){return N(e)+I}}else if(t.rangeBand){t=l}else{r.call(a,l)}n.call(a,t);o.call(a,l)})}Z.scale=function(e){if(!arguments.length){return L}L=e;return Z};Z.orient=function(e){if(!arguments.length){return F}F=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom";return Z};Z.tickFormat=function(e){if(!arguments.length){return i}i=e;return Z};Z.tickCentered=function(e){if(!arguments.length){return B}B=e;return Z};Z.tickOffset=function(){return j};Z.tickInterval=function(){var e,t;if(M.isCategory){e=j*2}else{t=Z.g.select("path.domain").node().getTotalLength()-$*2;e=t/Z.g.selectAll("line").size()}return e===Infinity?0:e};Z.ticks=function(){if(!arguments.length){return r}r=arguments;return Z};Z.tickCulling=function(e){if(!arguments.length){return t}t=e;return Z};Z.tickValues=function(e){if(typeof e==="function"){H=function(){return e(L.domain())}}else{if(!arguments.length){return H}H=e}return Z};return Z}d.isSafari=function(){var e=c.navigator.userAgent;return e.indexOf("Safari")>=0&&e.indexOf("Chrome")<0};d.isChrome=function(){var e=c.navigator.userAgent;return e.indexOf("Chrome")>=0};if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),i=this,n=function(){},r=function(){return i.apply(this instanceof n?this:e,t.concat(Array.prototype.slice.call(arguments)))};n.prototype=this.prototype;r.prototype=new n;return r}}if(typeof define==="function"&&define.amd){define("c3",["d3"],e)}else if("undefined"!==typeof exports&&"undefined"!==typeof module){module.exports=e}else{c.c3=e}})(window);(function(e){e(["jquery","lodash"],function(C,A){return function(){var f;var t;var p=0;var n={alert:"alert",info:"info",success:"success",warning:"warning"};var e={clear:l,remove:u,alert:i,getContainer:h,info:r,options:{},subscribe:s,success:o,version:"2.0.3",warning:a};return e;function i(e,t,i){return b({type:n.alert,title:e,message:t,options:i})}function r(e,t,i){return b({type:n.info,title:e,message:t,options:i})}function o(e,t,i){return b({type:n.success,title:e,message:t,options:i})}function a(e,t,i){return b({type:n.warning,title:e,message:t,options:i})}function s(e){t=e}function h(e,t){if(!e){e=_()}f=C("#"+e.containerId);if(f.length){return f}if(t){f=g(e)}return f}function l(e){var t=_();if(!f){h(t)}if(!d(e,t)){c(t)}}function u(e){var t=_();if(!f){h(t)}if(e&&C(":focus",e).length===0){w(e);return}if(f.children().length){f.remove()}}function c(e){var t=f.children();for(var i=t.length-1;i>=0;i--){d(C(t[i]),e)}}function d(e,t){if(e&&C(":focus",e).length===0){e[t.hideMethod]({duration:t.hideDuration,easing:t.hideEasing,complete:function(){w(e)}});return true}return false}function g(e){f=C("<div/>").attr("id",e.containerId).addClass(e.positionClass).attr("aria-live","polite").attr("role","alert");f.appendTo(C(e.target));return f}function v(){return{tapToDismiss:false,toastClass:"notification",containerId:"notifications-container",debug:false,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:undefined,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:undefined,extendedTimeOut:1e3,onCloseClick:undefined,positionClass:"notification-below-header",timeOut:5e3,titleClass:"headline",messageClass:"notification-content",closeIcon:"icon icon-times-circle",target:"body",newestOnTop:true}}function m(e){if(!t){return}t(e)}function y(){return this._template||(this._template='<div class="{{= toastClass }} {{= toastClass }}-{{= type }}">'+'<div class="notification-header">'+'<p class="{{= titleClass }}">'+'<i class="icon icon-state-{{= type }}"></i>&nbsp;'+'<span class="text">{{= title }}</span>'+'<i class="js-close close-icon {{= closeIcon }}"></i>'+"</p>"+"</div>"+'<div class="{{= messageClass }}" style="display: none;">{{= message }}</div>'+"</div>")}function b(e){var t=_(),i=C.extend(t,e);if(typeof e.options!=="undefined"){i=C.extend(i,e.options)}p++;f=h(i,true);var n=A.template(y())(i),r=C(n);var o=null,a=r,s=a.find(".js-close"),l={toastId:p,state:"visible",startTime:new Date,options:i};if(i.message){a.find("."+i.messageClass).show()}a.hide();if(i.newestOnTop){f.prepend(a)}else{f.append(a)}a[i.showMethod]({duration:i.showDuration,easing:i.showEasing,complete:i.onShown});if(i.timeOut>0){o=setTimeout(u,i.timeOut)}a.hover(d,c);if(!i.onclick&&i.tapToDismiss){a.click(u)}if(s){s.click(function(e){if(e.stopPropagation){e.stopPropagation()}else if(e.cancelBubble!==undefined&&e.cancelBubble!==true){e.cancelBubble=true}if(i.onCloseClick){i.onCloseClick(e)}u(true)})}if(i.onclick){a.click(function(){i.onclick();u()})}m(l);if(i.debug&&console){console.log(l)}return a;function u(e){if(C(":focus",a).length&&!e){return}return a[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){w(a);if(i.onHidden&&l.state!=="hidden"){i.onHidden()}l.state="hidden";l.endTime=new Date;m(l)}})}function c(){if(i.timeOut>0||i.extendedTimeOut>0){o=setTimeout(u,i.extendedTimeOut)}}function d(){clearTimeout(o);a.stop(true,true)[i.showMethod]({duration:i.showDuration,easing:i.showEasing})}}function _(){return C.extend({},v(),e.options)}function w(e){if(!f){f=h()}if(e.is(":visible")){return}e.remove();e=null;if(f.children().length===0){f.remove()}}}()})})(typeof define==="function"&&define.amd?define:function(e,t){if(typeof module!=="undefined"&&module.exports){module.exports=t(require("jquery","lodash"))}else{window["toastr"]=t(window["jQuery"],window["_"])}});(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):e.moment=t()})(this,function(){"use strict";var L;function u(){return L.apply(null,arguments)}function F(e){L=e}function a(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function G(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function $(e){if(Object.getOwnPropertyNames){return Object.getOwnPropertyNames(e).length===0}else{var t;for(t in e){if(e.hasOwnProperty(t)){return false}}return true}}function o(e){return e===void 0}function W(e){return typeof e==="number"||Object.prototype.toString.call(e)==="[object Number]"}function H(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function j(e,t){var i=[],n;for(n=0;n<e.length;++n){i.push(t(e[n],n))}return i}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function B(e,t){for(var i in t){if(s(t,i)){e[i]=t[i]}}if(s(t,"toString")){e.toString=t.toString}if(s(t,"valueOf")){e.valueOf=t.valueOf}return e}function c(e,t,i,n){return Ji(e,t,i,n,true).utc()}function V(){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 d(e){if(e._pf==null){e._pf=V()}return e._pf}var z;if(Array.prototype.some){z=Array.prototype.some}else{z=function(e){var t=Object(this);var i=t.length>>>0;for(var n=0;n<i;n++){if(n in t&&e.call(this,t[n],n,t)){return true}}return false}}function U(e){if(e._isValid==null){var t=d(e);var i=z.call(t.parsedDateParts,function(e){return e!=null});var n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i);if(e._strict){n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===undefined}if(Object.isFrozen==null||!Object.isFrozen(e)){e._isValid=n}else{return n}}return e._isValid}function Y(e){var t=c(NaN);if(e!=null){B(d(t),e)}else{d(t).userInvalidated=true}return t}var q=u.momentProperties=[];function X(e,t){var i,n,r;if(!o(t._isAMomentObject)){e._isAMomentObject=t._isAMomentObject}if(!o(t._i)){e._i=t._i}if(!o(t._f)){e._f=t._f}if(!o(t._l)){e._l=t._l}if(!o(t._strict)){e._strict=t._strict}if(!o(t._tzm)){e._tzm=t._tzm}if(!o(t._isUTC)){e._isUTC=t._isUTC}if(!o(t._offset)){e._offset=t._offset}if(!o(t._pf)){e._pf=d(t)}if(!o(t._locale)){e._locale=t._locale}if(q.length>0){for(i=0;i<q.length;i++){n=q[i];r=t[n];if(!o(r)){e[n]=r}}}return e}var K=false;function Q(e){X(this,e);this._d=new Date(e._d!=null?e._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN)}if(K===false){K=true;u.updateOffset(this);K=false}}function l(e){return e instanceof Q||e!=null&&e._isAMomentObject!=null}function m(e){if(e<0){return Math.ceil(e)||0}else{return Math.floor(e)}}function f(e){var t=+e,i=0;if(t!==0&&isFinite(t)){i=m(t)}return i}function Z(e,t,i){var n=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),o=0,a;for(a=0;a<n;a++){if(i&&e[a]!==t[a]||!i&&f(e[a])!==f(t[a])){o++}}return o+r}function J(e){if(u.suppressDeprecationWarnings===false&&typeof console!=="undefined"&&console.warn){console.warn("Deprecation warning: "+e)}}function e(r,o){var a=true;return B(function(){if(u.deprecationHandler!=null){u.deprecationHandler(null,r)}if(a){var e=[];var t;for(var i=0;i<arguments.length;i++){t="";if(typeof arguments[i]==="object"){t+="\n["+i+"] ";for(var n in arguments[0]){t+=n+": "+arguments[0][n]+", "}t=t.slice(0,-2)}else{t=arguments[i]}e.push(t)}J(r+"\nArguments: "+Array.prototype.slice.call(e).join("")+"\n"+(new Error).stack);a=false}return o.apply(this,arguments)},o)}var ee={};function te(e,t){if(u.deprecationHandler!=null){u.deprecationHandler(e,t)}if(!ee[e]){J(t);ee[e]=true}}u.suppressDeprecationWarnings=false;u.deprecationHandler=null;function p(e){return e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ie(e){var t,i;for(i in e){t=e[i];if(p(t)){this[i]=t}else{this["_"+i]=t}}this._config=e;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function ne(e,t){var i=B({},e),n;for(n in t){if(s(t,n)){if(G(e[n])&&G(t[n])){i[n]={};B(i[n],e[n]);B(i[n],t[n])}else if(t[n]!=null){i[n]=t[n]}else{delete i[n]}}}for(n in e){if(s(e,n)&&!s(t,n)&&G(e[n])){i[n]=B({},i[n])}}return i}function re(e){if(e!=null){this.set(e)}}var oe;if(Object.keys){oe=Object.keys}else{oe=function(e){var t,i=[];for(t in e){if(s(e,t)){i.push(t)}}return i}}var ae={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function se(e,t,i){var n=this._calendar[e]||this._calendar["sameElse"];return p(n)?n.call(t,i):n}var le={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 ue(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];if(t||!i){return t}this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)});return this._longDateFormat[e]}var ce="Invalid date";function de(){return this._invalidDate}var fe="%d";var pe=/\d{1,2}/;function he(e){return this._ordinal.replace("%d",e)}var ge={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 ve(e,t,i,n){var r=this._relativeTime[i];return p(r)?r(e,t,i,n):r.replace(/%d/i,e)}function me(e,t){var i=this._relativeTime[e>0?"future":"past"];return p(i)?i(t):i.replace(/%s/i,t)}var ye={};function t(e,t){var i=e.toLowerCase();ye[i]=ye[i+"s"]=ye[t]=e}function h(e){return typeof e==="string"?ye[e]||ye[e.toLowerCase()]:undefined}function be(e){var t={},i,n;for(n in e){if(s(e,n)){i=h(n);if(i){t[i]=e[n]}}}return t}var _e={};function i(e,t){_e[e]=t}function we(e){var t=[];for(var i in e){t.push({unit:i,priority:_e[i]})}t.sort(function(e,t){return e.priority-t.priority});return t}function g(e,t,i){var n=""+Math.abs(e),r=t-n.length,o=e>=0;return(o?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}var Ce=/(\[[^\[]*\])|(\\)?([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 Ae=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;var Ee={};var xe={};function n(e,t,i,n){var r=n;if(typeof n==="string"){r=function(){return this[n]()}}if(e){xe[e]=r}if(t){xe[t[0]]=function(){return g(r.apply(this,arguments),t[1],t[2])}}if(i){xe[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)}}}function Te(e){if(e.match(/\[[\s\S]/)){return e.replace(/^\[|\]$/g,"")}return e.replace(/\\/g,"")}function Se(n){var r=n.match(Ce),e,o;for(e=0,o=r.length;e<o;e++){if(xe[r[e]]){r[e]=xe[r[e]]}else{r[e]=Te(r[e])}}return function(e){var t="",i;for(i=0;i<o;i++){t+=p(r[i])?r[i].call(e,n):r[i]}return t}}function De(e,t){if(!e.isValid()){return e.localeData().invalidDate()}t=ke(t,e.localeData());Ee[t]=Ee[t]||Se(t);return Ee[t](e)}function ke(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}Ae.lastIndex=0;while(i>=0&&Ae.test(e)){e=e.replace(Ae,n);Ae.lastIndex=0;i-=1}return e}var Oe=/\d/;var r=/\d\d/;var Re=/\d{3}/;var Ne=/\d{4}/;var Ie=/[+-]?\d{6}/;var v=/\d\d?/;var Pe=/\d\d\d\d?/;var Me=/\d\d\d\d\d\d?/;var Le=/\d{1,3}/;var Fe=/\d{1,4}/;var Ge=/[+-]?\d{1,6}/;var $e=/\d+/;var We=/[+-]?\d+/;var He=/Z|[+-]\d\d:?\d\d/gi;var je=/Z|[+-]\d\d(?::?\d\d)?/gi;var Be=/[+-]?\d+(\.\d{1,3})?/;var Ve=/[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 ze={};function y(e,i,n){ze[e]=p(i)?i:function(e,t){return e&&n?n:i}}function Ue(e,t){if(!s(ze,e)){return new RegExp(Ye(e))}return ze[e](t._strict,t._locale)}function Ye(e){return qe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,r){return t||i||n||r}))}function qe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Xe={};function b(e,i){var t,n=i;if(typeof e==="string"){e=[e]}if(W(i)){n=function(e,t){t[i]=f(e)}}for(t=0;t<e.length;t++){Xe[e[t]]=n}}function Ke(e,r){b(e,function(e,t,i,n){i._w=i._w||{};r(e,i._w,i,n)})}function Qe(e,t,i){if(t!=null&&s(Xe,e)){Xe[e](t,i._a,i,e)}}var _=0;var w=1;var C=2;var A=3;var E=4;var x=5;var Ze=6;var Je=7;var et=8;n("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e});n(0,["YY",2],0,function(){return this.year()%100});n(0,["YYYY",4],0,"year");n(0,["YYYYY",5],0,"year");n(0,["YYYYYY",6,true],0,"year");t("year","y");i("year",1);y("Y",We);y("YY",v,r);y("YYYY",Fe,Ne);y("YYYYY",Ge,Ie);y("YYYYYY",Ge,Ie);b(["YYYYY","YYYYYY"],_);b("YYYY",function(e,t){t[_]=e.length===2?u.parseTwoDigitYear(e):f(e)});b("YY",function(e,t){t[_]=u.parseTwoDigitYear(e)});b("Y",function(e,t){t[_]=parseInt(e,10)});function tt(e){return it(e)?366:365}function it(e){return e%4===0&&e%100!==0||e%400===0}u.parseTwoDigitYear=function(e){return f(e)+(f(e)>68?1900:2e3)};var nt=ot("FullYear",true);function rt(){return it(this.year())}function ot(t,i){return function(e){if(e!=null){st(this,t,e);u.updateOffset(this,i);return this}else{return at(this,t)}}}function at(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function st(e,t,i){if(e.isValid()&&!isNaN(i)){if(t==="FullYear"&&it(e.year())&&e.month()===1&&e.date()===29){e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),dt(i,e.month()))}else{e._d["set"+(e._isUTC?"UTC":"")+t](i)}}}function lt(e){e=h(e);if(p(this[e])){return this[e]()}return this}function ut(e,t){if(typeof e==="object"){e=be(e);var i=we(e);for(var n=0;n<i.length;n++){this[i[n].unit](e[i[n].unit])}}else{e=h(e);if(p(this[e])){return this[e](t)}}return this}function ct(e,t){return(e%t+t)%t}var T;if(Array.prototype.indexOf){T=Array.prototype.indexOf}else{T=function(e){var t;for(t=0;t<this.length;++t){if(this[t]===e){return t}}return-1}}function dt(e,t){if(isNaN(e)||isNaN(t)){return NaN}var i=ct(t,12);e+=(t-i)/12;return i===1?it(e)?29:28:31-i%7%2}n("M",["MM",2],"Mo",function(){return this.month()+1});n("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});n("MMMM",0,0,function(e){return this.localeData().months(this,e)});t("month","M");i("month",8);y("M",v);y("MM",v,r);y("MMM",function(e,t){return t.monthsShortRegex(e)});y("MMMM",function(e,t){return t.monthsRegex(e)});b(["M","MM"],function(e,t){t[w]=f(e)-1});b(["MMM","MMMM"],function(e,t,i,n){var r=i._locale.monthsParse(e,n,i._strict);if(r!=null){t[w]=r}else{d(i).invalidMonth=e}});var ft=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;var pt="January_February_March_April_May_June_July_August_September_October_November_December".split("_");function ht(e,t){if(!e){return a(this._months)?this._months:this._months["standalone"]}return a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ft).test(t)?"format":"standalone"][e.month()]}var gt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function vt(e,t){if(!e){return a(this._monthsShort)?this._monthsShort:this._monthsShort["standalone"]}return a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ft.test(t)?"format":"standalone"][e.month()]}function mt(e,t,i){var n,r,o,a=e.toLocaleLowerCase();if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[];for(n=0;n<12;++n){o=c([2e3,n]);this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase();this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase()}}if(i){if(t==="MMM"){r=T.call(this._shortMonthsParse,a);return r!==-1?r:null}else{r=T.call(this._longMonthsParse,a);return r!==-1?r:null}}else{if(t==="MMM"){r=T.call(this._shortMonthsParse,a);if(r!==-1){return r}r=T.call(this._longMonthsParse,a);return r!==-1?r:null}else{r=T.call(this._longMonthsParse,a);if(r!==-1){return r}r=T.call(this._shortMonthsParse,a);return r!==-1?r:null}}}function yt(e,t,i){var n,r,o;if(this._monthsParseExact){return mt.call(this,e,t,i)}if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[]}for(n=0;n<12;n++){r=c([2e3,n]);if(i&&!this._longMonthsParse[n]){this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i");this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")}if(!i&&!this._monthsParse[n]){o="^"+this.months(r,"")+"|^"+this.monthsShort(r,"");this._monthsParse[n]=new RegExp(o.replace(".",""),"i")}if(i&&t==="MMMM"&&this._longMonthsParse[n].test(e)){return n}else if(i&&t==="MMM"&&this._shortMonthsParse[n].test(e)){return n}else if(!i&&this._monthsParse[n].test(e)){return n}}}function bt(e,t){var i;if(!e.isValid()){return e}if(typeof t==="string"){if(/^\d+$/.test(t)){t=f(t)}else{t=e.localeData().monthsParse(t);if(!W(t)){return e}}}i=Math.min(e.date(),dt(e.year(),t));e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i);return e}function _t(e){if(e!=null){bt(this,e);u.updateOffset(this,true);return this}else{return at(this,"Month")}}function wt(){return dt(this.year(),this.month())}var Ct=Ve;function At(e){if(this._monthsParseExact){if(!s(this,"_monthsRegex")){Tt.call(this)}if(e){return this._monthsShortStrictRegex}else{return this._monthsShortRegex}}else{if(!s(this,"_monthsShortRegex")){this._monthsShortRegex=Ct}return this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}}var Et=Ve;function xt(e){if(this._monthsParseExact){if(!s(this,"_monthsRegex")){Tt.call(this)}if(e){return this._monthsStrictRegex}else{return this._monthsRegex}}else{if(!s(this,"_monthsRegex")){this._monthsRegex=Et}return this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}}function Tt(){function e(e,t){return t.length-e.length}var t=[],i=[],n=[],r,o;for(r=0;r<12;r++){o=c([2e3,r]);t.push(this.monthsShort(o,""));i.push(this.months(o,""));n.push(this.months(o,""));n.push(this.monthsShort(o,""))}t.sort(e);i.sort(e);n.sort(e);for(r=0;r<12;r++){t[r]=qe(t[r]);i[r]=qe(i[r])}for(r=0;r<24;r++){n[r]=qe(n[r])}this._monthsRegex=new RegExp("^("+n.join("|")+")","i");this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function St(e,t,i,n,r,o,a){var s;if(e<100&&e>=0){s=new Date(e+400,t,i,n,r,o,a);if(isFinite(s.getFullYear())){s.setFullYear(e)}}else{s=new Date(e,t,i,n,r,o,a)}return s}function Dt(e){var t;if(e<100&&e>=0){var i=Array.prototype.slice.call(arguments);i[0]=e+400;t=new Date(Date.UTC.apply(null,i));if(isFinite(t.getUTCFullYear())){t.setUTCFullYear(e)}}else{t=new Date(Date.UTC.apply(null,arguments))}return t}function kt(e,t,i){var n=7+t-i,r=(7+Dt(e,0,n).getUTCDay()-t)%7;return-r+n-1}function Ot(e,t,i,n,r){var o=(7+i-n)%7,a=kt(e,n,r),s=1+7*(t-1)+o+a,l,u;if(s<=0){l=e-1;u=tt(l)+s}else if(s>tt(e)){l=e+1;u=s-tt(e)}else{l=e;u=s}return{year:l,dayOfYear:u}}function Rt(e,t,i){var n=kt(e.year(),t,i),r=Math.floor((e.dayOfYear()-n-1)/7)+1,o,a;if(r<1){a=e.year()-1;o=r+Nt(a,t,i)}else if(r>Nt(e.year(),t,i)){o=r-Nt(e.year(),t,i);a=e.year()+1}else{a=e.year();o=r}return{week:o,year:a}}function Nt(e,t,i){var n=kt(e,t,i),r=kt(e+1,t,i);return(tt(e)-n+r)/7}n("w",["ww",2],"wo","week");n("W",["WW",2],"Wo","isoWeek");t("week","w");t("isoWeek","W");i("week",5);i("isoWeek",5);y("w",v);y("ww",v,r);y("W",v);y("WW",v,r);Ke(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=f(e)});function It(e){return Rt(e,this._week.dow,this._week.doy).week}var Pt={dow:0,doy:6};function Mt(){return this._week.dow}function Lt(){return this._week.doy}function Ft(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Gt(e){var t=Rt(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}n("d",0,"do","day");n("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});n("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});n("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});n("e",0,0,"weekday");n("E",0,0,"isoWeekday");t("day","d");t("weekday","e");t("isoWeekday","E");i("day",11);i("weekday",11);i("isoWeekday",11);y("d",v);y("e",v);y("E",v);y("dd",function(e,t){return t.weekdaysMinRegex(e)});y("ddd",function(e,t){return t.weekdaysShortRegex(e)});y("dddd",function(e,t){return t.weekdaysRegex(e)});Ke(["dd","ddd","dddd"],function(e,t,i,n){var r=i._locale.weekdaysParse(e,n,i._strict);if(r!=null){t.d=r}else{d(i).invalidWeekday=e}});Ke(["d","e","E"],function(e,t,i,n){t[n]=f(e)});function $t(e,t){if(typeof e!=="string"){return e}if(!isNaN(e)){return parseInt(e,10)}e=t.weekdaysParse(e);if(typeof e==="number"){return e}return null}function Wt(e,t){if(typeof e==="string"){return t.weekdaysParse(e)%7||7}return isNaN(e)?null:e}function Ht(e,t){return e.slice(t,7).concat(e.slice(0,t))}var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");function Bt(e,t){var i=a(this._weekdays)?this._weekdays:this._weekdays[e&&e!==true&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===true?Ht(i,this._week.dow):e?i[e.day()]:i}var Vt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function zt(e){return e===true?Ht(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}var Ut="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Yt(e){return e===true?Ht(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,i){var n,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse){this._weekdaysParse=[];this._shortWeekdaysParse=[];this._minWeekdaysParse=[];for(n=0;n<7;++n){o=c([2e3,1]).day(n);this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase();this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase();this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase()}}if(i){if(t==="dddd"){r=T.call(this._weekdaysParse,a);return r!==-1?r:null}else if(t==="ddd"){r=T.call(this._shortWeekdaysParse,a);return r!==-1?r:null}else{r=T.call(this._minWeekdaysParse,a);return r!==-1?r:null}}else{if(t==="dddd"){r=T.call(this._weekdaysParse,a);if(r!==-1){return r}r=T.call(this._shortWeekdaysParse,a);if(r!==-1){return r}r=T.call(this._minWeekdaysParse,a);return r!==-1?r:null}else if(t==="ddd"){r=T.call(this._shortWeekdaysParse,a);if(r!==-1){return r}r=T.call(this._weekdaysParse,a);if(r!==-1){return r}r=T.call(this._minWeekdaysParse,a);return r!==-1?r:null}else{r=T.call(this._minWeekdaysParse,a);if(r!==-1){return r}r=T.call(this._weekdaysParse,a);if(r!==-1){return r}r=T.call(this._shortWeekdaysParse,a);return r!==-1?r:null}}}function Xt(e,t,i){var n,r,o;if(this._weekdaysParseExact){return qt.call(this,e,t,i)}if(!this._weekdaysParse){this._weekdaysParse=[];this._minWeekdaysParse=[];this._shortWeekdaysParse=[];this._fullWeekdaysParse=[]}for(n=0;n<7;n++){r=c([2e3,1]).day(n);if(i&&!this._fullWeekdaysParse[n]){this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i");this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i");this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")}if(!this._weekdaysParse[n]){o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,"");this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")}if(i&&t==="dddd"&&this._fullWeekdaysParse[n].test(e)){return n}else if(i&&t==="ddd"&&this._shortWeekdaysParse[n].test(e)){return n}else if(i&&t==="dd"&&this._minWeekdaysParse[n].test(e)){return n}else if(!i&&this._weekdaysParse[n].test(e)){return n}}}function Kt(e){if(!this.isValid()){return e!=null?this:NaN}var t=this._isUTC?this._d.getUTCDay():this._d.getDay();if(e!=null){e=$t(e,this.localeData());return this.add(e-t,"d")}else{return t}}function Qt(e){if(!this.isValid()){return e!=null?this:NaN}var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Zt(e){if(!this.isValid()){return e!=null?this:NaN}if(e!=null){var t=Wt(e,this.localeData());return this.day(this.day()%7?t:t-7)}else{return this.day()||7}}var Jt=Ve;function ei(e){if(this._weekdaysParseExact){if(!s(this,"_weekdaysRegex")){oi.call(this)}if(e){return this._weekdaysStrictRegex}else{return this._weekdaysRegex}}else{if(!s(this,"_weekdaysRegex")){this._weekdaysRegex=Jt}return this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}}var ti=Ve;function ii(e){if(this._weekdaysParseExact){if(!s(this,"_weekdaysRegex")){oi.call(this)}if(e){return this._weekdaysShortStrictRegex}else{return this._weekdaysShortRegex}}else{if(!s(this,"_weekdaysShortRegex")){this._weekdaysShortRegex=ti}return this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}}var ni=Ve;function ri(e){if(this._weekdaysParseExact){if(!s(this,"_weekdaysRegex")){oi.call(this)}if(e){return this._weekdaysMinStrictRegex}else{return this._weekdaysMinRegex}}else{if(!s(this,"_weekdaysMinRegex")){this._weekdaysMinRegex=ni}return this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}}function oi(){function e(e,t){return t.length-e.length}var t=[],i=[],n=[],r=[],o,a,s,l,u;for(o=0;o<7;o++){a=c([2e3,1]).day(o);s=this.weekdaysMin(a,"");l=this.weekdaysShort(a,"");u=this.weekdays(a,"");t.push(s);i.push(l);n.push(u);r.push(s);r.push(l);r.push(u)}t.sort(e);i.sort(e);n.sort(e);r.sort(e);for(o=0;o<7;o++){i[o]=qe(i[o]);n[o]=qe(n[o]);r[o]=qe(r[o])}this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i");this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i");this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ai(){return this.hours()%12||12}function si(){return this.hours()||24}n("H",["HH",2],0,"hour");n("h",["hh",2],0,ai);n("k",["kk",2],0,si);n("hmm",0,0,function(){return""+ai.apply(this)+g(this.minutes(),2)});n("hmmss",0,0,function(){return""+ai.apply(this)+g(this.minutes(),2)+g(this.seconds(),2)});n("Hmm",0,0,function(){return""+this.hours()+g(this.minutes(),2)});n("Hmmss",0,0,function(){return""+this.hours()+g(this.minutes(),2)+g(this.seconds(),2)});function li(e,t){n(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}li("a",true);li("A",false);t("hour","h");i("hour",13);function ui(e,t){return t._meridiemParse}y("a",ui);y("A",ui);y("H",v);y("h",v);y("k",v);y("HH",v,r);y("hh",v,r);y("kk",v,r);y("hmm",Pe);y("hmmss",Me);y("Hmm",Pe);y("Hmmss",Me);b(["H","HH"],A);b(["k","kk"],function(e,t,i){var n=f(e);t[A]=n===24?0:n});b(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e);i._meridiem=e});b(["h","hh"],function(e,t,i){t[A]=f(e);d(i).bigHour=true});b("hmm",function(e,t,i){var n=e.length-2;t[A]=f(e.substr(0,n));t[E]=f(e.substr(n));d(i).bigHour=true});b("hmmss",function(e,t,i){var n=e.length-4;var r=e.length-2;t[A]=f(e.substr(0,n));t[E]=f(e.substr(n,2));t[x]=f(e.substr(r));d(i).bigHour=true});b("Hmm",function(e,t,i){var n=e.length-2;t[A]=f(e.substr(0,n));t[E]=f(e.substr(n))});b("Hmmss",function(e,t,i){var n=e.length-4;var r=e.length-2;t[A]=f(e.substr(0,n));t[E]=f(e.substr(n,2));t[x]=f(e.substr(r))});function ci(e){return(e+"").toLowerCase().charAt(0)==="p"}var di=/[ap]\.?m?\.?/i;function fi(e,t,i){if(e>11){return i?"pm":"PM"}else{return i?"am":"AM"}}var pi=ot("Hours",true);var hi={calendar:ae,longDateFormat:le,invalidDate:ce,ordinal:fe,dayOfMonthOrdinalParse:pe,relativeTime:ge,months:pt,monthsShort:gt,week:Pt,weekdays:jt,weekdaysMin:Ut,weekdaysShort:Vt,meridiemParse:di};var S={};var gi={};var vi;function mi(e){return e?e.toLowerCase().replace("_","-"):e}function yi(e){var t=0,i,n,r,o;while(t<e.length){o=mi(e[t]).split("-");i=o.length;n=mi(e[t+1]);n=n?n.split("-"):null;while(i>0){r=bi(o.slice(0,i).join("-"));if(r){return r}if(n&&n.length>=i&&Z(o,n,true)>=i-1){break}i--}t++}return vi}function bi(e){var t=null;if(!S[e]&&typeof module!=="undefined"&&module&&module.exports){try{t=vi._abbr;var i=require;i("./locale/"+e);_i(t)}catch(e){}}return S[e]}function _i(e,t){var i;if(e){if(o(t)){i=Ai(e)}else{i=wi(e,t)}if(i){vi=i}else{if(typeof console!=="undefined"&&console.warn){console.warn("Locale "+e+" not found. Did you forget to load it?")}}}return vi._abbr}function wi(e,t){if(t!==null){var i,n=hi;t.abbr=e;if(S[e]!=null){te("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.");n=S[e]._config}else if(t.parentLocale!=null){if(S[t.parentLocale]!=null){n=S[t.parentLocale]._config}else{i=bi(t.parentLocale);if(i!=null){n=i._config}else{if(!gi[t.parentLocale]){gi[t.parentLocale]=[]}gi[t.parentLocale].push({name:e,config:t});return null}}}S[e]=new re(ne(n,t));if(gi[e]){gi[e].forEach(function(e){wi(e.name,e.config)})}_i(e);return S[e]}else{delete S[e];return null}}function Ci(e,t){if(t!=null){var i,n,r=hi;n=bi(e);if(n!=null){r=n._config}t=ne(r,t);i=new re(t);i.parentLocale=S[e];S[e]=i;_i(e)}else{if(S[e]!=null){if(S[e].parentLocale!=null){S[e]=S[e].parentLocale}else if(S[e]!=null){delete S[e]}}}return S[e]}function Ai(e){var t;if(e&&e._locale&&e._locale._abbr){e=e._locale._abbr}if(!e){return vi}if(!a(e)){t=bi(e);if(t){return t}e=[e]}return yi(e)}function Ei(){return oe(S)}function xi(e){var t;var i=e._a;if(i&&d(e).overflow===-2){t=i[w]<0||i[w]>11?w:i[C]<1||i[C]>dt(i[_],i[w])?C:i[A]<0||i[A]>24||i[A]===24&&(i[E]!==0||i[x]!==0||i[Ze]!==0)?A:i[E]<0||i[E]>59?E:i[x]<0||i[x]>59?x:i[Ze]<0||i[Ze]>999?Ze:-1;if(d(e)._overflowDayOfYear&&(t<_||t>C)){t=C}if(d(e)._overflowWeeks&&t===-1){t=Je}if(d(e)._overflowWeekday&&t===-1){t=et}d(e).overflow=t}return e}function Ti(e,t,i){if(e!=null){return e}if(t!=null){return t}return i}function Si(e){var t=new Date(u.now());if(e._useUTC){return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]}return[t.getFullYear(),t.getMonth(),t.getDate()]}function Di(e){var t,i,n=[],r,o,a;if(e._d){return}r=Si(e);if(e._w&&e._a[C]==null&&e._a[w]==null){ki(e)}if(e._dayOfYear!=null){a=Ti(e._a[_],r[_]);if(e._dayOfYear>tt(a)||e._dayOfYear===0){d(e)._overflowDayOfYear=true}i=Dt(a,0,e._dayOfYear);e._a[w]=i.getUTCMonth();e._a[C]=i.getUTCDate()}for(t=0;t<3&&e._a[t]==null;++t){e._a[t]=n[t]=r[t]}for(;t<7;t++){e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t]}if(e._a[A]===24&&e._a[E]===0&&e._a[x]===0&&e._a[Ze]===0){e._nextDay=true;e._a[A]=0}e._d=(e._useUTC?Dt:St).apply(null,n);o=e._useUTC?e._d.getUTCDay():e._d.getDay();if(e._tzm!=null){e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm)}if(e._nextDay){e._a[A]=24}if(e._w&&typeof e._w.d!=="undefined"&&e._w.d!==o){d(e).weekdayMismatch=true}}function ki(e){var t,i,n,r,o,a,s,l;t=e._w;if(t.GG!=null||t.W!=null||t.E!=null){o=1;a=4;i=Ti(t.GG,e._a[_],Rt(D(),1,4).year);n=Ti(t.W,1);r=Ti(t.E,1);if(r<1||r>7){l=true}}else{o=e._locale._week.dow;a=e._locale._week.doy;var u=Rt(D(),o,a);i=Ti(t.gg,e._a[_],u.year);n=Ti(t.w,u.week);if(t.d!=null){r=t.d;if(r<0||r>6){l=true}}else if(t.e!=null){r=t.e+o;if(t.e<0||t.e>6){l=true}}else{r=o}}if(n<1||n>Nt(i,o,a)){d(e)._overflowWeeks=true}else if(l!=null){d(e)._overflowWeekday=true}else{s=Ot(i,n,r,o,a);e._a[_]=s.year;e._dayOfYear=s.dayOfYear}}var Oi=/^\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 Ri=/^\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 Ni=/Z|[+-]\d\d(?::?\d\d)?/;var Ii=[["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}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,false],["YYYYDDD",/\d{7}/]];var Pi=[["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 Mi=/^\/?Date\((\-?\d+)/i;function Li(e){var t,i,n=e._i,r=Oi.exec(n)||Ri.exec(n),o,a,s,l;if(r){d(e).iso=true;for(t=0,i=Ii.length;t<i;t++){if(Ii[t][1].exec(r[1])){a=Ii[t][0];o=Ii[t][2]!==false;break}}if(a==null){e._isValid=false;return}if(r[3]){for(t=0,i=Pi.length;t<i;t++){if(Pi[t][1].exec(r[3])){s=(r[2]||" ")+Pi[t][0];break}}if(s==null){e._isValid=false;return}}if(!o&&s!=null){e._isValid=false;return}if(r[4]){if(Ni.exec(r[4])){l="Z"}else{e._isValid=false;return}}e._f=a+(s||"")+(l||"");Ui(e)}else{e._isValid=false}}var Fi=/^(?:(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 Gi(e,t,i,n,r,o){var a=[$i(e),gt.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(r,10)];if(o){a.push(parseInt(o,10))}return a}function $i(e){var t=parseInt(e,10);if(t<=49){return 2e3+t}else if(t<=999){return 1900+t}return t}function Wi(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Hi(e,t,i){if(e){var n=Vt.indexOf(e),r=new Date(t[0],t[1],t[2]).getDay();if(n!==r){d(i).weekdayMismatch=true;i._isValid=false;return false}}return true}var ji={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 Bi(e,t,i){if(e){return ji[e]}else if(t){return 0}else{var n=parseInt(i,10);var r=n%100,o=(n-r)/100;return o*60+r}}function Vi(e){var t=Fi.exec(Wi(e._i));if(t){var i=Gi(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Hi(t[1],i,e)){return}e._a=i;e._tzm=Bi(t[8],t[9],t[10]);e._d=Dt.apply(null,e._a);e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm);d(e).rfc2822=true}else{e._isValid=false}}function zi(e){var t=Mi.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}Li(e);if(e._isValid===false){delete e._isValid}else{return}Vi(e);if(e._isValid===false){delete e._isValid}else{return}u.createFromInputFallback(e)}u.createFromInputFallback=e("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});u.ISO_8601=function(){};u.RFC_2822=function(){};function Ui(e){if(e._f===u.ISO_8601){Li(e);return}if(e._f===u.RFC_2822){Vi(e);return}e._a=[];d(e).empty=true;var t=""+e._i,i,n,r,o,a,s=t.length,l=0;r=ke(e._f,e._locale).match(Ce)||[];for(i=0;i<r.length;i++){o=r[i];n=(t.match(Ue(o,e))||[])[0];if(n){a=t.substr(0,t.indexOf(n));if(a.length>0){d(e).unusedInput.push(a)}t=t.slice(t.indexOf(n)+n.length);l+=n.length}if(xe[o]){if(n){d(e).empty=false}else{d(e).unusedTokens.push(o)}Qe(o,n,e)}else if(e._strict&&!n){d(e).unusedTokens.push(o)}}d(e).charsLeftOver=s-l;if(t.length>0){d(e).unusedInput.push(t)}if(e._a[A]<=12&&d(e).bigHour===true&&e._a[A]>0){d(e).bigHour=undefined}d(e).parsedDateParts=e._a.slice(0);d(e).meridiem=e._meridiem;e._a[A]=Yi(e._locale,e._a[A],e._meridiem);Di(e);xi(e)}function Yi(e,t,i){var n;if(i==null){return t}if(e.meridiemHour!=null){return e.meridiemHour(t,i)}else if(e.isPM!=null){n=e.isPM(i);if(n&&t<12){t+=12}if(!n&&t===12){t=0}return t}else{return t}}function qi(e){var t,i,n,r,o;if(e._f.length===0){d(e).invalidFormat=true;e._d=new Date(NaN);return}for(r=0;r<e._f.length;r++){o=0;t=X({},e);if(e._useUTC!=null){t._useUTC=e._useUTC}t._f=e._f[r];Ui(t);if(!U(t)){continue}o+=d(t).charsLeftOver;o+=d(t).unusedTokens.length*10;d(t).score=o;if(n==null||o<n){n=o;i=t}}B(e,i||t)}function Xi(e){if(e._d){return}var t=be(e._i);e._a=j([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)});Di(e)}function Ki(e){var t=new Q(xi(Qi(e)));if(t._nextDay){t.add(1,"d");t._nextDay=undefined}return t}function Qi(e){var t=e._i,i=e._f;e._locale=e._locale||Ai(e._l);if(t===null||i===undefined&&t===""){return Y({nullInput:true})}if(typeof t==="string"){e._i=t=e._locale.preparse(t)}if(l(t)){return new Q(xi(t))}else if(H(t)){e._d=t}else if(a(i)){qi(e)}else if(i){Ui(e)}else{Zi(e)}if(!U(e)){e._d=null}return e}function Zi(e){var t=e._i;if(o(t)){e._d=new Date(u.now())}else if(H(t)){e._d=new Date(t.valueOf())}else if(typeof t==="string"){zi(e)}else if(a(t)){e._a=j(t.slice(0),function(e){return parseInt(e,10)});Di(e)}else if(G(t)){Xi(e)}else if(W(t)){e._d=new Date(t)}else{u.createFromInputFallback(e)}}function Ji(e,t,i,n,r){var o={};if(i===true||i===false){n=i;i=undefined}if(G(e)&&$(e)||a(e)&&e.length===0){e=undefined}o._isAMomentObject=true;o._useUTC=o._isUTC=r;o._l=i;o._i=e;o._f=t;o._strict=n;return Ki(o)}function D(e,t,i,n){return Ji(e,t,i,n,false)}var en=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=D.apply(null,arguments);if(this.isValid()&&e.isValid()){return e<this?this:e}else{return Y()}});var tn=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=D.apply(null,arguments);if(this.isValid()&&e.isValid()){return e>this?this:e}else{return Y()}});function nn(e,t){var i,n;if(t.length===1&&a(t[0])){t=t[0]}if(!t.length){return D()}i=t[0];for(n=1;n<t.length;++n){if(!t[n].isValid()||t[n][e](i)){i=t[n]}}return i}function rn(){var e=[].slice.call(arguments,0);return nn("isBefore",e)}function on(){var e=[].slice.call(arguments,0);return nn("isAfter",e)}var an=function(){return Date.now?Date.now():+new Date};var sn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ln(e){for(var t in e){if(!(T.call(sn,t)!==-1&&(e[t]==null||!isNaN(e[t])))){return false}}var i=false;for(var n=0;n<sn.length;++n){if(e[sn[n]]){if(i){return false}if(parseFloat(e[sn[n]])!==f(e[sn[n]])){i=true}}}return true}function un(){return this._isValid}function cn(){return k(NaN)}function dn(e){var t=be(e),i=t.year||0,n=t.quarter||0,r=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=ln(t);this._milliseconds=+c+u*1e3+l*6e4+s*1e3*60*60;this._days=+a+o*7;this._months=+r+n*3+i*12;this._data={};this._locale=Ai();this._bubble()}function fn(e){return e instanceof dn}function pn(e){if(e<0){return Math.round(-1*e)*-1}else{return Math.round(e)}}function hn(e,i){n(e,0,0,function(){var e=this.utcOffset();var t="+";if(e<0){e=-e;t="-"}return t+g(~~(e/60),2)+i+g(~~e%60,2)})}hn("Z",":");hn("ZZ","");y("Z",je);y("ZZ",je);b(["Z","ZZ"],function(e,t,i){i._useUTC=true;i._tzm=vn(je,e)});var gn=/([\+\-]|\d\d)/gi;function vn(e,t){var i=(t||"").match(e);if(i===null){return null}var n=i[i.length-1]||[];var r=(n+"").match(gn)||["-",0,0];var o=+(r[1]*60)+f(r[2]);return o===0?0:r[0]==="+"?o:-o}function mn(e,t){var i,n;if(t._isUTC){i=t.clone();n=(l(e)||H(e)?e.valueOf():D(e).valueOf())-i.valueOf();i._d.setTime(i._d.valueOf()+n);u.updateOffset(i,false);return i}else{return D(e).local()}}function yn(e){return-Math.round(e._d.getTimezoneOffset()/15)*15}u.updateOffset=function(){};function bn(e,t,i){var n=this._offset||0,r;if(!this.isValid()){return e!=null?this:NaN}if(e!=null){if(typeof e==="string"){e=vn(je,e);if(e===null){return this}}else if(Math.abs(e)<16&&!i){e=e*60}if(!this._isUTC&&t){r=yn(this)}this._offset=e;this._isUTC=true;if(r!=null){this.add(r,"m")}if(n!==e){if(!t||this._changeInProgress){Ln(this,k(e-n,"m"),1,false)}else if(!this._changeInProgress){this._changeInProgress=true;u.updateOffset(this,true);this._changeInProgress=null}}return this}else{return this._isUTC?n:yn(this)}}function _n(e,t){if(e!=null){if(typeof e!=="string"){e=-e}this.utcOffset(e,t);return this}else{return-this.utcOffset()}}function wn(e){return this.utcOffset(0,e)}function Cn(e){if(this._isUTC){this.utcOffset(0,e);this._isUTC=false;if(e){this.subtract(yn(this),"m")}}return this}function An(){if(this._tzm!=null){this.utcOffset(this._tzm,false,true)}else if(typeof this._i==="string"){var e=vn(He,this._i);if(e!=null){this.utcOffset(e)}else{this.utcOffset(0,true)}}return this}function En(e){if(!this.isValid()){return false}e=e?D(e).utcOffset():0;return(this.utcOffset()-e)%60===0}function xn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tn(){if(!o(this._isDSTShifted)){return this._isDSTShifted}var e={};X(e,this);e=Qi(e);if(e._a){var t=e._isUTC?c(e._a):D(e._a);this._isDSTShifted=this.isValid()&&Z(e._a,t.toArray())>0}else{this._isDSTShifted=false}return this._isDSTShifted}function Sn(){return this.isValid()?!this._isUTC:false}function Dn(){return this.isValid()?this._isUTC:false}function kn(){return this.isValid()?this._isUTC&&this._offset===0:false}var On=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;var Rn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function k(e,t){var i=e,n=null,r,o,a;if(fn(e)){i={ms:e._milliseconds,d:e._days,M:e._months}}else if(W(e)){i={};if(t){i[t]=e}else{i.milliseconds=e}}else if(!!(n=On.exec(e))){r=n[1]==="-"?-1:1;i={y:0,d:f(n[C])*r,h:f(n[A])*r,m:f(n[E])*r,s:f(n[x])*r,ms:f(pn(n[Ze]*1e3))*r}}else if(!!(n=Rn.exec(e))){r=n[1]==="-"?-1:1;i={y:Nn(n[2],r),M:Nn(n[3],r),w:Nn(n[4],r),d:Nn(n[5],r),h:Nn(n[6],r),m:Nn(n[7],r),s:Nn(n[8],r)}}else if(i==null){i={}}else if(typeof i==="object"&&("from"in i||"to"in i)){a=Pn(D(i.from),D(i.to));i={};i.ms=a.milliseconds;i.M=a.months}o=new dn(i);if(fn(e)&&s(e,"_locale")){o._locale=e._locale}return o}k.fn=dn.prototype;k.invalid=cn;function Nn(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function In(e,t){var i={};i.months=t.month()-e.month()+(t.year()-e.year())*12;if(e.clone().add(i.months,"M").isAfter(t)){--i.months}i.milliseconds=+t-+e.clone().add(i.months,"M");return i}function Pn(e,t){var i;if(!(e.isValid()&&t.isValid())){return{milliseconds:0,months:0}}t=mn(t,e);if(e.isBefore(t)){i=In(e,t)}else{i=In(t,e);i.milliseconds=-i.milliseconds;i.months=-i.months}return i}function Mn(r,o){return function(e,t){var i,n;if(t!==null&&!isNaN(+t)){te(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). "+"See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.");n=e;e=t;t=n}e=typeof e==="string"?+e:e;i=k(e,t);Ln(this,i,r);return this}}function Ln(e,t,i,n){var r=t._milliseconds,o=pn(t._days),a=pn(t._months);if(!e.isValid()){return}n=n==null?true:n;if(a){bt(e,at(e,"Month")+a*i)}if(o){st(e,"Date",at(e,"Date")+o*i)}if(r){e._d.setTime(e._d.valueOf()+r*i)}if(n){u.updateOffset(e,o||a)}}var Fn=Mn(1,"add");var Gn=Mn(-1,"subtract");function $n(e,t){var i=e.diff(t,"days",true);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Wn(e,t){var i=e||D(),n=mn(i,this).startOf("day"),r=u.calendarFormat(this,n)||"sameElse";var o=t&&(p(t[r])?t[r].call(this,i):t[r]);return this.format(o||this.localeData().calendar(r,this,D(i)))}function Hn(){return new Q(this)}function jn(e,t){var i=l(e)?e:D(e);if(!(this.isValid()&&i.isValid())){return false}t=h(t)||"millisecond";if(t==="millisecond"){return this.valueOf()>i.valueOf()}else{return i.valueOf()<this.clone().startOf(t).valueOf()}}function Bn(e,t){var i=l(e)?e:D(e);if(!(this.isValid()&&i.isValid())){return false}t=h(t)||"millisecond";if(t==="millisecond"){return this.valueOf()<i.valueOf()}else{return this.clone().endOf(t).valueOf()<i.valueOf()}}function Vn(e,t,i,n){var r=l(e)?e:D(e),o=l(t)?t:D(t);if(!(this.isValid()&&r.isValid()&&o.isValid())){return false}n=n||"()";return(n[0]==="("?this.isAfter(r,i):!this.isBefore(r,i))&&(n[1]===")"?this.isBefore(o,i):!this.isAfter(o,i))}function zn(e,t){var i=l(e)?e:D(e),n;if(!(this.isValid()&&i.isValid())){return false}t=h(t)||"millisecond";if(t==="millisecond"){return this.valueOf()===i.valueOf()}else{n=i.valueOf();return this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()}}function Un(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Yn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function qn(e,t,i){var n,r,o;if(!this.isValid()){return NaN}n=mn(e,this);if(!n.isValid()){return NaN}r=(n.utcOffset()-this.utcOffset())*6e4;t=h(t);switch(t){case"year":o=Xn(this,n)/12;break;case"month":o=Xn(this,n);break;case"quarter":o=Xn(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-r)/864e5;break;case"week":o=(this-n-r)/6048e5;break;default:o=this-n}return i?o:m(o)}function Xn(e,t){var i=(t.year()-e.year())*12+(t.month()-e.month()),n=e.clone().add(i,"months"),r,o;if(t-n<0){r=e.clone().add(i-1,"months");o=(t-n)/(n-r)}else{r=e.clone().add(i+1,"months");o=(t-n)/(r-n)}return-(i+o)||0}u.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";u.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Kn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Qn(e){if(!this.isValid()){return null}var t=e!==true;var i=t?this.clone().utc():this;if(i.year()<0||i.year()>9999){return De(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ")}if(p(Date.prototype.toISOString)){if(t){return this.toDate().toISOString()}else{return new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",De(i,"Z"))}}return De(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Zn(){if(!this.isValid()){return"moment.invalid(/* "+this._i+" */)"}var e="moment";var t="";if(!this.isLocal()){e=this.utcOffset()===0?"moment.utc":"moment.parseZone";t="Z"}var i="["+e+'("]';var n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY";var r="-MM-DD[T]HH:mm:ss.SSS";var o=t+'[")]';return this.format(i+n+r+o)}function Jn(e){if(!e){e=this.isUtc()?u.defaultFormatUtc:u.defaultFormat}var t=De(this,e);return this.localeData().postformat(t)}function er(e,t){if(this.isValid()&&(l(e)&&e.isValid()||D(e).isValid())){return k({to:this,from:e}).locale(this.locale()).humanize(!t)}else{return this.localeData().invalidDate()}}function tr(e){return this.from(D(),e)}function ir(e,t){if(this.isValid()&&(l(e)&&e.isValid()||D(e).isValid())){return k({from:this,to:e}).locale(this.locale()).humanize(!t)}else{return this.localeData().invalidDate()}}function nr(e){return this.to(D(),e)}function rr(e){var t;if(e===undefined){return this._locale._abbr}else{t=Ai(e);if(t!=null){this._locale=t}return this}}var or=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){if(e===undefined){return this.localeData()}else{return this.locale(e)}});function ar(){return this._locale}var sr=1e3;var lr=60*sr;var ur=60*lr;var cr=(365*400+97)*24*ur;function dr(e,t){return(e%t+t)%t}function fr(e,t,i){if(e<100&&e>=0){return new Date(e+400,t,i)-cr}else{return new Date(e,t,i).valueOf()}}function pr(e,t,i){if(e<100&&e>=0){return Date.UTC(e+400,t,i)-cr}else{return Date.UTC(e,t,i)}}function hr(e){var t;e=h(e);if(e===undefined||e==="millisecond"||!this.isValid()){return this}var i=this._isUTC?pr:fr;switch(e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf();t-=dr(t+(this._isUTC?0:this.utcOffset()*lr),ur);break;case"minute":t=this._d.valueOf();t-=dr(t,lr);break;case"second":t=this._d.valueOf();t-=dr(t,sr);break}this._d.setTime(t);u.updateOffset(this,true);return this}function gr(e){var t;e=h(e);if(e===undefined||e==="millisecond"||!this.isValid()){return this}var i=this._isUTC?pr:fr;switch(e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf();t+=ur-dr(t+(this._isUTC?0:this.utcOffset()*lr),ur)-1;break;case"minute":t=this._d.valueOf();t+=lr-dr(t,lr)-1;break;case"second":t=this._d.valueOf();t+=sr-dr(t,sr)-1;break}this._d.setTime(t);u.updateOffset(this,true);return this}function vr(){return this._d.valueOf()-(this._offset||0)*6e4}function mr(){return Math.floor(this.valueOf()/1e3)}function yr(){return new Date(this.valueOf())}function br(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _r(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function wr(){return this.isValid()?this.toISOString():null}function Cr(){return U(this)}function Ar(){return B({},d(this))}function Er(){return d(this).overflow}function xr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}n(0,["gg",2],0,function(){return this.weekYear()%100});n(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Tr(e,t){n(0,[e,e.length],0,t)}Tr("gggg","weekYear");Tr("ggggg","weekYear");Tr("GGGG","isoWeekYear");Tr("GGGGG","isoWeekYear");t("weekYear","gg");t("isoWeekYear","GG");i("weekYear",1);i("isoWeekYear",1);y("G",We);y("g",We);y("GG",v,r);y("gg",v,r);y("GGGG",Fe,Ne);y("gggg",Fe,Ne);y("GGGGG",Ge,Ie);y("ggggg",Ge,Ie);Ke(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=f(e)});Ke(["gg","GG"],function(e,t,i,n){t[n]=u.parseTwoDigitYear(e)});function Sr(e){return Rr.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Dr(e){return Rr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function kr(){return Nt(this.year(),1,4)}function Or(){var e=this.localeData()._week;return Nt(this.year(),e.dow,e.doy)}function Rr(e,t,i,n,r){var o;if(e==null){return Rt(this,n,r).year}else{o=Nt(e,n,r);if(t>o){t=o}return Nr.call(this,e,t,i,n,r)}}function Nr(e,t,i,n,r){var o=Ot(e,t,i,n,r),a=Dt(o.year,0,o.dayOfYear);this.year(a.getUTCFullYear());this.month(a.getUTCMonth());this.date(a.getUTCDate());return this}n("Q",0,"Qo","quarter");t("quarter","Q");i("quarter",7);y("Q",Oe);b("Q",function(e,t){t[w]=(f(e)-1)*3});function Ir(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}n("D",["DD",2],"Do","date");t("date","D");i("date",9);y("D",v);y("DD",v,r);y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});b(["D","DD"],C);b("Do",function(e,t){t[C]=f(e.match(v)[0])});var Pr=ot("Date",true);n("DDD",["DDDD",3],"DDDo","dayOfYear");t("dayOfYear","DDD");i("dayOfYear",4);y("DDD",Le);y("DDDD",Re);b(["DDD","DDDD"],function(e,t,i){i._dayOfYear=f(e)});function Mr(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}n("m",["mm",2],0,"minute");t("minute","m");i("minute",14);y("m",v);y("mm",v,r);b(["m","mm"],E);var Lr=ot("Minutes",false);n("s",["ss",2],0,"second");t("second","s");i("second",15);y("s",v);y("ss",v,r);b(["s","ss"],x);var Fr=ot("Seconds",false);n("S",0,0,function(){return~~(this.millisecond()/100)});n(0,["SS",2],0,function(){return~~(this.millisecond()/10)});n(0,["SSS",3],0,"millisecond");n(0,["SSSS",4],0,function(){return this.millisecond()*10});n(0,["SSSSS",5],0,function(){return this.millisecond()*100});n(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});n(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});n(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});n(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});t("millisecond","ms");i("millisecond",16);y("S",Le,Oe);y("SS",Le,r);y("SSS",Le,Re);var Gr;for(Gr="SSSS";Gr.length<=9;Gr+="S"){y(Gr,$e)}function $r(e,t){t[Ze]=f(("0."+e)*1e3)}for(Gr="S";Gr.length<=9;Gr+="S"){b(Gr,$r)}var Wr=ot("Milliseconds",false);n("z",0,0,"zoneAbbr");n("zz",0,0,"zoneName");function Hr(){return this._isUTC?"UTC":""}function jr(){return this._isUTC?"Coordinated Universal Time":""}var O=Q.prototype;O.add=Fn;O.calendar=Wn;O.clone=Hn;O.diff=qn;O.endOf=gr;O.format=Jn;O.from=er;O.fromNow=tr;O.to=ir;O.toNow=nr;O.get=lt;O.invalidAt=Er;O.isAfter=jn;O.isBefore=Bn;O.isBetween=Vn;O.isSame=zn;O.isSameOrAfter=Un;O.isSameOrBefore=Yn;O.isValid=Cr;O.lang=or;O.locale=rr;O.localeData=ar;O.max=tn;O.min=en;O.parsingFlags=Ar;O.set=ut;O.startOf=hr;O.subtract=Gn;O.toArray=br;O.toObject=_r;O.toDate=yr;O.toISOString=Qn;O.inspect=Zn;O.toJSON=wr;O.toString=Kn;O.unix=mr;O.valueOf=vr;O.creationData=xr;O.year=nt;O.isLeapYear=rt;O.weekYear=Sr;O.isoWeekYear=Dr;O.quarter=O.quarters=Ir;O.month=_t;O.daysInMonth=wt;O.week=O.weeks=Ft;O.isoWeek=O.isoWeeks=Gt;O.weeksInYear=Or;O.isoWeeksInYear=kr;O.date=Pr;O.day=O.days=Kt;O.weekday=Qt;O.isoWeekday=Zt;O.dayOfYear=Mr;O.hour=O.hours=pi;O.minute=O.minutes=Lr;O.second=O.seconds=Fr;O.millisecond=O.milliseconds=Wr;O.utcOffset=bn;O.utc=wn;O.local=Cn;O.parseZone=An;O.hasAlignedHourOffset=En;O.isDST=xn;O.isLocal=Sn;O.isUtcOffset=Dn;O.isUtc=kn;O.isUTC=kn;O.zoneAbbr=Hr;O.zoneName=jr;O.dates=e("dates accessor is deprecated. Use date instead.",Pr);O.months=e("months accessor is deprecated. Use month instead",_t);O.years=e("years accessor is deprecated. Use year instead",nt);O.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_n);O.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Tn);function Br(e){return D(e*1e3)}function Vr(){return D.apply(null,arguments).parseZone()}function zr(e){return e}var R=re.prototype;R.calendar=se;R.longDateFormat=ue;R.invalidDate=de;R.ordinal=he;R.preparse=zr;R.postformat=zr;R.relativeTime=ve;R.pastFuture=me;R.set=ie;R.months=ht;R.monthsShort=vt;R.monthsParse=yt;R.monthsRegex=xt;R.monthsShortRegex=At;R.week=It;R.firstDayOfYear=Lt;R.firstDayOfWeek=Mt;R.weekdays=Bt;R.weekdaysMin=Yt;R.weekdaysShort=zt;R.weekdaysParse=Xt;R.weekdaysRegex=ei;R.weekdaysShortRegex=ii;R.weekdaysMinRegex=ri;R.isPM=ci;R.meridiem=fi;function Ur(e,t,i,n){var r=Ai();var o=c().set(n,t);return r[i](o,e)}function Yr(e,t,i){if(W(e)){t=e;e=undefined}e=e||"";if(t!=null){return Ur(e,t,i,"month")}var n;var r=[];for(n=0;n<12;n++){r[n]=Ur(e,n,i,"month")}return r}function qr(e,t,i,n){if(typeof e==="boolean"){if(W(t)){i=t;t=undefined}t=t||""}else{t=e;i=t;e=false;if(W(t)){i=t;t=undefined}t=t||""}var r=Ai(),o=e?r._week.dow:0;if(i!=null){return Ur(t,(i+o)%7,n,"day")}var a;var s=[];for(a=0;a<7;a++){s[a]=Ur(t,(a+o)%7,n,"day")}return s}function Xr(e,t){return Yr(e,t,"months")}function Kr(e,t){return Yr(e,t,"monthsShort")}function Qr(e,t,i){return qr(e,t,i,"weekdays")}function Zr(e,t,i){return qr(e,t,i,"weekdaysShort")}function Jr(e,t,i){return qr(e,t,i,"weekdaysMin")}_i("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=f(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+i}});u.lang=e("moment.lang is deprecated. Use moment.locale instead.",_i);u.langData=e("moment.langData is deprecated. Use moment.localeData instead.",Ai);var N=Math.abs;function eo(){var e=this._data;this._milliseconds=N(this._milliseconds);this._days=N(this._days);this._months=N(this._months);e.milliseconds=N(e.milliseconds);e.seconds=N(e.seconds);e.minutes=N(e.minutes);e.hours=N(e.hours);e.months=N(e.months);e.years=N(e.years);return this}function to(e,t,i,n){var r=k(t,i);e._milliseconds+=n*r._milliseconds;e._days+=n*r._days;e._months+=n*r._months;return e._bubble()}function io(e,t){return to(this,e,t,1)}function no(e,t){return to(this,e,t,-1)}function ro(e){if(e<0){return Math.floor(e)}else{return Math.ceil(e)}}function oo(){var e=this._milliseconds;var t=this._days;var i=this._months;var n=this._data;var r,o,a,s,l;if(!(e>=0&&t>=0&&i>=0||e<=0&&t<=0&&i<=0)){e+=ro(so(i)+t)*864e5;t=0;i=0}n.milliseconds=e%1e3;r=m(e/1e3);n.seconds=r%60;o=m(r/60);n.minutes=o%60;a=m(o/60);n.hours=a%24;t+=m(a/24);l=m(ao(t));i+=l;t-=ro(so(l));s=m(i/12);i%=12;n.days=t;n.months=i;n.years=s;return this}function ao(e){return e*4800/146097}function so(e){return e*146097/4800}function lo(e){if(!this.isValid()){return NaN}var t;var i;var n=this._milliseconds;e=h(e);if(e==="month"||e==="quarter"||e==="year"){t=this._days+n/864e5;i=this._months+ao(t);switch(e){case"month":return i;case"quarter":return i/3;case"year":return i/12}}else{t=this._days+Math.round(so(this._months));switch(e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}}function uo(){if(!this.isValid()){return NaN}return this._milliseconds+this._days*864e5+this._months%12*2592e6+f(this._months/12)*31536e6}function I(e){return function(){return this.as(e)}}var co=I("ms");var fo=I("s");var po=I("m");var ho=I("h");var go=I("d");var vo=I("w");var mo=I("M");var yo=I("Q");var bo=I("y");function _o(){return k(this)}function wo(e){e=h(e);return this.isValid()?this[e+"s"]():NaN}function Co(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ao=Co("milliseconds");var Eo=Co("seconds");var xo=Co("minutes");var To=Co("hours");var So=Co("days");var Do=Co("months");var ko=Co("years");function Oo(){return m(this.days()/7)}var Ro=Math.round;var P={ss:44,s:45,m:45,h:22,d:26,M:11};function No(e,t,i,n,r){return r.relativeTime(t||1,!!i,e,n)}function Io(e,t,i){var n=k(e).abs();var r=Ro(n.as("s"));var o=Ro(n.as("m"));var a=Ro(n.as("h"));var s=Ro(n.as("d"));var l=Ro(n.as("M"));var u=Ro(n.as("y"));var c=r<=P.ss&&["s",r]||r<P.s&&["ss",r]||o<=1&&["m"]||o<P.m&&["mm",o]||a<=1&&["h"]||a<P.h&&["hh",a]||s<=1&&["d"]||s<P.d&&["dd",s]||l<=1&&["M"]||l<P.M&&["MM",l]||u<=1&&["y"]||["yy",u];c[2]=t;c[3]=+e>0;c[4]=i;return No.apply(null,c)}function Po(e){if(e===undefined){return Ro}if(typeof e==="function"){Ro=e;return true}return false}function Mo(e,t){if(P[e]===undefined){return false}if(t===undefined){return P[e]}P[e]=t;if(e==="s"){P.ss=t-1}return true}function Lo(e){if(!this.isValid()){return this.localeData().invalidDate()}var t=this.localeData();var i=Io(this,!e,t);if(e){i=t.pastFuture(+this,i)}return t.postformat(i)}var Fo=Math.abs;function Go(e){return(e>0)-(e<0)||+e}function $o(){if(!this.isValid()){return this.localeData().invalidDate()}var e=Fo(this._milliseconds)/1e3;var t=Fo(this._days);var i=Fo(this._months);var n,r,o;n=m(e/60);r=m(n/60);e%=60;n%=60;o=m(i/12);i%=12;var a=o;var s=i;var l=t;var u=r;var c=n;var d=e?e.toFixed(3).replace(/\.?0+$/,""):"";var f=this.asSeconds();if(!f){return"P0D"}var p=f<0?"-":"";var h=Go(this._months)!==Go(f)?"-":"";var g=Go(this._days)!==Go(f)?"-":"";var v=Go(this._milliseconds)!==Go(f)?"-":"";return p+"P"+(a?h+a+"Y":"")+(s?h+s+"M":"")+(l?g+l+"D":"")+(u||c||d?"T":"")+(u?v+u+"H":"")+(c?v+c+"M":"")+(d?v+d+"S":"")}var M=dn.prototype;M.isValid=un;M.abs=eo;M.add=io;M.subtract=no;M.as=lo;M.asMilliseconds=co;M.asSeconds=fo;M.asMinutes=po;M.asHours=ho;M.asDays=go;M.asWeeks=vo;M.asMonths=mo;M.asQuarters=yo;M.asYears=bo;M.valueOf=uo;M._bubble=oo;M.clone=_o;M.get=wo;M.milliseconds=Ao;M.seconds=Eo;M.minutes=xo;M.hours=To;M.days=So;M.weeks=Oo;M.months=Do;M.years=ko;M.humanize=Lo;M.toISOString=$o;M.toString=$o;M.toJSON=$o;M.locale=rr;M.localeData=ar;M.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$o);M.lang=or;n("X",0,0,"unix");n("x",0,0,"valueOf");y("x",We);y("X",Be);b("X",function(e,t,i){i._d=new Date(parseFloat(e,10)*1e3)});b("x",function(e,t,i){i._d=new Date(f(e))});u.version="2.24.0";F(D);u.fn=O;u.min=rn;u.max=on;u.now=an;u.utc=c;u.unix=Br;u.months=Xr;u.isDate=H;u.locale=_i;u.invalid=Y;u.duration=k;u.isMoment=l;u.weekdays=Qr;u.parseZone=Vr;u.localeData=Ai;u.isDuration=fn;u.monthsShort=Kr;u.weekdaysMin=Jr;u.defineLocale=wi;u.updateLocale=Ci;u.locales=Ei;u.weekdaysShort=Zr;u.normalizeUnits=h;u.relativeTimeRounding=Po;u.relativeTimeThreshold=Mo;u.calendarFormat=$n;u.prototype=O;u.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};return u});(function(e,t){"use strict";if(typeof module==="object"&&module.exports){module.exports=t(require("moment"))}else if(typeof define==="function"&&define.amd){define(["moment"],t)}else{t(e.moment)}})(this,function(o){"use strict";var e="0.5.25",a={},s={},u={},l={},t;if(!o||typeof o.version!=="string"){O("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/")}var i=o.version.split("."),n=+i[0],r=+i[1];if(n<2||n===2&&r<6){O("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+o.version+". See momentjs.com")}function c(e){if(e>96){return e-87}else if(e>64){return e-29}return e-48}function d(e){var t=0,i=e.split("."),n=i[0],r=i[1]||"",o=1,a,s=0,l=1;if(e.charCodeAt(0)===45){t=1;l=-1}for(t;t<n.length;t++){a=c(n.charCodeAt(t));s=60*s+a}for(t=0;t<r.length;t++){o=o/60;a=c(r.charCodeAt(t));s+=a*o}return s*l}function f(e){for(var t=0;t<e.length;t++){e[t]=d(e[t])}}function p(e,t){for(var i=0;i<t;i++){e[i]=Math.round((e[i-1]||0)+e[i]*6e4)}e[t-1]=Infinity}function h(e,t){var i=[],n;for(n=0;n<t.length;n++){i[n]=e[t[n]]}return i}function g(e){var t=e.split("|"),i=t[2].split(" "),n=t[3].split(""),r=t[4].split(" ");f(i);f(n);f(r);p(r,n.length);return{name:t[0],abbrs:h(t[1].split(" "),n),offsets:h(i,n),untils:r,population:t[5]|0}}function v(e){if(e){this._set(g(e))}}v.prototype={_set:function(e){this.name=e.name;this.abbrs=e.abbrs;this.untils=e.untils;this.offsets=e.offsets;this.population=e.population},_index:function(e){var t=+e,i=this.untils,n;for(n=0;n<i.length;n++){if(t<i[n]){return n}}},parse:function(e){var t=+e,i=this.offsets,n=this.untils,r=n.length-1,o,a,s,l;for(l=0;l<r;l++){o=i[l];a=i[l+1];s=i[l?l-1:l];if(o<a&&R.moveAmbiguousForward){o=a}else if(o>s&&R.moveInvalidForward){o=s}if(t<n[l]-o*6e4){return i[l]}}return i[r]},abbr:function(e){return this.abbrs[this._index(e)]},offset:function(e){O("zone.offset has been deprecated in favor of zone.utcOffset");return this.offsets[this._index(e)]},utcOffset:function(e){return this.offsets[this._index(e)]}};function m(e){var t=e.toTimeString();var i=t.match(/\([a-z ]+\)/i);if(i&&i[0]){i=i[0].match(/[A-Z]/g);i=i?i.join(""):undefined}else{i=t.match(/[A-Z]{3,5}/g);i=i?i[0]:undefined}if(i==="GMT"){i=undefined}this.at=+e;this.abbr=i;this.offset=e.getTimezoneOffset()}function y(e){this.zone=e;this.offsetScore=0;this.abbrScore=0}y.prototype.scoreOffsetAt=function(e){this.offsetScore+=Math.abs(this.zone.utcOffset(e.at)-e.offset);if(this.zone.abbr(e.at).replace(/[^A-Z]/g,"")!==e.abbr){this.abbrScore++}};function b(e,t){var i,n;while(n=((t.at-e.at)/12e4|0)*6e4){i=new m(new Date(e.at+n));if(i.offset===e.offset){e=i}else{t=i}}return e}function _(){var e=(new Date).getFullYear()-2,t=new m(new Date(e,0,1)),i=[t],n,r,o;for(o=1;o<48;o++){r=new m(new Date(e,o,1));if(r.offset!==t.offset){n=b(t,r);i.push(n);i.push(new m(new Date(n.at+6e4)))}t=r}for(o=0;o<4;o++){i.push(new m(new Date(e+o,0,1)));i.push(new m(new Date(e+o,6,1)))}return i}function w(e,t){if(e.offsetScore!==t.offsetScore){return e.offsetScore-t.offsetScore}if(e.abbrScore!==t.abbrScore){return e.abbrScore-t.abbrScore}return t.zone.population-e.zone.population}function C(e,t){var i,n;f(t);for(i=0;i<t.length;i++){n=t[i];l[n]=l[n]||{};l[n][e]=true}}function L(e){var t=e.length,i={},n=[],r,o,a;for(r=0;r<t;r++){a=l[e[r].offset]||{};for(o in a){if(a.hasOwnProperty(o)){i[o]=true}}}for(r in i){if(i.hasOwnProperty(r)){n.push(u[r])}}return n}function F(){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&e.length>3){var t=u[A(e)];if(t){return t}O("Moment Timezone found "+e+" from the Intl api, but did not have that data loaded.")}}catch(e){}var i=_(),n=i.length,r=L(i),o=[],a,s,l;for(s=0;s<r.length;s++){a=new y(x(r[s]),n);for(l=0;l<n;l++){a.scoreOffsetAt(i[l])}o.push(a)}o.sort(w);return o.length>0?o[0].zone.name:undefined}function G(e){if(!t||e){t=F()}return t}function A(e){return(e||"").toLowerCase().replace(/\//g,"_")}function E(e){var t,i,n,r;if(typeof e==="string"){e=[e]}for(t=0;t<e.length;t++){n=e[t].split("|");i=n[0];r=A(i);a[r]=e[t];u[r]=i;C(r,n[2].split(" "))}}function x(e,t){e=A(e);var i=a[e];var n;if(i instanceof v){return i}if(typeof i==="string"){i=new v(i);a[e]=i;return i}if(s[e]&&t!==x&&(n=x(s[e],x))){i=a[e]=new v;i._set(n);i.name=u[e];return i}return null}function $(){var e,t=[];for(e in u){if(u.hasOwnProperty(e)&&(a[e]||a[s[e]])&&u[e]){t.push(u[e])}}return t.sort()}function T(e){var t,i,n,r;if(typeof e==="string"){e=[e]}for(t=0;t<e.length;t++){i=e[t].split("|");n=A(i[0]);r=A(i[1]);s[n]=r;u[n]=i[0];s[r]=n;u[r]=i[1]}}function S(e){E(e.zones);T(e.links);R.dataVersion=e.version}function D(e){if(!D.didShowError){D.didShowError=true;O("moment.tz.zoneExists('"+e+"') has been deprecated in favor of !moment.tz.zone('"+e+"')")}return!!x(e)}function k(e){var t=e._f==="X"||e._f==="x";return!!(e._a&&e._tzm===undefined&&!t)}function O(e){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error(e)}}function R(e){var t=Array.prototype.slice.call(arguments,0,-1),i=arguments[arguments.length-1],n=x(i),r=o.utc.apply(null,t);if(n&&!o.isMoment(e)&&k(r)){r.add(n.parse(r),"minutes")}r.tz(i);return r}R.version=e;R.dataVersion="";R._zones=a;R._links=s;R._names=u;R.add=E;R.link=T;R.load=S;R.zone=x;R.zoneExists=D;R.guess=G;R.names=$;R.Zone=v;R.unpack=g;R.unpackBase60=d;R.needsOffset=k;R.moveInvalidForward=true;R.moveAmbiguousForward=false;var N=o.fn;o.tz=R;o.defaultZone=null;o.updateOffset=function(e,t){var i=o.defaultZone,n;if(e._z===undefined){if(i&&k(e)&&!e._isUTC){e._d=o.utc(e._a)._d;e.utc().add(i.parse(e),"minutes")}e._z=i}if(e._z){n=e._z.utcOffset(e);if(Math.abs(n)<16){n=n/60}if(e.utcOffset!==undefined){var r=e._z;e.utcOffset(-n,t);e._z=r}else{e.zone(n,t)}}};N.tz=function(e,t){if(e){if(typeof e!=="string"){throw new Error("Time zone name must be a string, got "+e+" ["+typeof e+"]")}this._z=x(e);if(this._z){o.updateOffset(this,t)}else{O("Moment Timezone has no data for "+e+". See http://momentjs.com/timezone/docs/#/data-loading/.")}return this}if(this._z){return this._z.name}};function I(e){return function(){if(this._z){return this._z.abbr(this)}return e.call(this)}}function P(e){return function(){this._z=null;return e.apply(this,arguments)}}function W(e){return function(){if(arguments.length>0)this._z=null;return e.apply(this,arguments)}}N.zoneName=I(N.zoneName);N.zoneAbbr=I(N.zoneAbbr);N.utc=P(N.utc);N.local=P(N.local);N.utcOffset=W(N.utcOffset);o.tz.setDefault=function(e){if(n<2||n===2&&r<9){O("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js "+o.version+".")}o.defaultZone=e?x(e):null;return o};var M=o.momentProperties;if(Object.prototype.toString.call(M)==="[object Array]"){M.push("_z");M.push("_a")}else if(M){M._z=null}S({version:"2019a",zones:["Africa/Abidjan|GMT|0|0||48e5","Africa/Nairobi|EAT|-30|0||47e5","Africa/Algiers|CET|-10|0||26e5","Africa/Lagos|WAT|-10|0||17e6","Africa/Maputo|CAT|-20|0||26e5","Africa/Cairo|EET EEST|-20 -30|01010|1M2m0 gL0 e10 mn0|15e6","Africa/Casablanca|+00 +01|0 -10|01010101010101010101010101010101|1LHC0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00|32e5","Europe/Paris|CET CEST|-10 -20|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|11e6","Africa/Johannesburg|SAST|-20|0||84e5","Africa/Khartoum|EAT CAT|-30 -20|01|1Usl0|51e5","Africa/Sao_Tome|GMT WAT|0 -10|010|1UQN0 2q00","Africa/Tripoli|EET|-20|0||11e5","Africa/Windhoek|CAT WAT|-20 -10|010101010|1LKo0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|32e4","America/Adak|HST HDT|a0 90|01010101010101010101010|1Lzo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|326","America/Anchorage|AKST AKDT|90 80|01010101010101010101010|1Lzn0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|30e4","America/Santo_Domingo|AST|40|0||29e5","America/Fortaleza|-03|30|0||34e5","America/Asuncion|-03 -04|30 40|01010101010101010101010|1LEP0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0|28e5","America/Panama|EST|50|0||15e5","America/Mexico_City|CST CDT|60 50|01010101010101010101010|1LKw0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0|20e6","America/Managua|CST|60|0||22e5","America/La_Paz|-04|40|0||19e5","America/Lima|-05|50|0||11e6","America/Denver|MST MDT|70 60|01010101010101010101010|1Lzl0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e5","America/Campo_Grande|-03 -04|30 40|01010101010101010101010|1LqP0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0 1HB0 FX0 1HB0 IL0 1HB0 FX0 1HB0 IL0 1EN0 FX0 1HB0|77e4","America/Cancun|CST CDT EST|60 50 50|0102|1LKw0 1lb0 Dd0|63e4","America/Caracas|-0430 -04|4u 40|01|1QMT0|29e5","America/Chicago|CST CDT|60 50|01010101010101010101010|1Lzk0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|92e5","America/Chihuahua|MST MDT|70 60|01010101010101010101010|1LKx0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0|81e4","America/Phoenix|MST|70|0||42e5","America/Los_Angeles|PST PDT|80 70|01010101010101010101010|1Lzm0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6","America/New_York|EST EDT|50 40|01010101010101010101010|1Lzj0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e6","America/Fort_Nelson|PST PDT MST|80 70 70|0102|1Lzm0 1zb0 Op0|39e2","America/Halifax|AST ADT|40 30|01010101010101010101010|1Lzi0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|39e4","America/Godthab|-03 -02|30 20|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e3","America/Grand_Turk|EST EDT AST|50 40 40|0101210101010101010|1Lzj0 1zb0 Op0 1zb0 5Ip0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e2","America/Havana|CST CDT|50 40|01010101010101010101010|1Lzh0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0|21e5","America/Metlakatla|PST AKST AKDT|80 90 80|012121201212121212121|1PAa0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 uM0 jB0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2","America/Miquelon|-03 -02|30 20|01010101010101010101010|1Lzh0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|61e2","America/Montevideo|-02 -03|20 30|0101|1Lzg0 1o10 11z0|17e5","America/Noronha|-02|20|0||30e2","America/Port-au-Prince|EST EDT|50 40|010101010101010101010|1Lzj0 1zb0 Op0 1zb0 3iN0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5","Antarctica/Palmer|-03 -04|30 40|01010|1LSP0 Rd0 46n0 Ap0|40","America/Santiago|-03 -04|30 40|010101010101010101010|1LSP0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0|62e5","America/Sao_Paulo|-02 -03|20 30|01010101010101010101010|1LqO0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0 1HB0 FX0 1HB0 IL0 1HB0 FX0 1HB0 IL0 1EN0 FX0 1HB0|20e6","Atlantic/Azores|-01 +00|10 0|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|25e4","America/St_Johns|NST NDT|3u 2u|01010101010101010101010|1Lzhu 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|11e4","Antarctica/Casey|+08 +11|-80 -b0|010|1RWg0 3m10|10","Asia/Bangkok|+07|-70|0||15e6","Pacific/Port_Moresby|+10|-a0|0||25e4","Pacific/Guadalcanal|+11|-b0|0||11e4","Asia/Tashkent|+05|-50|0||23e5","Pacific/Auckland|NZDT NZST|-d0 -c0|01010101010101010101010|1LKe0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00|14e5","Asia/Baghdad|+03|-30|0||66e5","Antarctica/Troll|+00 +02|0 -20|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|40","Asia/Dhaka|+06|-60|0||16e6","Asia/Amman|EET EEST|-20 -30|01010101010101010101010|1LGK0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00|25e5","Asia/Kamchatka|+12|-c0|0||18e4","Asia/Baku|+04 +05|-40 -50|01010|1LHA0 1o00 11A0 1o00|27e5","Asia/Barnaul|+07 +06|-70 -60|010|1N7v0 3rd0","Asia/Beirut|EET EEST|-20 -30|01010101010101010101010|1LHy0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|22e5","Asia/Kuala_Lumpur|+08|-80|0||71e5","Asia/Kolkata|IST|-5u|0||15e6","Asia/Chita|+10 +08 +09|-a0 -80 -90|012|1N7s0 3re0|33e4","Asia/Ulaanbaatar|+08 +09|-80 -90|01010|1O8G0 1cJ0 1cP0 1cJ0|12e5","Asia/Shanghai|CST|-80|0||23e6","Asia/Colombo|+0530|-5u|0||22e5","Asia/Damascus|EET EEST|-20 -30|01010101010101010101010|1LGK0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0|26e5","Asia/Dili|+09|-90|0||19e4","Asia/Dubai|+04|-40|0||39e5","Asia/Famagusta|EET EEST +03|-20 -30 -30|0101012010101010101010|1LHB0 1o00 11A0 1o00 11A0 15U0 2Ks0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00","Asia/Gaza|EET EEST|-20 -30|01010101010101010101010|1LGK0 1nX0 1210 1nz0 1220 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|18e5","Asia/Hong_Kong|HKT|-80|0||73e5","Asia/Hovd|+07 +08|-70 -80|01010|1O8H0 1cJ0 1cP0 1cJ0|81e3","Asia/Irkutsk|+09 +08|-90 -80|01|1N7t0|60e4","Europe/Istanbul|EET EEST +03|-20 -30 -30|0101012|1LI10 1nA0 11A0 1tA0 U00 15w0|13e6","Asia/Jakarta|WIB|-70|0||31e6","Asia/Jayapura|WIT|-90|0||26e4","Asia/Jerusalem|IST IDT|-20 -30|01010101010101010101010|1LGM0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0|81e4","Asia/Kabul|+0430|-4u|0||46e5","Asia/Karachi|PKT|-50|0||24e6","Asia/Kathmandu|+0545|-5J|0||12e5","Asia/Yakutsk|+10 +09|-a0 -90|01|1N7s0|28e4","Asia/Krasnoyarsk|+08 +07|-80 -70|01|1N7u0|10e5","Asia/Magadan|+12 +10 +11|-c0 -a0 -b0|012|1N7q0 3Cq0|95e3","Asia/Makassar|WITA|-80|0||15e5","Asia/Manila|PST|-80|0||24e6","Europe/Athens|EET EEST|-20 -30|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|35e5","Asia/Novosibirsk|+07 +06|-70 -60|010|1N7v0 4eN0|15e5","Asia/Omsk|+07 +06|-70 -60|01|1N7v0|12e5","Asia/Pyongyang|KST KST|-90 -8u|010|1P4D0 6BA0|29e5","Asia/Qyzylorda|+06 +05|-60 -50|01|1Xei0|73e4","Asia/Rangoon|+0630|-6u|0||48e5","Asia/Sakhalin|+11 +10|-b0 -a0|010|1N7r0 3rd0|58e4","Asia/Seoul|KST|-90|0||23e6","Asia/Srednekolymsk|+12 +11|-c0 -b0|01|1N7q0|35e2","Asia/Tehran|+0330 +0430|-3u -4u|01010101010101010101010|1LEku 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0|14e6","Asia/Tokyo|JST|-90|0||38e6","Asia/Tomsk|+07 +06|-70 -60|010|1N7v0 3Qp0|10e5","Asia/Vladivostok|+11 +10|-b0 -a0|01|1N7r0|60e4","Asia/Yekaterinburg|+06 +05|-60 -50|01|1N7w0|14e5","Europe/Lisbon|WET WEST|0 -10|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|27e5","Atlantic/Cape_Verde|-01|10|0||50e4","Australia/Sydney|AEDT AEST|-b0 -a0|01010101010101010101010|1LKg0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0|40e5","Australia/Adelaide|ACDT ACST|-au -9u|01010101010101010101010|1LKgu 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0|11e5","Australia/Brisbane|AEST|-a0|0||20e5","Australia/Darwin|ACST|-9u|0||12e4","Australia/Eucla|+0845|-8J|0||368","Australia/Lord_Howe|+11 +1030|-b0 -au|01010101010101010101010|1LKf0 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1fzu 1cMu|347","Australia/Perth|AWST|-80|0||18e5","Pacific/Easter|-05 -06|50 60|010101010101010101010|1LSP0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0|30e2","Europe/Dublin|GMT IST|0 -10|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5","Etc/GMT-1|+01|-10|0|","Pacific/Fakaofo|+13|-d0|0||483","Pacific/Kiritimati|+14|-e0|0||51e2","Etc/GMT-2|+02|-20|0|","Pacific/Tahiti|-10|a0|0||18e4","Pacific/Niue|-11|b0|0||12e2","Etc/GMT+12|-12|c0|0|","Pacific/Galapagos|-06|60|0||25e3","Etc/GMT+7|-07|70|0|","Pacific/Pitcairn|-08|80|0||56","Pacific/Gambier|-09|90|0||125","Etc/UTC|UTC|0|0|","Europe/Ulyanovsk|+04 +03|-40 -30|010|1N7y0 3rd0|13e5","Europe/London|GMT BST|0 -10|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|10e6","Europe/Chisinau|EET EEST|-20 -30|01010101010101010101010|1LHA0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|67e4","Europe/Kaliningrad|+03 EET|-30 -20|01|1N7z0|44e4","Europe/Kirov|+04 +03|-40 -30|01|1N7y0|48e4","Europe/Moscow|MSK MSK|-40 -30|01|1N7y0|16e6","Europe/Saratov|+04 +03|-40 -30|010|1N7y0 5810","Europe/Simferopol|EET MSK MSK|-20 -40 -30|012|1LHA0 1nW0|33e4","Europe/Volgograd|+04 +03|-40 -30|010|1N7y0 9Jd0|10e5","Pacific/Honolulu|HST|a0|0||37e4","MET|MET MEST|-10 -20|01010101010101010101010|1LHB0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00","Pacific/Chatham|+1345 +1245|-dJ -cJ|01010101010101010101010|1LKe0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00|600","Pacific/Apia|+14 +13|-e0 -d0|01010101010101010101010|1LKe0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00|37e3","Pacific/Bougainville|+10 +11|-a0 -b0|01|1NwE0|18e4","Pacific/Fiji|+13 +12|-d0 -c0|01010101010101010101010|1Lfp0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 s00 1VA0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 s00 1VA0|88e4","Pacific/Guam|ChST|-a0|0||17e4","Pacific/Marquesas|-0930|9u|0||86e2","Pacific/Pago_Pago|SST|b0|0||37e2","Pacific/Norfolk|+1130 +11|-bu -b0|01|1PoCu|25e4","Pacific/Tongatapu|+13 +14|-d0 -e0|010|1S4d0 s00|75e3"],links:["Africa/Abidjan|Africa/Accra","Africa/Abidjan|Africa/Bamako","Africa/Abidjan|Africa/Banjul","Africa/Abidjan|Africa/Bissau","Africa/Abidjan|Africa/Conakry","Africa/Abidjan|Africa/Dakar","Africa/Abidjan|Africa/Freetown","Africa/Abidjan|Africa/Lome","Africa/Abidjan|Africa/Monrovia","Africa/Abidjan|Africa/Nouakchott","Africa/Abidjan|Africa/Ouagadougou","Africa/Abidjan|Africa/Timbuktu","Africa/Abidjan|America/Danmarkshavn","Africa/Abidjan|Atlantic/Reykjavik","Africa/Abidjan|Atlantic/St_Helena","Africa/Abidjan|Etc/GMT","Africa/Abidjan|Etc/GMT+0","Africa/Abidjan|Etc/GMT-0","Africa/Abidjan|Etc/GMT0","Africa/Abidjan|Etc/Greenwich","Africa/Abidjan|GMT","Africa/Abidjan|GMT+0","Africa/Abidjan|GMT-0","Africa/Abidjan|GMT0","Africa/Abidjan|Greenwich","Africa/Abidjan|Iceland","Africa/Algiers|Africa/Tunis","Africa/Cairo|Egypt","Africa/Casablanca|Africa/El_Aaiun","Africa/Johannesburg|Africa/Maseru","Africa/Johannesburg|Africa/Mbabane","Africa/Lagos|Africa/Bangui","Africa/Lagos|Africa/Brazzaville","Africa/Lagos|Africa/Douala","Africa/Lagos|Africa/Kinshasa","Africa/Lagos|Africa/Libreville","Africa/Lagos|Africa/Luanda","Africa/Lagos|Africa/Malabo","Africa/Lagos|Africa/Ndjamena","Africa/Lagos|Africa/Niamey","Africa/Lagos|Africa/Porto-Novo","Africa/Maputo|Africa/Blantyre","Africa/Maputo|Africa/Bujumbura","Africa/Maputo|Africa/Gaborone","Africa/Maputo|Africa/Harare","Africa/Maputo|Africa/Kigali","Africa/Maputo|Africa/Lubumbashi","Africa/Maputo|Africa/Lusaka","Africa/Nairobi|Africa/Addis_Ababa","Africa/Nairobi|Africa/Asmara","Africa/Nairobi|Africa/Asmera","Africa/Nairobi|Africa/Dar_es_Salaam","Africa/Nairobi|Africa/Djibouti","Africa/Nairobi|Africa/Juba","Africa/Nairobi|Africa/Kampala","Africa/Nairobi|Africa/Mogadishu","Africa/Nairobi|Indian/Antananarivo","Africa/Nairobi|Indian/Comoro","Africa/Nairobi|Indian/Mayotte","Africa/Tripoli|Libya","America/Adak|America/Atka","America/Adak|US/Aleutian","America/Anchorage|America/Juneau","America/Anchorage|America/Nome","America/Anchorage|America/Sitka","America/Anchorage|America/Yakutat","America/Anchorage|US/Alaska","America/Campo_Grande|America/Cuiaba","America/Chicago|America/Indiana/Knox","America/Chicago|America/Indiana/Tell_City","America/Chicago|America/Knox_IN","America/Chicago|America/Matamoros","America/Chicago|America/Menominee","America/Chicago|America/North_Dakota/Beulah","America/Chicago|America/North_Dakota/Center","America/Chicago|America/North_Dakota/New_Salem","America/Chicago|America/Rainy_River","America/Chicago|America/Rankin_Inlet","America/Chicago|America/Resolute","America/Chicago|America/Winnipeg","America/Chicago|CST6CDT","America/Chicago|Canada/Central","America/Chicago|US/Central","America/Chicago|US/Indiana-Starke","America/Chihuahua|America/Mazatlan","America/Chihuahua|Mexico/BajaSur","America/Denver|America/Boise","America/Denver|America/Cambridge_Bay","America/Denver|America/Edmonton","America/Denver|America/Inuvik","America/Denver|America/Ojinaga","America/Denver|America/Shiprock","America/Denver|America/Yellowknife","America/Denver|Canada/Mountain","America/Denver|MST7MDT","America/Denver|Navajo","America/Denver|US/Mountain","America/Fortaleza|America/Araguaina","America/Fortaleza|America/Argentina/Buenos_Aires","America/Fortaleza|America/Argentina/Catamarca","America/Fortaleza|America/Argentina/ComodRivadavia","America/Fortaleza|America/Argentina/Cordoba","America/Fortaleza|America/Argentina/Jujuy","America/Fortaleza|America/Argentina/La_Rioja","America/Fortaleza|America/Argentina/Mendoza","America/Fortaleza|America/Argentina/Rio_Gallegos","America/Fortaleza|America/Argentina/Salta","America/Fortaleza|America/Argentina/San_Juan","America/Fortaleza|America/Argentina/San_Luis","America/Fortaleza|America/Argentina/Tucuman","America/Fortaleza|America/Argentina/Ushuaia","America/Fortaleza|America/Bahia","America/Fortaleza|America/Belem","America/Fortaleza|America/Buenos_Aires","America/Fortaleza|America/Catamarca","America/Fortaleza|America/Cayenne","America/Fortaleza|America/Cordoba","America/Fortaleza|America/Jujuy","America/Fortaleza|America/Maceio","America/Fortaleza|America/Mendoza","America/Fortaleza|America/Paramaribo","America/Fortaleza|America/Recife","America/Fortaleza|America/Rosario","America/Fortaleza|America/Santarem","America/Fortaleza|Antarctica/Rothera","America/Fortaleza|Atlantic/Stanley","America/Fortaleza|Etc/GMT+3","America/Halifax|America/Glace_Bay","America/Halifax|America/Goose_Bay","America/Halifax|America/Moncton","America/Halifax|America/Thule","America/Halifax|Atlantic/Bermuda","America/Halifax|Canada/Atlantic","America/Havana|Cuba","America/La_Paz|America/Boa_Vista","America/La_Paz|America/Guyana","America/La_Paz|America/Manaus","America/La_Paz|America/Porto_Velho","America/La_Paz|Brazil/West","America/La_Paz|Etc/GMT+4","America/Lima|America/Bogota","America/Lima|America/Eirunepe","America/Lima|America/Guayaquil","America/Lima|America/Porto_Acre","America/Lima|America/Rio_Branco","America/Lima|Brazil/Acre","America/Lima|Etc/GMT+5","America/Los_Angeles|America/Dawson","America/Los_Angeles|America/Ensenada","America/Los_Angeles|America/Santa_Isabel","America/Los_Angeles|America/Tijuana","America/Los_Angeles|America/Vancouver","America/Los_Angeles|America/Whitehorse","America/Los_Angeles|Canada/Pacific","America/Los_Angeles|Canada/Yukon","America/Los_Angeles|Mexico/BajaNorte","America/Los_Angeles|PST8PDT","America/Los_Angeles|US/Pacific","America/Los_Angeles|US/Pacific-New","America/Managua|America/Belize","America/Managua|America/Costa_Rica","America/Managua|America/El_Salvador","America/Managua|America/Guatemala","America/Managua|America/Regina","America/Managua|America/Swift_Current","America/Managua|America/Tegucigalpa","America/Managua|Canada/Saskatchewan","America/Mexico_City|America/Bahia_Banderas","America/Mexico_City|America/Merida","America/Mexico_City|America/Monterrey","America/Mexico_City|Mexico/General","America/New_York|America/Detroit","America/New_York|America/Fort_Wayne","America/New_York|America/Indiana/Indianapolis","America/New_York|America/Indiana/Marengo","America/New_York|America/Indiana/Petersburg","America/New_York|America/Indiana/Vevay","America/New_York|America/Indiana/Vincennes","America/New_York|America/Indiana/Winamac","America/New_York|America/Indianapolis","America/New_York|America/Iqaluit","America/New_York|America/Kentucky/Louisville","America/New_York|America/Kentucky/Monticello","America/New_York|America/Louisville","America/New_York|America/Montreal","America/New_York|America/Nassau","America/New_York|America/Nipigon","America/New_York|America/Pangnirtung","America/New_York|America/Thunder_Bay","America/New_York|America/Toronto","America/New_York|Canada/Eastern","America/New_York|EST5EDT","America/New_York|US/East-Indiana","America/New_York|US/Eastern","America/New_York|US/Michigan","America/Noronha|Atlantic/South_Georgia","America/Noronha|Brazil/DeNoronha","America/Noronha|Etc/GMT+2","America/Panama|America/Atikokan","America/Panama|America/Cayman","America/Panama|America/Coral_Harbour","America/Panama|America/Jamaica","America/Panama|EST","America/Panama|Jamaica","America/Phoenix|America/Creston","America/Phoenix|America/Dawson_Creek","America/Phoenix|America/Hermosillo","America/Phoenix|MST","America/Phoenix|US/Arizona","America/Santiago|Chile/Continental","America/Santo_Domingo|America/Anguilla","America/Santo_Domingo|America/Antigua","America/Santo_Domingo|America/Aruba","America/Santo_Domingo|America/Barbados","America/Santo_Domingo|America/Blanc-Sablon","America/Santo_Domingo|America/Curacao","America/Santo_Domingo|America/Dominica","America/Santo_Domingo|America/Grenada","America/Santo_Domingo|America/Guadeloupe","America/Santo_Domingo|America/Kralendijk","America/Santo_Domingo|America/Lower_Princes","America/Santo_Domingo|America/Marigot","America/Santo_Domingo|America/Martinique","America/Santo_Domingo|America/Montserrat","America/Santo_Domingo|America/Port_of_Spain","America/Santo_Domingo|America/Puerto_Rico","America/Santo_Domingo|America/St_Barthelemy","America/Santo_Domingo|America/St_Kitts","America/Santo_Domingo|America/St_Lucia","America/Santo_Domingo|America/St_Thomas","America/Santo_Domingo|America/St_Vincent","America/Santo_Domingo|America/Tortola","America/Santo_Domingo|America/Virgin","America/Sao_Paulo|Brazil/East","America/St_Johns|Canada/Newfoundland","Antarctica/Palmer|America/Punta_Arenas","Asia/Baghdad|Antarctica/Syowa","Asia/Baghdad|Asia/Aden","Asia/Baghdad|Asia/Bahrain","Asia/Baghdad|Asia/Kuwait","Asia/Baghdad|Asia/Qatar","Asia/Baghdad|Asia/Riyadh","Asia/Baghdad|Etc/GMT-3","Asia/Baghdad|Europe/Minsk","Asia/Bangkok|Antarctica/Davis","Asia/Bangkok|Asia/Ho_Chi_Minh","Asia/Bangkok|Asia/Novokuznetsk","Asia/Bangkok|Asia/Phnom_Penh","Asia/Bangkok|Asia/Saigon","Asia/Bangkok|Asia/Vientiane","Asia/Bangkok|Etc/GMT-7","Asia/Bangkok|Indian/Christmas","Asia/Dhaka|Antarctica/Vostok","Asia/Dhaka|Asia/Almaty","Asia/Dhaka|Asia/Bishkek","Asia/Dhaka|Asia/Dacca","Asia/Dhaka|Asia/Kashgar","Asia/Dhaka|Asia/Qostanay","Asia/Dhaka|Asia/Thimbu","Asia/Dhaka|Asia/Thimphu","Asia/Dhaka|Asia/Urumqi","Asia/Dhaka|Etc/GMT-6","Asia/Dhaka|Indian/Chagos","Asia/Dili|Etc/GMT-9","Asia/Dili|Pacific/Palau","Asia/Dubai|Asia/Muscat","Asia/Dubai|Asia/Tbilisi","Asia/Dubai|Asia/Yerevan","Asia/Dubai|Etc/GMT-4","Asia/Dubai|Europe/Samara","Asia/Dubai|Indian/Mahe","Asia/Dubai|Indian/Mauritius","Asia/Dubai|Indian/Reunion","Asia/Gaza|Asia/Hebron","Asia/Hong_Kong|Hongkong","Asia/Jakarta|Asia/Pontianak","Asia/Jerusalem|Asia/Tel_Aviv","Asia/Jerusalem|Israel","Asia/Kamchatka|Asia/Anadyr","Asia/Kamchatka|Etc/GMT-12","Asia/Kamchatka|Kwajalein","Asia/Kamchatka|Pacific/Funafuti","Asia/Kamchatka|Pacific/Kwajalein","Asia/Kamchatka|Pacific/Majuro","Asia/Kamchatka|Pacific/Nauru","Asia/Kamchatka|Pacific/Tarawa","Asia/Kamchatka|Pacific/Wake","Asia/Kamchatka|Pacific/Wallis","Asia/Kathmandu|Asia/Katmandu","Asia/Kolkata|Asia/Calcutta","Asia/Kuala_Lumpur|Asia/Brunei","Asia/Kuala_Lumpur|Asia/Kuching","Asia/Kuala_Lumpur|Asia/Singapore","Asia/Kuala_Lumpur|Etc/GMT-8","Asia/Kuala_Lumpur|Singapore","Asia/Makassar|Asia/Ujung_Pandang","Asia/Rangoon|Asia/Yangon","Asia/Rangoon|Indian/Cocos","Asia/Seoul|ROK","Asia/Shanghai|Asia/Chongqing","Asia/Shanghai|Asia/Chungking","Asia/Shanghai|Asia/Harbin","Asia/Shanghai|Asia/Macao","Asia/Shanghai|Asia/Macau","Asia/Shanghai|Asia/Taipei","Asia/Shanghai|PRC","Asia/Shanghai|ROC","Asia/Tashkent|Antarctica/Mawson","Asia/Tashkent|Asia/Aqtau","Asia/Tashkent|Asia/Aqtobe","Asia/Tashkent|Asia/Ashgabat","Asia/Tashkent|Asia/Ashkhabad","Asia/Tashkent|Asia/Atyrau","Asia/Tashkent|Asia/Dushanbe","Asia/Tashkent|Asia/Oral","Asia/Tashkent|Asia/Samarkand","Asia/Tashkent|Etc/GMT-5","Asia/Tashkent|Indian/Kerguelen","Asia/Tashkent|Indian/Maldives","Asia/Tehran|Iran","Asia/Tokyo|Japan","Asia/Ulaanbaatar|Asia/Choibalsan","Asia/Ulaanbaatar|Asia/Ulan_Bator","Asia/Vladivostok|Asia/Ust-Nera","Asia/Yakutsk|Asia/Khandyga","Atlantic/Azores|America/Scoresbysund","Atlantic/Cape_Verde|Etc/GMT+1","Australia/Adelaide|Australia/Broken_Hill","Australia/Adelaide|Australia/South","Australia/Adelaide|Australia/Yancowinna","Australia/Brisbane|Australia/Lindeman","Australia/Brisbane|Australia/Queensland","Australia/Darwin|Australia/North","Australia/Lord_Howe|Australia/LHI","Australia/Perth|Australia/West","Australia/Sydney|Australia/ACT","Australia/Sydney|Australia/Canberra","Australia/Sydney|Australia/Currie","Australia/Sydney|Australia/Hobart","Australia/Sydney|Australia/Melbourne","Australia/Sydney|Australia/NSW","Australia/Sydney|Australia/Tasmania","Australia/Sydney|Australia/Victoria","Etc/UTC|Etc/UCT","Etc/UTC|Etc/Universal","Etc/UTC|Etc/Zulu","Etc/UTC|UCT","Etc/UTC|UTC","Etc/UTC|Universal","Etc/UTC|Zulu","Europe/Athens|Asia/Nicosia","Europe/Athens|EET","Europe/Athens|Europe/Bucharest","Europe/Athens|Europe/Helsinki","Europe/Athens|Europe/Kiev","Europe/Athens|Europe/Mariehamn","Europe/Athens|Europe/Nicosia","Europe/Athens|Europe/Riga","Europe/Athens|Europe/Sofia","Europe/Athens|Europe/Tallinn","Europe/Athens|Europe/Uzhgorod","Europe/Athens|Europe/Vilnius","Europe/Athens|Europe/Zaporozhye","Europe/Chisinau|Europe/Tiraspol","Europe/Dublin|Eire","Europe/Istanbul|Asia/Istanbul","Europe/Istanbul|Turkey","Europe/Lisbon|Atlantic/Canary","Europe/Lisbon|Atlantic/Faeroe","Europe/Lisbon|Atlantic/Faroe","Europe/Lisbon|Atlantic/Madeira","Europe/Lisbon|Portugal","Europe/Lisbon|WET","Europe/London|Europe/Belfast","Europe/London|Europe/Guernsey","Europe/London|Europe/Isle_of_Man","Europe/London|Europe/Jersey","Europe/London|GB","Europe/London|GB-Eire","Europe/Moscow|W-SU","Europe/Paris|Africa/Ceuta","Europe/Paris|Arctic/Longyearbyen","Europe/Paris|Atlantic/Jan_Mayen","Europe/Paris|CET","Europe/Paris|Europe/Amsterdam","Europe/Paris|Europe/Andorra","Europe/Paris|Europe/Belgrade","Europe/Paris|Europe/Berlin","Europe/Paris|Europe/Bratislava","Europe/Paris|Europe/Brussels","Europe/Paris|Europe/Budapest","Europe/Paris|Europe/Busingen","Europe/Paris|Europe/Copenhagen","Europe/Paris|Europe/Gibraltar","Europe/Paris|Europe/Ljubljana","Europe/Paris|Europe/Luxembourg","Europe/Paris|Europe/Madrid","Europe/Paris|Europe/Malta","Europe/Paris|Europe/Monaco","Europe/Paris|Europe/Oslo","Europe/Paris|Europe/Podgorica","Europe/Paris|Europe/Prague","Europe/Paris|Europe/Rome","Europe/Paris|Europe/San_Marino","Europe/Paris|Europe/Sarajevo","Europe/Paris|Europe/Skopje","Europe/Paris|Europe/Stockholm","Europe/Paris|Europe/Tirane","Europe/Paris|Europe/Vaduz","Europe/Paris|Europe/Vatican","Europe/Paris|Europe/Vienna","Europe/Paris|Europe/Warsaw","Europe/Paris|Europe/Zagreb","Europe/Paris|Europe/Zurich","Europe/Paris|Poland","Europe/Ulyanovsk|Europe/Astrakhan","Pacific/Auckland|Antarctica/McMurdo","Pacific/Auckland|Antarctica/South_Pole","Pacific/Auckland|NZ","Pacific/Chatham|NZ-CHAT","Pacific/Easter|Chile/EasterIsland","Pacific/Fakaofo|Etc/GMT-13","Pacific/Fakaofo|Pacific/Enderbury","Pacific/Galapagos|Etc/GMT+6","Pacific/Gambier|Etc/GMT+9","Pacific/Guadalcanal|Antarctica/Macquarie","Pacific/Guadalcanal|Etc/GMT-11","Pacific/Guadalcanal|Pacific/Efate","Pacific/Guadalcanal|Pacific/Kosrae","Pacific/Guadalcanal|Pacific/Noumea","Pacific/Guadalcanal|Pacific/Pohnpei","Pacific/Guadalcanal|Pacific/Ponape","Pacific/Guam|Pacific/Saipan","Pacific/Honolulu|HST","Pacific/Honolulu|Pacific/Johnston","Pacific/Honolulu|US/Hawaii","Pacific/Kiritimati|Etc/GMT-14","Pacific/Niue|Etc/GMT+11","Pacific/Pago_Pago|Pacific/Midway","Pacific/Pago_Pago|Pacific/Samoa","Pacific/Pago_Pago|US/Samoa","Pacific/Pitcairn|Etc/GMT+8","Pacific/Port_Moresby|Antarctica/DumontDUrville","Pacific/Port_Moresby|Etc/GMT-10","Pacific/Port_Moresby|Pacific/Chuuk","Pacific/Port_Moresby|Pacific/Truk","Pacific/Port_Moresby|Pacific/Yap","Pacific/Tahiti|Etc/GMT+10","Pacific/Tahiti|Pacific/Rarotonga"]});return o});(function(e){if(typeof define=="function"&&define.amd)define("picker",["jquery"],e);else if(typeof exports=="object")module.exports=e(require("jquery"));else this.Picker=e(jQuery)})(function(b){var r=b(window);var _=b(document);var w=b(document.documentElement);var C=document.documentElement.style.transition!=null;function A(n,e,t,i){if(!n)return A;var r=false,s={id:n.id||"P"+Math.abs(~~(Math.random()*new Date))},l=t?b.extend(true,{},t.defaults,i):i||{},o=b.extend({},A.klasses(),l.klass),u=b(n),a=function(){return this.start()},c=a.prototype={constructor:a,$node:u,start:function(){if(s&&s.start)return c;s.methods={};s.start=true;s.open=false;s.type=n.type;n.autofocus=n==S();n.readOnly=!l.editable;n.id=n.id||s.id;if(n.type!="text"){n.type="text"}c.component=new t(c,l);c.$root=b('<div class="'+o.picker+'" id="'+n.id+'_root" />');p();c.$holder=b(d()).appendTo(c.$root);h();if(l.formatSubmit){g()}f();if(l.containerHidden)b(l.containerHidden).append(c._hidden);else u.after(c._hidden);if(l.container)b(l.container).append(c.$root);else u.after(c.$root);c.on({start:c.component.onStart,render:c.component.onRender,stop:c.component.onStop,open:c.component.onOpen,close:c.component.onClose,set:c.component.onSet}).on({start:l.onStart,render:l.onRender,stop:l.onStop,open:l.onOpen,close:l.onClose,set:l.onSet});r=E(c.$holder[0]);if(n.autofocus){c.open()}return c.trigger("start").trigger("render")},render:function(e){if(e){c.$holder=b(d());h();c.$root.html(c.$holder)}else c.$root.find("."+o.box).html(c.component.nodes(s.open));return c.trigger("render")},stop:function(){if(!s.start)return c;c.close();if(c._hidden){c._hidden.parentNode.removeChild(c._hidden)}c.$root.remove();u.removeClass(o.input).removeData(e);setTimeout(function(){u.off("."+s.id)},0);n.type=s.type;n.readOnly=false;c.trigger("stop");s.methods={};s.start=false;return c},open:function(e){if(s.open)return c;u.addClass(o.active);T(n,"expanded",true);setTimeout(function(){c.$root.addClass(o.opened);T(c.$root[0],"hidden",false)},0);if(e!==false){s.open=true;if(r){w.css("overflow","hidden").css("padding-right","+="+x())}v();_.on("click."+s.id+" focusin."+s.id,function(e){var t=e.target;if(t!=n&&t!=document&&e.which!=3){c.close(t===c.$holder[0])}}).on("keydown."+s.id,function(e){var t=e.keyCode,i=c.component.key[t],n=e.target;if(t==27){c.close(true)}else if(n==c.$holder[0]&&(i||t==13)){e.preventDefault();if(i){A._.trigger(c.component.key.go,c,[A._.trigger(i)])}else if(!c.$root.find("."+o.highlighted).hasClass(o.disabled)){c.set("select",c.component.item.highlight);if(l.closeOnSelect){c.close(true)}}}else if(b.contains(c.$root[0],n)&&t==13){e.preventDefault();n.click()}})}return c.trigger("open")},close:function(e){if(e){if(l.editable){n.focus()}else{c.$holder.off("focus.toOpen").focus();setTimeout(function(){c.$holder.on("focus.toOpen",m)},0)}}u.removeClass(o.active);T(n,"expanded",false);setTimeout(function(){c.$root.removeClass(o.opened+" "+o.focused);T(c.$root[0],"hidden",true)},0);if(!s.open)return c;s.open=false;if(r){w.css("overflow","").css("padding-right","-="+x())}_.off("."+s.id);return c.trigger("close")},clear:function(e){return c.set("clear",null,e)},set:function(e,t,i){var n,r,o=b.isPlainObject(e),a=o?e:{};i=o&&b.isPlainObject(t)?t:i||{};if(e){if(!o){a[e]=t}for(n in a){r=a[n];if(n in c.component.item){if(r===undefined)r=null;c.component.set(n,r,i)}if(n=="select"||n=="clear"){u.val(n=="clear"?"":c.get(n,l.format)).trigger("change")}}c.render()}return i.muted?c:c.trigger("set",a)},get:function(e,t){e=e||"value";if(s[e]!=null){return s[e]}if(e=="valueSubmit"){if(c._hidden){return c._hidden.value}e="value"}if(e=="value"){return n.value}if(e in c.component.item){if(typeof t=="string"){var i=c.component.get(e);return i?A._.trigger(c.component.formats.toString,c.component,[t,i]):""}return c.component.get(e)}},on:function(e,t,i){var n,r,o=b.isPlainObject(e),a=o?e:{};if(e){if(!o){a[e]=t}for(n in a){r=a[n];if(i){n="_"+n}s.methods[n]=s.methods[n]||[];s.methods[n].push(r)}}return c},off:function(){var e,t,i=arguments;for(e=0,namesCount=i.length;e<namesCount;e+=1){t=i[e];if(t in s.methods){delete s.methods[t]}}return c},trigger:function(e,i){var t=function(e){var t=s.methods[e];if(t){t.map(function(e){A._.trigger(e,c,[i])})}};t("_"+e);t(e);return c}};function d(){return A._.node("div",A._.node("div",A._.node("div",A._.node("div",c.component.nodes(s.open),o.box),o.wrap),o.frame),o.holder,'tabindex="-1"')}function f(){u.data(e,c).addClass(o.input).val(u.data("value")?c.get("select",l.format):n.value);if(!l.editable){u.on("focus."+s.id+" click."+s.id,function(e){e.preventDefault();c.open()}).on("keydown."+s.id,y)}T(n,{haspopup:true,expanded:false,readonly:false,owns:n.id+"_root"})}function p(){T(c.$root[0],"hidden",true)}function h(){c.$holder.on({keydown:y,"focus.toOpen":m,blur:function(){u.removeClass(o.target)},focusin:function(e){c.$root.removeClass(o.focused);e.stopPropagation()},"mousedown click":function(e){var t=e.target;if(t!=c.$holder[0]){e.stopPropagation();if(e.type=="mousedown"&&!b(t).is("input, select, textarea, button, option")){e.preventDefault();c.$holder[0].focus()}}}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var e=b(this),t=e.data(),i=e.hasClass(o.navDisabled)||e.hasClass(o.disabled),n=S();n=n&&(n.type||n.href);if(i||n&&!b.contains(c.$root[0],n)){c.$holder[0].focus()}if(!i&&t.nav){c.set("highlight",c.component.item.highlight,{nav:t.nav})}else if(!i&&"pick"in t){c.set("select",t.pick);if(l.closeOnSelect){c.close(true)}}else if(t.clear){c.clear();if(l.closeOnClear){c.close(true)}}else if(t.close){c.close(true)}})}function g(){var e;if(l.hiddenName===true){e=n.name;n.name=""}else{e=[typeof l.hiddenPrefix=="string"?l.hiddenPrefix:"",typeof l.hiddenSuffix=="string"?l.hiddenSuffix:"_submit"];e=e[0]+n.name+e[1]}c._hidden=b("<input "+"type=hidden "+'name="'+e+'"'+(u.data("value")||n.value?' value="'+c.get("select",l.formatSubmit)+'"':"")+">")[0];u.on("change."+s.id,function(){c._hidden.value=n.value?c.get("select",l.formatSubmit):""})}function v(){if(r&&C){c.$holder.find("."+o.frame).one("transitionend",function(){c.$holder[0].focus()})}else{c.$holder[0].focus()}}function m(e){e.stopPropagation();u.addClass(o.target);c.$root.addClass(o.focused);c.open()}function y(e){var t=e.keyCode,i=/^(8|46)$/.test(t);if(t==27){c.close(true);return false}if(t==32||i||!s.open&&c.component.key[t]){e.preventDefault();e.stopPropagation();if(i){c.clear().close()}else{c.open()}}}return new a}A.klasses=function(e){e=e||"picker";return{picker:e,opened:e+"--opened",focused:e+"--focused",input:e+"__input",active:e+"__input--active",target:e+"__input--target",holder:e+"__holder",frame:e+"__frame",wrap:e+"__wrap",box:e+"__box"}};function E(e){var t,i="position";if(e.currentStyle){t=e.currentStyle[i]}else if(window.getComputedStyle){t=getComputedStyle(e)[i]}return t=="fixed"}function x(){if(w.height()<=r.height()){return 0}var e=b('<div style="visibility:hidden;width:100px" />').appendTo("body");var t=e[0].offsetWidth;e.css("overflow","scroll");var i=b('<div style="width:100%" />').appendTo(e);var n=i[0].offsetWidth;e.remove();return t-n}A._={group:function(e){var t,i="",n=A._.trigger(e.min,e);for(;n<=A._.trigger(e.max,e,[n]);n+=e.i){t=A._.trigger(e.item,e,[n]);i+=A._.node(e.node,t[0],t[1],t[2])}return i},node:function(e,t,i,n){if(!t)return"";t=b.isArray(t)?t.join(""):t;i=i?' class="'+i+'"':"";n=n?" "+n:"";return"<"+e+i+n+">"+t+"</"+e+">"},lead:function(e){return(e<10?"0":"")+e},trigger:function(e,t,i){return typeof e=="function"?e.apply(t,i||[]):e},digits:function(e){return/\d/.test(e[1])?2:1},isDate:function(e){return{}.toString.call(e).indexOf("Date")>-1&&this.isInteger(e.getDate())},isInteger:function(e){return{}.toString.call(e).indexOf("Number")>-1&&e%1===0},ariaAttr:e};A.extend=function(n,r){b.fn[n]=function(t,e){var i=this.data(n);if(t=="picker"){return i}if(i&&typeof t=="string"){return A._.trigger(i[t],i,[e])}return this.each(function(){var e=b(this);if(!e.data(n)){new A(this,n,r,t)}})};b.fn[n].defaults=r.defaults};function T(e,t,i){if(b.isPlainObject(t)){for(var n in t){o(e,n,t[n])}}else{o(e,t,i)}}function o(e,t,i){e.setAttribute((t=="role"?"":"aria-")+t,i)}function e(e,t){if(!b.isPlainObject(e)){e={attribute:t}}t="";for(var i in e){var n=(i=="role"?"":"aria-")+i,r=e[i];t+=r==null?"":n+'="'+e[i]+'"'}return t}function S(){try{return document.activeElement}catch(e){}}return A});(function(e){if(typeof define=="function"&&define.amd)define(["picker","jquery"],e);else if(typeof exports=="object")module.exports=e(require("./picker.js"),require("jquery"));else e(Picker,jQuery)})(function(e,h){var g=7,v=6,m=e._;function t(t,i){var n=this,e=t.$node[0],r=e.value,o=t.$node.data("value"),a=o||r,s=o?i.formatSubmit:i.format,l=function(){return e.currentStyle?e.currentStyle.direction=="rtl":getComputedStyle(t.$root[0]).direction=="rtl"};n.settings=i;n.$node=t.$node;n.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"};n.item={};n.item.clear=null;n.item.disable=(i.disable||[]).slice(0);n.item.enable=-function(e){return e[0]===true?e.shift():-1}(n.item.disable);n.set("min",i.min).set("max",i.max).set("now");if(a){n.set("select",a,{format:s,defaultValue:true})}else{n.set("select",null).set("highlight",n.item.now)}n.key={40:7,38:-7,39:function(){return l()?-1:1},37:function(){return l()?1:-1},go:function(e){var t=n.item.highlight,i=new Date(t.year,t.month,t.date+e);n.set("highlight",i,{interval:e});this.render()}};t.on("render",function(){t.$root.find("."+i.klass.selectMonth).on("change",function(){var e=this.value;if(e){t.set("highlight",[t.get("view").year,e,t.get("highlight").date]);t.$root.find("."+i.klass.selectMonth).trigger("focus")}});t.$root.find("."+i.klass.selectYear).on("change",function(){var e=this.value;if(e){t.set("highlight",[e,t.get("view").month,t.get("highlight").date]);t.$root.find("."+i.klass.selectYear).trigger("focus")}})},1).on("open",function(){var e="";if(n.disabled(n.get("now"))){e=":not(."+i.klass.buttonToday+")"}t.$root.find("button"+e+", select").attr("disabled",false)},1).on("close",function(){t.$root.find("button, select").attr("disabled",true)},1)}t.prototype.set=function(t,i,n){var r=this,e=r.item;if(i===null){if(t=="clear")t="select";e[t]=i;return r}e[t=="enable"?"disable":t=="flip"?"enable":t]=r.queue[t].split(" ").map(function(e){i=r[e](t,i,n);return i}).pop();if(t=="select"){r.set("highlight",e.select,n)}else if(t=="highlight"){r.set("view",e.highlight,n)}else if(t.match(/^(flip|min|max|disable|enable)$/)){if(e.select&&r.disabled(e.select)){r.set("select",e.select,n)}if(e.highlight&&r.disabled(e.highlight)){r.set("highlight",e.highlight,n)}}return r};t.prototype.get=function(e){return this.item[e]};t.prototype.create=function(e,t,i){var n,r=this;t=t===undefined?e:t;if(t==-Infinity||t==Infinity){n=t}else if(h.isPlainObject(t)&&m.isInteger(t.pick)){t=t.obj}else if(h.isArray(t)){t=new Date(t[0],t[1],t[2]);t=m.isDate(t)?t:r.create().obj}else if(m.isInteger(t)||m.isDate(t)){t=r.normalize(new Date(t),i)}else{t=r.now(e,t,i)}return{year:n||t.getFullYear(),month:n||t.getMonth(),date:n||t.getDate(),day:n||t.getDay(),obj:n||t,pick:n||t.getTime()}};t.prototype.createRange=function(e,t){var i=this,n=function(e){if(e===true||h.isArray(e)||m.isDate(e)){return i.create(e)}return e};if(!m.isInteger(e)){e=n(e)}if(!m.isInteger(t)){t=n(t)}if(m.isInteger(e)&&h.isPlainObject(t)){e=[t.year,t.month,t.date+e]}else if(m.isInteger(t)&&h.isPlainObject(e)){t=[e.year,e.month,e.date+t]}return{from:n(e),to:n(t)}};t.prototype.withinRange=function(e,t){e=this.createRange(e.from,e.to);return t.pick>=e.from.pick&&t.pick<=e.to.pick};t.prototype.overlapRanges=function(e,t){var i=this;e=i.createRange(e.from,e.to);t=i.createRange(t.from,t.to);return i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)};t.prototype.now=function(e,t,i){t=new Date;if(i&&i.rel){t.setDate(t.getDate()+i.rel)}return this.normalize(t,i)};t.prototype.navigate=function(e,t,i){var n,r,o,a,s=h.isArray(t),l=h.isPlainObject(t),u=this.item.view;if(s||l){if(l){r=t.year;o=t.month;a=t.date}else{r=+t[0];o=+t[1];a=+t[2]}if(i&&i.nav&&u&&u.month!==o){r=u.year;o=u.month}n=new Date(r,o+(i&&i.nav?i.nav:0),1);r=n.getFullYear();o=n.getMonth();while(new Date(r,o,a).getMonth()!==o){a-=1}t=[r,o,a]}return t};t.prototype.normalize=function(e){e.setHours(0,0,0,0);return e};t.prototype.measure=function(e,t){var i=this;if(!t){t=e=="min"?-Infinity:Infinity}else if(typeof t=="string"){t=i.parse(e,t)}else if(m.isInteger(t)){t=i.now(e,t,{rel:t})}return t};t.prototype.viewset=function(e,t){return this.create([t.year,t.month,1])};t.prototype.validate=function(e,i,t){var n=this,r=i,o=t&&t.interval?t.interval:1,a=n.item.enable===-1,s,l,u=n.item.min,c=n.item.max,d,f,p=a&&n.item.disable.filter(function(e){if(h.isArray(e)){var t=n.create(e).pick;if(t<i.pick)s=true;else if(t>i.pick)l=true}return m.isInteger(e)}).length;if(!t||!t.nav&&!t.defaultValue)if(!a&&n.disabled(i)||a&&n.disabled(i)&&(p||s||l)||!a&&(i.pick<=u.pick||i.pick>=c.pick)){if(a&&!p&&(!l&&o>0||!s&&o<0)){o*=-1}while(n.disabled(i)){if(Math.abs(o)>1&&(i.month<r.month||i.month>r.month)){i=r;o=o>0?1:-1}if(i.pick<=u.pick){d=true;o=1;i=n.create([u.year,u.month,u.date+(i.pick===u.pick?0:-1)])}else if(i.pick>=c.pick){f=true;o=-1;i=n.create([c.year,c.month,c.date+(i.pick===c.pick?0:1)])}if(d&&f){break}i=n.create([i.year,i.month,i.date+o])}}return i};t.prototype.disabled=function(t){var i=this,e=i.item.disable.filter(function(e){if(m.isInteger(e)){return t.day===(i.settings.firstDay?e:e-1)%7}if(h.isArray(e)||m.isDate(e)){return t.pick===i.create(e).pick}if(h.isPlainObject(e)){return i.withinRange(e,t)}});e=e.length&&!e.filter(function(e){return h.isArray(e)&&e[3]=="inverted"||h.isPlainObject(e)&&e.inverted}).length;return i.item.enable===-1?!e:e||t.pick<i.item.min.pick||t.pick>i.item.max.pick};t.prototype.parse=function(e,n,t){var r=this,o={};if(!n||typeof n!="string"){return n}if(!(t&&t.format)){t=t||{};t.format=r.settings.format}r.formats.toArray(t.format).map(function(e){var t=r.formats[e],i=t?m.trigger(t,r,[n,o]):e.replace(/^!/,"").length;if(t){o[e]=n.substr(0,i)}n=n.substr(i)});return[o.yyyy||o.yy,+(o.mm||o.m)-1,o.dd||o.d]};t.prototype.formats=function(){function n(e,t,i){var n=e.match(/[^\x00-\x7F]+|\w+/)[0];if(!i.mm&&!i.m){i.m=t.indexOf(n)+1}return n.length}function i(e){return e.match(/\w+/)[0].length}return{d:function(e,t){return e?m.digits(e):t.date},dd:function(e,t){return e?2:m.lead(t.date)},ddd:function(e,t){return e?i(e):this.settings.weekdaysShort[t.day]},dddd:function(e,t){return e?i(e):this.settings.weekdaysFull[t.day]},m:function(e,t){return e?m.digits(e):t.month+1},mm:function(e,t){return e?2:m.lead(t.month+1)},mmm:function(e,t){var i=this.settings.monthsShort;return e?n(e,i,t):i[t.month]},mmmm:function(e,t){var i=this.settings.monthsFull;return e?n(e,i,t):i[t.month]},yy:function(e,t){return e?2:(""+t.year).slice(2)},yyyy:function(e,t){return e?4:t.year},toArray:function(e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return m.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}}}();t.prototype.isDateExact=function(e,t){var i=this;if(m.isInteger(e)&&m.isInteger(t)||typeof e=="boolean"&&typeof t=="boolean"){return e===t}if((m.isDate(e)||h.isArray(e))&&(m.isDate(t)||h.isArray(t))){return i.create(e).pick===i.create(t).pick}if(h.isPlainObject(e)&&h.isPlainObject(t)){return i.isDateExact(e.from,t.from)&&i.isDateExact(e.to,t.to)}return false};t.prototype.isDateOverlap=function(e,t){var i=this,n=i.settings.firstDay?1:0;if(m.isInteger(e)&&(m.isDate(t)||h.isArray(t))){e=e%7+n;return e===i.create(t).day+1}if(m.isInteger(t)&&(m.isDate(e)||h.isArray(e))){t=t%7+n;return t===i.create(e).day+1}if(h.isPlainObject(e)&&h.isPlainObject(t)){return i.overlapRanges(e,t)}return false};t.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(t.enable==-1?1:-1)};t.prototype.deactivate=function(e,t){var n=this,r=n.item.disable.slice(0);if(t=="flip"){n.flipEnable()}else if(t===false){n.flipEnable(1);r=[]}else if(t===true){n.flipEnable(-1);r=[]}else{t.map(function(e){var t;for(var i=0;i<r.length;i+=1){if(n.isDateExact(e,r[i])){t=true;break}}if(!t){if(m.isInteger(e)||m.isDate(e)||h.isArray(e)||h.isPlainObject(e)&&e.from&&e.to){r.push(e)}}})}return r};t.prototype.activate=function(e,t){var o=this,a=o.item.disable,s=a.length;if(t=="flip"){o.flipEnable()}else if(t===true){o.flipEnable(1);a=[]}else if(t===false){o.flipEnable(-1);a=[]}else{t.map(function(e){var t,i,n,r;for(n=0;n<s;n+=1){i=a[n];if(o.isDateExact(i,e)){t=a[n]=null;r=true;break}else if(o.isDateOverlap(i,e)){if(h.isPlainObject(e)){e.inverted=true;t=e}else if(h.isArray(e)){t=e;if(!t[3])t.push("inverted")}else if(m.isDate(e)){t=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]}break}}if(t)for(n=0;n<s;n+=1){if(o.isDateExact(a[n],e)){a[n]=null;break}}if(r)for(n=0;n<s;n+=1){if(o.isDateOverlap(a[n],e)){a[n]=null;break}}if(t){a.push(t)}})}return a.filter(function(e){return e!=null})};t.prototype.nodes=function(l){var u=this,c=u.settings,e=u.item,o=e.now,a=e.select,s=e.highlight,d=e.view,f=e.disable,p=e.min,h=e.max,t=function(t,i){if(c.firstDay){t.push(t.shift());i.push(i.shift())}return m.node("thead",m.node("tr",m.group({min:0,max:g-1,i:1,node:"th",item:function(e){return[t[e],c.klass.weekdays,'scope=col title="'+i[e]+'"']}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0),c.weekdaysFull.slice(0)),i=function(e){return m.node("div"," ",c.klass["nav"+(e?"Next":"Prev")]+(e&&d.year>=h.year&&d.month>=h.month||!e&&d.year<=p.year&&d.month<=p.month?" "+c.klass.navDisabled:""),"data-nav="+(e||-1)+" "+m.ariaAttr({role:"button",controls:u.$node[0].id+"_table"})+" "+'title="'+(e?c.labelMonthNext:c.labelMonthPrev)+'"')},n=function(){var t=c.showMonthsShort?c.monthsShort:c.monthsFull;if(c.selectMonths){return m.node("select",m.group({min:0,max:11,i:1,node:"option",item:function(e){return[t[e],0,"value="+e+(d.month==e?" selected":"")+(d.year==p.year&&e<p.month||d.year==h.year&&e>h.month?" disabled":"")]}}),c.klass.selectMonth,(l?"":"disabled")+" "+m.ariaAttr({controls:u.$node[0].id+"_table"})+" "+'title="'+c.labelMonthSelect+'"')}return m.node("div",t[d.month],c.klass.month)},r=function(){var t=d.year,e=c.selectYears===true?5:~~(c.selectYears/2);if(e){var i=p.year,n=h.year,r=t-e,o=t+e;if(i>r){o+=i-r;r=i}if(n<o){var a=r-i,s=o-n;r-=a>s?s:a;o=n}return m.node("select",m.group({min:r,max:o,i:1,node:"option",item:function(e){return[e,0,"value="+e+(t==e?" selected":"")]}}),c.klass.selectYear,(l?"":"disabled")+" "+m.ariaAttr({controls:u.$node[0].id+"_table"})+" "+'title="'+c.labelYearSelect+'"')}return m.node("div",t,c.klass.year)};return m.node("div",(c.selectYears?r()+n():n()+r())+i()+i(1),c.klass.header)+m.node("table",t+m.node("tbody",m.group({min:0,max:v-1,i:1,node:"tr",item:function(e){var t=c.firstDay&&u.create([d.year,d.month,1]).day===0?-7:0;return[m.group({min:g*e-d.day+t+1,max:function(){return this.min+g-1},i:1,node:"td",item:function(t){t=u.create([d.year,d.month,t+(c.firstDay?1:0)]);var i=a&&a.pick==t.pick,n=s&&s.pick==t.pick,r=f&&u.disabled(t)||t.pick<p.pick||t.pick>h.pick,e=m.trigger(u.formats.toString,u,[c.format,t]);return[m.node("div",t.date,function(e){e.push(d.month==t.month?c.klass.infocus:c.klass.outfocus);if(o.pick==t.pick){e.push(c.klass.now)}if(i){e.push(c.klass.selected)}if(n){e.push(c.klass.highlighted)}if(r){e.push(c.klass.disabled)}return e.join(" ")}([c.klass.day]),"data-pick="+t.pick+" "+m.ariaAttr({role:"gridcell",label:e,selected:i&&u.$node.val()===e?true:null,activedescendant:n?true:null,disabled:r?true:null})),"",m.ariaAttr({role:"presentation"})]}})]}})),c.klass.table,'id="'+u.$node[0].id+"_table"+'" '+m.ariaAttr({role:"grid",controls:u.$node[0].id,readonly:true}))+m.node("div",m.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+o.pick+(l&&!u.disabled(o)?"":" disabled")+" "+m.ariaAttr({controls:u.$node[0].id}))+m.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(l?"":" disabled")+" "+m.ariaAttr({controls:u.$node[0].id}))+m.node("button",c.close,c.klass.buttonClose,"type=button data-close=true "+(l?"":" disabled")+" "+m.ariaAttr({controls:u.$node[0].id})),c.klass.footer)};t.defaults=function(e){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["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"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:true,closeOnClear:true,format:"d mmmm, yyyy",klass:{table:e+"table",header:e+"header",navPrev:e+"nav--prev",navNext:e+"nav--next",navDisabled:e+"nav--disabled",month:e+"month",year:e+"year",selectMonth:e+"select--month",selectYear:e+"select--year",weekdays:e+"weekday",day:e+"day",disabled:e+"day--disabled",selected:e+"day--selected",highlighted:e+"day--highlighted",now:e+"day--today",infocus:e+"day--infocus",outfocus:e+"day--outfocus",footer:e+"footer",buttonClear:e+"button--clear",buttonToday:e+"button--today",buttonClose:e+"button--close"}}}(e.klasses().picker+"__");e.extend("pickadate",t)});(function(e){if(typeof define=="function"&&define.amd)define(["picker","jquery"],e);else if(typeof exports=="object")module.exports=e(require("./picker.js"),require("jquery"));else e(Picker,jQuery)})(function(e,l){var r=24,c=60,i=12,o=r*c,f=e._;function t(r,o){var t=this,e=r.$node[0].value,i=r.$node.data("value"),n=i||e,a=i?o.formatSubmit:o.format;t.settings=o;t.$node=r.$node;t.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"};t.item={};t.item.clear=null;t.item.interval=o.interval||30;t.item.disable=(o.disable||[]).slice(0);t.item.enable=-function(e){return e[0]===true?e.shift():-1}(t.item.disable);t.set("min",o.min).set("max",o.max).set("now");if(n){t.set("select",n,{format:a})}else{t.set("select",null).set("highlight",t.item.now)}t.key={40:1,38:-1,39:1,37:-1,go:function(e){t.set("highlight",t.item.highlight.pick+e*t.item.interval,{interval:e*t.item.interval});this.render()}};r.on("render",function(){var e=r.$root.children(),t=e.find("."+o.klass.viewset),n=function(t){return["webkit","moz","ms","o",""].map(function(e){return(e?"-"+e+"-":"")+t})},i=function(t,i){n("transform").map(function(e){t.css(e,i)});n("transition").map(function(e){t.css(e,i)})};if(t.length){i(e,"none");e[0].scrollTop=~~t.position().top-t[0].clientHeight*2;i(e,"")}},1).on("open",function(){r.$root.find("button").attr("disabled",false)},1).on("close",function(){r.$root.find("button").attr("disabled",true)},1)}t.prototype.set=function(t,i,n){var r=this,e=r.item;if(i===null){if(t=="clear")t="select";e[t]=i;return r}e[t=="enable"?"disable":t=="flip"?"enable":t]=r.queue[t].split(" ").map(function(e){i=r[e](t,i,n);return i}).pop();if(t=="select"){r.set("highlight",e.select,n)}else if(t=="highlight"){r.set("view",e.highlight,n)}else if(t=="interval"){r.set("min",e.min,n).set("max",e.max,n)}else if(t.match(/^(flip|min|max|disable|enable)$/)){if(e.select&&r.disabled(e.select)){r.set("select",i,n)}if(e.highlight&&r.disabled(e.highlight)){r.set("highlight",i,n)}if(t=="min"){r.set("max",e.max,n)}}return r};t.prototype.get=function(e){return this.item[e]};t.prototype.create=function(e,t,i){var n=this;t=t===undefined?e:t;if(f.isDate(t)){t=[t.getHours(),t.getMinutes()]}if(l.isPlainObject(t)&&f.isInteger(t.pick)){t=t.pick}else if(l.isArray(t)){t=+t[0]*c+ +t[1]}else if(!f.isInteger(t)){t=n.now(e,t,i)}if(e=="max"&&t<n.item.min.pick){t+=o}if(e!="min"&&e!="max"&&(t-n.item.min.pick)%n.item.interval!==0){t+=n.item.interval}t=n.normalize(e,t,i);return{hour:~~(r+t/c)%r,mins:(c+t%c)%c,time:(o+t)%o,pick:t%o}};t.prototype.createRange=function(e,t){var i=this,n=function(e){if(e===true||l.isArray(e)||f.isDate(e)){return i.create(e)}return e};if(!f.isInteger(e)){e=n(e)}if(!f.isInteger(t)){t=n(t)}if(f.isInteger(e)&&l.isPlainObject(t)){e=[t.hour,t.mins+e*i.settings.interval]}else if(f.isInteger(t)&&l.isPlainObject(e)){t=[e.hour,e.mins+t*i.settings.interval]}return{from:n(e),to:n(t)}};t.prototype.withinRange=function(e,t){e=this.createRange(e.from,e.to);return t.pick>=e.from.pick&&t.pick<=e.to.pick};t.prototype.overlapRanges=function(e,t){var i=this;e=i.createRange(e.from,e.to);t=i.createRange(t.from,t.to);return i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)};t.prototype.now=function(e,t){var i=this.item.interval,n=new Date,r=n.getHours()*c+n.getMinutes(),o=f.isInteger(t),a;r-=r%i;a=t<0&&i*t+r<=-i;r+=e=="min"&&a?0:i;if(o){r+=i*(a&&e!="max"?t+1:t)}return r};t.prototype.normalize=function(e,t){var i=this.item.interval,n=this.item.min&&this.item.min.pick||0;t-=e=="min"?0:(t-n)%i;return t};t.prototype.measure=function(e,t,i){var n=this;if(!t){t=e=="min"?[0,0]:[r-1,c-1]}if(typeof t=="string"){t=n.parse(e,t)}else if(t===true||f.isInteger(t)){t=n.now(e,t,i)}else if(l.isPlainObject(t)&&f.isInteger(t.pick)){t=n.normalize(e,t.pick,i)}return t};t.prototype.validate=function(e,t,i){var n=this,r=i&&i.interval?i.interval:n.item.interval;if(n.disabled(t)){t=n.shift(t,r)}t=n.scope(t);if(n.disabled(t)){t=n.shift(t,r*-1)}return t};t.prototype.disabled=function(t){var i=this,e=i.item.disable.filter(function(e){if(f.isInteger(e)){return t.hour==e}if(l.isArray(e)||f.isDate(e)){return t.pick==i.create(e).pick}if(l.isPlainObject(e)){return i.withinRange(e,t)}});e=e.length&&!e.filter(function(e){return l.isArray(e)&&e[2]=="inverted"||l.isPlainObject(e)&&e.inverted}).length;return i.item.enable===-1?!e:e||t.pick<i.item.min.pick||t.pick>i.item.max.pick};t.prototype.shift=function(e,t){var i=this,n=i.item.min.pick,r=i.item.max.pick;t=t||i.item.interval;while(i.disabled(e)){e=i.create(e.pick+=t);if(e.pick<=n||e.pick>=r){break}}return e};t.prototype.scope=function(e){var t=this.item.min.pick,i=this.item.max.pick;return this.create(e.pick>i?i:e.pick<t?t:e)};t.prototype.parse=function(e,r,t){var i,n,o,a,s,l=this,u={};if(!r||typeof r!="string"){return r}if(!(t&&t.format)){t=t||{};t.format=l.settings.format}l.formats.toArray(t.format).map(function(e){var t,i=l.formats[e],n=i?f.trigger(i,l,[r,u]):e.replace(/^!/,"").length;if(i){t=r.substr(0,n);u[e]=t.match(/^\d+$/)?+t:t}r=r.substr(n)});for(a in u){s=u[a];if(f.isInteger(s)){if(a.match(/^(h|hh)$/i)){i=s;if(a=="h"||a=="hh"){i%=12}}else if(a=="i"){n=s}}else if(a.match(/^a$/i)&&s.match(/^p/i)&&("h"in u||"hh"in u)){o=true}}return(o?i+12:i)*c+n};t.prototype.formats={h:function(e,t){return e?f.digits(e):t.hour%i||i},hh:function(e,t){return e?2:f.lead(t.hour%i||i)},H:function(e,t){return e?f.digits(e):""+t.hour%24},HH:function(e,t){return e?f.digits(e):f.lead(t.hour%24)},i:function(e,t){return e?2:f.lead(t.mins)},a:function(e,t){return e?4:o/2>t.time%o?"a.m.":"p.m."},A:function(e,t){return e?2:o/2>t.time%o?"AM":"PM"},toArray:function(e){return e.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return f.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}};t.prototype.isTimeExact=function(e,t){var i=this;if(f.isInteger(e)&&f.isInteger(t)||typeof e=="boolean"&&typeof t=="boolean"){return e===t}if((f.isDate(e)||l.isArray(e))&&(f.isDate(t)||l.isArray(t))){return i.create(e).pick===i.create(t).pick}if(l.isPlainObject(e)&&l.isPlainObject(t)){return i.isTimeExact(e.from,t.from)&&i.isTimeExact(e.to,t.to)}return false};t.prototype.isTimeOverlap=function(e,t){var i=this;if(f.isInteger(e)&&(f.isDate(t)||l.isArray(t))){return e===i.create(t).hour}if(f.isInteger(t)&&(f.isDate(e)||l.isArray(e))){return t===i.create(e).hour}if(l.isPlainObject(e)&&l.isPlainObject(t)){return i.overlapRanges(e,t)}return false};t.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(t.enable==-1?1:-1)};t.prototype.deactivate=function(e,t){var n=this,r=n.item.disable.slice(0);if(t=="flip"){n.flipEnable()}else if(t===false){n.flipEnable(1);r=[]}else if(t===true){n.flipEnable(-1);r=[]}else{t.map(function(e){var t;for(var i=0;i<r.length;i+=1){if(n.isTimeExact(e,r[i])){t=true;break}}if(!t){if(f.isInteger(e)||f.isDate(e)||l.isArray(e)||l.isPlainObject(e)&&e.from&&e.to){r.push(e)}}})}return r};t.prototype.activate=function(e,t){var o=this,a=o.item.disable,s=a.length;if(t=="flip"){o.flipEnable()}else if(t===true){o.flipEnable(1);a=[]}else if(t===false){o.flipEnable(-1);a=[]}else{t.map(function(e){var t,i,n,r;for(n=0;n<s;n+=1){i=a[n];if(o.isTimeExact(i,e)){t=a[n]=null;r=true;break}else if(o.isTimeOverlap(i,e)){if(l.isPlainObject(e)){e.inverted=true;t=e}else if(l.isArray(e)){t=e;if(!t[2])t.push("inverted")}else if(f.isDate(e)){t=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]}break}}if(t)for(n=0;n<s;n+=1){if(o.isTimeExact(a[n],e)){a[n]=null;break}}if(r)for(n=0;n<s;n+=1){if(o.isTimeOverlap(a[n],e)){a[n]=null;break}}if(t){a.push(t)}})}return a.filter(function(e){return e!=null})};t.prototype.i=function(e,t){return f.isInteger(t)&&t>0?t:this.item.interval};t.prototype.nodes=function(e){var a=this,s=a.settings,l=a.item.select,u=a.item.highlight,c=a.item.view,d=a.item.disable;return f.node("ul",f.group({min:a.item.min.pick,max:a.item.max.pick,i:a.item.interval,node:"li",item:function(e){e=a.create(e);var t=e.pick,i=l&&l.pick==t,n=u&&u.pick==t,r=d&&a.disabled(e),o=f.trigger(a.formats.toString,a,[s.format,e]);return[f.trigger(a.formats.toString,a,[f.trigger(s.formatLabel,a,[e])||s.format,e]),function(e){if(i){e.push(s.klass.selected)}if(n){e.push(s.klass.highlighted)}if(c&&c.pick==t){e.push(s.klass.viewset)}if(r){e.push(s.klass.disabled)}return e.join(" ")}([s.klass.listItem]),"data-pick="+e.pick+" "+f.ariaAttr({role:"option",label:o,selected:i&&a.$node.val()===o?true:null,activedescendant:n?true:null,disabled:r?true:null})]}})+f.node("li",f.node("button",s.clear,s.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+f.ariaAttr({controls:a.$node[0].id})),"",f.ariaAttr({role:"presentation"})),s.klass.list,f.ariaAttr({role:"listbox",controls:a.$node[0].id}))};t.defaults=function(e){return{clear:"Clear",format:"h:i A",interval:30,closeOnSelect:true,closeOnClear:true,klass:{picker:e+" "+e+"--time",holder:e+"__holder",list:e+"__list",listItem:e+"__list-item",disabled:e+"__list-item--disabled",selected:e+"__list-item--selected",highlighted:e+"__list-item--highlighted",viewset:e+"__list-item--viewset",now:e+"__list-item--now",buttonClear:e+"__button--clear"}}}(e.klasses().picker);e.extend("pickatime",t)});if(![].map){Array.prototype.map=function(e,t){var i=this,n=i.length,r=new Array(n);for(var o=0;o<n;o++){if(o in i){r[o]=e.call(t,i[o],o,i)}}return r}}if(![].filter){Array.prototype.filter=function(e){if(this==null)throw new TypeError;var t=Object(this),i=t.length>>>0;if(typeof e!="function")throw new TypeError;var n=[],r=arguments[1];for(var o=0;o<i;o++){if(o in t){var a=t[o];if(e.call(r,a,o,t))n.push(a)}}return n}}if(![].indexOf){Array.prototype.indexOf=function(e){if(this==null)throw new TypeError;var t=Object(this),i=t.length>>>0;if(i===0)return-1;var n=0;if(arguments.length>1){n=Number(arguments[1]);if(n!=n){n=0}else if(n!==0&&n!=Infinity&&n!=-Infinity){n=(n>0||-1)*Math.floor(Math.abs(n))}}if(n>=i)return-1;var r=n>=0?n:Math.max(i-Math.abs(n),0);for(;r<i;r++){if(r in t&&t[r]===e)return r}return-1}}var nativeSplit=String.prototype.split,compliantExecNpcg=/()??/.exec("")[1]===undefined;String.prototype.split=function(e,t){var i=this;if(Object.prototype.toString.call(e)!=="[object RegExp]"){return nativeSplit.call(i,e,t)}var n=[],r=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),o=0,a,s,l,u;e=new RegExp(e.source,r+"g");i+="";if(!compliantExecNpcg){a=new RegExp("^"+e.source+"$(?!\\s)",r)}t=t===undefined?-1>>>0:t>>>0;while(s=e.exec(i)){l=s.index+s[0].length;if(l>o){n.push(i.slice(o,s.index));if(!compliantExecNpcg&&s.length>1){s[0].replace(a,function(){for(var e=1;e<arguments.length-2;e++){if(arguments[e]===undefined){s[e]=undefined}}})}if(s.length>1&&s.index<i.length){Array.prototype.push.apply(n,s.slice(1))}u=s[0].length;o=l;if(n.length>=t){break}}if(e.lastIndex===s.index){e.lastIndex++}}if(o===i.length){if(u||!e.test("")){n.push("")}}else{n.push(i.slice(o))}return n.length>t?n.slice(0,t):n};(function(e){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){e(require("jquery"))}else{e(jQuery)}})(function(q){"use strict";function X(e){if(typeof e==="string"){return parseInt(e,10)}else{return~~e}}var K={wheelSpeed:1,wheelPropagation:false,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:false,useKeyboard:true,suppressScrollX:false,suppressScrollY:false,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:false};var e=0;var Q=function(){var i=e++;return function(e){var t=".perfect-scrollbar-"+i;if(typeof e==="undefined"){return t}else{return e+t}}};q.fn.perfectScrollbar=function(U,Y){return this.each(function(){var a=q.extend(true,{},K);var v=q(this);var m=function(){return!!v};if(typeof U==="object"){q.extend(true,a,U)}else{Y=U}if(Y==="update"){if(v.data("perfect-scrollbar-update")){v.data("perfect-scrollbar-update")()}return v}else if(Y==="destroy"){if(v.data("perfect-scrollbar-destroy")){v.data("perfect-scrollbar-destroy")()}return v}if(v.data("perfect-scrollbar")){return v.data("perfect-scrollbar")}v.addClass("ps-container");var o;var s;var l;var u;var i=v.css("direction")==="rtl";var y=Q();var c=this.ownerDocument||document;var d=q("<div class='ps-scrollbar-x-rail'>").appendTo(v);var r=q("<div class='ps-scrollbar-x'>").appendTo(d);var f;var p;var h;var n=X(d.css("bottom"));var g=n===n;var b=g?null:X(d.css("top"));var _=X(d.css("borderLeftWidth"))+X(d.css("borderRightWidth"));var w=q("<div class='ps-scrollbar-y-rail'>").appendTo(v);var C=q("<div class='ps-scrollbar-y'>").appendTo(w);var A;var E;var x;var T=X(w.css("right"));var S=T===T;var D=S?null:X(w.css("left"));var k=X(w.css("borderTopWidth"))+X(w.css("borderBottomWidth"));function O(e,t){var i=e+t;var n=s-E;if(i<0){x=0}else if(i>n){x=n}else{x=i}var r=X(x*(u-s)/(s-E));v.scrollTop(r)}function R(e,t){var i=e+t;var n=o-p;if(i<0){h=0}else if(i>n){h=n}else{h=i}var r=X(h*(l-o)/(o-p));v.scrollLeft(r)}function e(e){if(a.minScrollbarLength){e=Math.max(e,a.minScrollbarLength)}if(a.maxScrollbarLength){e=Math.min(e,a.maxScrollbarLength)}return e}function t(){var e={width:o};if(i){e.left=v.scrollLeft()+o-l}else{e.left=v.scrollLeft()}if(g){e.bottom=n-v.scrollTop()}else{e.top=b+v.scrollTop()}d.css(e);var t={top:v.scrollTop(),height:s};if(S){if(i){t.right=l-v.scrollLeft()-T-C.outerWidth()}else{t.right=T-v.scrollLeft()}}else{if(i){t.left=v.scrollLeft()+o*2-l-D-C.outerWidth()}else{t.left=D+v.scrollLeft()}}w.css(t);r.css({left:h,width:p-_});C.css({top:x,height:E-k})}function N(){v.removeClass("ps-active-x");v.removeClass("ps-active-y");o=a.includePadding?v.innerWidth():v.width();s=a.includePadding?v.innerHeight():v.height();l=v.prop("scrollWidth");u=v.prop("scrollHeight");if(!a.suppressScrollX&&o+a.scrollXMarginOffset<l){f=true;p=e(X(o*o/l));h=X(v.scrollLeft()*(o-p)/(l-o))}else{f=false;p=0;h=0;v.scrollLeft(0)}if(!a.suppressScrollY&&s+a.scrollYMarginOffset<u){A=true;E=e(X(s*s/u));x=X(v.scrollTop()*(s-E)/(u-s))}else{A=false;E=0;x=0;v.scrollTop(0)}if(h>=o-p){h=o-p}if(x>=s-E){x=s-E}t();if(f){v.addClass("ps-active-x")}if(A){v.addClass("ps-active-y")}}function L(){var t;var i;var n=false;r.bind(y("mousedown"),function(e){i=e.pageX;t=r.position().left;d.addClass("in-scrolling");n=true;e.stopPropagation();e.preventDefault()});q(c).bind(y("mousemove"),function(e){if(n){R(t,e.pageX-i);N();e.stopPropagation();e.preventDefault()}});q(c).bind(y("mouseup"),function(e){if(n){n=false;d.removeClass("in-scrolling")}});t=i=null}function F(){var t;var i;var n=false;C.bind(y("mousedown"),function(e){i=e.pageY;t=C.position().top;n=true;w.addClass("in-scrolling");e.stopPropagation();e.preventDefault()});q(c).bind(y("mousemove"),function(e){if(n){O(t,e.pageY-i);N();e.stopPropagation();e.preventDefault()}});q(c).bind(y("mouseup"),function(e){if(n){n=false;w.removeClass("in-scrolling")}});t=i=null}function I(e,t){var i=v.scrollTop();if(e===0){if(!A){return false}if(i===0&&t>0||i>=u-s&&t<0){return!a.wheelPropagation}}var n=v.scrollLeft();if(t===0){if(!f){return false}if(n===0&&e<0||n>=l-o&&e>0){return!a.wheelPropagation}}return true}function G(){var r=false;function o(e){var t=e.originalEvent.deltaX;var i=-1*e.originalEvent.deltaY;if(typeof t==="undefined"||typeof i==="undefined"){t=-1*e.originalEvent.wheelDeltaX/6;i=e.originalEvent.wheelDeltaY/6}if(e.originalEvent.deltaMode&&e.originalEvent.deltaMode===1){t*=10;i*=10}if(t!==t&&i!==i){t=0;i=e.originalEvent.wheelDelta}return[t,i]}function e(e){var t=o(e);var i=t[0];var n=t[1];r=false;if(!a.useBothWheelAxes){v.scrollTop(v.scrollTop()-n*a.wheelSpeed);v.scrollLeft(v.scrollLeft()+i*a.wheelSpeed)}else if(A&&!f){if(n){v.scrollTop(v.scrollTop()-n*a.wheelSpeed)}else{v.scrollTop(v.scrollTop()+i*a.wheelSpeed)}r=true}else if(f&&!A){if(i){v.scrollLeft(v.scrollLeft()+i*a.wheelSpeed)}else{v.scrollLeft(v.scrollLeft()-n*a.wheelSpeed)}r=true}N();r=r||I(i,n);if(r){e.stopPropagation();e.preventDefault()}}if(typeof window.onwheel!=="undefined"){v.bind(y("wheel"),e)}else if(typeof window.onmousewheel!=="undefined"){v.bind(y("mousewheel"),e)}}function $(){var r=false;v.bind(y("mouseenter"),function(e){r=true});v.bind(y("mouseleave"),function(e){r=false});var o=false;q(c).bind(y("keydown"),function(e){if(e.isDefaultPrevented&&e.isDefaultPrevented()){return}if(!r){return}var t=document.activeElement?document.activeElement:c.activeElement;while(t.shadowRoot){t=t.shadowRoot.activeElement}if(q(t).is(":input,[contenteditable]")){return}var i=0;var n=0;switch(e.which){case 37:i=-30;break;case 38:n=30;break;case 39:i=30;break;case 40:n=-30;break;case 33:n=90;break;case 32:case 34:n=-90;break;case 35:if(e.ctrlKey){n=-u}else{n=-s}break;case 36:if(e.ctrlKey){n=v.scrollTop()}else{n=s}break;default:return}v.scrollTop(v.scrollTop()-n);v.scrollLeft(v.scrollLeft()+i);o=I(i,n);if(o){e.preventDefault()}})}function W(){function e(e){e.stopPropagation()}C.bind(y("click"),e);w.bind(y("click"),function(e){var t=X(E/2);var i=e.pageY-w.offset().top-t;var n=s-E;var r=i/n;if(r<0){r=0}else if(r>1){r=1}v.scrollTop((u-s)*r)});r.bind(y("click"),e);d.bind(y("click"),function(e){var t=X(p/2);var i=e.pageX-d.offset().left-t;var n=o-p;var r=i/n;if(r<0){r=0}else if(r>1){r=1}v.scrollLeft((l-o)*r)})}function H(){function t(){var e=window.getSelection?window.getSelection():document.getSlection?document.getSlection():{rangeCount:0};if(e.rangeCount===0){return null}else{return e.getRangeAt(0).commonAncestorContainer}}var e=null;var r={top:0,left:0};function o(){if(!e){e=setInterval(function(){if(!m()){clearInterval(e);return}v.scrollTop(v.scrollTop()+r.top);v.scrollLeft(v.scrollLeft()+r.left);N()},50)}}function a(){if(e){clearInterval(e);e=null}d.removeClass("in-scrolling");w.removeClass("in-scrolling")}var s=false;q(c).bind(y("selectionchange"),function(e){if(q.contains(v[0],t())){s=true}else{s=false;a()}});q(window).bind(y("mouseup"),function(e){if(s){s=false;a()}});q(window).bind(y("mousemove"),function(e){if(s){var t={x:e.pageX,y:e.pageY};var i=v.offset();var n={left:i.left,right:i.left+v.outerWidth(),top:i.top,bottom:i.top+v.outerHeight()};if(t.x<n.left+3){r.left=-5;d.addClass("in-scrolling")}else if(t.x>n.right-3){r.left=5;d.addClass("in-scrolling")}else{r.left=0}if(t.y<n.top+3){if(n.top+3-t.y<5){r.top=-5}else{r.top=-20}w.addClass("in-scrolling")}else if(t.y>n.bottom-3){if(t.y-n.bottom+3<5){r.top=5}else{r.top=20}w.addClass("in-scrolling")}else{r.top=0}if(r.top===0&&r.left===0){a()}else{o()}}})}function j(e,t){function s(e,t){v.scrollTop(v.scrollTop()-t);v.scrollLeft(v.scrollLeft()-e);N()}var l={};var u=0;var c={};var i=null;var d=false;var f=false;function n(e){d=true}function r(e){d=false}function p(e){if(e.originalEvent.targetTouches){return e.originalEvent.targetTouches[0]}else{return e.originalEvent}}function h(e){var t=e.originalEvent;if(t.targetTouches&&t.targetTouches.length===1){return true}if(t.pointerType&&t.pointerType!=="mouse"&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){return true}return false}function o(e){if(h(e)){f=true;var t=p(e);l.pageX=t.pageX;l.pageY=t.pageY;u=(new Date).getTime();if(i!==null){clearInterval(i)}e.stopPropagation()}}function a(e){if(!d&&f&&h(e)){var t=p(e);var i={pageX:t.pageX,pageY:t.pageY};var n=i.pageX-l.pageX;var r=i.pageY-l.pageY;s(n,r);l=i;var o=(new Date).getTime();var a=o-u;if(a>0){c.x=n/a;c.y=r/a;u=o}e.stopPropagation();e.preventDefault()}}function g(e){if(!d&&f){f=false;clearInterval(i);i=setInterval(function(){if(!m()){clearInterval(i);return}if(Math.abs(c.x)<.01&&Math.abs(c.y)<.01){clearInterval(i);return}s(c.x*30,c.y*30);c.x*=.8;c.y*=.8},10)}}if(e){q(window).bind(y("touchstart"),n);q(window).bind(y("touchend"),r);v.bind(y("touchstart"),o);v.bind(y("touchmove"),a);v.bind(y("touchend"),g)}if(t){if(window.PointerEvent){q(window).bind(y("pointerdown"),n);q(window).bind(y("pointerup"),r);v.bind(y("pointerdown"),o);v.bind(y("pointermove"),a);v.bind(y("pointerup"),g)}else if(window.MSPointerEvent){q(window).bind(y("MSPointerDown"),n);q(window).bind(y("MSPointerUp"),r);v.bind(y("MSPointerDown"),o);v.bind(y("MSPointerMove"),a);v.bind(y("MSPointerUp"),g)}}}function B(){v.bind(y("scroll"),function(e){N()})}function V(){v.unbind(y());q(window).unbind(y());q(c).unbind(y());v.data("perfect-scrollbar",null);v.data("perfect-scrollbar-update",null);v.data("perfect-scrollbar-destroy",null);r.remove();C.remove();d.remove();w.remove();v=d=w=r=C=f=A=o=s=l=u=p=h=n=g=b=E=x=T=S=D=i=y=null}var P="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch;var M=window.navigator.msMaxTouchPoints!==null;function z(){N();B();L();F();W();H();G();if(P||M){j(P,M)}if(a.useKeyboard){$()}v.data("perfect-scrollbar",v);v.data("perfect-scrollbar-update",N);v.data("perfect-scrollbar-destroy",V)}z();return v})}});(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){module.exports=e}else{e(jQuery)}})(function(u){var e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,d,f;if(u.event.fixHooks){for(var i=e.length;i;){u.event.fixHooks[e[--i]]=u.event.mouseHooks}}var n=u.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener){for(var e=t.length;e;){this.addEventListener(t[--e],r,false)}}else{this.onmousewheel=r}u.data(this,"mousewheel-line-height",n.getLineHeight(this));u.data(this,"mousewheel-page-height",n.getPageHeight(this))},teardown:function(){if(this.removeEventListener){for(var e=t.length;e;){this.removeEventListener(t[--e],r,false)}}else{this.onmousewheel=null}},getLineHeight:function(e){return parseInt(u(e)["offsetParent"in u.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(e){return u(e).height()},settings:{adjustOldDeltas:true}};u.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}});function r(e){var t=e||window.event,i=c.call(arguments,1),n=0,r=0,o=0,a=0;e=u.event.fix(t);e.type="mousewheel";if("detail"in t){o=t.detail*-1}if("wheelDelta"in t){o=t.wheelDelta}if("wheelDeltaY"in t){o=t.wheelDeltaY}if("wheelDeltaX"in t){r=t.wheelDeltaX*-1}if("axis"in t&&t.axis===t.HORIZONTAL_AXIS){r=o*-1;o=0}n=o===0?r:o;if("deltaY"in t){o=t.deltaY*-1;n=o}if("deltaX"in t){r=t.deltaX;if(o===0){n=r*-1}}if(o===0&&r===0){return}if(t.deltaMode===1){var s=u.data(this,"mousewheel-line-height");n*=s;o*=s;r*=s}else if(t.deltaMode===2){var l=u.data(this,"mousewheel-page-height");n*=l;o*=l;r*=l}a=Math.max(Math.abs(o),Math.abs(r));if(!f||a<f){f=a;if(h(t,a)){f/=40}}if(h(t,a)){n/=40;r/=40;o/=40}n=Math[n>=1?"floor":"ceil"](n/f);r=Math[r>=1?"floor":"ceil"](r/f);o=Math[o>=1?"floor":"ceil"](o/f);e.deltaX=r;e.deltaY=o;e.deltaFactor=f;e.deltaMode=0;i.unshift(e,n,r,o);if(d){clearTimeout(d)}d=setTimeout(p,200);return(u.event.dispatch||u.event.handle).apply(this,i)}function p(){f=null}function h(e,t){return n.settings.adjustOldDeltas&&e.type==="mousewheel"&&t%120===0}});jQuery.fn.doubleScroll=function(e){var n={contentElement:undefined,scrollCss:{"overflow-x":"auto","overflow-y":"hidden"},contentCss:{"overflow-x":"auto","overflow-y":"hidden"},onlyIfScroll:true,resetOnWindowResize:false,timeToWaitForResize:30};$.extend(true,n,e);$.extend(n,{topScrollBarMarkup:'<div class="doubleScroll-scroll-wrapper" style="height: 20px;"><div class="doubleScroll-scroll" style="height: 20px;"></div></div>',topScrollBarWrapperSelector:".doubleScroll-scroll-wrapper",topScrollBarInnerSelector:".doubleScroll-scroll"});var r=function(e,t){if(t.onlyIfScroll&&e.get(0).scrollWidth<=e.width()){e.prev(t.topScrollBarWrapperSelector).remove();return}var i=e.prev(t.topScrollBarWrapperSelector);if(i.length==0){i=$(t.topScrollBarMarkup);e.before(i);i.css(t.scrollCss);e.css(t.contentCss);i.bind("scroll.doubleScroll",function(){e.scrollLeft(i.scrollLeft())});var n=function(){i.scrollLeft(e.scrollLeft())};e.bind("scroll.doubleScroll",n)}var r;if(t.contentElement!==undefined&&e.find(t.contentElement).length!==0){r=e.find(t.contentElement)}else{r=e.find(">:first-child")}$(t.topScrollBarInnerSelector,i).width(r.outerWidth());i.width(e.width());i.scrollLeft(e.scrollLeft())};return this.each(function(){var t=$(this);r(t,n);if(n.resetOnWindowResize){var e;var i=function(e){r(t,n)};$(window).bind("resize.doubleScroll",function(){clearTimeout(e);e=setTimeout(i,n.timeToWaitForResize)})}})};(function(m){if(typeof window==="undefined")return;var y=0,b=false,o=false,e="message",Y=e.length,k="[iFrameSizer]",O=k.length,R=null,n=window.requestAnimationFrame,A={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},N={},i=null,_={autoResize:true,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:true,inPageLinks:false,enablePublicMethods:true,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:false,maxHeight:Infinity,maxWidth:Infinity,minHeight:0,minWidth:0,mouseEvents:true,resizeFrom:"parent",scrolling:false,sizeHeight:true,sizeWidth:false,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return true},onClosed:function(){},onInit:function(){},onMessage:function(){L("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return true}};function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function I(e,t,i){e.addEventListener(t,i,false)}function q(e,t,i){e.removeEventListener(t,i,false)}function f(){var e=["moz","webkit","o","ms"];var t;for(t=0;t<e.length&&!n;t+=1){n=window[e[t]+"RequestAnimationFrame"]}if(!n){P("setup","RequestAnimationFrame not supported")}else{n=n.bind(window)}}function p(e){var t="Host page: "+e;if(window.top!==window.self){t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e}return t}function h(e){return k+"["+p(e)+"]"}function r(e){return N[e]?N[e].log:b}function P(e,t){a("log",e,t,r(e))}function M(e,t){a("info",e,t,r(e))}function L(e,t){a("warn",e,t,true)}function a(e,t,i,n){if(true===n&&"object"===typeof window.console){console[e](h(t),i)}}function g(t){function e(){function e(){B(S);W(D);w("onResized",S)}n("Height");n("Width");V(e,S,"init")}function i(){var e=T.substr(O).split(":");var t=e[1]?parseInt(e[1],10):0;var i=N[e[0]]&&N[e[0]].iframe;var n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+r(n)+o(n),width:e[2],type:e[3]}}function r(e){if(e.boxSizing!=="border-box"){return 0}var t=e.paddingTop?parseInt(e.paddingTop,10):0;var i=e.paddingBottom?parseInt(e.paddingBottom,10):0;return t+i}function o(e){if(e.boxSizing!=="border-box"){return 0}var t=e.borderTopWidth?parseInt(e.borderTopWidth,10):0;var i=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return t+i}function n(e){var t=Number(N[D]["max"+e]),i=Number(N[D]["min"+e]),n=e.toLowerCase(),r=Number(S[n]);P(D,"Checking "+n+" is in range "+i+"-"+t);if(r<i){r=i;P(D,"Set "+n+" to min value")}if(r>t){r=t;P(D,"Set "+n+" to max value")}S[n]=""+r}function a(){function e(){function e(){var e=0,t=false;P(D,"Checking connection is from allowed list of origins: "+n);for(;e<n.length;e++){if(n[e]===i){t=true;break}}return t}function t(){var e=N[D]&&N[D].remoteHost;P(D,"Checking connection is from: "+e);return i===e}return n.constructor===Array?e():t()}var i=t.origin,n=N[D]&&N[D].checkOrigin;if(n&&""+i!=="null"&&!e()){throw new Error("Unexpected message received from: "+i+" for "+S.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.")}return true}function s(){return k===(""+T).substr(0,O)&&T.substr(O).split(":")[0]in N}function l(){var e=S.type in{true:1,false:1,undefined:1};if(e){P(D,"Ignoring init message from meta parent page")}return e}function u(e){return T.substr(T.indexOf(":")+Y+e)}function c(e){P(D,"onMessage passed: {iframe: "+S.iframe.id+", message: "+e+"}");w("onMessage",{iframe:S.iframe,message:JSON.parse(e)});P(D,"--")}function d(){var e=document.body.getBoundingClientRect(),t=S.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function f(e,t){function i(){z("Send Page Info","pageInfo:"+d(),e,t)}X(i,32,t)}function p(){function e(t,i){function n(){if(N[o]){f(N[o].iframe,o)}else{r()}}["scroll","resize"].forEach(function(e){P(o,t+e+" listener for sendPageInfo");i(window,e,n)})}function r(){e("Remove ",q)}function t(){e("Add ",I)}var o=D;t();if(N[o]){N[o].stopPageInfo=r}}function h(){if(N[D]&&N[D].stopPageInfo){N[D].stopPageInfo();delete N[D].stopPageInfo}}function g(){var e=true;if(null===S.iframe){L(D,"IFrame ("+S.id+") not found");e=false}return e}function v(e){var t=e.getBoundingClientRect();$(D);return{x:Math.floor(Number(t.left)+Number(R.x)),y:Math.floor(Number(t.top)+Number(R.y))}}function m(e){function t(){R=o;y();P(D,"--")}function i(){return{x:Number(S.width)+r.x,y:Number(S.height)+r.y}}function n(){if(window.parentIFrame){window.parentIFrame["scrollTo"+(e?"Offset":"")](o.x,o.y)}else{L(D,"Unable to scroll to requested position, window.parentIFrame not found")}}var r=e?v(S.iframe):{x:0,y:0},o=i();P(D,"Reposition requested from iFrame (offset x:"+r.x+" y:"+r.y+")");if(window.top!==window.self){n()}else{t()}}function y(){if(false!==w("onScroll",R)){W(D)}else{H()}}function b(e){function t(){var e=v(o);P(D,"Moving to in page link (#"+n+") at x: "+e.x+" y: "+e.y);R={x:e.x,y:e.y};y();P(D,"--")}function i(){if(window.parentIFrame){window.parentIFrame.moveToAnchor(n)}else{P(D,"In page link #"+n+" not found and window.parentIFrame not found")}}var n=e.split("#")[1]||"",r=decodeURIComponent(n),o=document.getElementById(r)||document.getElementsByName(r)[0];if(o){t()}else if(window.top!==window.self){i()}else{P(D,"In page link #"+n+" not found")}}function _(e){var t={};if(Number(S.width)===0&&Number(S.height)===0){var i=u(9).split(":");t={x:i[1],y:i[0]}}else{t={x:S.width,y:S.height}}w(e,{iframe:S.iframe,screenX:Number(t.x),screenY:Number(t.y),type:S.type})}function w(e,t){return F(D,e,t)}function C(){if(N[D]&&N[D].firstRun)x();switch(S.type){case"close":G(S.iframe);break;case"message":c(u(6));break;case"mouseenter":_("onMouseEnter");break;case"mouseleave":_("onMouseLeave");break;case"autoResize":N[D].autoResize=JSON.parse(u(9));break;case"scrollTo":m(false);break;case"scrollToOffset":m(true);break;case"pageInfo":f(N[D]&&N[D].iframe,D);p();break;case"pageInfoStop":h();break;case"inPageLink":b(u(9));break;case"reset":j(S);break;case"init":e();w("onInit",S.iframe);break;default:if(Number(S.width)===0&&Number(S.height)===0){L("Unsupported message received ("+S.type+"), this is likely due to the iframe containing a later "+"version of iframe-resizer than the parent page")}else{e()}}}function A(e){var t=true;if(!N[e]){t=false;L(S.type+" No settings for "+e+". Message was: "+T)}return t}function E(){for(var e in N){z("iFrame requested init",U(e),N[e].iframe,e)}}function x(){if(N[D]){N[D].firstRun=false}}var T=t.data,S={},D=null;if("[iFrameResizerChild]Ready"===T){E()}else if(s()){S=i();D=S.id;if(N[D]){N[D].loaded=true}if(!l()&&A(D)){P(D,"Received: "+T);if(g()&&a()){C()}}}else{M(D,"Ignored: "+T)}}function F(e,t,i){var n=null,r=null;if(N[e]){n=N[e][t];if("function"===typeof n){r=n(i)}else{throw new TypeError(t+" on iFrame["+e+"] is not a function")}}return r}function C(e){var t=e.id;delete N[t]}function G(e){var t=e.id;if(F(t,"onClose",t)===false){P(t,"Close iframe cancelled by onClose event");return}P(t,"Removing iFrame: "+t);try{if(e.parentNode){e.parentNode.removeChild(e)}}catch(e){L(e)}F(t,"onClosed",t);P(t,"--");C(e)}function $(e){if(null===R){R={x:window.pageXOffset!==m?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==m?window.pageYOffset:document.documentElement.scrollTop};P(e,"Get page position: "+R.x+","+R.y)}}function W(e){if(null!==R){window.scrollTo(R.x,R.y);P(e,"Set page position: "+R.x+","+R.y);H()}}function H(){R=null}function j(e){function t(){B(e);z("reset","reset",e.iframe,e.id)}P(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame"));$(e.id);V(t,e,"reset")}function B(t){function i(e){if(!t.id){P("undefined","messageData id not set");return}t.iframe.style[e]=t[e]+"px";P(t.id,"IFrame ("+r+") "+e+" set to "+t[e]+"px")}function n(e){if(!o&&"0"===t[e]){o=true;P(r,"Hidden iFrame detected, creating visibility listener");v()}}function e(e){i(e);n(e)}var r=t.iframe.id;if(N[r]){if(N[r].sizeHeight){e("height")}if(N[r].sizeWidth){e("width")}}}function V(e,t,i){if(i!==t.type&&n&&!window.jasmine){P(t.id,"Requesting animation frame");n(e)}else{e()}}function z(t,i,n,r,o){function e(){var e=N[r]&&N[r].targetOrigin;P(r,"["+t+"] Sending msg to iframe["+r+"] ("+i+") targetOrigin: "+e);n.contentWindow.postMessage(k+i,e)}function a(){L(r,"["+t+"] IFrame("+r+") not found")}function s(){if(n&&"contentWindow"in n&&null!==n.contentWindow){e()}else{a()}}function l(){function e(){if(N[r]&&!N[r].loaded&&!u){u=true;L(r,"IFrame has not responded within "+N[r].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.")}}if(!!o&&N[r]&&!!N[r].warningTimeout){N[r].msgTimeout=setTimeout(e,N[r].warningTimeout)}}var u=false;r=r||n.id;if(N[r]){s();l()}}function U(e){return e+":"+N[e].bodyMarginV1+":"+N[e].sizeWidth+":"+N[e].log+":"+N[e].interval+":"+N[e].enablePublicMethods+":"+N[e].autoResize+":"+N[e].bodyMargin+":"+N[e].heightCalculationMethod+":"+N[e].bodyBackground+":"+N[e].bodyPadding+":"+N[e].tolerance+":"+N[e].inPageLinks+":"+N[e].resizeFrom+":"+N[e].widthCalculationMethod+":"+N[e].mouseEvents}function E(e){return typeof e==="number"}function s(r,t){function e(){function e(e){var t=N[v][e];if(Infinity!==t&&0!==t){r.style[e]=E(t)?t+"px":t;P(v,"Set "+e+" = "+r.style[e])}}function t(e){if(N[v]["min"+e]>N[v]["max"+e]){throw new Error("Value for min"+e+" can not be greater than max"+e)}}t("Height");t("Width");e("maxHeight");e("minHeight");e("maxWidth");e("minWidth")}function i(){var e=t&&t.id||_.id+y++;if(null!==document.getElementById(e)){e+=y++}return e}function n(e){if(""===e){r.id=e=i();b=(t||{}).log;P(e,"Added missing iframe ID: "+e+" ("+r.src+")")}return e}function o(){P(v,"IFrame scrolling "+(N[v]&&N[v].scrolling?"enabled":"disabled")+" for "+v);r.style.overflow=false===(N[v]&&N[v].scrolling)?"hidden":"auto";switch(N[v]&&N[v].scrolling){case"omit":break;case true:r.scrolling="yes";break;case false:r.scrolling="no";break;default:r.scrolling=N[v]?N[v].scrolling:"no"}}function a(){if("number"===typeof(N[v]&&N[v].bodyMargin)||"0"===(N[v]&&N[v].bodyMargin)){N[v].bodyMarginV1=N[v].bodyMargin;N[v].bodyMargin=""+N[v].bodyMargin+"px"}}function s(){var e=N[v]&&N[v].firstRun,t=N[v]&&N[v].heightCalculationMethod in A;if(!e&&t){j({iframe:r,height:0,width:0,type:"init"})}}function l(){if(N[v]){N[v].iframe.iFrameResizer={close:G.bind(null,N[v].iframe),removeListeners:C.bind(null,N[v].iframe),resize:z.bind(null,"Window resize","resize",N[v].iframe),moveToAnchor:function(e){z("Move to anchor","moveToAnchor:"+e,N[v].iframe,v)},sendMessage:function(e){e=JSON.stringify(e);z("Send Message","message:"+e,N[v].iframe,v)}}}}function u(e){function t(){z("iFrame.onload",e,r,m,true);s()}function i(e){if(!r.parentNode){return}var t=new e(function(e){e.forEach(function(e){var t=Array.prototype.slice.call(e.removedNodes);t.forEach(function(e){if(e===r){G(r)}})})});t.observe(r.parentNode,{childList:true})}var n=w();if(n){i(n)}I(r,"load",t);z("init",e,r,m,true)}function c(e){if("object"!==typeof e){throw new TypeError("Options is not an object")}}function d(e){for(var t in _){if(Object.prototype.hasOwnProperty.call(_,t)){N[v][t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:_[t]}}}function f(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}function p(e){var t=e.split("Callback");if(t.length===2){var i="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[i]=this[e];delete this[e];L(v,"Deprecated: '"+e+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}function h(e){e=e||{};N[v]={firstRun:true,iframe:r,remoteHost:r.src&&r.src.split("/").slice(0,3).join("/")};c(e);Object.keys(e).forEach(p,e);d(e);if(N[v]){N[v].targetOrigin=true===N[v].checkOrigin?f(N[v].remoteHost):"*"}}function g(){return v in N&&"iFrameResizer"in r}var v=n(r.id);if(!g()){h(t);o();e();a();u(U(v));l()}else{L(v,"Ignored iFrame, already setup.")}}function l(e,t){if(null===i){i=setTimeout(function(){i=null;e()},t)}}var u={};function X(e,t,i){if(!u[i]){u[i]=setTimeout(function(){u[i]=null;e()},t)}}function v(){function t(){function t(t){function e(e){return"0px"===(N[t]&&N[t].iframe.style[e])}function i(e){return null!==e.offsetParent}if(N[t]&&i(N[t].iframe)&&(e("height")||e("width"))){z("Visibility change","resize",N[t].iframe,t)}}Object.keys(N).forEach(function(e){t(e)})}function n(e){P("window","Mutation observed: "+e[0].target+" "+e[0].type);l(t,16)}function e(){var e=document.querySelector("body"),t={attributes:true,attributeOldValue:false,characterData:true,characterDataOldValue:false,childList:true,subtree:true},i=new r(n);i.observe(e,t)}var r=w();if(r){e()}}function x(e){function t(){c("Window "+e,"resize")}P("window","Trigger event: "+e);l(t,16)}function t(){function e(){c("Tab Visable","resize")}if("hidden"!==document.visibilityState){P("document","Trigger event: Visiblity change");l(e,16)}}function c(t,i){function n(e){return N[e]&&"parent"===N[e].resizeFrom&&N[e].autoResize&&!N[e].firstRun}Object.keys(N).forEach(function(e){if(n(e)){z(t,i,N[e].iframe,e)}})}function T(){I(window,"message",g);I(window,"resize",function(){x("resize")});I(document,"visibilitychange",t);I(document,"-webkit-visibilitychange",t)}function d(){function n(e,t){function i(){if(!t.tagName){throw new TypeError("Object is not a valid DOM element")}else if("IFRAME"!==t.tagName.toUpperCase()){throw new TypeError("Expected <IFRAME> tag, found <"+t.tagName+">")}}if(t){i();s(t,e);o.push(t)}}function r(e){if(e&&e.enablePublicMethods){L("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}}var o;f();T();return function e(t,i){o=[];r(t);switch(typeof i){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(i||"iframe"),n.bind(m,t));break;case"object":n(t,i);break;default:throw new TypeError("Unexpected data type ("+typeof i+")")}return o}}function S(e){if(!e.fn){M("","Unable to bind to jQuery, it is not fully loaded.")}else if(!e.fn.iFrameResize){e.fn.iFrameResize=function e(i){function t(e,t){s(t,i)}return this.filter("iframe").each(t).end()}}}if(window.jQuery){S(window.jQuery)}if(typeof define==="function"&&define.amd){define([],d)}else if(typeof module==="object"&&typeof module.exports==="object"){module.exports=d()}window.iFrameResize=window.iFrameResize||d()})();!function(de){function fe(e){var t=document.createElement("input"),i="on"+e,n=i in t;return n||(t.setAttribute(i,"return;"),n="function"==typeof t[i]),t=null,n}function pe(e){var t="text"==e||"tel"==e||"password"==e;if(!t){var i=document.createElement("input");i.setAttribute("type",e),t="text"===i.type,i=null}return t}function a(e,t,i){var n=i.aliases[e];return n?(n.alias&&a(n.alias,void 0,i),de.extend(!0,i,n),de.extend(!0,i,t),!0):!1}function s(w,r){function o(e){function t(e,t,i,n){this.matches=[],this.isGroup=e||!1,this.isOptional=t||!1,this.isQuantifier=i||!1,this.isAlternator=n||!1,this.quantifier={min:1,max:1}}function i(e,t,i){var n=w.definitions[t],r=0==e.matches.length;if(i=void 0!=i?i:e.matches.length,n&&!d){n.placeholder=de.isFunction(n.placeholder)?n.placeholder.call(this,w):n.placeholder;for(var o=n.prevalidator,a=o?o.length:0,s=1;s<n.cardinality;s++){var l=a>=s?o[s-1]:[],u=l.validator,c=l.cardinality;e.matches.splice(i++,0,{fn:u?"string"==typeof u?new RegExp(u):new function(){this.test=u}:new RegExp("."),cardinality:c?c:1,optionality:e.isOptional,newBlockMarker:r,casing:n.casing,def:n.definitionSymbol||t,placeholder:n.placeholder,mask:t})}e.matches.splice(i++,0,{fn:n.validator?"string"==typeof n.validator?new RegExp(n.validator):new function(){this.test=n.validator}:new RegExp("."),cardinality:n.cardinality,optionality:e.isOptional,newBlockMarker:r,casing:n.casing,def:n.definitionSymbol||t,placeholder:n.placeholder,mask:t})}else e.matches.splice(i++,0,{fn:null,cardinality:0,optionality:e.isOptional,newBlockMarker:r,casing:null,def:t,placeholder:void 0,mask:t}),d=!1}for(var n,r,o,a,s,l,u=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g,d=!1,c=new t,f=[],p=[];n=u.exec(e);)switch(r=n[0],r.charAt(0)){case w.optionalmarker.end:case w.groupmarker.end:if(o=f.pop(),f.length>0){if(a=f[f.length-1],a.matches.push(o),a.isAlternator){s=f.pop();for(var h=0;h<s.matches.length;h++)s.matches[h].isGroup=!1;f.length>0?(a=f[f.length-1],a.matches.push(s)):c.matches.push(s)}}else c.matches.push(o);break;case w.optionalmarker.start:f.push(new t(!1,!0));break;case w.groupmarker.start:f.push(new t(!0));break;case w.quantifiermarker.start:var g=new t(!1,!1,!0);r=r.replace(/[{}]/g,"");var v=r.split(","),m=isNaN(v[0])?v[0]:parseInt(v[0]),y=1==v.length?m:isNaN(v[1])?v[1]:parseInt(v[1]);if(("*"==y||"+"==y)&&(m="*"==y?0:1),g.quantifier={min:m,max:y},f.length>0){var b=f[f.length-1].matches;if(n=b.pop(),!n.isGroup){var _=new t(!0);_.matches.push(n),n=_}b.push(n),b.push(g)}else{if(n=c.matches.pop(),!n.isGroup){var _=new t(!0);_.matches.push(n),n=_}c.matches.push(n),c.matches.push(g)}break;case w.escapeChar:d=!0;break;case w.alternatormarker:f.length>0?(a=f[f.length-1],l=a.matches.pop()):l=c.matches.pop(),l.isAlternator?f.push(l):(s=new t(!1,!1,!1,!0),s.matches.push(l),f.push(s));break;default:if(f.length>0){if(a=f[f.length-1],a.matches.length>0&&!a.isAlternator&&(l=a.matches[a.matches.length-1],l.isGroup&&(l.isGroup=!1,i(l,w.groupmarker.start,0),i(l,w.groupmarker.end))),i(a,r),a.isAlternator){s=f.pop();for(var h=0;h<s.matches.length;h++)s.matches[h].isGroup=!1;f.length>0?(a=f[f.length-1],a.matches.push(s)):c.matches.push(s)}}else c.matches.length>0&&(l=c.matches[c.matches.length-1],l.isGroup&&(l.isGroup=!1,i(l,w.groupmarker.start,0),i(l,w.groupmarker.end))),i(c,r)}return c.matches.length>0&&(l=c.matches[c.matches.length-1],l.isGroup&&(l.isGroup=!1,i(l,w.groupmarker.start,0),i(l,w.groupmarker.end)),p.push(c)),p}function e(e,t){if(void 0==e||""==e)return void 0;if(1==e.length&&0==w.greedy&&0!=w.repeat&&(w.placeholder=""),w.repeat>0||"*"==w.repeat||"+"==w.repeat){var i="*"==w.repeat?0:"+"==w.repeat?1:w.repeat;e=w.groupmarker.start+e+w.groupmarker.end+w.quantifiermarker.start+i+","+w.repeat+w.quantifiermarker.end}var n;return void 0==de.inputmask.masksCache[e]||r===!0?(n={mask:e,maskToken:o(e),validPositions:{},_buffer:void 0,buffer:void 0,tests:{},metadata:t},r!==!0&&(de.inputmask.masksCache[e]=n)):n=de.extend(!0,{},de.inputmask.masksCache[e]),n}function i(e){if(e=e.toString(),w.numericInput){e=e.split("").reverse();for(var t=0;t<e.length;t++)e[t]==w.optionalmarker.start?e[t]=w.optionalmarker.end:e[t]==w.optionalmarker.end?e[t]=w.optionalmarker.start:e[t]==w.groupmarker.start?e[t]=w.groupmarker.end:e[t]==w.groupmarker.end&&(e[t]=w.groupmarker.start);e=e.join("")}return e}var t=void 0;if(de.isFunction(w.mask)&&(w.mask=w.mask.call(this,w)),de.isArray(w.mask)){if(w.mask.length>1){w.keepStatic=void 0==w.keepStatic?!0:w.keepStatic;var n="(";return de.each(w.mask,function(e,t){n.length>1&&(n+=")|("),n+=i(void 0==t.mask||de.isFunction(t.mask)?t:t.mask)}),n+=")",e(n,w.mask)}w.mask=w.mask.pop()}return w.mask&&(t=void 0==w.mask.mask||de.isFunction(w.mask.mask)?e(i(w.mask),w.mask):e(i(w.mask.mask),w.mask)),t}function l(e,o,C){function L(e,t,i){t=t||0;var n,r,o,a=[],s=0;do{if(e===!0&&P().validPositions[s]){var l=P().validPositions[s];r=l.match,n=l.locator.slice(),a.push(i===!0?l.input:y(s,r))}else o=x(s,n,s-1),r=o.match,n=o.locator.slice(),a.push(y(s,r));s++}while((void 0==d||d>s-1)&&null!=r.fn||null==r.fn&&""!=r.def||t>=s);return a.pop(),a}function P(){return o}function A(e){var t=P();t.buffer=void 0,t.tests={},e!==!0&&(t._buffer=void 0,t.validPositions={},t.p=0)}function E(e,t){var i=P(),n=-1,r=i.validPositions;void 0==e&&(e=-1);var o=n,a=n;for(var s in r){var l=parseInt(s);r[l]&&(t||null!=r[l].match.fn)&&(e>=l&&(o=l),l>=e&&(a=l))}return n=-1!=o&&e-o>1||e>a?o:a}function b(e,t,i){if(C.insertMode&&void 0!=P().validPositions[e]&&void 0==i){var n,r=de.extend(!0,{},P().validPositions),o=E();for(n=e;o>=n;n++)delete P().validPositions[n];P().validPositions[e]=t;var a,s=!0,l=P().validPositions;for(n=a=e;o>=n;n++){var u=r[n];if(void 0!=u)for(var c=a,d=-1;c<m()&&(null==u.match.fn&&l[n]&&(l[n].match.optionalQuantifier===!0||l[n].match.optionality===!0)||null!=u.match.fn);){if(null==u.match.fn||!C.keepStatic&&l[n]&&(void 0!=l[n+1]&&_(n+1,l[n].locator.slice(),n).length>1||void 0!=l[n].alternation)?c++:c=D(a),$(c,u.match.def)){s=S(c,u.input,!0,!0)!==!1,a=c;break}if(s=null==u.match.fn,d==c)break;d=c}if(!s)break}if(!s)return P().validPositions=de.extend(!0,{},r),!1}else P().validPositions[e]=t;return!0}function F(e,t,i,n){var r,o=e;P().p=e,void 0!=P().validPositions[e]&&P().validPositions[e].input==C.radixPoint&&(t++,o++);for(r=o;t>r;r++)void 0!=P().validPositions[r]&&(i===!0||0!=C.canClearPosition(P(),r,E(),n,C))&&delete P().validPositions[r];for(A(!0),r=o+1;r<=E();){for(;void 0!=P().validPositions[o];)o++;var a=P().validPositions[o];o>r&&(r=o+1);var s=P().validPositions[r];void 0!=s&&void 0==a?($(o,s.match.def)&&S(o,s.input,!0)!==!1&&(delete P().validPositions[r],r++),o++):r++}var l=E(),u=m();for(l>=e&&void 0!=P().validPositions[l]&&P().validPositions[l].input==C.radixPoint&&delete P().validPositions[l],r=l+1;u>=r;r++)P().validPositions[r]&&delete P().validPositions[r];A(!0)}function x(e,t,i){var n=P().validPositions[e];if(void 0==n)for(var r=_(e,t,i),o=E(),a=P().validPositions[o]||_(0)[0],s=void 0!=a.alternation?a.locator[a.alternation].toString().split(","):[],l=0;l<r.length&&(n=r[l],!(n.match&&(C.greedy&&n.match.optionalQuantifier!==!0||(n.match.optionality===!1||n.match.newBlockMarker===!1)&&n.match.optionalQuantifier!==!0)&&(void 0==a.alternation||a.alternation!=n.alternation||void 0!=n.locator[a.alternation]&&H(n.locator[a.alternation].toString().split(","),s))));l++);return n}function G(e){return P().validPositions[e]?P().validPositions[e].match:_(e)[0].match}function $(e,t){for(var i=!1,n=_(e),r=0;r<n.length;r++)if(n[r].match&&n[r].match.def==t){i=!0;break}return i}function _(k,e,t,i){function O(x,T,e,t){function S(e,i,t){if(R>1e4)return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+P().mask),!0;if(R==k&&void 0==e.matches)return N.push({match:e,locator:i.reverse()}),!0;if(void 0!=e.matches){if(e.isGroup&&t!==!0){if(e=S(x.matches[D+1],i))return!0}else if(e.isOptional){var n=e;if(e=O(e,T,i,t)){var r=N[N.length-1].match,o=0==de.inArray(r,n.matches);if(!o)return!0;I=!0,R=k}}else if(e.isAlternator){var a,s=e,l=[],u=N.slice(),c=i.length,d=T.length>0?T.shift():-1;if(-1==d||"string"==typeof d){var f=R,p=T.slice(),h=[];"string"==typeof d&&(h=d.split(","));for(var g=0;g<s.matches.length;g++){if(N=[],e=S(s.matches[g],[g].concat(i),t)||e,e!==!0&&void 0!=e&&h[h.length-1]<s.matches.length){var v=x.matches.indexOf(e)+1;x.matches.length>v&&(e=S(x.matches[v],[v].concat(i.slice(1,i.length)),t),e&&(h.push(v.toString()),de.each(N,function(e,t){t.alternation=i.length-1})))}a=N.slice(),R=f,N=[];for(var m=0;m<p.length;m++)T[m]=p[m];for(var y=0;y<a.length;y++){var b=a[y];b.alternation=b.alternation||c;for(var _=0;_<l.length;_++){var w=l[_];if(b.match.mask==w.match.mask&&("string"!=typeof d||-1!=de.inArray(b.locator[b.alternation].toString(),h))){a.splice(y,1),y--,w.locator[b.alternation]=w.locator[b.alternation]+","+b.locator[b.alternation],w.alternation=b.alternation;break}}}l=l.concat(a)}"string"==typeof d&&(l=de.map(l,function(e,t){if(isFinite(t)){var i,n=e.alternation,r=e.locator[n].toString().split(",");e.locator[n]=void 0,e.alternation=void 0;for(var o=0;o<r.length;o++)i=-1!=de.inArray(r[o],h),i&&(void 0!=e.locator[n]?(e.locator[n]+=",",e.locator[n]+=r[o]):e.locator[n]=parseInt(r[o]),e.alternation=n);if(void 0!=e.locator[n])return e}})),N=u.concat(l),R=k,I=N.length>0}else e=s.matches[d]?S(s.matches[d],[d].concat(i),t):!1;if(e)return!0}else if(e.isQuantifier&&t!==!0)for(var C=e,A=T.length>0&&t!==!0?T.shift():0;A<(isNaN(C.quantifier.max)?A+1:C.quantifier.max)&&k>=R;A++){var E=x.matches[de.inArray(C,x.matches)-1];if(e=S(E,[A].concat(i),!0)){var r=N[N.length-1].match;r.optionalQuantifier=A>C.quantifier.min-1;var o=0==de.inArray(r,E.matches);if(o){if(A>C.quantifier.min-1){I=!0,R=k;break}return!0}return!0}}else if(e=O(e,T,i,t))return!0}else R++}for(var D=T.length>0?T.shift():0;D<x.matches.length;D++)if(x.matches[D].isQuantifier!==!0){var i=S(x.matches[D],[D].concat(e),t);if(i&&R==k)return i;if(R>k)break}}var n=P().maskToken,R=e?t:0,r=e||[0],N=[],I=!1;if(i===!0&&P().tests[k])return P().tests[k];if(void 0==e){for(var o,a=k-1;void 0==(o=P().validPositions[a])&&a>-1&&(!P().tests[a]||void 0==(o=P().tests[a][0]));)a--;void 0!=o&&a>-1&&(R=a,r=o.locator.slice())}for(var s=r.shift();s<n.length;s++){var l=O(n[s],r,[s]);if(l&&R==k||R>k)break}return(0==N.length||I)&&N.push({match:{fn:null,cardinality:0,optionality:!0,casing:null,def:""},locator:[]}),P().tests[k]=de.extend(!0,[],N),P().tests[k]}function f(){return void 0==P()._buffer&&(P()._buffer=L(!1,1)),P()._buffer}function w(){return void 0==P().buffer&&(P().buffer=L(!0,E(),!0)),P().buffer}function T(e,t,i){if(i=i||w().slice(),e===!0)A(),e=0,t=i.length;else for(var n=e;t>n;n++)delete P().validPositions[n],delete P().tests[n];for(var n=e;t>n;n++)i[n]!=C.skipOptionalPartCharacter&&S(n,i[n],!0,!0)}function W(e,t){switch(t.casing){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e}function H(e,t){for(var i=C.greedy?t:t.slice(0,1),n=!1,r=0;r<e.length;r++)if(-1!=de.inArray(e[r],i)){n=!0;break}return n}function S(e,t,i,n){function r(c,d,f,p){var h=!1;return de.each(_(c),function(e,t){for(var i=t.match,n=d?1:0,r="",o=(w(),i.cardinality);o>n;o--)r+=j(c-(o-1));if(d&&(r+=d),h=null!=i.fn?i.fn.test(r,P(),c,f,C):d!=i.def&&d!=C.skipOptionalPartCharacter||""==i.def?!1:{c:i.def,pos:c},h!==!1){var a=void 0!=h.c?h.c:d;a=a==C.skipOptionalPartCharacter&&null===i.fn?i.def:a;var s=c,l=w();if(void 0!=h.remove&&(de.isArray(h.remove)||(h.remove=[h.remove]),de.each(h.remove.sort(function(e,t){return t-e}),function(e,t){F(t,t+1,!0)})),void 0!=h.insert&&(de.isArray(h.insert)||(h.insert=[h.insert]),de.each(h.insert.sort(function(e,t){return e-t}),function(e,t){S(t.pos,t.c,!0)})),h.refreshFromBuffer){var u=h.refreshFromBuffer;if(f=!0,T(u===!0?u:u.start,u.end,l),void 0==h.pos&&void 0==h.c)return h.pos=E(),!1;if(s=void 0!=h.pos?h.pos:c,s!=c)return h=de.extend(h,S(s,a,!0)),!1}else if(h!==!0&&void 0!=h.pos&&h.pos!=c&&(s=h.pos,T(c,s),s!=c))return h=de.extend(h,S(s,a,!0)),!1;return 1!=h&&void 0==h.pos&&void 0==h.c?!1:(e>0&&A(!0),b(s,de.extend({},t,{input:W(a,i)}),p)||(h=!1),!1)}}),h}function o(e,t,i,n){for(var r,o,a,s,l=de.extend(!0,{},P().validPositions),u=E();u>=0&&(s=P().validPositions[u],!s||void 0==s.alternation||(r=u,o=P().validPositions[r].alternation,x(r).locator[s.alternation]==s.locator[s.alternation]));u--);if(void 0!=o)for(var c in P().validPositions)if(s=P().validPositions[c],parseInt(c)>parseInt(r)&&void 0!=s.alternation){var d=P().validPositions[r].locator[o].toString().split(","),f=s.locator[o]||d[0];f.length>0&&(f=f.split(",")[0]);for(var p=0;p<d.length;p++)if(f<d[p]){for(var h,g,v=c-1;v>=0;v--)if(h=P().validPositions[v],void 0!=h){g=h.locator[o],h.locator[o]=parseInt(d[p]);break}if(f!=h.locator[o]){for(var m=[],y=c;y<E()+1;y++){var b=P().validPositions[y];b&&null!=b.match.fn&&m.push(b.input),delete P().validPositions[y],delete P().tests[y]}for(A(!0),C.keepStatic=!C.keepStatic,a=!0;m.length>0;){var _=m.shift();if(_!=C.skipOptionalPartCharacter&&!(a=S(E()+1,_,!1,!0)))break}if(h.alternation=o,h.locator[o]=g,a){var w=E(e)+1;a=S(e>w?w:e,t,i,n)}if(C.keepStatic=!C.keepStatic,a)return a;A(),P().validPositions=de.extend(!0,{},l)}}break}return!1}function a(e,t){for(var i=P().validPositions[t],n=i.locator,r=n.length,o=e;t>o;o++)if(!v(o)){var a=_(o),s=a[0],l=-1;de.each(a,function(e,t){for(var i=0;r>i;i++)t.locator[i]&&H(t.locator[i].toString().split(","),n[i].toString().split(","))&&i>l&&(l=i,s=t)}),b(o,de.extend({},s,{input:s.match.def}),!0)}}i=i===!0;for(var s=w(),l=e-1;l>-1&&!P().validPositions[l];l--);for(l++;e>l;l++)void 0==P().validPositions[l]&&((!v(l)||s[l]!=y(l))&&_(l).length>1||s[l]==C.radixPoint||"0"==s[l]&&de.inArray(C.radixPoint,s)<l)&&r(l,s[l],!0);var u=e,c=!1,d=de.extend(!0,{},P().validPositions);if(u<m()&&(c=r(u,t,i,n),(!i||n)&&c===!1)){var f=P().validPositions[u];if(!f||null!=f.match.fn||f.match.def!=t&&t!=C.skipOptionalPartCharacter){if((C.insertMode||void 0==P().validPositions[D(u)])&&!v(u))for(var p=u+1,h=D(u);h>=p;p++)if(c=r(p,t,i,n),c!==!1){a(u,p),u=p;break}}else c={caret:D(u)}}if(c===!1&&C.keepStatic&&N(s)&&(c=o(e,t,i,n)),c===!0&&(c={pos:u}),de.isFunction(C.postValidation)&&0!=c&&!i){A(!0);var g=C.postValidation(w(),C);if(!g)return A(!0),P().validPositions=de.extend(!0,{},d),!1}return c}function v(e){var t=G(e);if(null!=t.fn)return t.fn;if(!C.keepStatic&&void 0==P().validPositions[e]){for(var i=_(e),n=!0,r=0;r<i.length;r++)if(""!=i[r].match.def&&(void 0==i[r].alternation||i[r].locator[i[r].alternation].length>1)){n=!1;break}return n}return!1}function m(){var e;d=c.prop("maxLength"),-1==d&&(d=void 0);var t,i=E(),n=P().validPositions[i],r=void 0!=n?n.locator.slice():void 0;for(t=i+1;void 0==n||null!=n.match.fn||null==n.match.fn&&""!=n.match.def;t++)n=x(t,r,t-1),r=n.locator.slice();var o=G(t-1);return e=""!=o.def?t:t-1,void 0==d||d>e?e:d}function D(e){var t=m();if(e>=t)return t;for(var i=e;++i<t&&!v(i)&&(C.nojumps!==!0||C.nojumpsThreshold>i););return i}function k(e){var t=e;if(0>=t)return 0;for(;--t>0&&!v(t););return t}function j(e){return void 0==P().validPositions[e]?y(e):P().validPositions[e].input}function O(e,t,i,n,r){if(n&&de.isFunction(C.onBeforeWrite)){var o=C.onBeforeWrite.call(e,n,t,i,C);if(o){if(o.refreshFromBuffer){var a=o.refreshFromBuffer;T(a===!0?a:a.start,a.end,o.buffer),A(!0),t=w()}i=o.caret||i}}e._valueSet(t.join("")),void 0!=i&&R(e,i),r===!0&&(g=!0,de(e).trigger("input"))}function y(e,t){if(t=t||G(e),void 0!=t.placeholder)return t.placeholder;if(null==t.fn){if(!C.keepStatic&&void 0==P().validPositions[e]){for(var i=_(e),n=!0,r=0;r<i.length;r++)if(""!=i[r].match.def&&(null!==i[r].match.fn||void 0==i[r].alternation||i[r].locator[i[r].alternation].length>1)){n=!1;break}if(n)return C.placeholder.charAt(e%C.placeholder.length)}return t.def}return C.placeholder.charAt(e%C.placeholder.length)}function l(s,e,l,t){function u(){var e=!1,t=f().slice(d,D(d)).join("").indexOf(c);if(-1!=t&&!v(d)){e=!0;for(var i=f().slice(d,d+t),n=0;n<i.length;n++)if(" "!=i[n]){e=!1;break}}return e}var i=void 0!=t?t.slice():s._valueGet().split(""),c="",d=0;if(A(),P().p=D(-1),e&&s._valueSet(""),!l){var n=f().slice(0,D(-1)).join(""),r=i.join("").match(new RegExp("^"+B(n),"g"));r&&r.length>0&&(i.splice(0,r.length*n.length),d=D(d))}de.each(i,function(e,t){var i=de.Event("keypress");i.which=t.charCodeAt(0),c+=t;var n=E(void 0,!0),r=P().validPositions[n],o=x(n+1,r?r.locator.slice():void 0,n);if(!u()||l){var a=l?e:null==o.match.fn&&o.match.optionality&&n+1<P().p?n+1:P().p;p.call(s,i,!0,!1,l,a),d=a+1,c=""}else p.call(s,i,!0,!1,!0,n+1)}),e&&O(s,w(),de(s).is(":focus")?D(E(0)):void 0,de.Event("checkval"))}function B(e){return de.inputmask.escapeRegex(e)}function V(e){if(e.data("_inputmask")&&!e.hasClass("hasDatepicker")){var t=[],i=P().validPositions;for(var n in i)i[n].match&&null!=i[n].match.fn&&t.push(i[n].input);var r=(I?t.reverse():t).join(""),o=(I?w().slice().reverse():w()).join("");return de.isFunction(C.onUnMask)&&(r=C.onUnMask.call(e,o,r,C)||r),r}return e[0]._valueGet()}function u(e){if(I&&"number"==typeof e&&(!C.greedy||""!=C.placeholder)){var t=w().length;e=t-e}return e}function R(e,t,i){var n,r=e.jquery&&e.length>0?e[0]:e;if("number"!=typeof t)return r.setSelectionRange?(t=r.selectionStart,i=r.selectionEnd):window.getSelection?(n=window.getSelection().getRangeAt(0),(n.commonAncestorContainer.parentNode==r||n.commonAncestorContainer==r)&&(t=n.startOffset,i=n.endOffset)):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),t=0-n.duplicate().moveStart("character",-1e5),i=t+n.text.length),{begin:u(t),end:u(i)};if(t=u(t),i=u(i),i="number"==typeof i?i:t,de(r).is(":visible")){var o=de(r).css("font-size").replace("px","")*i;if(r.scrollLeft=o>r.scrollWidth?o:0,ge||0!=C.insertMode||t!=i||i++,r.setSelectionRange)r.selectionStart=t,r.selectionEnd=i;else if(window.getSelection){if(n=document.createRange(),void 0==r.firstChild){var a=document.createTextNode("");r.appendChild(a)}n.setStart(r.firstChild,t<r._valueGet().length?t:r._valueGet().length),n.setEnd(r.firstChild,i<r._valueGet().length?i:r._valueGet().length),n.collapse(!0);var s=window.getSelection();s.removeAllRanges(),s.addRange(n)}else r.createTextRange&&(n=r.createTextRange(),n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n.select())}}function z(e){var t,i,n=w(),r=n.length,o=E(),a={},s=P().validPositions[o],l=void 0!=s?s.locator.slice():void 0;for(t=o+1;t<n.length;t++)i=x(t,l,t-1),l=i.locator.slice(),a[t]=de.extend(!0,{},i);var u=s&&void 0!=s.alternation?s.locator[s.alternation]:void 0;for(t=r-1;t>o&&(i=a[t],(i.match.optionality||i.match.optionalQuantifier||u&&(u!=a[t].locator[s.alternation]&&null!=i.match.fn||null==i.match.fn&&i.locator[s.alternation]&&H(i.locator[s.alternation].toString().split(","),u.split(","))&&""!=_(t)[0].def))&&n[t]==y(t,i.match));t--)r--;return e?{l:r,def:a[r]?a[r].match:void 0}:r}function U(e){for(var t=z(),i=e.length-1;i>t&&!v(i);i--);return e.splice(t,i+1-t),e}function N(e){if(de.isFunction(C.isComplete))return C.isComplete.call(c,e,C);if("*"==C.repeat)return void 0;{var t=!1,i=z(!0),n=k(i.l);E()}if(void 0==i.def||i.def.newBlockMarker||i.def.optionality||i.def.optionalQuantifier){t=!0;for(var r=0;n>=r;r++){var o=x(r).match;if(null!=o.fn&&void 0==P().validPositions[r]&&o.optionality!==!0&&o.optionalQuantifier!==!0||null==o.fn&&e[r]!=y(r,o)){t=!1;break}}}return t}function Y(e,t){return I?e-t>1||e-t==1&&C.insertMode:t-e>1||t-e==1&&C.insertMode}function q(e){var t=de._data(e).events,n=!1;de.each(t,function(e,t){de.each(t,function(e,t){if("inputmask"==t.namespace&&"setvalue"!=t.type){var i=t.handler;t.handler=function(e){if(!(this.disabled||this.readOnly&&!("keydown"==e.type&&e.ctrlKey&&67==e.keyCode||e.keyCode==de.inputmask.keyCode.TAB))){switch(e.type){case"input":if(g===!0||n===!0)return g=!1,e.preventDefault();break;case"keydown":h=!1,n=!1;break;case"keypress":if(h===!0)return e.preventDefault();h=!0;break;case"compositionstart":n=!0;break;case"compositionupdate":g=!0;break;case"compositionend":n=!1}return i.apply(this,arguments)}e.preventDefault()}}})})}function X(t){function e(e){if(void 0==de.valHooks[e]||1!=de.valHooks[e].inputmaskpatch){var a=de.valHooks[e]&&de.valHooks[e].get?de.valHooks[e].get:function(e){return e.value},o=de.valHooks[e]&&de.valHooks[e].set?de.valHooks[e].set:function(e,t){return e.value=t,e};de.valHooks[e]={get:function(e){var t=de(e);if(t.data("_inputmask")){if(t.data("_inputmask").opts.autoUnmask)return t.inputmask("unmaskedvalue");var i=a(e),n=t.data("_inputmask"),r=n.maskset,o=r._buffer;return o=o?o.join(""):"",i!=o?i:""}return a(e)},set:function(e,t){var i,n=de(e),r=n.data("_inputmask");return i=o(e,t),r&&n.triggerHandler("setvalue.inputmask"),i},inputmaskpatch:!0}}}function i(){var e=de(this),t=de(this).data("_inputmask");return t?t.opts.autoUnmask?e.inputmask("unmaskedvalue"):o.call(this)!=f().join("")?o.call(this):"":o.call(this)}function n(e){var t=de(this).data("_inputmask");a.call(this,e),t&&de(this).triggerHandler("setvalue.inputmask")}function r(e){de(e).bind("mouseenter.inputmask",function(e){var t=de(this),i=this,n=i._valueGet();""!=n&&n!=w().join("")&&t.triggerHandler("setvalue.inputmask")});var t=de._data(e).events,i=t.mouseover;if(i){for(var n=i[i.length-1],r=i.length-1;r>0;r--)i[r]=i[r-1];i[0]=n}}var o,a;if(!t._valueGet){var s;Object.getOwnPropertyDescriptor&&void 0==t.value?(o=function(){return this.textContent},a=function(e){this.textContent=e},Object.defineProperty(t,"value",{get:i,set:n})):((s=Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(t,"value"))&&s.configurable,document.__lookupGetter__&&t.__lookupGetter__("value")?(o=t.__lookupGetter__("value"),a=t.__lookupSetter__("value"),t.__defineGetter__("value",i),t.__defineSetter__("value",n)):(o=function(){return t.value},a=function(e){t.value=e},e(t.type),r(t))),t._valueGet=function(e){return I&&e!==!0?o.call(this).split("").reverse().join(""):o.call(this)},t._valueSet=function(e){a.call(this,I?e.split("").reverse().join(""):e)}}}function K(o,e,t,i){function n(){if(C.keepStatic){A(!0);var e,t=[],i=de.extend(!0,{},P().validPositions);for(e=E();e>=0;e--){var n=P().validPositions[e];if(n){if(void 0!=n.alternation&&n.locator[n.alternation]==x(e).locator[n.alternation])break;null!=n.match.fn&&t.push(n.input),delete P().validPositions[e]}}if(e>0)for(;t.length>0;){P().p=D(E());var r=de.Event("keypress");r.which=t.pop().charCodeAt(0),p.call(o,r,!0,!1,!1,P().p)}else P().validPositions=de.extend(!0,{},i)}}if((C.numericInput||I)&&(e==de.inputmask.keyCode.BACKSPACE?e=de.inputmask.keyCode.DELETE:e==de.inputmask.keyCode.DELETE&&(e=de.inputmask.keyCode.BACKSPACE),I)){var r=t.end;t.end=t.begin,t.begin=r}if(e==de.inputmask.keyCode.BACKSPACE&&(t.end-t.begin<1||0==C.insertMode)?t.begin=k(t.begin):e==de.inputmask.keyCode.DELETE&&t.begin==t.end&&(t.end=v(t.end)?t.end+1:D(t.end)+1),F(t.begin,t.end,!1,i),i!==!0){n();var a=E(t.begin);a<t.begin?(-1==a&&A(),P().p=D(a)):P().p=t.begin}}function Q(t){var i=this,e=de(i),n=t.keyCode,r=R(i);n==de.inputmask.keyCode.BACKSPACE||n==de.inputmask.keyCode.DELETE||he&&127==n||t.ctrlKey&&88==n&&!fe("cut")?(t.preventDefault(),88==n&&(a=w().join("")),K(i,n,r),O(i,w(),P().p,t,a!=w().join("")),i._valueGet()==f().join("")?e.trigger("cleared"):N(w())===!0&&e.trigger("complete"),C.showTooltip&&e.prop("title",P().mask)):n==de.inputmask.keyCode.END||n==de.inputmask.keyCode.PAGE_DOWN?setTimeout(function(){var e=D(E());C.insertMode||e!=m()||t.shiftKey||e--,R(i,t.shiftKey?r.begin:e,e)},0):n==de.inputmask.keyCode.HOME&&!t.shiftKey||n==de.inputmask.keyCode.PAGE_UP?R(i,0,t.shiftKey?r.begin:0):(C.undoOnEscape&&n==de.inputmask.keyCode.ESCAPE||90==n&&t.ctrlKey)&&t.altKey!==!0?(l(i,!0,!1,a.split("")),e.click()):n!=de.inputmask.keyCode.INSERT||t.shiftKey||t.ctrlKey?0!=C.insertMode||t.shiftKey||(n==de.inputmask.keyCode.RIGHT?setTimeout(function(){var e=R(i);R(i,e.begin)},0):n==de.inputmask.keyCode.LEFT&&setTimeout(function(){var e=R(i);R(i,I?e.begin+1:e.begin-1)},0)):(C.insertMode=!C.insertMode,R(i,C.insertMode||r.begin!=m()?r.begin:r.begin-1)),C.onKeyDown.call(this,t,w(),R(i).begin,C),oe=-1!=de.inArray(n,C.ignorables)}function p(e,t,i,n,r){var o=this,a=de(o),s=e.which||e.charCode||e.keyCode;if(!(t===!0||e.ctrlKey&&e.altKey)&&(e.ctrlKey||e.metaKey||oe))return!0;if(s){46==s&&0==e.shiftKey&&","==C.radixPoint&&(s=44);var l,u=t?{begin:r,end:r}:R(o),c=String.fromCharCode(s),d=Y(u.begin,u.end);d&&(P().undoPositions=de.extend(!0,{},P().validPositions),K(o,de.inputmask.keyCode.DELETE,u,!0),u.begin=P().p,C.insertMode||(C.insertMode=!C.insertMode,b(u.begin,n),C.insertMode=!C.insertMode),d=!C.multi),P().writeOutBuffer=!0;var f=I&&!d?u.end:u.begin,p=S(f,c,n);if(p!==!1){if(p!==!0&&(f=void 0!=p.pos?p.pos:f,c=void 0!=p.c?p.c:c),A(!0),void 0!=p.caret)l=p.caret;else{var h=P().validPositions;l=!C.keepStatic&&(void 0!=h[f+1]&&_(f+1,h[f].locator.slice(),f).length>1||void 0!=h[f].alternation)?f+1:D(f)}P().p=l}if(i!==!1){var g=this;if(setTimeout(function(){C.onKeyValidation.call(g,p,C)},0),P().writeOutBuffer&&p!==!1){var v=w();O(o,v,t?void 0:C.numericInput?k(l):l,e,t!==!0),t!==!0&&setTimeout(function(){N(v)===!0&&a.trigger("complete")},0)}else d&&(P().buffer=void 0,P().validPositions=P().undoPositions)}else d&&(P().buffer=void 0,P().validPositions=P().undoPositions);if(C.showTooltip&&a.prop("title",P().mask),t&&de.isFunction(C.onBeforeWrite)){var m=C.onBeforeWrite.call(this,e,w(),l,C);if(m&&m.refreshFromBuffer){var y=m.refreshFromBuffer;T(y===!0?y:y.start,y.end,m.buffer),A(!0),m.caret&&(P().p=m.caret)}}e.preventDefault()}}function Z(e){var t=this,i=de(t),n=t._valueGet(!0),r=R(t);if("propertychange"==e.type&&t._valueGet().length<=m())return!0;if("paste"==e.type){var o=n.substr(0,r.begin),a=n.substr(r.end,n.length);o==f().slice(0,r.begin).join("")&&(o=""),a==f().slice(r.end).join("")&&(a=""),window.clipboardData&&window.clipboardData.getData?n=o+window.clipboardData.getData("Text")+a:e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.getData&&(n=o+e.originalEvent.clipboardData.getData("text/plain")+a)}var s=n;if(de.isFunction(C.onBeforePaste)){if(s=C.onBeforePaste.call(t,n,C),s===!1)return e.preventDefault(),!1;s||(s=n)}return l(t,!0,!1,I?s.split("").reverse():s.split("")),i.click(),N(w())===!0&&i.trigger("complete"),!1}function J(e){var t=this;l(t,!0,!1),N(w())===!0&&de(t).trigger("complete"),e.preventDefault()}function ee(e){var t=this;a=w().join(""),(""==s||0!=e.originalEvent.data.indexOf(s))&&(re=R(t))}function te(e){var t=this,i=re||R(t);0==e.originalEvent.data.indexOf(s)&&(A(),i={begin:0,end:0});var n=e.originalEvent.data;R(t,i.begin,i.end);for(var r=0;r<n.length;r++){var o=de.Event("keypress");o.which=n.charCodeAt(r),h=!1,oe=!1,p.call(t,o)}setTimeout(function(){var e=P().p;O(t,w(),C.numericInput?k(e):e)},0),s=e.originalEvent.data}function ie(e){}function ne(e){if(c=de(e),c.data("_inputmask",{maskset:o,opts:C,isRTL:!1}),C.showTooltip&&c.prop("title",P().mask),("rtl"==e.dir||C.rightAlign)&&c.css("text-align","right"),"rtl"==e.dir||C.numericInput){e.dir="ltr",c.removeAttr("dir");var t=c.data("_inputmask");t.isRTL=!0,c.data("_inputmask",t),I=!0}c.unbind(".inputmask"),(c.is(":input")&&pe(c.attr("type"))||e.isContentEditable)&&(c.closest("form").bind("submit",function(e){a!=w().join("")&&c.change(),c[0]._valueGet&&c[0]._valueGet()==f().join("")&&c[0]._valueSet(""),C.removeMaskOnSubmit&&c.inputmask("remove")}).bind("reset",function(){setTimeout(function(){c.triggerHandler("setvalue.inputmask")},0)}),c.bind("mouseenter.inputmask",function(){var e=de(this),t=this;!e.is(":focus")&&C.showMaskOnHover&&t._valueGet()!=w().join("")&&O(t,w())}).bind("blur.inputmask",function(e){var t=de(this),i=this;if(t.data("_inputmask")){var n=i._valueGet(),r=w().slice();ae=!0,a!=r.join("")&&setTimeout(function(){t.change(),a=r.join("")},0),""!=n&&(C.clearMaskOnLostFocus&&(n==f().join("")?r=[]:U(r)),N(r)===!1&&(t.trigger("incomplete"),C.clearIncomplete&&(A(),r=C.clearMaskOnLostFocus?[]:f().slice())),O(i,r,void 0,e))}}).bind("focus.inputmask",function(e){var t=(de(this),this),i=t._valueGet();C.showMaskOnFocus&&(!C.showMaskOnHover||C.showMaskOnHover&&""==i)&&t._valueGet()!=w().join("")&&O(t,w(),D(E())),a=w().join("")}).bind("mouseleave.inputmask",function(){var e=de(this),t=this;if(C.clearMaskOnLostFocus){var i=w().slice(),n=t._valueGet();e.is(":focus")||n==e.attr("placeholder")||""==n||(n==f().join("")?i=[]:U(i),O(t,i))}}).bind("click.inputmask",function(){var e=de(this),t=this;if(e.is(":focus")){var i=R(t);if(i.begin==i.end)if(C.radixFocus&&""!=C.radixPoint&&-1!=de.inArray(C.radixPoint,w())&&(ae||w().join("")==f().join("")))R(t,de.inArray(C.radixPoint,w())),ae=!1;else{var n=u(i.begin),r=D(E(n));r>n?R(t,v(n)?n:D(n)):R(t,r)}}}).bind("dblclick.inputmask",function(){var e=this;setTimeout(function(){R(e,0,D(E()))},0)}).bind(me+".inputmask dragdrop.inputmask drop.inputmask",Z).bind("cut.inputmask",function(e){g=!0;var t=this,i=de(t),n=R(t);K(t,de.inputmask.keyCode.DELETE,n),O(t,w(),P().p,e,a!=w().join("")),t._valueGet()==f().join("")&&i.trigger("cleared"),C.showTooltip&&i.prop("title",P().mask)}).bind("complete.inputmask",C.oncomplete).bind("incomplete.inputmask",C.onincomplete).bind("cleared.inputmask",C.oncleared),c.bind("keydown.inputmask",Q).bind("keypress.inputmask",p),ve||c.bind("compositionstart.inputmask",ee).bind("compositionupdate.inputmask",te).bind("compositionend.inputmask",ie),"paste"===me&&c.bind("input.inputmask",J)),c.bind("setvalue.inputmask",function(){var e=this,t=e._valueGet();e._valueSet(de.isFunction(C.onBeforeMask)?C.onBeforeMask.call(e,t,C)||t:t),l(e,!0,!1),a=w().join(""),(C.clearMaskOnLostFocus||C.clearIncomplete)&&e._valueGet()==f().join("")&&e._valueSet("")}),X(e);var i=de.isFunction(C.onBeforeMask)?C.onBeforeMask.call(e,e._valueGet(),C)||e._valueGet():e._valueGet();l(e,!0,!1,i.split(""));var n=w().slice();a=n.join("");var r;try{r=document.activeElement}catch(e){}N(n)===!1&&C.clearIncomplete&&A(),C.clearMaskOnLostFocus&&(n.join("")==f().join("")?n=[]:U(n)),O(e,n),r===e&&R(e,D(E())),q(e)}var a,re,s,c,d,I=!1,h=!1,g=!1,oe=!1,ae=!0;if(void 0!=e)switch(e.action){case"isComplete":return c=de(e.el),o=c.data("_inputmask").maskset,C=c.data("_inputmask").opts,N(e.buffer);case"unmaskedvalue":return c=e.$input,o=c.data("_inputmask").maskset,C=c.data("_inputmask").opts,I=e.$input.data("_inputmask").isRTL,V(e.$input);case"mask":a=w().join(""),ne(e.el);break;case"format":c=de({}),c.data("_inputmask",{maskset:o,opts:C,isRTL:C.numericInput}),C.numericInput&&(I=!0);var t=(de.isFunction(C.onBeforeMask)?C.onBeforeMask.call(c,e.value,C)||e.value:e.value).split("");return l(c,!1,!1,I?t.reverse():t),de.isFunction(C.onBeforeWrite)&&C.onBeforeWrite.call(this,void 0,w(),0,C),e.metadata?{value:I?w().slice().reverse().join(""):w().join(""),metadata:c.inputmask("getmetadata")}:I?w().slice().reverse().join(""):w().join("");case"isValid":c=de({}),c.data("_inputmask",{maskset:o,opts:C,isRTL:C.numericInput}),C.numericInput&&(I=!0);var t=e.value.split("");l(c,!1,!0,I?t.reverse():t);for(var i=w(),se=z(),n=i.length-1;n>se&&!v(n);n--);return i.splice(se,n+1-se),N(i)&&e.value==i.join("");case"getemptymask":return c=de(e.el),o=c.data("_inputmask").maskset,C=c.data("_inputmask").opts,f();case"remove":var r=e.el;c=de(r),o=c.data("_inputmask").maskset,C=c.data("_inputmask").opts,r._valueSet(V(c)),c.unbind(".inputmask"),c.removeData("_inputmask");var le;Object.getOwnPropertyDescriptor&&(le=Object.getOwnPropertyDescriptor(r,"value")),le&&le.get?r._valueGet&&Object.defineProperty(r,"value",{get:r._valueGet,set:r._valueSet}):document.__lookupGetter__&&r.__lookupGetter__("value")&&r._valueGet&&(r.__defineGetter__("value",r._valueGet),r.__defineSetter__("value",r._valueSet));try{delete r._valueGet,delete r._valueSet}catch(e){r._valueGet=void 0,r._valueSet=void 0}break;case"getmetadata":if(c=de(e.el),o=c.data("_inputmask").maskset,C=c.data("_inputmask").opts,de.isArray(o.metadata)){for(var ue,ce=E(),M=ce;M>=0;M--)if(P().validPositions[M]&&void 0!=P().validPositions[M].alternation){ue=P().validPositions[M].alternation;break}return void 0!=ue?o.metadata[P().validPositions[ce].locator[ue]]:o.metadata[0]}return o.metadata}}if(void 0===de.fn.inputmask){var e=navigator.userAgent,he=null!==e.match(new RegExp("iphone","i")),ge=(null!==e.match(new RegExp("android.*safari.*","i")),null!==e.match(new RegExp("android.*chrome.*","i"))),ve=null!==e.match(new RegExp("android.*firefox.*","i")),me=(/Kindle/i.test(e)||/Silk/i.test(e)||/KFTT/i.test(e)||/KFOT/i.test(e)||/KFJWA/i.test(e)||/KFJWI/i.test(e)||/KFSOWI/i.test(e)||/KFTHWA/i.test(e)||/KFTHWI/i.test(e)||/KFAPWA/i.test(e)||/KFAPWI/i.test(e),fe("paste")?"paste":fe("input")?"input":"propertychange");de.inputmask={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},alternatormarker:"|",escapeChar:"\\",mask:null,oncomplete:de.noop,onincomplete:de.noop,oncleared:de.noop,repeat:0,greedy:!0,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,aliases:{},alias:null,onKeyDown:de.noop,onBeforeMask:void 0,onBeforePaste:void 0,onBeforeWrite:void 0,onUnMask:void 0,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:de.noop,skipOptionalPartCharacter:" ",showTooltip:!1,numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",radixFocus:!1,nojumps:!1,nojumpsThreshold:0,keepStatic:void 0,definitions:{9:{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},a:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",cardinality:1,definitionSymbol:"*"},"*":{validator:"[0-9A-Za-zА-яЁёÀ-ÿµ]",cardinality:1}},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],isComplete:void 0,canClearPosition:de.noop,postValidation:void 0},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},masksCache:{},escapeRegex:function(e){var t=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return e.replace(new RegExp("(\\"+t.join("|\\")+")","gim"),"\\$1")},format:function(e,t,i){var n=de.extend(!0,{},de.inputmask.defaults,t);return a(n.alias,t,n),l({action:"format",value:e,metadata:i},s(n,t&&void 0!==t.definitions),n)},isValid:function(e,t){var i=de.extend(!0,{},de.inputmask.defaults,t);return a(i.alias,t,i),l({action:"isValid",value:e},s(i,t&&void 0!==t.definitions),i)}},de.fn.inputmask=function(e,n){function r(e,t,i){var n=de(e);n.data("inputmask-alias")&&a(n.data("inputmask-alias"),de.extend(!0,{},t),t);for(var r in t){var o=n.data("inputmask-"+r.toLowerCase());void 0!=o&&(o="boolean"==typeof o?o:o.toString(),"mask"==r&&0==o.indexOf("[")?(t[r]=o.replace(/[\s[\]]/g,"").split("','"),t[r][0]=t[r][0].replace("'",""),t[r][t[r].length-1]=t[r][t[r].length-1].replace("'","")):t[r]=o,i&&(i[r]=t[r]))}return t}var t,o=de.extend(!0,{},de.inputmask.defaults,n);if("string"==typeof e)switch(e){case"mask":return a(o.alias,n,o),this.each(function(){return r(this,o),t=s(o,n&&void 0!==n.definitions),void 0==t?this:void l({action:"mask",el:this},t,o)});case"unmaskedvalue":var i=de(this);return i.data("_inputmask")?l({action:"unmaskedvalue",$input:i}):i.val();case"remove":return this.each(function(){var e=de(this);e.data("_inputmask")&&l({action:"remove",el:this})});case"getemptymask":return this.data("_inputmask")?l({action:"getemptymask",el:this}):"";case"hasMaskedValue":return this.data("_inputmask")?!this.data("_inputmask").opts.autoUnmask:!1;case"isComplete":return this.data("_inputmask")?l({action:"isComplete",buffer:this[0]._valueGet().split(""),el:this}):!0;case"getmetadata":return this.data("_inputmask")?l({action:"getmetadata",el:this}):void 0;default:return a(o.alias,n,o),a(e,n,o)||(o.mask=e),this.each(function(){return r(this,o),t=s(o,n&&void 0!==n.definitions),void 0==t?this:void l({action:"mask",el:this},t,o)})}else{if("object"==typeof e)return o=de.extend(!0,{},de.inputmask.defaults,e),a(o.alias,e,o),this.each(function(){return r(this,o),t=s(o,e&&void 0!==e.definitions),void 0==t?this:void l({action:"mask",el:this},t,o)});if(void 0==e)return this.each(function(){var e=de(this).attr("data-inputmask");if(e&&""!=e)try{e=e.replace(new RegExp("'","g"),'"');var t=de.parseJSON("{"+e+"}");de.extend(!0,t,n),o=de.extend(!0,{},de.inputmask.defaults,t),o=r(this,o),a(o.alias,t,o),o.alias=void 0,de(this).inputmask("mask",o)}catch(e){}if(de(this).attr("data-inputmask-mask")||de(this).attr("data-inputmask-alias")){o=de.extend(!0,{},de.inputmask.defaults,{});var i={};o=r(this,o,i),a(o.alias,i,o),o.alias=void 0,de(this).inputmask("mask",o)}})}}}return de.fn.inputmask}(jQuery),function(a){return a.extend(a.inputmask.defaults.definitions,{h:{validator:"[01][0-9]|2[0-3]",cardinality:2,prevalidator:[{validator:"[0-2]",cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:"[0-5]",cardinality:1}]},d:{validator:"0[1-9]|[12][0-9]|3[01]",cardinality:2,prevalidator:[{validator:"[0-3]",cardinality:1}]},m:{validator:"0[1-9]|1[012]",cardinality:2,prevalidator:[{validator:"[01]",cardinality:1}]},y:{validator:"(19|20)\\d{2}",cardinality:4,prevalidator:[{validator:"[12]",cardinality:1},{validator:"(19|20)",cardinality:2},{validator:"(19|20)\\d",cardinality:3}]}}),a.extend(a.inputmask.defaults.aliases,{"dd/mm/yyyy":{mask:"1/2/y",placeholder:"dd/mm/yyyy",regex:{val1pre:new RegExp("[0-3]"),val1:new RegExp("0[1-9]|[12][0-9]|3[01]"),val2pre:function(e){var t=a.inputmask.escapeRegex.call(this,e);return new RegExp("((0[1-9]|[12][0-9]|3[01])"+t+"[01])")},val2:function(e){var t=a.inputmask.escapeRegex.call(this,e);return new RegExp("((0[1-9]|[12][0-9])"+t+"(0[1-9]|1[012]))|(30"+t+"(0[13-9]|1[012]))|(31"+t+"(0[13578]|1[02]))")}},leapday:"29/02/",separator:"/",yearrange:{minyear:1900,maxyear:2099},isInYearRange:function(e,t,i){if(isNaN(e))return!1;var n=parseInt(e.concat(t.toString().slice(e.length))),r=parseInt(e.concat(i.toString().slice(e.length)));return(isNaN(n)?!1:n>=t&&i>=n)||(isNaN(r)?!1:r>=t&&i>=r)},determinebaseyear:function(e,t,i){var n=(new Date).getFullYear();if(e>n)return e;if(n>t){for(var r=t.toString().slice(0,2),o=t.toString().slice(2,4);r+i>t;)r--;var a=r+o;return e>a?e:a}return n},onKeyDown:function(e,t,i,n){var r=a(this);if(e.ctrlKey&&e.keyCode==a.inputmask.keyCode.RIGHT){var o=new Date;r.val(o.getDate().toString()+(o.getMonth()+1).toString()+o.getFullYear().toString()),r.triggerHandler("setvalue.inputmask")}},getFrontValue:function(e,t,i){for(var n=0,r=0,o=0;o<e.length&&"2"!=e.charAt(o);o++){var a=i.definitions[e.charAt(o)];a?(n+=r,r=a.cardinality):r++}return t.join("").substr(n,r)},definitions:{1:{validator:function(e,t,i,n,r){var o=r.regex.val1.test(e);return n||o||e.charAt(1)!=r.separator&&-1=="-./".indexOf(e.charAt(1))||!(o=r.regex.val1.test("0"+e.charAt(0)))?o:(t.buffer[i-1]="0",{refreshFromBuffer:{start:i-1,end:i},pos:i,c:e.charAt(0)})},cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){var o=e;isNaN(t.buffer[i+1])||(o+=t.buffer[i+1]);var a=1==o.length?r.regex.val1pre.test(o):r.regex.val1.test(o);if(!n&&!a){if(a=r.regex.val1.test(e+"0"))return t.buffer[i]=e,t.buffer[++i]="0",{pos:i,c:"0"};if(a=r.regex.val1.test("0"+e))return t.buffer[i]="0",i++,{pos:i}}return a},cardinality:1}]},2:{validator:function(e,t,i,n,r){var o=r.getFrontValue(t.mask,t.buffer,r);-1!=o.indexOf(r.placeholder[0])&&(o="01"+r.separator);var a=r.regex.val2(r.separator).test(o+e);if(!n&&!a&&(e.charAt(1)==r.separator||-1!="-./".indexOf(e.charAt(1)))&&(a=r.regex.val2(r.separator).test(o+"0"+e.charAt(0))))return t.buffer[i-1]="0",{refreshFromBuffer:{start:i-1,end:i},pos:i,c:e.charAt(0)};if(r.mask.indexOf("2")==r.mask.length-1&&a){var s=t.buffer.join("").substr(4,4)+e;if(s!=r.leapday)return!0;var l=parseInt(t.buffer.join("").substr(0,4),10);return l%4===0?l%100===0?l%400===0?!0:!1:!0:!1}return a},cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){isNaN(t.buffer[i+1])||(e+=t.buffer[i+1]);var o=r.getFrontValue(t.mask,t.buffer,r);-1!=o.indexOf(r.placeholder[0])&&(o="01"+r.separator);var a=1==e.length?r.regex.val2pre(r.separator).test(o+e):r.regex.val2(r.separator).test(o+e);return n||a||!(a=r.regex.val2(r.separator).test(o+"0"+e))?a:(t.buffer[i]="0",i++,{pos:i})},cardinality:1}]},y:{validator:function(e,t,i,n,r){if(r.isInYearRange(e,r.yearrange.minyear,r.yearrange.maxyear)){var o=t.buffer.join("").substr(0,6);if(o!=r.leapday)return!0;var a=parseInt(e,10);return a%4===0?a%100===0?a%400===0?!0:!1:!0:!1}return!1},cardinality:4,prevalidator:[{validator:function(e,t,i,n,r){var o=r.isInYearRange(e,r.yearrange.minyear,r.yearrange.maxyear);if(!n&&!o){var a=r.determinebaseyear(r.yearrange.minyear,r.yearrange.maxyear,e+"0").toString().slice(0,1);if(o=r.isInYearRange(a+e,r.yearrange.minyear,r.yearrange.maxyear))return t.buffer[i++]=a.charAt(0),{pos:i};if(a=r.determinebaseyear(r.yearrange.minyear,r.yearrange.maxyear,e+"0").toString().slice(0,2),o=r.isInYearRange(a+e,r.yearrange.minyear,r.yearrange.maxyear))return t.buffer[i++]=a.charAt(0),t.buffer[i++]=a.charAt(1),{pos:i}}return o},cardinality:1},{validator:function(e,t,i,n,r){var o=r.isInYearRange(e,r.yearrange.minyear,r.yearrange.maxyear);if(!n&&!o){var a=r.determinebaseyear(r.yearrange.minyear,r.yearrange.maxyear,e).toString().slice(0,2);if(o=r.isInYearRange(e[0]+a[1]+e[1],r.yearrange.minyear,r.yearrange.maxyear))return t.buffer[i++]=a.charAt(1),{pos:i};if(a=r.determinebaseyear(r.yearrange.minyear,r.yearrange.maxyear,e).toString().slice(0,2),r.isInYearRange(a+e,r.yearrange.minyear,r.yearrange.maxyear)){var s=t.buffer.join("").substr(0,6);if(s!=r.leapday)o=!0;else{var l=parseInt(e,10);o=l%4===0?l%100===0?l%400===0?!0:!1:!0:!1}}else o=!1;if(o)return t.buffer[i-1]=a.charAt(0),t.buffer[i++]=a.charAt(1),t.buffer[i++]=e.charAt(0),{refreshFromBuffer:{start:i-3,end:i},pos:i}}return o},cardinality:2},{validator:function(e,t,i,n,r){return r.isInYearRange(e,r.yearrange.minyear,r.yearrange.maxyear)},cardinality:3}]}},insertMode:!1,autoUnmask:!1},"mm/dd/yyyy":{placeholder:"mm/dd/yyyy",alias:"dd/mm/yyyy",regex:{val2pre:function(e){var t=a.inputmask.escapeRegex.call(this,e);return new RegExp("((0[13-9]|1[012])"+t+"[0-3])|(02"+t+"[0-2])")},val2:function(e){var t=a.inputmask.escapeRegex.call(this,e);return new RegExp("((0[1-9]|1[012])"+t+"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])"+t+"30)|((0[13578]|1[02])"+t+"31)")},val1pre:new RegExp("[01]"),val1:new RegExp("0[1-9]|1[012]")},leapday:"02/29/",onKeyDown:function(e,t,i,n){var r=a(this);if(e.ctrlKey&&e.keyCode==a.inputmask.keyCode.RIGHT){var o=new Date;r.val((o.getMonth()+1).toString()+o.getDate().toString()+o.getFullYear().toString()),r.triggerHandler("setvalue.inputmask")}}},"yyyy/mm/dd":{mask:"y/1/2",placeholder:"yyyy/mm/dd",alias:"mm/dd/yyyy",leapday:"/02/29",onKeyDown:function(e,t,i,n){var r=a(this);if(e.ctrlKey&&e.keyCode==a.inputmask.keyCode.RIGHT){var o=new Date;r.val(o.getFullYear().toString()+(o.getMonth()+1).toString()+o.getDate().toString()),r.triggerHandler("setvalue.inputmask")}}},"dd.mm.yyyy":{mask:"1.2.y",placeholder:"dd.mm.yyyy",leapday:"29.02.",separator:".",alias:"dd/mm/yyyy"},"dd-mm-yyyy":{mask:"1-2-y",placeholder:"dd-mm-yyyy",leapday:"29-02-",separator:"-",alias:"dd/mm/yyyy"},"mm.dd.yyyy":{mask:"1.2.y",placeholder:"mm.dd.yyyy",leapday:"02.29.",separator:".",alias:"mm/dd/yyyy"},"mm-dd-yyyy":{mask:"1-2-y",placeholder:"mm-dd-yyyy",leapday:"02-29-",separator:"-",alias:"mm/dd/yyyy"},"yyyy.mm.dd":{mask:"y.1.2",placeholder:"yyyy.mm.dd",leapday:".02.29",separator:".",alias:"yyyy/mm/dd"},"yyyy-mm-dd":{mask:"y-1-2",placeholder:"yyyy-mm-dd",leapday:"-02-29",separator:"-",alias:"yyyy/mm/dd"},datetime:{mask:"1/2/y h:s",placeholder:"dd/mm/yyyy hh:mm",alias:"dd/mm/yyyy",regex:{hrspre:new RegExp("[012]"),hrs24:new RegExp("2[0-4]|1[3-9]"),hrs:new RegExp("[01][0-9]|2[0-4]"),ampm:new RegExp("^[a|p|A|P][m|M]"),mspre:new RegExp("[0-5]"),ms:new RegExp("[0-5][0-9]")},timeseparator:":",hourFormat:"24",definitions:{h:{validator:function(e,t,i,n,r){if("24"==r.hourFormat&&24==parseInt(e,10))return t.buffer[i-1]="0",t.buffer[i]="0",{refreshFromBuffer:{start:i-1,end:i},c:"0"};var o=r.regex.hrs.test(e);if(!n&&!o&&(e.charAt(1)==r.timeseparator||-1!="-.:".indexOf(e.charAt(1)))&&(o=r.regex.hrs.test("0"+e.charAt(0))))return t.buffer[i-1]="0",t.buffer[i]=e.charAt(0),i++,{refreshFromBuffer:{start:i-2,end:i},pos:i,c:r.timeseparator};if(o&&"24"!==r.hourFormat&&r.regex.hrs24.test(e)){var a=parseInt(e,10);return 24==a?(t.buffer[i+5]="a",t.buffer[i+6]="m"):(t.buffer[i+5]="p",t.buffer[i+6]="m"),a-=12,10>a?(t.buffer[i]=a.toString(),t.buffer[i-1]="0"):(t.buffer[i]=a.toString().charAt(1),t.buffer[i-1]=a.toString().charAt(0)),{refreshFromBuffer:{start:i-1,end:i+6},c:t.buffer[i]}}return o},cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){var o=r.regex.hrspre.test(e);return n||o||!(o=r.regex.hrs.test("0"+e))?o:(t.buffer[i]="0",i++,{pos:i})},cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){var o=r.regex.mspre.test(e);return n||o||!(o=r.regex.ms.test("0"+e))?o:(t.buffer[i]="0",i++,{pos:i})},cardinality:1}]},t:{validator:function(e,t,i,n,r){return r.regex.ampm.test(e+"m")},casing:"lower",cardinality:1}},insertMode:!1,autoUnmask:!1},datetime12:{mask:"1/2/y h:s t\\m",placeholder:"dd/mm/yyyy hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:s t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm:ss":{mask:"h:s:s",placeholder:"hh:mm:ss",alias:"datetime",autoUnmask:!1},"hh:mm":{mask:"h:s",placeholder:"hh:mm",alias:"datetime",autoUnmask:!1},date:{alias:"dd/mm/yyyy"},"mm/yyyy":{mask:"1/y",placeholder:"mm/yyyy",leapday:"donotuse",separator:"/",alias:"mm/dd/yyyy"}}),a.fn.inputmask}(jQuery),function(e){return e.extend(e.inputmask.defaults.definitions,{A:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",cardinality:1,casing:"upper"},"#":{validator:"[0-9A-Za-zА-яЁёÀ-ÿµ]",cardinality:1,casing:"upper"}}),e.extend(e.inputmask.defaults.aliases,{url:{mask:"ir",placeholder:"",separator:"",defaultPrefix:"http://",regex:{urlpre1:new RegExp("[fh]"),urlpre2:new RegExp("(ft|ht)"),urlpre3:new RegExp("(ftp|htt)"),urlpre4:new RegExp("(ftp:|http|ftps)"),urlpre5:new RegExp("(ftp:/|ftps:|http:|https)"),urlpre6:new RegExp("(ftp://|ftps:/|http:/|https:)"),urlpre7:new RegExp("(ftp://|ftps://|http://|https:/)"),urlpre8:new RegExp("(ftp://|ftps://|http://|https://)")},definitions:{i:{validator:function(e,t,i,n,r){return!0},cardinality:8,prevalidator:function(){for(var e=[],t=8,i=0;t>i;i++)e[i]=function(){var l=i;return{validator:function(e,t,i,n,r){if(r.regex["urlpre"+(l+1)]){var o,a=e;l+1-e.length>0&&(a=t.buffer.join("").substring(0,l+1-e.length)+""+a);var s=r.regex["urlpre"+(l+1)].test(a);if(!n&&!s){for(i-=l,o=0;o<r.defaultPrefix.length;o++)t.buffer[i]=r.defaultPrefix[o],i++;for(o=0;o<a.length-1;o++)t.buffer[i]=a[o],i++;return{pos:i}}return s}return!1},cardinality:l}}();return e}()},r:{validator:".",cardinality:50}},insertMode:!1,autoUnmask:!1},ip:{mask:"i[i[i]].i[i[i]].i[i[i]].i[i[i]]",definitions:{i:{validator:function(e,t,i,n,r){return i-1>-1&&"."!=t.buffer[i-1]?(e=t.buffer[i-1]+e,e=i-2>-1&&"."!=t.buffer[i-2]?t.buffer[i-2]+e:"0"+e):e="00"+e,new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(e)},cardinality:1}}},email:{mask:"*{1,64}[.*{1,64}][.*{1,64}][.*{1,64}]@*{1,64}[.*{2,64}][.*{2,6}][.*{1,2}]",greedy:!1,onBeforePaste:function(e,t){return e=e.toLowerCase(),e.replace("mailto:","")},definitions:{"*":{validator:"[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",cardinality:1,casing:"lower"}}}}),e.fn.inputmask}(jQuery),function(v){return v.extend(v.inputmask.defaults.aliases,{numeric:{mask:function(n){function e(e){for(var t="",i=0;i<e.length;i++)t+=n.definitions[e[i]]?"\\"+e[i]:e[i];return t}if(0!==n.repeat&&isNaN(n.integerDigits)&&(n.integerDigits=n.repeat),n.repeat=0,n.groupSeparator==n.radixPoint&&("."==n.radixPoint?n.groupSeparator=",":","==n.radixPoint?n.groupSeparator=".":n.groupSeparator="")," "===n.groupSeparator&&(n.skipOptionalPartCharacter=void 0),n.autoGroup=n.autoGroup&&""!=n.groupSeparator,n.autoGroup&&("string"==typeof n.groupSize&&isFinite(n.groupSize)&&(n.groupSize=parseInt(n.groupSize)),isFinite(n.integerDigits))){var t=Math.floor(n.integerDigits/n.groupSize),i=n.integerDigits%n.groupSize;n.integerDigits=parseInt(n.integerDigits)+(0==i?t-1:t)}n.placeholder.length>1&&(n.placeholder=n.placeholder.charAt(0)),n.radixFocus=n.radixFocus&&"0"==n.placeholder,n.definitions[";"]=n.definitions["~"];var r=e(n.prefix);return r+="[+]",r+="~{1,"+n.integerDigits+"}",void 0!=n.digits&&(isNaN(n.digits)||parseInt(n.digits)>0)&&(r+=n.digitsOptional?"["+(n.decimalProtect?":":n.radixPoint)+";{"+n.digits+"}]":(n.decimalProtect?":":n.radixPoint)+";{"+n.digits+"}"),""!=n.negationSymbol.back&&(r+="[-]"),r+=e(n.suffix),n.greedy=!1,r},placeholder:"",greedy:!1,digits:"*",digitsOptional:!0,groupSeparator:"",radixPoint:".",radixFocus:!0,groupSize:3,autoGroup:!1,allowPlus:!0,allowMinus:!0,negationSymbol:{front:"-",back:""},integerDigits:"+",prefix:"",suffix:"",rightAlign:!0,decimalProtect:!0,min:void 0,max:void 0,postFormat:function(e,t,i,n){var r=!1;e.length>=n.suffix.length&&e.join("").indexOf(n.suffix)==e.length-n.suffix.length&&(e.length=e.length-n.suffix.length,r=!0),t=t>=e.length?e.length-1:t<n.prefix.length?n.prefix.length:t;var o=!1,a=e[t];if(""==n.groupSeparator||-1!=v.inArray(n.radixPoint,e)&&t>=v.inArray(n.radixPoint,e)||new RegExp("["+v.inputmask.escapeRegex(n.negationSymbol.front)+"+]").test(a)){if(r)for(var s=0,l=n.suffix.length;l>s;s++)e.push(n.suffix.charAt(s));return{pos:t}}var u=e.slice();a==n.groupSeparator&&(u.splice(t--,1),a=u[t]),i?u[t]="?":u.splice(t,0,"?");var c=u.join(""),d=c;if(c.length>0&&n.autoGroup||i&&-1!=c.indexOf(n.groupSeparator)){var f=v.inputmask.escapeRegex(n.groupSeparator);o=0==c.indexOf(n.groupSeparator),c=c.replace(new RegExp(f,"g"),"");var p=c.split(n.radixPoint);if(c=""==n.radixPoint?c:p[0],c!=n.prefix+"?0"&&c.length>=n.groupSize+n.prefix.length)for(var h=new RegExp("([-+]?[\\d?]+)([\\d?]{"+n.groupSize+"})");h.test(c);)c=c.replace(h,"$1"+n.groupSeparator+"$2"),c=c.replace(n.groupSeparator+n.groupSeparator,n.groupSeparator);""!=n.radixPoint&&p.length>1&&(c+=n.radixPoint+p[1])}o=d!=c,e.length=c.length;for(var s=0,l=c.length;l>s;s++)e[s]=c.charAt(s);var g=v.inArray("?",e);if(i?e[g]=a:e.splice(g,1),!o&&r)for(var s=0,l=n.suffix.length;l>s;s++)e.push(n.suffix.charAt(s));return{pos:g,refreshFromBuffer:o,buffer:e}},onBeforeWrite:function(e,t,i,n){if(e&&"blur"==e.type){var r=t.join(""),o=r.replace(n.prefix,"");if(o=o.replace(n.suffix,""),o=o.replace(new RegExp(v.inputmask.escapeRegex(n.groupSeparator),"g"),""),","===n.radixPoint&&(o=o.replace(v.inputmask.escapeRegex(n.radixPoint),".")),isFinite(o)&&isFinite(n.min)&&parseFloat(o)<parseFloat(n.min))return v.extend(!0,{refreshFromBuffer:!0,buffer:(n.prefix+n.min).split("")},n.postFormat((n.prefix+n.min).split(""),0,!0,n));var a=""!=n.radixPoint?t.join("").split(n.radixPoint):[t.join("")],s=a[0].match(n.regex.integerPart(n)),l=2==a.length?a[1].match(n.regex.integerNPart(n)):void 0;!s||s[0]!=n.negationSymbol.front+"0"&&s[0]!=n.negationSymbol.front&&"+"!=s[0]||void 0!=l&&!l[0].match(/^0+$/)||t.splice(s.index,1);var u=v.inArray(n.radixPoint,t);if(-1!=u&&isFinite(n.digits)&&!n.digitsOptional){for(var c=1;c<=n.digits;c++)(void 0==t[u+c]||t[u+c]==n.placeholder.charAt(0))&&(t[u+c]="0");return{refreshFromBuffer:!0,buffer:t}}}if(n.autoGroup){var d=n.postFormat(t,i-1,!0,n);return d.caret=i<=n.prefix.length?d.pos:d.pos+1,d}},regex:{integerPart:function(e){return new RegExp("["+v.inputmask.escapeRegex(e.negationSymbol.front)+"+]?\\d+")},integerNPart:function(e){return new RegExp("[\\d"+v.inputmask.escapeRegex(e.groupSeparator)+"]+")}},signHandler:function(e,t,i,n,r){if(!n&&r.allowMinus&&"-"===e||r.allowPlus&&"+"===e){var o=t.buffer.join("").match(r.regex.integerPart(r));if(o&&o[0].length>0)return t.buffer[o.index]==("-"===e?"+":r.negationSymbol.front)?"-"==e?""!=r.negationSymbol.back?{pos:o.index,c:r.negationSymbol.front,remove:o.index,caret:i,insert:{pos:t.buffer.length-r.suffix.length-1,c:r.negationSymbol.back}}:{pos:o.index,c:r.negationSymbol.front,remove:o.index,caret:i}:""!=r.negationSymbol.back?{pos:o.index,c:"+",remove:[o.index,t.buffer.length-r.suffix.length-1],caret:i}:{pos:o.index,c:"+",remove:o.index,caret:i}:t.buffer[o.index]==("-"===e?r.negationSymbol.front:"+")?"-"==e&&""!=r.negationSymbol.back?{remove:[o.index,t.buffer.length-r.suffix.length-1],caret:i-1}:{remove:o.index,caret:i-1}:"-"==e?""!=r.negationSymbol.back?{pos:o.index,c:r.negationSymbol.front,caret:i+1,insert:{pos:t.buffer.length-r.suffix.length,c:r.negationSymbol.back}}:{pos:o.index,c:r.negationSymbol.front,caret:i+1}:{pos:o.index,c:e,caret:i+1}}return!1},radixHandler:function(e,t,i,n,r){if(!n&&e===r.radixPoint&&r.digits>0){var o=v.inArray(r.radixPoint,t.buffer),a=t.buffer.join("").match(r.regex.integerPart(r));if(-1!=o&&t.validPositions[o])return t.validPositions[o-1]?{caret:o+1}:{pos:a.index,c:a[0],caret:o+1};if(!a||"0"==a[0]&&a.index+1!=i)return t.buffer[a?a.index:i]="0",{pos:(a?a.index:i)+1}}return!1},leadingZeroHandler:function(e,t,i,n,r){var o=t.buffer.join("").match(r.regex.integerNPart(r)),a=v.inArray(r.radixPoint,t.buffer);if(o&&!n&&(-1==a||a>=i))if(0==o[0].indexOf("0")){i<r.prefix.length&&(i=o.index);var s=v.inArray(r.radixPoint,t._buffer),l=t._buffer&&t.buffer.slice(a).join("")==t._buffer.slice(s).join("")||0==parseInt(t.buffer.slice(a+1).join("")),u=t._buffer&&t.buffer.slice(o.index,a).join("")==t._buffer.slice(r.prefix.length,s).join("")||"0"==t.buffer.slice(o.index,a).join("");if(-1==a||l&&u)return t.buffer.splice(o.index,1),i=i>o.index?i-1:o.index,{pos:i,remove:o.index};if(o.index+1==i||"0"==e)return t.buffer.splice(o.index,1),i=o.index,{pos:i,remove:o.index}}else if("0"===e&&i<=o.index&&o[0]!=r.groupSeparator)return!1;return!0},postValidation:function(e,t){var i=!0,n=e.join(""),r=n.replace(t.prefix,"");return r=r.replace(t.suffix,""),r=r.replace(new RegExp(v.inputmask.escapeRegex(t.groupSeparator),"g"),""),","===t.radixPoint&&(r=r.replace(v.inputmask.escapeRegex(t.radixPoint),".")),r=r.replace(new RegExp("^"+v.inputmask.escapeRegex(t.negationSymbol.front)),"-"),r=r.replace(new RegExp(v.inputmask.escapeRegex(t.negationSymbol.back)+"$"),""),isFinite(r)&&isFinite(t.max)&&(i=parseFloat(r)<=parseFloat(t.max)),i},definitions:{"~":{validator:function(e,t,i,n,r){var o=r.signHandler(e,t,i,n,r);if(!o&&(o=r.radixHandler(e,t,i,n,r),!o&&(o=n?new RegExp("[0-9"+v.inputmask.escapeRegex(r.groupSeparator)+"]").test(e):new RegExp("[0-9]").test(e),o===!0&&(o=r.leadingZeroHandler(e,t,i,n,r),o===!0)))){var a=v.inArray(r.radixPoint,t.buffer);o=r.digitsOptional===!1&&i>a&&!n?{pos:i,remove:i}:{pos:i}}return o},cardinality:1,prevalidator:null},"+":{validator:function(e,t,i,n,r){var o=r.signHandler(e,t,i,n,r);return!o&&(n&&r.allowMinus&&e===r.negationSymbol.front||r.allowMinus&&"-"==e||r.allowPlus&&"+"==e)&&(o="-"==e?""!=r.negationSymbol.back?{pos:i,c:"-"===e?r.negationSymbol.front:"+",caret:i+1,insert:{pos:t.buffer.length,c:r.negationSymbol.back}}:{pos:i,c:"-"===e?r.negationSymbol.front:"+",caret:i+1}:!0),o},cardinality:1,prevalidator:null,placeholder:""},"-":{validator:function(e,t,i,n,r){var o=r.signHandler(e,t,i,n,r);return!o&&n&&r.allowMinus&&e===r.negationSymbol.back&&(o=!0),o},cardinality:1,prevalidator:null,placeholder:""},":":{validator:function(e,t,i,n,r){var o=r.signHandler(e,t,i,n,r);if(!o){var a="["+v.inputmask.escapeRegex(r.radixPoint)+"]";o=new RegExp(a).test(e),o&&t.validPositions[i]&&t.validPositions[i].match.placeholder==r.radixPoint&&(o={caret:i+1})}return o},cardinality:1,prevalidator:null,placeholder:function(e){return e.radixPoint}}},insertMode:!0,autoUnmask:!1,unmaskAsNumber:!1,onUnMask:function(e,t,i){var n=e.replace(i.prefix,"");return n=n.replace(i.suffix,""),n=n.replace(new RegExp(v.inputmask.escapeRegex(i.groupSeparator),"g"),""),i.unmaskAsNumber?(n=n.replace(v.inputmask.escapeRegex.call(this,i.radixPoint),"."),Number(n)):n},isComplete:function(e,t){var i=e.join(""),n=e.slice();if(t.postFormat(n,0,!0,t),n.join("")!=i)return!1;var r=i.replace(t.prefix,"");return r=r.replace(t.suffix,""),r=r.replace(new RegExp(v.inputmask.escapeRegex(t.groupSeparator),"g"),""),","===t.radixPoint&&(r=r.replace(v.inputmask.escapeRegex(t.radixPoint),".")),isFinite(r)},onBeforeMask:function(e,t){if(""!=t.radixPoint&&isFinite(e))e=e.toString().replace(".",t.radixPoint);else{var i=e.match(/,/g),n=e.match(/\./g);n&&i?n.length>i.length?(e=e.replace(/\./g,""),e=e.replace(",",t.radixPoint)):i.length>n.length?(e=e.replace(/,/g,""),e=e.replace(".",t.radixPoint)):e=e.indexOf(".")<e.indexOf(",")?e.replace(/\./g,""):e=e.replace(/,/g,""):e=e.replace(new RegExp(v.inputmask.escapeRegex(t.groupSeparator),"g"),"")}return 0==t.digits&&(-1!=e.indexOf(".")?e=e.substring(0,e.indexOf(".")):-1!=e.indexOf(",")&&(e=e.substring(0,e.indexOf(",")))),e},canClearPosition:function(e,t,i,n,r){var o=e.validPositions[t].input,a=o!=r.radixPoint&&isFinite(o)||t==i||o==r.groupSeparator||o==r.negationSymbol.front||o==r.negationSymbol.back;if(a&&isFinite(o)){var s;if(!n&&e.buffer){s=e.buffer.join("").substr(0,t).match(r.regex.integerNPart(r));var l=t+1,u=null==s||0==parseInt(s[0].replace(new RegExp(v.inputmask.escapeRegex(r.groupSeparator),"g"),""));if(u)for(;e.validPositions[l]&&(e.validPositions[l].input==r.groupSeparator||"0"==e.validPositions[l].input);)delete e.validPositions[l],l++}var c=[];for(var d in e.validPositions)c.push(e.validPositions[d].input);s=c.join("").match(r.regex.integerNPart(r));var f=v.inArray(r.radixPoint,e.buffer);if(s&&(-1==f||f>=t))if(0==s[0].indexOf("0"))a=s.index!=t||-1==f;else{var p=parseInt(s[0].replace(new RegExp(v.inputmask.escapeRegex(r.groupSeparator),"g"),""));-1!=f&&10>p&&"0"==r.placeholder.charAt(0)&&(e.validPositions[t].input="0",e.p=r.prefix.length+1,a=!1)}}return a}},currency:{prefix:"$ ",groupSeparator:",",alias:"numeric",placeholder:"0",autoGroup:!0,digits:2,digitsOptional:!1,clearMaskOnLostFocus:!1},decimal:{alias:"numeric"},integer:{alias:"numeric",digits:"0",radixPoint:""}}),v.fn.inputmask}(jQuery),function(e){return e.extend(e.inputmask.defaults.aliases,{phone:{url:"phone-codes/phone-codes.js",countrycode:"",mask:function(n){n.definitions["#"]=n.definitions[9];var t=[];return e.ajax({url:n.url,async:!1,dataType:"json",success:function(e){t=e},error:function(e,t,i){alert(i+" - "+n.url)}}),t=t.sort(function(e,t){return(e.mask||e)<(t.mask||t)?-1:1})},keepStatic:!1,nojumps:!0,nojumpsThreshold:1,onBeforeMask:function(e,t){var i=e.replace(/^0/g,"");return(i.indexOf(t.countrycode)>1||-1==i.indexOf(t.countrycode))&&(i="+"+t.countrycode+i),i}},phonebe:{alias:"phone",url:"phone-codes/phone-be.js",countrycode:"32",nojumpsThreshold:4}}),e.fn.inputmask}(jQuery),function(_){return _.extend(_.inputmask.defaults.aliases,{Regex:{mask:"r",greedy:!1,repeat:"*",regex:null,regexTokens:null,tokenizer:/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,quantifierFilter:/[0-9]+[^,]/,isComplete:function(e,t){return new RegExp(t.regex).test(e.join(""))},definitions:{r:{validator:function(e,t,i,n,c){function d(e,t){this.matches=[],this.isGroup=e||!1,this.isQuantifier=t||!1,this.quantifier={min:1,max:1},this.repeaterPart=void 0}function r(){var e,t,i=new d,n=[];for(c.regexTokens=[];e=c.tokenizer.exec(c.regex);)switch(t=e[0],t.charAt(0)){case"(":n.push(new d(!0));break;case")":var r=n.pop();n.length>0?n[n.length-1].matches.push(r):i.matches.push(r);break;case"{":case"+":case"*":var o=new d(!1,!0);t=t.replace(/[{}]/g,"");var a=t.split(","),s=isNaN(a[0])?a[0]:parseInt(a[0]),l=1==a.length?s:isNaN(a[1])?a[1]:parseInt(a[1]);if(o.quantifier={min:s,max:l},n.length>0){var u=n[n.length-1].matches;if(e=u.pop(),!e.isGroup){var r=new d(!0);r.matches.push(e),e=r}u.push(e),u.push(o)}else{if(e=i.matches.pop(),!e.isGroup){var r=new d(!0);r.matches.push(e),e=r}i.matches.push(e),i.matches.push(o)}break;default:n.length>0?n[n.length-1].matches.push(t):i.matches.push(t)}i.matches.length>0&&c.regexTokens.push(i)}function v(e,t){var i=!1;t&&(m+="(",y++);for(var n=0;n<e.matches.length;n++){var r=e.matches[n];if(1==r.isGroup)i=v(r,!0);else if(1==r.isQuantifier){var o=_.inArray(r,e.matches),a=e.matches[o-1],s=m;if(isNaN(r.quantifier.max)){for(;r.repeaterPart&&r.repeaterPart!=m&&r.repeaterPart.length>m.length&&!(i=v(a,!0)););i=i||v(a,!0),i&&(r.repeaterPart=m),m=s+r.quantifier.max}else{for(var l=0,u=r.quantifier.max-1;u>l&&!(i=v(a,!0));l++);m=s+"{"+r.quantifier.min+","+r.quantifier.max+"}"}}else if(void 0!=r.matches)for(var c=0;c<r.length&&!(i=v(r[c],t));c++);else{var d;if("["==r.charAt(0)){d=m,d+=r;for(var f=0;y>f;f++)d+=")";var p=new RegExp("^("+d+")$");i=p.test(b)}else for(var h=0,g=r.length;g>h;h++)if("\\"!=r.charAt(h)){d=m,d+=r.substr(0,h+1),d=d.replace(/\|$/,"");for(var f=0;y>f;f++)d+=")";var p=new RegExp("^("+d+")$");if(i=p.test(b))break}m+=r}if(i)break}return t&&(m+=")",y--),i}null==c.regexTokens&&r();var o=t.buffer.slice(),m="",a=!1,y=0;o.splice(i,0,e);for(var b=o.join(""),s=0;s<c.regexTokens.length;s++){var d=c.regexTokens[s];if(a=v(d,d.isGroup))break}return a},cardinality:1}}}}),_.fn.inputmask}(jQuery);(function(e){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){e(require("jquery"))}else{e(window.jQuery)}})(function(l){"use strict";var n=0;l.ajaxTransport("iframe",function(r){if(r.async){var o=r.initialIframeSrc||"javascript:false;",a,s,t;return{send:function(e,i){a=l('<form style="display:none;"></form>');a.attr("accept-charset",r.formAcceptCharset);t=/\?/.test(r.url)?"&":"?";if(r.type==="DELETE"){r.url=r.url+t+"_method=DELETE";r.type="POST"}else if(r.type==="PUT"){r.url=r.url+t+"_method=PUT";r.type="POST"}else if(r.type==="PATCH"){r.url=r.url+t+"_method=PATCH";r.type="POST"}n+=1;s=l('<iframe src="'+o+'" name="iframe-transport-'+n+'"></iframe>').bind("load",function(){var n,t=l.isArray(r.paramName)?r.paramName:[r.paramName];s.unbind("load").bind("load",function(){var t;try{t=s.contents();if(!t.length||!t[0].firstChild){throw new Error}}catch(e){t=undefined}i(200,"success",{iframe:t});l('<iframe src="'+o+'"></iframe>').appendTo(a);window.setTimeout(function(){a.remove()},0)});a.prop("target",s.prop("name")).prop("action",r.url).prop("method",r.type);if(r.formData){l.each(r.formData,function(e,t){l('<input type="hidden"/>').prop("name",t.name).val(t.value).appendTo(a)})}if(r.fileInput&&r.fileInput.length&&r.type==="POST"){n=r.fileInput.clone();r.fileInput.after(function(e){return n[e]});if(r.paramName){r.fileInput.each(function(e){l(this).prop("name",t[e]||r.paramName)})}a.append(r.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data");r.fileInput.removeAttr("form")}a.submit();if(n&&n.length){r.fileInput.each(function(e,t){var i=l(n[e]);l(t).prop("name",i.prop("name")).attr("form",i.attr("form"));i.replaceWith(t)})}});a.append(s).appendTo(document.body)},abort:function(){if(s){s.unbind("load").prop("src",o)}if(a){a.remove()}}}}});l.ajaxSetup({converters:{"iframe text":function(e){return e&&l(e[0].body).text()},"iframe json":function(e){return e&&l.parseJSON(l(e[0].body).text())},"iframe html":function(e){return e&&l(e[0].body).html()},"iframe xml":function(e){var t=e&&e[0];return t&&l.isXMLDoc(t)?t:l.parseXML(t.XMLDocument&&t.XMLDocument.xml||l(t.body).html())},"iframe script":function(e){return e&&l.globalEval(l(e[0].body).text())}}})});(function(){var e,t=function(e,t){return function(){return e.apply(t,arguments)}};e=function(){function e(e){this.el=e;this.dragleave=t(this.dragleave,this);this.dragenter=t(this.dragenter,this);if(this.supportsEventConstructors()){this.first=false;this.second=false;this.el.addEventListener("dragenter",this.dragenter,false);this.el.addEventListener("dragleave",this.dragleave,false)}}e.prototype.dragenter=function(e){if(this.first){return this.second=true}else{this.first=true;return this.el.dispatchEvent(new CustomEvent("dragster:enter",{bubbles:true,cancelable:true,detail:{dataTransfer:e.dataTransfer}}))}};e.prototype.dragleave=function(e){if(this.second){this.second=false}else if(this.first){this.first=false}if(!this.first&&!this.second){return this.el.dispatchEvent(new CustomEvent("dragster:leave",{bubbles:true,cancelable:true,detail:{dataTransfer:e.dataTransfer}}))}};e.prototype.removeListeners=function(){this.el.removeEventListener("dragenter",this.dragenter,false);return this.el.removeEventListener("dragleave",this.dragleave,false)};e.prototype.supportsEventConstructors=function(){try{new CustomEvent("z")}catch(e){return false}return true};e.prototype.reset=function(){this.first=false;return this.second=false};return e}();if(typeof module==="undefined"){window.Dragster=e}else{module.exports=e}}).call(this);(function(){var e;e=function(){function e(e,t){var i;if(t==null){t=[]}i={script:null,ajaxQueue:false,autoUpload:false,classDragOver:"is-dragover",onUploadingFiles:function(e,t){},onSelectFiles:function(e,t){},onSuccessFile:function(e,t,i){},onComplete:function(e,t){},onFileError:function(e,t){},onFileFail:function(e,t){}};this.options=$.extend(i,t);this.files=[];$.each($(e),function(r){return function(e,t){var i,n;i=$(t);n=i.find("input[type=file]");i.data("pos",e);n.on("change",function(e){var t;t=$(e.currentTarget).prop("files");r.options.onSelectFiles(t,i);r.files[i.data("pos")]=e.target.files;if(r.options.autoUpload){return r.submit(i,e.target.files)}});return r.initDrag(i)}}(this))}e.prototype.initDrag=function(i){var n;if(this.isAdvancedUpload()){n=false;return i.on("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault();e.stopPropagation()}).on("dragover dragenter",function(e){return function(){i.addClass(e.options.classDragOver)}}(this)).on("dragleave dragend drop",function(e){return function(){i.removeClass(e.options.classDragOver)}}(this)).on("drop",function(t){return function(e){n=e.originalEvent.dataTransfer.files;t.options.onSelectFiles(n,i);if(t.options.autoUpload){return t.submit(i,n)}else{return t.files[i.data("pos")]=n}}}(this))}};e.prototype.startUpload=function(e){var t;t=this.files[e.data("pos")];if(t){return this.submit(e,t)}};e.prototype.submit=function(i,t){var e,n,r,o,a,s,l,u,c,d;if(i.hasClass("is-uploading")){return false}i.addClass("is-uploading");c=t.length;d=1;r=i.find("input[type=file]").attr("name");this.options.onUploadingFiles(d,c);u=[];for(a=o=0,s=t.length;o<s;a=++o){n=t[a];l=new FormData;l.append(r+"[]",n);l.append("position",a);e=this.options.ajaxQueue?$.ajaxQueue:$.ajax;u.push(e({url:this.options.script,type:"POST",data:l,processData:false,contentType:false,cache:false,complete:function(e){return function(){d++;if(d>=c+1){e.options.onComplete(t,i);e.removeFiles(i);return i.removeClass("is-uploading")}else{return e.options.onUploadingFiles(d,c)}}}(this),success:function(t){return function(e){t.options.onSuccessFile(n,e,i)}}(this),fail:function(t){return function(e){t.options.onFileFail(e,i)}}(this),error:function(t){return function(e){t.options.onFileError(e,i)}}(this)}))}return u};e.prototype.removeFiles=function(e){return this.files[e.data("pos")]=null};e.prototype.isAdvancedUpload=function(){var e;e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&"FormData"in window&&"FileReader"in window};e.prototype.isFormData=function(){return"FormData"in window};e.prototype.isFileReader=function(){return"FileReader"in window};e.prototype.isDraggable=function(){var e;e=document.createElement("div");return"draggable"in e||"ondragstart"in e&&"ondrop"in e};return e}();if(typeof module==="undefined"){window.Dropzone=e}else{module.exports=e}return e}).call(this);window=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};document=window.document||{};(function(e,t){if(typeof require==="function"&&typeof exports==="object"&&typeof module==="object"){e(require("jquery"))}else if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(t.jQuery)}})(function(C){"use strict";var g=0;var a={};var s={};var A=window.emojione;var n=[];function r(e){if(A){e()}else{n.push(e)}}var E="data:image/gif;base64,R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==";var o=[].slice;var x="emojionearea";var T=0;var S="&#8203;";function D(i,e,n){var r=true,t=1;if(e){e=e.toLowerCase();do{var o=t==1?"@"+e:e;if(a[i.id][o]&&a[i.id][o].length){C.each(a[i.id][o],function(e,t){return r=t.apply(i,n||[])!==false})}}while(r&&!!t--)}return r}function k(i,n,r,o){o=o||function(e,t){return C(t.currentTarget)};C.each(r,function(e,t){e=C.isArray(r)?t:e;(s[i.id][t]||(s[i.id][t]=[])).push([n,e,o])})}function l(e,t,i){var n=A.imageType,r;if(n=="svg"){r=A.imagePathSVG}else{r=A.imagePathPNG}var o="";if(i){o=i.substr(1,i.length-2).replace(/_/g," ").replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}var a="";if(t.uc_base&&T>4){a=t.uc_base;t=t.uc_output.toUpperCase()}else{a=t}e=e.replace("{name}",i||"").replace("{friendlyName}",o).replace("{img}",r+(T<2?a.toUpperCase():a)+"."+n).replace("{uni}",t);if(i){e=e.replace("{alt}",A.shortnameToUnicode(i))}else{e=e.replace("{alt}",A.convert(t))}return e}function O(e,i,n){return e.replace(/:?\+?[\w_\-]+:?/g,function(e){e=":"+e.replace(/:$/,"").replace(/^:/,"")+":";var t=A.emojioneList[e];if(t){if(T>4){return l(i,t,e)}else{if(T>3)t=t.unicode;return l(i,t[t.length-1],e)}}return n?"":e})}function R(e){var t,i;if(window.getSelection){t=window.getSelection();if(t.getRangeAt&&t.rangeCount){i=t.getRangeAt(0);i.deleteContents();var n=document.createElement("div");n.innerHTML=e;var r=document.createDocumentFragment(),o,a;while(o=n.firstChild){a=r.appendChild(o)}i.insertNode(r);if(a){i=i.cloneRange();i.setStartAfter(a);i.collapse(true);t.removeAllRanges();t.addRange(i)}}}else if(document.selection&&document.selection.type!="Control"){document.selection.createRange().pasteHTML(e)}}function u(){return window.emojioneVersion||"3.1.2"}function N(e){return typeof e==="object"}function c(e){var t;if(e.cacheBustParam){t=e.cacheBustParam;if(!N(e["jsEscapeMap"]))return"1.5.2";if(t==="?v=1.2.4")return"2.0.0";if(t==="?v=2.0.1")return"2.1.0";if(t==="?v=2.1.1")return"2.1.1";if(t==="?v=2.1.2")return"2.1.2";if(t==="?v=2.1.3")return"2.1.3";if(t==="?v=2.1.4")return"2.1.4";if(t==="?v=2.2.7")return"2.2.7";return"2.2.7"}else{return e.emojiVersion}}function d(e){switch(e){case"1.5.2":return 0;case"2.0.0":return 1;case"2.1.0":case"2.1.1":return 2;case"2.1.2":return 3;case"2.1.3":case"2.1.4":case"2.2.7":return 4;case"3.0.1":case"3.0.2":case"3.0.3":case"3.0":return 5;case"3.1.0":case"3.1.1":case"3.1.2":case"3.1":default:return 6}}function i(){if(C.fn.emojioneArea&&C.fn.emojioneArea.defaults){return C.fn.emojioneArea.defaults}var e={attributes:{dir:"ltr",spellcheck:false,autocomplete:"off",autocorrect:"off",autocapitalize:"off"},search:true,placeholder:null,emojiPlaceholder:":smiley:",searchPlaceholder:"SEARCH",container:null,hideSource:true,shortnames:true,sprite:true,pickerPosition:"top",filtersPosition:"top",searchPosition:"top",hidePickerOnBlur:true,buttonTitle:"Use the TAB key to insert emoji faster",tones:true,tonesStyle:"bullet",inline:null,saveEmojisAs:"unicode",shortcuts:true,autocomplete:true,autocompleteTones:false,standalone:false,useInternalCDN:true,imageType:"png",recentEmojis:true,textcomplete:{maxCount:15,placement:null}};var t=!A?d(u()):d(c(A));if(t>4){e.filters={tones:{title:"Diversity",emoji:"open_hands raised_hands palms_up_together clap pray thumbsup thumbsdown punch fist left_facing_fist right_facing_fist "+"fingers_crossed v metal love_you_gesture ok_hand point_left point_right point_up_2 point_down point_up raised_hand "+"raised_back_of_hand hand_splayed vulcan wave call_me muscle middle_finger writing_hand selfie nail_care ear "+"nose baby boy girl man woman blond-haired_woman blond-haired_man older_man older_woman "+"man_with_chinese_cap woman_wearing_turban man_wearing_turban woman_police_officer "+"man_police_officer woman_construction_worker man_construction_worker "+"woman_guard man_guard woman_detective man_detective woman_health_worker man_health_worker "+"woman_farmer man_farmer woman_cook man_cook woman_student man_student woman_singer man_singer woman_teacher "+"man_teacher woman_factory_worker man_factory_worker woman_technologist man_technologist woman_office_worker "+"man_office_worker woman_mechanic man_mechanic woman_scientist man_scientist woman_artist man_artist "+"woman_firefighter man_firefighter woman_pilot man_pilot woman_astronaut man_astronaut woman_judge "+"man_judge mrs_claus santa princess prince bride_with_veil man_in_tuxedo angel pregnant_woman "+"breast_feeding woman_bowing man_bowing man_tipping_hand woman_tipping_hand "+"man_gesturing_no woman_gesturing_no man_gesturing_ok woman_gesturing_ok "+"man_raising_hand woman_raising_hand woman_facepalming man_facepalming "+"woman_shrugging man_shrugging man_pouting woman_pouting "+"man_frowning woman_frowning man_getting_haircut woman_getting_haircut "+"man_getting_face_massage woman_getting_face_massage man_in_business_suit_levitating dancer man_dancing "+"woman_walking man_walking woman_running man_running adult child older_adult "+"bearded_person woman_with_headscarf woman_mage man_mage "+"woman_fairy man_fairy woman_vampire man_vampire mermaid merman woman_elf man_elf "+"snowboarder woman_lifting_weights man_lifting_weights woman_cartwheeling "+"man_cartwheeling woman_bouncing_ball man_bouncing_ball "+"woman_playing_handball man_playing_handball woman_golfing man_golfing "+"woman_surfing man_surfing woman_swimming man_swimming woman_playing_water_polo "+"man_playing_water_polo woman_rowing_boat man_rowing_boat "+"horse_racing woman_biking man_biking woman_mountain_biking "+"man_mountain_biking woman_juggling man_juggling "+"woman_in_steamy_room man_in_steamy_room woman_climbing "+"man_climbing woman_in_lotus_position man_in_lotus_position bath person_in_bed"},recent:{icon:"clock3",title:"Recent",emoji:""},smileys_people:{icon:"yum",title:"Smileys & People",emoji:"grinning smiley smile grin laughing sweat_smile joy rofl relaxed blush innocent slight_smile upside_down "+"wink relieved crazy_face star_struck heart_eyes kissing_heart kissing kissing_smiling_eyes kissing_closed_eyes yum "+"stuck_out_tongue_winking_eye stuck_out_tongue_closed_eyes stuck_out_tongue money_mouth hugging nerd sunglasses "+"cowboy smirk unamused disappointed pensive worried face_with_raised_eyebrow face_with_monocle confused slight_frown "+"frowning2 persevere confounded tired_face weary triumph angry rage face_with_symbols_over_mouth "+"no_mouth neutral_face expressionless hushed frowning anguished open_mouth astonished dizzy_face exploding_head flushed scream "+"fearful cold_sweat cry disappointed_relieved drooling_face sob sweat sleepy sleeping rolling_eyes thinking "+"shushing_face face_with_hand_over_mouth lying_face grimacing zipper_mouth face_vomiting nauseated_face sneezing_face mask thermometer_face "+"head_bandage smiling_imp imp japanese_ogre japanese_goblin poop ghost skull skull_crossbones alien space_invader "+"robot jack_o_lantern clown smiley_cat smile_cat joy_cat heart_eyes_cat smirk_cat kissing_cat scream_cat crying_cat_face "+"pouting_cat open_hands raised_hands palms_up_together clap pray handshake thumbsup thumbsdown punch fist left_facing_fist "+"right_facing_fist fingers_crossed v metal love_you_gesture ok_hand point_left point_right point_up_2 point_down point_up "+"raised_hand raised_back_of_hand hand_splayed vulcan wave call_me muscle middle_finger writing_hand selfie "+"nail_care ring lipstick kiss lips tongue ear nose footprints eye eyes speaking_head bust_in_silhouette "+"busts_in_silhouette baby boy girl man woman blond-haired_woman blond_haired_man older_man older_woman "+"man_with_chinese_cap woman_wearing_turban man_wearing_turban woman_police_officer police_officer "+"woman_construction_worker construction_worker woman_guard guard woman_detective detective woman_health_worker "+"man_health_worker woman_farmer man_farmer woman_cook man_cook woman_student man_student woman_singer man_singer "+"woman_teacher man_teacher woman_factory_worker man_factory_worker woman_technologist man_technologist "+"woman_office_worker man_office_worker woman_mechanic man_mechanic woman_scientist man_scientist woman_artist "+"man_artist woman_firefighter man_firefighter woman_pilot man_pilot woman_astronaut man_astronaut woman_judge "+"man_judge mrs_claus santa princess prince bride_with_veil man_in_tuxedo angel pregnant_woman breast_feeding woman_bowing "+"man_bowing woman_tipping_hand man_tipping_hand woman_gesturing_no man_gesturing_no woman_gesturing_ok "+"man_gesturing_ok woman_raising_hand man_raising_hand woman_facepalming man_facepalming woman_shrugging "+"man_shrugging woman_pouting man_pouting woman_frowning man_frowning woman_getting_haircut man_getting_haircut "+"woman_getting_face_massage man_getting_face_massage man_in_business_suit_levitating dancer man_dancing women_with_bunny_ears_partying "+"men_with_bunny_ears_partying woman_walking man_walking woman_running man_running couple two_women_holding_hands "+"two_men_holding_hands couple_with_heart couple_ww couple_mm couplekiss kiss_ww kiss_mm family family_mwg family_mwgb "+"family_mwbb family_mwgg family_wwb family_wwg family_wwgb family_wwbb family_wwgg family_mmb family_mmg family_mmgb "+"family_mmbb family_mmgg family_woman_boy family_woman_girl family_woman_girl_boy family_woman_boy_boy "+"family_woman_girl_girl family_man_boy family_man_girl family_man_girl_boy family_man_boy_boy family_man_girl_girl "+"bearded_person woman_with_headscarf woman_mage man_mage woman_fairy man_fairy woman_vampire man_vampire "+"mermaid merman woman_elf man_elf woman_genie man_genie woman_zombie man_zombie "+"womans_clothes shirt jeans necktie dress bikini kimono high_heel sandal boot mans_shoe athletic_shoe womans_hat "+"tophat mortar_board crown helmet_with_cross school_satchel pouch purse handbag briefcase eyeglasses dark_sunglasses "+"closed_umbrella umbrella2 brain billed_cap scarf gloves coat socks "},animals_nature:{icon:"hamster",title:"Animals & Nature",emoji:"dog cat mouse hamster rabbit fox bear panda_face koala tiger lion_face cow pig pig_nose frog monkey_face see_no_evil "+"hear_no_evil speak_no_evil monkey chicken penguin bird baby_chick hatching_chick hatched_chick duck eagle owl bat wolf boar "+"horse unicorn bee bug butterfly snail shell beetle ant spider spider_web turtle snake lizard scorpion crab squid octopus shrimp "+"tropical_fish fish blowfish dolphin shark whale whale2 crocodile leopard tiger2 water_buffalo ox cow2 deer dromedary_camel camel "+"elephant rhino gorilla racehorse pig2 goat ram sheep dog2 poodle cat2 rooster turkey dove rabbit2 mouse2 rat chipmunk dragon "+"giraffe zebra hedgehog sauropod t_rex cricket dragon_face feet cactus christmas_tree evergreen_tree deciduous_tree palm_tree seedling herb shamrock four_leaf_clover "+"bamboo tanabata_tree leaves fallen_leaf maple_leaf mushroom ear_of_rice bouquet tulip rose wilted_rose sunflower blossom "+"cherry_blossom hibiscus earth_americas earth_africa earth_asia full_moon waning_gibbous_moon last_quarter_moon "+"waning_crescent_moon new_moon waxing_crescent_moon first_quarter_moon waxing_gibbous_moon new_moon_with_face "+"full_moon_with_face sun_with_face first_quarter_moon_with_face last_quarter_moon_with_face crescent_moon dizzy star star2 "+"sparkles zap fire boom comet sunny white_sun_small_cloud partly_sunny white_sun_cloud white_sun_rain_cloud rainbow cloud "+"cloud_rain thunder_cloud_rain cloud_lightning cloud_snow snowman2 snowman snowflake wind_blowing_face dash cloud_tornado "+"fog ocean droplet sweat_drops umbrella "},food_drink:{icon:"pizza",title:"Food & Drink",emoji:"green_apple apple pear tangerine lemon banana watermelon grapes strawberry melon cherries peach pineapple kiwi "+"avocado tomato eggplant cucumber carrot corn hot_pepper potato sweet_potato chestnut peanuts honey_pot croissant "+"bread french_bread cheese egg cooking bacon pancakes fried_shrimp poultry_leg meat_on_bone pizza hotdog hamburger "+"fries stuffed_flatbread taco burrito salad shallow_pan_of_food spaghetti ramen stew fish_cake sushi bento curry "+"rice_ball rice rice_cracker oden dango shaved_ice ice_cream icecream cake birthday custard lollipop candy "+"chocolate_bar popcorn doughnut cookie milk baby_bottle coffee tea sake beer beers champagne_glass wine_glass "+"tumbler_glass cocktail tropical_drink champagne spoon fork_and_knife fork_knife_plate dumpling fortune_cookie "+"takeout_box chopsticks bowl_with_spoon cup_with_straw coconut broccoli pie pretzel cut_of_meat sandwich canned_food"},activity:{icon:"basketball",title:"Activity",emoji:"soccer basketball football baseball tennis volleyball rugby_football 8ball ping_pong badminton goal hockey field_hockey "+"cricket_game golf bow_and_arrow fishing_pole_and_fish boxing_glove martial_arts_uniform ice_skate ski skier snowboarder "+"woman_lifting_weights man_lifting_weights person_fencing women_wrestling men_wrestling woman_cartwheeling "+"man_cartwheeling woman_bouncing_ball man_bouncing_ball woman_playing_handball man_playing_handball woman_golfing "+"man_golfing woman_surfing man_surfing woman_swimming man_swimming woman_playing_water_polo "+"man_playing_water_polo woman_rowing_boat man_rowing_boat horse_racing woman_biking man_biking woman_mountain_biking man_mountain_biking "+"woman_in_steamy_room man_in_steamy_room woman_climbing man_climbing woman_in_lotus_position man_in_lotus_position "+"running_shirt_with_sash medal military_medal first_place second_place "+"third_place trophy rosette reminder_ribbon ticket tickets circus_tent woman_juggling man_juggling performing_arts art "+"clapper microphone headphones musical_score musical_keyboard drum saxophone trumpet guitar violin game_die dart bowling "+"video_game slot_machine sled curling_stone "},travel_places:{icon:"rocket",title:"Travel & Places",emoji:"red_car taxi blue_car bus trolleybus race_car police_car ambulance fire_engine minibus truck articulated_lorry tractor "+"scooter bike motor_scooter motorcycle rotating_light oncoming_police_car oncoming_bus oncoming_automobile oncoming_taxi "+"aerial_tramway mountain_cableway suspension_railway railway_car train mountain_railway monorail bullettrain_side "+"bullettrain_front light_rail steam_locomotive train2 metro tram station helicopter airplane_small airplane "+"airplane_departure airplane_arriving rocket satellite_orbital seat canoe sailboat motorboat speedboat cruise_ship "+"ferry ship anchor construction fuelpump busstop vertical_traffic_light traffic_light map moyai statue_of_liberty "+"fountain tokyo_tower european_castle japanese_castle stadium ferris_wheel roller_coaster carousel_horse beach_umbrella "+"beach island mountain mountain_snow mount_fuji volcano desert camping tent railway_track motorway construction_site "+"factory house house_with_garden homes house_abandoned office department_store post_office european_post_office hospital "+"bank hotel convenience_store school love_hotel wedding classical_building church mosque synagogue kaaba shinto_shrine "+"japan rice_scene park sunrise sunrise_over_mountains stars sparkler fireworks city_sunset city_dusk cityscape "+"night_with_stars milky_way bridge_at_night foggy flying_saucer"},objects:{icon:"bulb",title:"Objects",emoji:"watch iphone calling computer keyboard desktop printer mouse_three_button trackball joystick compression minidisc "+"floppy_disk cd dvd vhs camera camera_with_flash video_camera movie_camera projector film_frames telephone_receiver "+"telephone pager fax tv radio microphone2 level_slider control_knobs stopwatch timer alarm_clock clock hourglass "+"hourglass_flowing_sand satellite battery electric_plug bulb flashlight candle wastebasket oil money_with_wings "+"dollar yen euro pound moneybag credit_card gem scales wrench hammer hammer_pick tools pick nut_and_bolt gear "+"chains gun bomb knife dagger crossed_swords shield smoking coffin urn amphora crystal_ball prayer_beads barber "+"alembic telescope microscope hole pill syringe thermometer toilet potable_water shower bathtub bath bellhop key "+"key2 door couch bed sleeping_accommodation frame_photo shopping_bags shopping_cart gift balloon flags ribbon "+"confetti_ball tada dolls izakaya_lantern wind_chime envelope envelope_with_arrow incoming_envelope e-mail "+"love_letter inbox_tray outbox_tray package label mailbox_closed mailbox mailbox_with_mail mailbox_with_no_mail "+"postbox postal_horn scroll page_with_curl page_facing_up bookmark_tabs bar_chart chart_with_upwards_trend "+"chart_with_downwards_trend notepad_spiral calendar_spiral calendar date card_index card_box ballot_box "+"file_cabinet clipboard file_folder open_file_folder dividers newspaper2 newspaper notebook "+"notebook_with_decorative_cover ledger closed_book green_book blue_book orange_book books book bookmark link "+"paperclip paperclips triangular_ruler straight_ruler pushpin round_pushpin scissors pen_ballpoint pen_fountain "+"black_nib paintbrush crayon pencil pencil2 mag mag_right lock_with_ink_pen closed_lock_with_key lock unlock"},symbols:{icon:"heartpulse",title:"Symbols",emoji:"heart orange_heart yellow_heart green_heart blue_heart purple_heart black_heart broken_heart heart_exclamation two_hearts "+"revolving_hearts heartbeat heartpulse sparkling_heart cupid gift_heart heart_decoration peace cross star_and_crescent "+"om_symbol wheel_of_dharma star_of_david six_pointed_star menorah yin_yang orthodox_cross place_of_worship ophiuchus "+"aries taurus gemini cancer leo virgo libra scorpius sagittarius capricorn aquarius pisces id atom accept radioactive "+"biohazard mobile_phone_off vibration_mode u6709 u7121 u7533 u55b6 u6708 eight_pointed_black_star vs white_flower "+"ideograph_advantage secret congratulations u5408 u6e80 u5272 u7981 a b ab cl o2 sos x o octagonal_sign no_entry "+"name_badge no_entry_sign 100 anger hotsprings no_pedestrians do_not_litter no_bicycles non-potable_water underage "+"no_mobile_phones no_smoking exclamation grey_exclamation question grey_question bangbang interrobang low_brightness "+"high_brightness part_alternation_mark warning children_crossing trident fleur-de-lis beginner recycle "+"white_check_mark u6307 chart sparkle eight_spoked_asterisk negative_squared_cross_mark globe_with_meridians "+"diamond_shape_with_a_dot_inside m cyclone zzz atm wc wheelchair parking u7a7a sa passport_control customs "+"baggage_claim left_luggage mens womens baby_symbol restroom put_litter_in_its_place cinema signal_strength koko "+"symbols information_source abc abcd capital_abcd ng ok up cool new free zero one two three four five six seven "+"eight nine keycap_ten 1234 hash asterisk arrow_forward pause_button play_pause stop_button record_button eject "+"track_next track_previous fast_forward rewind arrow_double_up arrow_double_down arrow_backward arrow_up_small "+"arrow_down_small arrow_right arrow_left arrow_up arrow_down arrow_upper_right arrow_lower_right arrow_lower_left "+"arrow_upper_left arrow_up_down left_right_arrow arrow_right_hook leftwards_arrow_with_hook arrow_heading_up "+"arrow_heading_down twisted_rightwards_arrows repeat repeat_one arrows_counterclockwise arrows_clockwise "+"musical_note notes heavy_plus_sign heavy_minus_sign heavy_division_sign heavy_multiplication_x heavy_dollar_sign "+"currency_exchange tm copyright registered wavy_dash curly_loop loop end back on top soon heavy_check_mark "+"ballot_box_with_check radio_button white_circle black_circle red_circle blue_circle small_red_triangle "+"small_red_triangle_down small_orange_diamond small_blue_diamond large_orange_diamond large_blue_diamond "+"white_square_button black_square_button black_small_square white_small_square black_medium_small_square "+"white_medium_small_square black_medium_square white_medium_square black_large_square white_large_square speaker "+"mute sound loud_sound bell no_bell mega loudspeaker speech_left eye_in_speech_bubble speech_balloon thought_balloon "+"anger_right spades clubs hearts diamonds black_joker flower_playing_cards mahjong clock1 clock2 clock3 clock4 clock5 "+"clock6 clock7 clock8 clock9 clock10 clock11 clock12 clock130 clock230 clock330 clock430 clock530 clock630 "+"clock730 clock830 clock930 clock1030 clock1130 clock1230"},flags:{icon:"flag_gb",title:"Flags",emoji:"flag_white flag_black checkered_flag triangular_flag_on_post rainbow_flag flag_af flag_ax flag_al flag_dz flag_as "+"flag_ad flag_ao flag_ai flag_aq flag_ag flag_ar flag_am flag_aw flag_au flag_at flag_az flag_bs flag_bh flag_bd flag_bb "+"flag_by flag_be flag_bz flag_bj flag_bm flag_bt flag_bo flag_ba flag_bw flag_br flag_io flag_vg flag_bn flag_bg flag_bf "+"flag_bi flag_kh flag_cm flag_ca flag_ic flag_cv flag_bq flag_ky flag_cf flag_td flag_cl flag_cn flag_cx flag_cc flag_co "+"flag_km flag_cg flag_cd flag_ck flag_cr flag_ci flag_hr flag_cu flag_cw flag_cy flag_cz flag_dk flag_dj flag_dm flag_do "+"flag_ec flag_eg flag_sv flag_gq flag_er flag_ee flag_et flag_eu flag_fk flag_fo flag_fj flag_fi flag_fr flag_gf flag_pf "+"flag_tf flag_ga flag_gm flag_ge flag_de flag_gh flag_gi flag_gr flag_gl flag_gd flag_gp flag_gu flag_gt flag_gg flag_gn "+"flag_gw flag_gy flag_ht flag_hn flag_hk flag_hu flag_is flag_in flag_id flag_ir flag_iq flag_ie flag_im flag_il flag_it "+"flag_jm flag_jp crossed_flags flag_je flag_jo flag_kz flag_ke flag_ki flag_xk flag_kw flag_kg flag_la flag_lv flag_lb "+"flag_ls flag_lr flag_ly flag_li flag_lt flag_lu flag_mo flag_mk flag_mg flag_mw flag_my flag_mv flag_ml flag_mt flag_mh "+"flag_mq flag_mr flag_mu flag_yt flag_mx flag_fm flag_md flag_mc flag_mn flag_me flag_ms flag_ma flag_mz flag_mm flag_na "+"flag_nr flag_np flag_nl flag_nc flag_nz flag_ni flag_ne flag_ng flag_nu flag_nf flag_kp flag_mp flag_no flag_om flag_pk "+"flag_pw flag_ps flag_pa flag_pg flag_py flag_pe flag_ph flag_pn flag_pl flag_pt flag_pr flag_qa flag_re flag_ro flag_ru "+"flag_rw flag_ws flag_sm flag_st flag_sa flag_sn flag_rs flag_sc flag_sl flag_sg flag_sx flag_sk flag_si flag_gs flag_sb "+"flag_so flag_za flag_kr flag_ss flag_es flag_lk flag_bl flag_sh flag_kn flag_lc flag_pm flag_vc flag_sd flag_sr flag_sz "+"flag_se flag_ch flag_sy flag_tw flag_tj flag_tz flag_th flag_tl flag_tg flag_tk flag_to flag_tt flag_tn flag_tr flag_tm "+"flag_tc flag_tv flag_vi flag_ug flag_ua flag_ae flag_gb flag_us flag_uy flag_uz flag_vu flag_va flag_ve flag_vn flag_wf "+"flag_eh flag_ye flag_zm flag_zw flag_ac flag_ta flag_bv flag_hm flag_sj flag_um flag_ea flag_cp flag_dg flag_mf "+"united_nations england scotland wales"}}}else{e.filters={tones:{title:"Diversity",emoji:"santa runner surfer swimmer lifter ear nose point_up_2 point_down point_left point_right punch "+"wave ok_hand thumbsup thumbsdown clap open_hands boy girl man woman cop bride_with_veil person_with_blond_hair "+"man_with_gua_pi_mao man_with_turban older_man grandma baby construction_worker princess angel "+"information_desk_person guardsman dancer nail_care massage haircut muscle spy hand_splayed middle_finger "+"vulcan no_good ok_woman bow raising_hand raised_hands person_frowning person_with_pouting_face pray rowboat "+"bicyclist mountain_bicyclist walking bath metal point_up basketball_player fist raised_hand v writing_hand"},recent:{icon:"clock3",title:"Recent",emoji:""},smileys_people:{icon:"yum",title:"Smileys & People",emoji:"grinning grimacing grin joy smiley smile sweat_smile laughing innocent wink blush slight_smile "+"upside_down relaxed yum relieved heart_eyes kissing_heart kissing kissing_smiling_eyes "+"kissing_closed_eyes stuck_out_tongue_winking_eye stuck_out_tongue_closed_eyes stuck_out_tongue "+"money_mouth nerd sunglasses hugging smirk no_mouth neutral_face expressionless unamused rolling_eyes "+"thinking flushed disappointed worried angry rage pensive confused slight_frown frowning2 persevere "+"confounded tired_face weary triumph open_mouth scream fearful cold_sweat hushed frowning anguished "+"cry disappointed_relieved sleepy sweat sob dizzy_face astonished zipper_mouth mask thermometer_face "+"head_bandage sleeping zzz poop smiling_imp imp japanese_ogre japanese_goblin skull ghost alien robot "+"smiley_cat smile_cat joy_cat heart_eyes_cat smirk_cat kissing_cat scream_cat crying_cat_face "+"pouting_cat raised_hands clap wave thumbsup thumbsdown punch fist v ok_hand raised_hand open_hands "+"muscle pray point_up point_up_2 point_down point_left point_right middle_finger hand_splayed metal "+"vulcan writing_hand nail_care lips tongue ear nose eye eyes bust_in_silhouette busts_in_silhouette "+"speaking_head baby boy girl man woman person_with_blond_hair older_man older_woman man_with_gua_pi_mao "+"man_with_turban cop construction_worker guardsman spy santa angel princess bride_with_veil walking "+"runner dancer dancers couple two_men_holding_hands two_women_holding_hands bow information_desk_person "+"no_good ok_woman raising_hand person_with_pouting_face person_frowning haircut massage couple_with_heart "+"couple_ww couple_mm couplekiss kiss_ww kiss_mm family family_mwg family_mwgb family_mwbb family_mwgg "+"family_wwb family_wwg family_wwgb family_wwbb family_wwgg family_mmb family_mmg family_mmgb family_mmbb "+"family_mmgg womans_clothes shirt jeans necktie dress bikini kimono lipstick kiss footprints high_heel "+"sandal boot mans_shoe athletic_shoe womans_hat tophat helmet_with_cross mortar_board crown school_satchel "+"pouch purse handbag briefcase eyeglasses dark_sunglasses ring closed_umbrella"},animals_nature:{icon:"hamster",title:"Animals & Nature",emoji:"dog cat mouse hamster rabbit bear panda_face koala tiger lion_face cow pig pig_nose frog "+"octopus monkey_face see_no_evil hear_no_evil speak_no_evil monkey chicken penguin bird baby_chick "+"hatching_chick hatched_chick wolf boar horse unicorn bee bug snail beetle ant spider scorpion crab "+"snake turtle tropical_fish fish blowfish dolphin whale whale2 crocodile leopard tiger2 water_buffalo "+"ox cow2 dromedary_camel camel elephant goat ram sheep racehorse pig2 rat mouse2 rooster turkey dove "+"dog2 poodle cat2 rabbit2 chipmunk feet dragon dragon_face cactus christmas_tree evergreen_tree "+"deciduous_tree palm_tree seedling herb shamrock four_leaf_clover bamboo tanabata_tree leaves "+"fallen_leaf maple_leaf ear_of_rice hibiscus sunflower rose tulip blossom cherry_blossom bouquet "+"mushroom chestnut jack_o_lantern shell spider_web earth_americas earth_africa earth_asia full_moon "+"waning_gibbous_moon last_quarter_moon waning_crescent_moon new_moon waxing_crescent_moon "+"first_quarter_moon waxing_gibbous_moon new_moon_with_face full_moon_with_face first_quarter_moon_with_face "+"last_quarter_moon_with_face sun_with_face crescent_moon star star2 dizzy sparkles comet sunny "+"white_sun_small_cloud partly_sunny white_sun_cloud white_sun_rain_cloud cloud cloud_rain "+"thunder_cloud_rain cloud_lightning zap fire boom snowflake cloud_snow snowman2 snowman wind_blowing_face "+"dash cloud_tornado fog umbrella2 umbrella droplet sweat_drops ocean"},food_drink:{icon:"pizza",title:"Food & Drink",emoji:"green_apple apple pear tangerine lemon banana watermelon grapes strawberry melon cherries peach "+"pineapple tomato eggplant hot_pepper corn sweet_potato honey_pot bread cheese poultry_leg meat_on_bone "+"fried_shrimp egg hamburger fries hotdog pizza spaghetti taco burrito ramen stew fish_cake sushi bento "+"curry rice_ball rice rice_cracker oden dango shaved_ice ice_cream icecream cake birthday custard candy "+"lollipop chocolate_bar popcorn doughnut cookie beer beers wine_glass cocktail tropical_drink champagne "+"sake tea coffee baby_bottle fork_and_knife fork_knife_plate"},activity:{icon:"basketball",title:"Activity",emoji:"soccer basketball football baseball tennis volleyball rugby_football 8ball golf golfer ping_pong "+"badminton hockey field_hockey cricket ski skier snowboarder ice_skate bow_and_arrow fishing_pole_and_fish "+"rowboat swimmer surfer bath basketball_player lifter bicyclist mountain_bicyclist horse_racing levitate "+"trophy running_shirt_with_sash medal military_medal reminder_ribbon rosette ticket tickets performing_arts "+"art circus_tent microphone headphones musical_score musical_keyboard saxophone trumpet guitar violin "+"clapper video_game space_invader dart game_die slot_machine bowling"},travel_places:{icon:"rocket",title:"Travel & Places",emoji:"red_car taxi blue_car bus trolleybus race_car police_car ambulance fire_engine minibus truck "+"articulated_lorry tractor motorcycle bike rotating_light oncoming_police_car oncoming_bus "+"oncoming_automobile oncoming_taxi aerial_tramway mountain_cableway suspension_railway railway_car "+"train monorail bullettrain_side bullettrain_front light_rail mountain_railway steam_locomotive train2 "+"metro tram station helicopter airplane_small airplane airplane_departure airplane_arriving sailboat "+"motorboat speedboat ferry cruise_ship rocket satellite_orbital seat anchor construction fuelpump busstop "+"vertical_traffic_light traffic_light checkered_flag ship ferris_wheel roller_coaster carousel_horse "+"construction_site foggy tokyo_tower factory fountain rice_scene mountain mountain_snow mount_fuji volcano "+"japan camping tent park motorway railway_track sunrise sunrise_over_mountains desert beach island "+"city_sunset city_dusk cityscape night_with_stars bridge_at_night milky_way stars sparkler fireworks "+"rainbow homes european_castle japanese_castle stadium statue_of_liberty house house_with_garden "+"house_abandoned office department_store post_office european_post_office hospital bank hotel "+"convenience_store school love_hotel wedding classical_building church mosque synagogue kaaba shinto_shrine"},objects:{icon:"bulb",title:"Objects",emoji:"watch iphone calling computer keyboard desktop printer mouse_three_button trackball joystick "+"compression minidisc floppy_disk cd dvd vhs camera camera_with_flash video_camera movie_camera projector "+"film_frames telephone_receiver telephone pager fax tv radio microphone2 level_slider control_knobs "+"stopwatch timer alarm_clock clock hourglass_flowing_sand hourglass satellite battery electric_plug bulb "+"flashlight candle wastebasket oil money_with_wings dollar yen euro pound moneybag credit_card gem scales "+"wrench hammer hammer_pick tools pick nut_and_bolt gear chains gun bomb knife dagger crossed_swords shield "+"smoking skull_crossbones coffin urn amphora crystal_ball prayer_beads barber alembic telescope microscope "+"hole pill syringe thermometer label bookmark toilet shower bathtub key key2 couch sleeping_accommodation "+"bed door bellhop frame_photo map beach_umbrella moyai shopping_bags balloon flags ribbon gift confetti_ball "+"tada dolls wind_chime crossed_flags izakaya_lantern envelope envelope_with_arrow incoming_envelope e-mail "+"love_letter postbox mailbox_closed mailbox mailbox_with_mail mailbox_with_no_mail package postal_horn "+"inbox_tray outbox_tray scroll page_with_curl bookmark_tabs bar_chart chart_with_upwards_trend "+"chart_with_downwards_trend page_facing_up date calendar calendar_spiral card_index card_box ballot_box "+"file_cabinet clipboard notepad_spiral file_folder open_file_folder dividers newspaper2 newspaper notebook "+"closed_book green_book blue_book orange_book notebook_with_decorative_cover ledger books book link "+"paperclip paperclips scissors triangular_ruler straight_ruler pushpin round_pushpin triangular_flag_on_post "+"flag_white flag_black closed_lock_with_key lock unlock lock_with_ink_pen pen_ballpoint pen_fountain "+"black_nib pencil pencil2 crayon paintbrush mag mag_right"},symbols:{icon:"heartpulse",title:"Symbols",emoji:"heart yellow_heart green_heart blue_heart purple_heart broken_heart heart_exclamation two_hearts "+"revolving_hearts heartbeat heartpulse sparkling_heart cupid gift_heart heart_decoration peace cross "+"star_and_crescent om_symbol wheel_of_dharma star_of_david six_pointed_star menorah yin_yang orthodox_cross "+"place_of_worship ophiuchus aries taurus gemini cancer leo virgo libra scorpius sagittarius capricorn "+"aquarius pisces id atom u7a7a u5272 radioactive biohazard mobile_phone_off vibration_mode u6709 u7121 "+"u7533 u55b6 u6708 eight_pointed_black_star vs accept white_flower ideograph_advantage secret congratulations "+"u5408 u6e80 u7981 a b ab cl o2 sos no_entry name_badge no_entry_sign x o anger hotsprings no_pedestrians "+"do_not_litter no_bicycles non-potable_water underage no_mobile_phones exclamation grey_exclamation question "+"grey_question bangbang interrobang 100 low_brightness high_brightness trident fleur-de-lis part_alternation_mark "+"warning children_crossing beginner recycle u6307 chart sparkle eight_spoked_asterisk negative_squared_cross_mark "+"white_check_mark diamond_shape_with_a_dot_inside cyclone loop globe_with_meridians m atm sa passport_control "+"customs baggage_claim left_luggage wheelchair no_smoking wc parking potable_water mens womens baby_symbol "+"restroom put_litter_in_its_place cinema signal_strength koko ng ok up cool new free zero one two three four "+"five six seven eight nine ten 1234 arrow_forward pause_button play_pause stop_button record_button track_next "+"track_previous fast_forward rewind twisted_rightwards_arrows repeat repeat_one arrow_backward arrow_up_small "+"arrow_down_small arrow_double_up arrow_double_down arrow_right arrow_left arrow_up arrow_down arrow_upper_right "+"arrow_lower_right arrow_lower_left arrow_upper_left arrow_up_down left_right_arrow arrows_counterclockwise "+"arrow_right_hook leftwards_arrow_with_hook arrow_heading_up arrow_heading_down hash asterisk information_source "+"abc abcd capital_abcd symbols musical_note notes wavy_dash curly_loop heavy_check_mark arrows_clockwise "+"heavy_plus_sign heavy_minus_sign heavy_division_sign heavy_multiplication_x heavy_dollar_sign currency_exchange "+"copyright registered tm end back on top soon ballot_box_with_check radio_button white_circle black_circle "+"red_circle large_blue_circle small_orange_diamond small_blue_diamond large_orange_diamond large_blue_diamond "+"small_red_triangle black_small_square white_small_square black_large_square white_large_square small_red_triangle_down "+"black_medium_square white_medium_square black_medium_small_square white_medium_small_square black_square_button "+"white_square_button speaker sound loud_sound mute mega loudspeaker bell no_bell black_joker mahjong spades "+"clubs hearts diamonds flower_playing_cards thought_balloon anger_right speech_balloon clock1 clock2 clock3 "+"clock4 clock5 clock6 clock7 clock8 clock9 clock10 clock11 clock12 clock130 clock230 clock330 clock430 "+"clock530 clock630 clock730 clock830 clock930 clock1030 clock1130 clock1230 eye_in_speech_bubble"},flags:{icon:"flag_gb",title:"Flags",emoji:"ac af al dz ad ao ai ag ar am aw au at az bs bh bd bb by be bz bj bm bt bo ba bw br bn bg bf bi "+"cv kh cm ca ky cf td flag_cl cn co km cg flag_cd cr hr cu cy cz dk dj dm do ec eg sv gq er ee et fk fo "+"fj fi fr pf ga gm ge de gh gi gr gl gd gu gt gn gw gy ht hn hk hu is in flag_id ir iq ie il it ci jm jp "+"je jo kz ke ki xk kw kg la lv lb ls lr ly li lt lu mo mk mg mw my mv ml mt mh mr mu mx fm md mc mn me "+"ms ma mz mm na nr np nl nc nz ni ne flag_ng nu kp no om pk pw ps pa pg py pe ph pl pt pr qa ro ru rw "+"sh kn lc vc ws sm st flag_sa sn rs sc sl sg sk si sb so za kr es lk sd sr sz se ch sy tw tj tz th tl "+"tg to tt tn tr flag_tm flag_tm ug ua ae gb us vi uy uz vu va ve vn wf eh ye zm zw re ax ta io bq cx "+"cc gg im yt nf pn bl pm gs tk bv hm sj um ic ea cp dg as aq vg ck cw eu gf tf gp mq mp sx ss tc "}}}return e}function I(e){var t=i();if(e&&e["filters"]){var n=t.filters;C.each(e["filters"],function(i,e){if(!N(e)||C.isEmptyObject(e)){delete n[i];return}C.each(e,function(e,t){n[i][e]=t})});e["filters"]=n}return C.extend({},t,e)}var P,M;if(window.getSelection&&document.createRange){P=function(e){var t=window.getSelection&&window.getSelection();if(t&&t.rangeCount>0){return t.getRangeAt(0)}};M=function(e,t){var i=document.createRange();i.setStart(t.startContainer,t.startOffset);i.setEnd(t.endContainer,t.endOffset);t=window.getSelection();t.removeAllRanges();t.addRange(i)}}else if(document.selection&&document.body.createTextRange){P=function(e){return document.selection.createRange()};M=function(e,t){var i=document.body.createTextRange();i.moveToElementText(e);i.setStart(t.startContanier,t.startOffset);i.setEnd(t.endContainer,t.endOffset);i.select()}}var f;function p(e,i){return e.replace(f,function(e){var t=A[T===0?"jsecapeMap":"jsEscapeMap"];if(typeof e!=="undefined"&&e in t){return l(i,t[e],A.toShort(e))}return e})}function L(e,t){e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/`/g,"&#x60;").replace(/(?:\r\n|\r|\n)/g,"\n").replace(/(\n+)/g,"<div>$1</div>").replace(/\n/g,"<br/>").replace(/<br\/><\/div>/g,"</div>");if(t.shortnames){e=A.shortnameToUnicode(e)}return p(e,t.emojiTemplate).replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/  /g,"&nbsp;&nbsp;")}function F(e,t){e=e.replace(/&#10;/g,"\n").replace(/&#09;/g,"\t").replace(/<img[^>]*alt="([^"]+)"[^>]*>/gi,"$1").replace(/\n|\r/g,"").replace(/<br[^>]*>/gi,"\n").replace(/(?:<(?:div|p|ol|ul|li|pre|code|object)[^>]*>)+/gi,"<div>").replace(/(?:<\/(?:div|p|ol|ul|li|pre|code|object)>)+/gi,"</div>").replace(/\n<div><\/div>/gi,"\n").replace(/<div><\/div>\n/gi,"\n").replace(/(?:<div>)+<\/div>/gi,"\n").replace(/([^\n])<\/div><div>/gi,"$1\n").replace(/(?:<\/div>)+/gi,"</div>").replace(/([^\n])<\/div>([^\n])/gi,"$1\n$2").replace(/<\/div>/gi,"").replace(/([^\n])<div>/gi,"$1\n").replace(/\n<div>/gi,"\n").replace(/<div>\n/gi,"\n\n").replace(/<(?:[^>]+)?>/g,"").replace(new RegExp(S,"g"),"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x60;/g,"`").replace(/&#60;/g,"<").replace(/&#62;/g,">").replace(/&amp;/g,"&");switch(t.saveEmojisAs){case"image":e=p(e,t.emojiTemplate);break;case"shortname":e=A.toShort(e)}return e}function G(){var e=this,t=e.editor[0].offsetWidth-e.editor[0].clientWidth,i=parseInt(e.button.css("marginRight"));if(i!==t){e.button.css({marginRight:t});if(e.floatingPicker){e.picker.css({right:parseInt(e.picker.css("right"))-i+t})}}}function $(){var e=this;if(!e.sprite&&e.lasyEmoji[0]&&e.lasyEmoji.eq(0).is(".lazy-emoji")){var i=e.picker.offset().top,n=i+e.picker.height()+20;e.lasyEmoji.each(function(){var e=C(this),t=e.offset().top;if(t>i&&t<n){e.attr("src",e.data("src")).removeClass("lazy-emoji")}if(t>n){return false}});e.lasyEmoji=e.lasyEmoji.filter(".lazy-emoji")}}function W(e,t){return(t?"":".")+x+(e?"-"+e:"")}function H(e){var i=C("<div/>",N(e)?e:{class:W(e,true)});C.each(o.call(arguments).slice(1),function(e,t){if(C.isFunction(t)){t=t.call(i)}if(t){C(t).appendTo(i)}});return i}function j(){return localStorage.getItem("recent_emojis")||""}function B(e,t){var i=j();if(!e.recent||e.recent!==i||t){if(i.length){var n=e.scrollArea.is(".skinnable"),r,o;if(!n){r=e.scrollArea.scrollTop();if(t){e.recentCategory.show()}o=e.recentCategory.is(":visible")?e.recentCategory.height():0}var a=O(i,e.emojiBtnTemplate,true).split("|").join("");e.recentCategory.children(".emojibtn").remove();C(a).insertAfter(e.recentCategory.children(".emojionearea-category-title"));e.recentCategory.children(".emojibtn").on("click",function(){e.trigger("emojibtn.click",C(this))});e.recentFilter.show();if(!n){e.recentCategory.show();var s=e.recentCategory.height();if(o!==s){e.scrollArea.scrollTop(r+s-o)}}}else{if(e.recentFilter.hasClass("active")){e.recentFilter.removeClass("active").next().addClass("active")}e.recentCategory.hide();e.recentFilter.hide()}e.recent=i}}function V(e,t){var i=j();var n=i.split("|");var r=n.indexOf(t);if(r!==-1){n.splice(r,1)}n.unshift(t);if(n.length>9){n.pop()}localStorage.setItem("recent_emojis",n.join("|"));B(e)}function z(){var e="test";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function v(l,t,a){l.options=a=I(a);l.sprite=a.sprite&&T<3;l.inline=a.inline===null?t.is("INPUT"):a.inline;l.shortnames=a.shortnames;l.saveEmojisAs=a.saveEmojisAs;l.standalone=a.standalone;l.emojiTemplate='<img alt="{alt}" class="emojione'+(l.sprite?'-{uni}" src="'+E+'"/>':'emoji" src="{img}"/>');l.emojiTemplateAlt=l.sprite?'<i class="emojione-{uni}"/>':'<img class="emojioneemoji" src="{img}"/>';l.emojiBtnTemplate='<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}">'+l.emojiTemplateAlt+"</i>";l.recentEmojis=a.recentEmojis&&z();var e=a.pickerPosition;l.floatingPicker=e==="top"||e==="bottom";l.source=t;if(t.is(":disabled")||t.is(".disabled")){l.disable()}var i=t.is("TEXTAREA")||t.is("INPUT")?"val":"text",n,r,s,o,u,c,d,f,p,h,g=H("tones",a.tones?function(){this.addClass(W("tones-"+a.tonesStyle,true));for(var e=0;e<=5;e++){this.append(C("<i/>",{class:"btn-tone btn-tone-"+e+(!e?" active":""),"data-skin":e,role:"button"}))}}:null),v=H({class:x+(l.standalone?" "+x+"-standalone ":" ")+(t.attr("class")||""),role:"application"},n=l.editor=H("editor").attr({contenteditable:l.standalone?false:true,placeholder:a.placeholder||t.data("placeholder")||t.attr("placeholder")||"",tabindex:0}),r=l.button=H("button",H("button-open"),H("button-close")).attr("title",a.buttonTitle),s=l.picker=H("picker",H("wrapper",o=H("filters"),a.search?c=H("search-panel",H("search",a.search?function(){l.search=C("<input/>",{placeholder:a.searchPlaceholder||"",type:"text",class:"search"});this.append(l.search)}:null),g):null,h=H("scroll-area",a.tones&&!a.search?H("tones-panel",g):null,d=H("emojis-list")))).addClass(W("picker-position-"+a.pickerPosition,true)).addClass(W("filters-position-"+a.filtersPosition,true)).addClass(W("search-position-"+a.searchPosition,true)).addClass("hidden"));if(a.search){c.addClass(W("with-search",true))}l.searchSel=null;n.data(t.data());C.each(a.attributes,function(e,t){n.attr(e,t)});var m=H("category-block").attr({"data-tone":0}).prependTo(d);C.each(a.filters,function(e,t){var i=0;if(e==="recent"&&!l.recentEmojis){return}if(e!=="tones"){C("<i/>",{class:W("filter",true)+" "+W("filter-"+e,true),"data-filter":e,title:t.title}).wrapInner(O(t.icon,l.emojiTemplateAlt)).appendTo(o)}else if(a.tones){i=5}else{return}do{var n,r=t.emoji.replace(/[\s,;]+/g,"|");if(i===0){n=H("category").attr({name:e,"data-tone":i}).appendTo(m)}else{n=H("category-block").attr({name:e,"data-tone":i}).appendTo(d)}if(i>0){n.hide();r=r.split("|").join("_tone"+i+"|")+"_tone"+i}if(e==="recent"){r=j()}r=O(r,l.sprite?'<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><i class="emojione-{uni}"></i></i>':'<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><img class="emojioneemoji lazy-emoji" data-src="{img}"/></i>',true).split("|").join("");n.html(r);C('<div class="emojionearea-category-title"/>').text(t.title).prependTo(n)}while(--i>0)});a.filters=null;if(!l.sprite){l.lasyEmoji=d.find(".lazy-emoji")}u=o.find(W("filter"));u.eq(0).addClass("active");p=d.find(W("category-block"));f=d.find(W("category"));l.recentFilter=u.filter('[data-filter="recent"]');l.recentCategory=f.filter("[name=recent]");l.scrollArea=h;if(a.container){C(a.container).wrapInner(v)}else{v.insertAfter(t)}if(a.hideSource){t.hide()}l.setText(t[i]());t[i](l.getText());G.apply(l);if(l.standalone&&!l.getText().length){var y=C(t).data("emoji-placeholder")||a.emojiPlaceholder;l.setText(y);n.addClass("has-placeholder")}k(l,d.find(".emojibtn"),{click:"emojibtn.click"});k(l,window,{resize:"!resize"});k(l,g.children(),{click:"tone.click"});k(l,[s,r],{mousedown:"!mousedown"},n);k(l,r,{click:"button.click"});k(l,n,{paste:"!paste"},n);k(l,n,["focus","blur"],function(){return l.stayFocused?false:n});k(l,s,{mousedown:"picker.mousedown",mouseup:"picker.mouseup",click:"picker.click",keyup:"picker.keyup",keydown:"picker.keydown",keypress:"picker.keypress"});k(l,n,["mousedown","mouseup","click","keyup","keydown","keypress"]);k(l,s.find(".emojionearea-filter"),{click:"filter.click"});k(l,t,{change:"source.change"});if(a.search){k(l,l.search,{keyup:"search.keypress",focus:"search.focus",blur:"search.blur"})}var b=false;h.on("scroll",function(){if(!b){$.call(l);if(h.is(":not(.skinnable)")){var i=f.eq(0),n=h.offset().top;f.each(function(e,t){if(C(t).offset().top-n>=10){return false}i=C(t)});var e=u.filter('[data-filter="'+i.attr("name")+'"]');if(e[0]&&!e.is(".active")){u.removeClass("active");e.addClass("active")}}}});l.on("@filter.click",function(e){var t=e.is(".active");if(h.is(".skinnable")){if(t)return;g.children().eq(0).click()}b=true;if(!t){u.filter(".active").removeClass("active");e.addClass("active")}var i=f.filter('[name="'+e.data("filter")+'"]').offset().top,n=h.scrollTop(),r=h.offset().top;h.stop().animate({scrollTop:i+n-r-2},200,"swing",function(){$.call(l);b=false})}).on("@picker.show",function(){if(l.recentEmojis){B(l)}$.call(l)}).on("@tone.click",function(e){g.children().removeClass("active");var t=e.addClass("active").data("skin");if(t){h.addClass("skinnable");p.hide().filter("[data-tone="+t+"]").show();u.removeClass("active")}else{h.removeClass("skinnable");p.hide().filter("[data-tone=0]").show();u.eq(0).click()}$.call(l);if(a.search){l.trigger("search.keypress")}}).on("@button.click",function(e){if(e.is(".active")){l.hidePicker()}else{l.showPicker();l.searchSel=null}}).on("@!paste",function(a,e){var t=function(e){var t="caret-"+(new Date).getTime();var i=L(e,l);R(i);R('<i id="'+t+'"></i>');a.scrollTop(s);var n=C("#"+t),r=n.offset().top-a.offset().top,o=a.height();if(s+r>=o||s>r){a.scrollTop(s+r-2*o/3)}n.remove();l.stayFocused=false;G.apply(l);D(l,"paste",[a,e,i])};if(e.originalEvent.clipboardData){var i=e.originalEvent.clipboardData.getData("text/plain");t(i);if(e.preventDefault){e.preventDefault()}else{e.stop()}e.returnValue=false;e.stopPropagation();return false}l.stayFocused=true;R("<span>"+S+"</span>");var n=P(a[0]),s=a.scrollTop(),r=C("<div/>",{contenteditable:true}).css({position:"fixed",left:"-999px",width:"1px",height:"1px",top:"20px",overflow:"hidden"}).appendTo(C("BODY")).focus();window.setTimeout(function(){a.focus();M(a[0],n);var e=F(r.html().replace(/\r\n|\n|\r/g,"<br>"),l);r.remove();t(e)},200)}).on("@emojibtn.click",function(e){n.removeClass("has-placeholder");if(l.searchSel!==null){n.focus();M(n[0],l.searchSel);l.searchSel=null}if(l.standalone){n.html(O(e.data("name"),l.emojiTemplate));l.trigger("blur")}else{P(n[0]);R(O(e.data("name"),l.emojiTemplate))}if(l.recentEmojis){V(l,e.data("name"))}l.trigger("search.keypress")}).on("@!resize @keyup @emojibtn.click",G).on("@!mousedown",function(e,t){if(C(t.target).hasClass("search")){l.stayFocused=true;if(l.searchSel===null){l.searchSel=P(e[0])}}else{if(!v.is(".focused")){e.trigger("focus")}t.preventDefault()}return false}).on("@change",function(){var e=l.editor.html().replace(/<\/?(?:div|span|p)[^>]*>/gi,"");if(!e.length||/^<br[^>]*>$/i.test(e)){l.editor.html(l.content="")}t[i](l.getText())}).on("@source.change",function(){l.setText(t[i]());D("change")}).on("@focus",function(){v.addClass("focused")}).on("@blur",function(){v.removeClass("focused");if(a.hidePickerOnBlur){l.hidePicker()}var e=l.editor.html();if(l.content!==e){l.content=e;D(l,"change",[l.editor]);t.trigger("blur").trigger("change")}else{t.trigger("blur")}if(a.search){l.search.val("");l.trigger("search.keypress",true)}});if(a.search){l.on("@search.focus",function(){l.stayFocused=true;l.search.addClass("focused")}).on("@search.keypress",function(e){var r=s.find(".emojionearea-filter");var i=a.tones?g.find("i.active").data("skin"):0;var o=l.search.val().replace(/ /g,"_").replace(/"/g,'\\"');if(o&&o.length){if(l.recentFilter.hasClass("active")){l.recentFilter.removeClass("active").next().addClass("active")}l.recentCategory.hide();l.recentFilter.hide();p.each(function(){var e=function(e,t){var i=e.find('.emojibtn[data-name*="'+o+'"]');if(i.length===0){if(e.data("tone")===t){e.hide()}r.filter('[data-filter="'+e.attr("name")+'"]').hide()}else{var n=e.find('.emojibtn:not([data-name*="'+o+'"])');n.hide();i.show();if(e.data("tone")===t){e.show()}r.filter('[data-filter="'+e.attr("name")+'"]').show()}};var t=C(this);if(t.data("tone")===0){f.filter(':not([name="recent"])').each(function(){e(C(this),0)})}else{e(t,i)}});if(!b){h.trigger("scroll")}else{$.call(l)}}else{B(l,true);p.filter('[data-tone="'+g.find("i.active").data("skin")+'"]:not([name="recent"])').show();C(".emojibtn",p).show();r.show();$.call(l)}}).on("@search.blur",function(){l.stayFocused=false;l.search.removeClass("focused");l.trigger("blur")})}if(a.shortcuts){l.on("@keydown",function(e,t){if(!t.ctrlKey){if(t.which==9){t.preventDefault();r.click()}else if(t.which==27){t.preventDefault();if(r.is(".active")){l.hidePicker()}}}})}if(N(a.events)&&!C.isEmptyObject(a.events)){C.each(a.events,function(e,t){l.on(e.replace(/_/g,"."),t)})}if(a.autocomplete){var _=function(){var e={maxCount:a.textcomplete.maxCount,placement:a.textcomplete.placement};if(a.shortcuts){e.onKeydown=function(e,t){if(!e.ctrlKey&&e.which==13){return t.KEY_ENTER}}}var i=C.map(A.emojioneList,function(e,t){return!a.autocompleteTones?/_tone[12345]/.test(t)?null:t:t});i.sort();n.textcomplete([{id:x,match:/\B(:[\-+\w]*)$/,search:function(t,e){e(C.map(i,function(e){return e.indexOf(t)===0?e:null}))},template:function(e){return O(e,l.emojiTemplate)+" "+e.replace(/:/g,"")},replace:function(e){return O(e,l.emojiTemplate)},cache:true,index:1}],e);if(a.textcomplete.placement){if(C(n.data("textComplete").option.appendTo).css("position")=="static"){C(n.data("textComplete").option.appendTo).css("position","relative")}}};var w=function(){if(l.disabled){var e=function(){l.off("enabled",e);_()};l.on("enabled",e)}else{_()}};if(C.fn.textcomplete){w()}else{C.ajax({url:"https://cdn.rawgit.com/yuku-t/jquery-textcomplete/v1.3.4/dist/jquery.textcomplete.js",dataType:"script",cache:true,success:w})}}if(l.inline){v.addClass(W("inline",true));l.on("@keydown",function(e,t){if(t.which==13){t.preventDefault()}})}if(/firefox/i.test(navigator.userAgent)){document.execCommand("enableObjectResizing",false,false)}l.isReady=true;l.trigger("onLoad",n);l.trigger("ready",n)}var h={defaultBase:"https://cdnjs.cloudflare.com/ajax/libs/emojione/",defaultBase3:"https://cdn.jsdelivr.net/",base:null,isLoading:false};function m(t){var i=u();t=I(t);if(!h.isLoading){if(!A||d(c(A))<2){h.isLoading=true;var e;if(d(i)>5){e=h.defaultBase3+"npm/emojione@"+i}else if(d(i)>4){e=h.defaultBase3+"emojione/"+i}else{e=h.defaultBase+"/"+i}C.ajax({url:e+"/lib/js/emojione.min.js",dataType:"script",cache:true,success:function(){A=window.emojione;i=c(A);T=d(i);var e;if(T>4){h.base=h.defaultBase3+"emojione/assets/"+i;e=h.base+"/sprites/emojione-sprite-"+A.emojiSize+".css"}else{h.base=h.defaultBase+i+"/assets";e=h.base+"/sprites/emojione.sprites.css"}if(t.sprite){if(document.createStyleSheet){document.createStyleSheet(e)}else{C("<link/>",{rel:"stylesheet",href:e}).appendTo("head")}}while(n.length){n.shift().call()}h.isLoading=false}})}else{i=c(A);T=d(i);if(T>4){h.base=h.defaultBase3+"emojione/assets/"+i}else{h.base=h.defaultBase+i+"/assets"}}}r(function(){var e="";if(t.useInternalCDN){if(T>4)e=A.emojiSize+"/";A.imagePathPNG=h.base+"/png/"+e;A.imagePathSVG=h.base+"/svg/"+e;A.imagePathSVGSprites=h.base+"/sprites/emojione.sprites.svg";A.imageType=t.imageType}if(d(i)>4){f=A.regUnicode;A.imageType=t.imageType||"png"}else{f=new RegExp("<object[^>]*>.*?</object>|<span[^>]*>.*?</span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+A.unicodeRegexp+")","gi")}})}var t=function(e,t){var i=this;m(t);a[i.id=++g]={};s[i.id]={};r(function(){v(i,e,t)})};function y(n,r){r=r.replace(/^@/,"");var e=n.id;if(s[e][r]){C.each(s[e][r],function(e,i){C.each(C.isArray(i[0])?i[0]:[i[0]],function(e,t){C(t).on(i[1],function(){var e=o.call(arguments),t=C.isFunction(i[2])?i[2].apply(n,[r].concat(e)):i[2];if(t){D(n,r,[t].concat(e))}})})});s[e][r]=null}}t.prototype.on=function(e,i){if(e&&C.isFunction(i)){var n=this;C.each(e.toLowerCase().split(" "),function(e,t){y(n,t);(a[n.id][t]||(a[n.id][t]=[])).push(i)})}return this};t.prototype.off=function(e,n){if(e){var r=this.id;C.each(e.toLowerCase().replace(/_/g,".").split(" "),function(e,i){if(a[r][i]&&!/^@/.test(i)){if(n){C.each(a[r][i],function(e,t){if(t===n){a[r][i].splice(e,1)}})}else{a[r][i]=[]}}})}return this};t.prototype.trigger=function(){var e=o.call(arguments),t=[this].concat(e.slice(0,1));t.push(e.slice(1));return D.apply(this,t)};t.prototype.setFocus=function(){var e=this;r(function(){e.editor.focus()});return e};t.prototype.setText=function(e){var t=this;r(function(){t.editor.html(L(e,t));t.content=t.editor.html();D(t,"change",[t.editor]);G.apply(t)});return t};t.prototype.getText=function(){return F(this.editor.html(),this)};t.prototype.showPicker=function(){var e=this;if(e._sh_timer){window.clearTimeout(e._sh_timer)}e.picker.removeClass("hidden");e._sh_timer=window.setTimeout(function(){e.button.addClass("active")},50);D(e,"picker.show",[e.picker]);return e};t.prototype.hidePicker=function(){var e=this;if(e._sh_timer){window.clearTimeout(e._sh_timer)}e.button.removeClass("active");e._sh_timer=window.setTimeout(function(){e.picker.addClass("hidden")},500);D(e,"picker.hide",[e.picker]);return e};t.prototype.enable=function(){var t=this;var e=function(){t.disabled=false;t.editor.prop("contenteditable",true);t.button.show();var e=t[t.standalone?"button":"editor"];e.parent().removeClass("emojionearea-disable");D(t,"enabled",[e])};t.isReady?e():t.on("ready",e);return t};t.prototype.disable=function(){var t=this;t.disabled=true;var e=function(){t.editor.prop("contenteditable",false);t.hidePicker();t.button.hide();var e=t[t.standalone?"button":"editor"];e.parent().addClass("emojionearea-disable");D(t,"disabled",[e])};t.isReady?e():t.on("ready",e);return t};C.fn.emojioneArea=function(e){return this.each(function(){if(!!this.emojioneArea)return this.emojioneArea;C.data(this,"emojioneArea",this.emojioneArea=new t(C(this),e));return this.emojioneArea})};C.fn.emojioneArea.defaults=i();C.fn.emojioneAreaText=function(e){e=I(e);var t=this,i={shortnames:e&&typeof e.shortnames!=="undefined"?e.shortnames:true,emojiTemplate:'<img alt="{alt}" class="emojione'+(e&&e.sprite&&T<3?'-{uni}" src="'+E:'emoji" src="{img}')+'"/>'};m(e);r(function(){t.each(function(){var e=C(this);if(!e.hasClass("emojionearea-text")){e.addClass("emojionearea-text").html(L(e.is("TEXTAREA")||e.is("INPUT")?e.val():e.text(),i))}return e})});return this}},window);(function(c,d){var e="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color outlineColor".split(" "),f=/^([\-+])=\s*(\d+\.?\d*)/,t=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],p=c.Color=function(e,t,i,n){return new c.Color.fn.parse(e,t,i,n)},h={rgba:{cache:"_rgba",props:{red:{idx:0,type:"byte",empty:true},green:{idx:1,type:"byte",empty:true},blue:{idx:2,type:"byte",empty:true},alpha:{idx:3,type:"percent",def:1}}},hsla:{cache:"_hsla",props:{hue:{idx:0,type:"degrees",empty:true},saturation:{idx:1,type:"percent",empty:true},lightness:{idx:2,type:"percent",empty:true}}}},g={byte:{floor:true,min:0,max:255},percent:{min:0,max:1},degrees:{mod:360,floor:true}},l=h.rgba.props,a=p.support={},v,m=c.each;h.hsla.props.alpha=l.alpha;function y(e,t,i){var n=g[t.type]||{},r=t.empty||i;if(r&&e==null){return null}if(t.def&&e==null){return t.def}if(n.floor){e=~~e}else{e=parseFloat(e)}if(e==null||isNaN(e)){return t.def}if(n.mod){e=e%n.mod;return e<0?n.mod+e:e}return n.min>e?n.min:n.max<e?n.max:e}function u(s){var l=p(),u=l._rgba=[];s=s.toLowerCase();m(t,function(e,t){var i=t.re.exec(s),n=i&&t.parse(i),r,o=t.space||"rgba",a=h[o].cache;if(n){r=l[o](n);l[a]=r[a];u=l._rgba=r._rgba;return false}});if(u.length!==0){if(Math.max.apply(Math,u)===0){c.extend(u,v.transparent)}return l}if(s=v[s]){return s}}p.fn=p.prototype={constructor:p,parse:function(r,e,t,i){if(r===d){this._rgba=[null,null,null,null];return this}if(r instanceof c||r.nodeType){r=r instanceof c?r.css(e):c(r).css(e);e=d}var o=this,n=c.type(r),a=this._rgba=[],s;if(e!==d){r=[r,e,t,i];n="array"}if(n==="string"){return this.parse(u(r)||v._default)}if(n==="array"){m(l,function(e,t){a[t.idx]=y(r[t.idx],t)});return this}if(n==="object"){if(r instanceof p){m(h,function(e,t){if(r[t.cache]){o[t.cache]=r[t.cache].slice()}})}else{m(h,function(e,n){m(n.props,function(e,t){var i=n.cache;if(!o[i]&&n.to){if(r[e]==null||e==="alpha"){return}o[i]=n.to(o._rgba)}o[i][t.idx]=y(r[e],t,true)})})}return this}},is:function(e){var r=p(e),o=true,a=this;m(h,function(e,t){var i=r[t.cache],n;if(i){n=a[t.cache]||t.to&&t.to(a._rgba)||[];m(t.props,function(e,t){if(i[t.idx]!=null){o=i[t.idx]===n[t.idx];return o}})}return o});return o},_space:function(){var i=[],n=this;m(h,function(e,t){if(n[t.cache]){i.push(e)}});return i.pop()},transition:function(e,a){var s=p(e),t=s._space(),i=h[t],l=this[i.cache]||i.to(this._rgba),u=l.slice();s=s[i.cache];m(i.props,function(e,t){var i=t.idx,n=l[i],r=s[i],o=g[t.type]||{};if(r===null){return}if(n===null){u[i]=r}else{if(o.mod){if(r-n>o.mod/2){n+=o.mod}else if(n-r>o.mod/2){n-=o.mod}}u[t.idx]=y((r-n)*a+n,t)}});return this[t](u)},blend:function(e){if(this._rgba[3]===1){return this}var t=this._rgba.slice(),i=t.pop(),n=p(e)._rgba;return p(c.map(t,function(e,t){return(1-i)*n[t]+i*e}))},toRgbaString:function(){var e="rgba(",t=c.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});if(t[3]===1){t.pop();e="rgb("}return e+t.join(",")+")"},toHslaString:function(){var e="hsla(",t=c.map(this.hsla(),function(e,t){if(e==null){e=t>2?1:0}if(t&&t<3){e=Math.round(e*100)+"%"}return e});if(t[3]===1){t.pop();e="hsl("}return e+t.join(",")+")"},toHexString:function(e){var t=this._rgba.slice(),i=t.pop();if(e){t.push(~~(i*255))}return"#"+c.map(t,function(e,t){e=(e||0).toString(16);return e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}};p.fn.parse.prototype=p.fn;function b(e,t,i){i=(i+1)%1;if(i*6<1){return e+(t-e)*6*i}if(i*2<1){return t}if(i*3<2){return e+(t-e)*(2/3-i)*6}return e}h.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null){return[null,null,null,e[3]]}var t=e[0]/255,i=e[1]/255,n=e[2]/255,r=e[3],o=Math.max(t,i,n),a=Math.min(t,i,n),s=o-a,l=o+a,u=l*.5,c,d;if(a===o){c=0}else if(t===o){c=60*(i-n)/s+360}else if(i===o){c=60*(n-t)/s+120}else{c=60*(t-i)/s+240}if(u===0||u===1){d=u}else if(u<=.5){d=s/l}else{d=s/(2-l)}return[Math.round(c)%360,d,u,r==null?1:r]};h.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null){return[null,null,null,e[3]]}var t=e[0]/360,i=e[1],n=e[2],r=e[3],o=n<=.5?n*(1+i):n+i-n*i,a=2*n-o,s,l,u;return[Math.round(b(a,o,t+1/3)*255),Math.round(b(a,o,t)*255),Math.round(b(a,o,t-1/3)*255),r]};m(h,function(l,e){var i=e.props,a=e.cache,s=e.to,u=e.from;p.fn[l]=function(e){if(s&&!this[a]){this[a]=s(this._rgba)}if(e===d){return this[a].slice()}var n=c.type(e),r=n==="array"||n==="object"?e:arguments,o=this[a].slice(),t;m(i,function(e,t){var i=r[n==="object"?e:t.idx];if(i==null){i=o[t.idx]}o[t.idx]=y(i,t)});if(u){t=p(u(o));t[a]=o;return t}else{return p(o)}};m(i,function(a,s){if(p.fn[a]){return}p.fn[a]=function(e){var t=c.type(e),i=a==="alpha"?this._hsla?"hsla":"rgba":l,n=this[i](),r=n[s.idx],o;if(t==="undefined"){return r}if(t==="function"){e=e.call(this,r);t=c.type(e)}if(e==null&&s.empty){return this}if(t==="string"){o=f.exec(e);if(o){e=r+parseFloat(o[2])*(o[1]==="+"?1:-1)}}n[s.idx]=e;return this[i](n)}})});m(e,function(e,o){c.cssHooks[o]={set:function(e,t){var i,n,r;if(c.type(t)!=="string"||(i=u(t))){t=p(i||t);if(!a.rgba&&t._rgba[3]!==1){r=o==="backgroundColor"?e.parentNode:e;do{n=c.curCSS(r,"backgroundColor")}while((n===""||n==="transparent")&&(r=r.parentNode)&&r.style);t=t.blend(n&&n!=="transparent"?n:"_default")}t=t.toRgbaString()}e.style[o]=t}};c.fx.step[o]=function(e){if(!e.colorInit){e.start=p(e.elem,o);e.end=p(e.end);e.colorInit=true}c.cssHooks[o].set(e.elem,e.start.transition(e.end,e.pos))}});c(function(){var e=document.createElement("div"),t=e.style;t.cssText="background-color:rgba(1,1,1,.5)";a.rgba=t.backgroundColor.indexOf("rgba")>-1});v=c.Color.names={aqua:"#00ffff",azure:"#f0ffff",beige:"#f5f5dc",black:"#000000",blue:"#0000ff",brown:"#a52a2a",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkviolet:"#9400d3",fuchsia:"#ff00ff",gold:"#ffd700",green:"#008000",indigo:"#4b0082",khaki:"#f0e68c",lightblue:"#add8e6",lightcyan:"#e0ffff",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightyellow:"#ffffe0",lime:"#00ff00",magenta:"#ff00ff",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",pink:"#ffc0cb",purple:"#800080",violet:"#800080",red:"#ff0000",silver:"#c0c0c0",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery);(function(me){me.Jcrop=function(e,t){var S=me.extend({},me.Jcrop.defaults),a,r=navigator.userAgent.toLowerCase(),o=/msie/.test(r),v=/msie [1-6]\./.test(r);function D(e){return Math.round(e)+"px"}function k(e){return S.baseClass+"-"+e}function m(){return me.fx.step.hasOwnProperty("backgroundColor")}function s(e){var t=me(e).offset();return[t.left,t.top]}function d(e){return[e.pageX-a[0],e.pageY-a[1]]}function y(e){if(typeof e!=="object")e={};S=me.extend(S,e);me.each(["onChange","onSelect","onRelease","onDblClick"],function(e,t){if(typeof S[t]!=="function")S[t]=function(){}})}function b(e,t,i){a=s(R);g.setCursor(e==="move"?e:e+"-resize");if(e==="move"){return g.activateHandlers(B(t),l,i)}var n=G.getFixed();var r=V(e);var o=G.getCorner(V(r));G.setPressed(G.getCorner(r));G.setCurrent(o);g.activateHandlers(j(e,n),l,i)}function j(t,i){return function(e){if(!S.aspectRatio){switch(t){case"e":e[1]=i.y2;break;case"w":e[1]=i.y2;break;case"n":e[0]=i.x2;break;case"s":e[0]=i.x2;break}}else{switch(t){case"e":e[1]=i.y+1;break;case"w":e[1]=i.y+1;break;case"n":e[0]=i.x+1;break;case"s":e[0]=i.x+1;break}}G.setCurrent(e);W.update()}}function B(e){var t=e;ie.watchKeys();return function(e){G.moveOffset([e[0]-t[0],e[1]-t[1]]);t=e;W.update()}}function V(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function z(t){return function(e){if(S.disabled){return false}if(t==="move"&&!S.allowMove){return false}a=s(R);h=true;b(t,d(e));e.stopPropagation();e.preventDefault();return false}}function U(e,t,i){var n=e.width(),r=e.height();if(n>t&&t>0){n=t;r=t/e.width()*e.height()}if(r>i&&i>0){r=i;n=i/e.height()*e.width()}x=e.width()/n;T=e.height()/r;e.width(n).height(r)}function O(e){return{x:e.x*x,y:e.y*T,x2:e.x2*x,y2:e.y2*T,w:e.w*x,h:e.h*T}}function l(e){var t=G.getFixed();if(t.w>S.minSelect[0]&&t.h>S.minSelect[1]){W.enableHandles();W.done()}else{W.release()}g.setCursor(S.allowSelect?"crosshair":"default")}function Y(e){if(S.disabled){return false}if(!S.allowSelect){return false}h=true;a=s(R);W.disableHandles();g.setCursor("crosshair");var t=d(e);G.setPressed(t);W.update();g.activateHandlers(q,l,e.type.substring(0,5)==="touch");ie.watchKeys();e.stopPropagation();e.preventDefault();return false}function q(e){G.setCurrent(e);W.update()}function X(){var e=me("<div></div>").addClass(k("tracker"));if(o){e.css({opacity:0,backgroundColor:"white"})}return e}if(typeof e!=="object"){e=me(e)[0]}if(typeof t!=="object"){t={}}y(t);var i={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0};var n=me(e),K=true;if(e.tagName=="IMG"){if(n[0].width!=0&&n[0].height!=0){n.width(n[0].width);n.height(n[0].height)}else{var Q=new Image;Q.src=n[0].src;n.width(Q.width);n.height(Q.height)}var R=n.clone().removeAttr("id").css(i).show();R.width(n.width());R.height(n.height());n.after(R).hide()}else{R=n.css(i).show();K=false;if(S.shade===null){S.shade=true}}U(R,S.boxWidth,S.boxHeight);var _=R.width(),w=R.height(),p=me("<div />").width(_).height(w).addClass(k("holder")).css({position:"relative",backgroundColor:S.bgColor}).insertAfter(n).append(R);if(S.addClass){p.addClass(S.addClass)}var N=me("<div />"),I=me("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),P=me("<div />").width("100%").height("100%").css("zIndex",320),M=me("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var e=G.getFixed();S.onDblClick.call(H,e)}).insertBefore(R).append(I,P);if(K){N=me("<img />").attr("src",R.attr("src")).css(i).width(_).height(w),I.append(N)}if(v){M.css({overflowY:"hidden"})}var u=S.boundary;var f=X().width(_+u*2).height(w+u*2).css({position:"absolute",top:D(-u),left:D(-u),zIndex:290}).mousedown(Y);var Z=S.bgColor,L=S.bgOpacity,c,C,A,E,x,T,J=true,h,ee,te;a=s(R);var F=function(){function e(){var e={},t=["touchstart","touchmove","touchend"],i=document.createElement("div"),n;try{for(n=0;n<t.length;n++){var r=t[n];r="on"+r;var o=r in i;if(!o){i.setAttribute(r,"return;");o=typeof i[r]=="function"}e[t[n]]=o}return e.touchstart&&e.touchend&&e.touchmove}catch(e){return false}}function t(){if(S.touchSupport===true||S.touchSupport===false)return S.touchSupport;else return e()}return{createDragger:function(t){return function(e){if(S.disabled){return false}if(t==="move"&&!S.allowMove){return false}a=s(R);h=true;b(t,d(F.cfilter(e)),true);e.stopPropagation();e.preventDefault();return false}},newSelection:function(e){return Y(F.cfilter(e))},cfilter:function(e){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return e},isSupported:e,support:t()}}();var G=function(){var p=0,h=0,g=0,v=0,t,i;function e(e){e=l(e);g=p=e[0];v=h=e[1]}function n(e){e=l(e);t=e[0]-g;i=e[1]-v;g=e[0];v=e[1]}function r(){return[t,i]}function o(e){var t=e[0],i=e[1];if(0>p+t){t-=t+p}if(0>h+i){i-=i+h}if(w<v+i){i+=w-(v+i)}if(_<g+t){t+=_-(g+t)}p+=t;g+=t;h+=i;v+=i}function a(e){var t=s();switch(e){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function s(){if(!S.aspectRatio){return y()}var e=S.aspectRatio,t=S.minSize[0]/x,i=S.maxSize[0]/x,n=S.maxSize[1]/T,r=g-p,o=v-h,a=Math.abs(r),s=Math.abs(o),l=a/s,u,c,d,f;if(i===0){i=_*10}if(n===0){n=w*10}if(l<e){c=v;d=s*e;u=r<0?p-d:d+p;if(u<0){u=0;f=Math.abs((u-p)/e);c=o<0?h-f:f+h}else if(u>_){u=_;f=Math.abs((u-p)/e);c=o<0?h-f:f+h}}else{u=g;f=a/e;c=o<0?h-f:h+f;if(c<0){c=0;d=Math.abs((c-h)*e);u=r<0?p-d:d+p}else if(c>w){c=w;d=Math.abs(c-h)*e;u=r<0?p-d:d+p}}if(u>p){if(u-p<t){u=p+t}else if(u-p>i){u=p+i}if(c>h){c=h+(u-p)/e}else{c=h-(u-p)/e}}else if(u<p){if(p-u<t){u=p-t}else if(p-u>i){u=p-i}if(c>h){c=h+(p-u)/e}else{c=h-(p-u)/e}}if(u<0){p-=u;u=0}else if(u>_){p-=u-_;u=_}if(c<0){h-=c;c=0}else if(c>w){h-=c-w;c=w}return b(m(p,h,u,c))}function l(e){if(e[0]<0)e[0]=0;if(e[1]<0)e[1]=0;if(e[0]>_)e[0]=_;if(e[1]>w)e[1]=w;return[Math.round(e[0]),Math.round(e[1])]}function m(e,t,i,n){var r=e,o=i,a=t,s=n;if(i<e){r=i;o=e}if(n<t){a=n;s=t}return[r,a,o,s]}function y(){var e=g-p,t=v-h,i;if(c&&Math.abs(e)>c){g=e>0?p+c:p-c}if(C&&Math.abs(t)>C){v=t>0?h+C:h-C}if(E/T&&Math.abs(t)<E/T){v=t>0?h+E/T:h-E/T}if(A/x&&Math.abs(e)<A/x){g=e>0?p+A/x:p-A/x}if(p<0){g-=p;p-=p}if(h<0){v-=h;h-=h}if(g<0){p-=g;g-=g}if(v<0){h-=v;v-=v}if(g>_){i=g-_;p-=i;g-=i}if(v>w){i=v-w;h-=i;v-=i}if(p>_){i=p-w;v-=i;h-=i}if(h>w){i=h-w;v-=i;h-=i}return b(m(p,h,g,v))}function b(e){return{x:e[0],y:e[1],x2:e[2],y2:e[3],w:e[2]-e[0],h:e[3]-e[1]}}return{flipCoords:m,setPressed:e,setCurrent:n,getOffset:r,moveOffset:o,getCorner:a,getFixed:s}}();var $=function(){var i=false,n=me("<div />").css({position:"absolute",zIndex:240,opacity:0}),r={top:a(),left:a().height(w),right:a().height(w),bottom:a()};function e(e,t){r.left.css({height:D(t)});r.right.css({height:D(t)})}function t(){return o(G.getFixed())}function o(e){r.top.css({left:D(e.x),width:D(e.w),height:D(e.y)});r.bottom.css({top:D(e.y2),left:D(e.x),width:D(e.w),height:D(w-e.y2)});r.right.css({left:D(e.x2),width:D(_-e.x2)});r.left.css({width:D(e.x)})}function a(){return me("<div />").css({position:"absolute",backgroundColor:S.shadeColor||S.bgColor}).appendTo(n)}function s(){if(!i){i=true;n.insertBefore(R);t();W.setBgOpacity(1,0,1);N.hide();l(S.shadeColor||S.bgColor,1);if(W.isAwake()){c(S.bgOpacity,1)}else c(1,1)}}function l(e,t){ge(f(),e,t)}function u(){if(i){n.remove();N.show();i=false;if(W.isAwake()){W.setBgOpacity(S.bgOpacity,1,1)}else{W.setBgOpacity(1,1,1);W.disableHandles()}ge(p,0,1)}}function c(e,t){if(i){if(S.bgFade&&!t){n.animate({opacity:1-e},{queue:false,duration:S.fadeTime})}else n.css({opacity:1-e})}}function d(){S.shade?s():u();if(W.isAwake())c(S.bgOpacity)}function f(){return n.children()}return{update:t,updateRaw:o,getShades:f,setBgColor:l,enable:s,disable:u,resize:e,refresh:d,opacity:c}}();var W=function(){var n,r=370,o={},i={},a={},e=false;function s(e){var t=me("<div />").css({position:"absolute",opacity:S.borderOpacity}).addClass(k(e));I.append(t);return t}function l(e,t){var i=me("<div />").mousedown(z(e)).css({cursor:e+"-resize",position:"absolute",zIndex:t}).addClass("ord-"+e);if(F.support){i.bind("touchstart.jcrop",F.createDragger(e))}P.append(i);return i}function u(e){var t=S.handleSize,i=l(e,r++).css({opacity:S.handleOpacity}).addClass(k("handle"));if(t){i.width(t).height(t)}return i}function c(e){return l(e,r++).addClass("jcrop-dragbar")}function t(e){var t;for(t=0;t<e.length;t++){a[e[t]]=c(e[t])}}function d(e){var t,i;for(i=0;i<e.length;i++){switch(e[i]){case"n":t="hline";break;case"s":t="hline bottom";break;case"e":t="vline right";break;case"w":t="vline";break}o[e[i]]=s(t)}}function f(e){var t;for(t=0;t<e.length;t++){i[e[t]]=u(e[t])}}function p(e,t){if(!S.shade){N.css({top:D(-t),left:D(-e)})}M.css({top:D(t),left:D(e)})}function h(e,t){M.width(Math.round(e)).height(Math.round(t))}function g(){var e=G.getFixed();G.setPressed([e.x,e.y]);G.setCurrent([e.x2,e.y2]);v()}function v(e){if(n){return m(e)}}function m(e){var t=G.getFixed();h(t.w,t.h);p(t.x,t.y);if(S.shade)$.updateRaw(t);n||b();if(e){S.onSelect.call(H,O(t))}else{S.onChange.call(H,O(t))}}function y(e,t,i){if(!n&&!t)return;if(S.bgFade&&!i){R.animate({opacity:e},{queue:false,duration:S.fadeTime})}else{R.css("opacity",e)}}function b(){M.show();if(S.shade)$.opacity(L);else y(L,true);n=true}function _(){A();M.hide();if(S.shade)$.opacity(1);else y(1);n=false;S.onRelease.call(H)}function w(){if(e){P.show()}}function C(){e=true;if(S.allowResize){P.show();return true}}function A(){e=false;P.hide()}function E(e){if(e){ee=true;A()}else{ee=false;C()}}function x(){E(false);g()}if(S.dragEdges&&me.isArray(S.createDragbars))t(S.createDragbars);if(me.isArray(S.createHandles))f(S.createHandles);if(S.drawBorders&&me.isArray(S.createBorders))d(S.createBorders);me(document).bind("touchstart.jcrop-ios",function(e){if(me(e.currentTarget).hasClass("jcrop-tracker"))e.stopPropagation()});var T=X().mousedown(z("move")).css({cursor:"move",position:"absolute",zIndex:360});if(F.support){T.bind("touchstart.jcrop",F.createDragger("move"))}I.append(T);A();return{updateVisible:v,update:m,release:_,refresh:g,isAwake:function(){return n},setCursor:function(e){T.css("cursor",e)},enableHandles:C,enableOnly:function(){e=true},showHandles:w,disableHandles:A,animMode:E,setBgOpacity:y,done:x}}();var g=function(){var n=function(){},r=function(){},t=S.trackDocument;function o(e){f.css({zIndex:450});if(e)me(document).bind("touchmove.jcrop",l).bind("touchend.jcrop",u);else if(t)me(document).bind("mousemove.jcrop",a).bind("mouseup.jcrop",s)}function i(){f.css({zIndex:290});me(document).unbind(".jcrop")}function a(e){n(d(e));return false}function s(e){e.preventDefault();e.stopPropagation();if(h){h=false;r(d(e));if(W.isAwake()){S.onSelect.call(H,O(G.getFixed()))}i();n=function(){};r=function(){}}return false}function e(e,t,i){h=true;n=e;r=t;o(i);return false}function l(e){n(d(F.cfilter(e)));return false}function u(e){return s(F.cfilter(e))}function c(e){f.css("cursor",e)}if(!t){f.mousemove(a).mouseup(s).mouseout(s)}R.before(f);return{activateHandlers:e,setCursor:c}}();var ie=function(){var t=me('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),e=me("<div />").css({position:"absolute",overflow:"hidden"}).append(t);function i(){if(S.keySupport){}}function n(e){t.hide()}function r(e,t,i){if(S.allowMove){G.moveOffset([t,i]);W.updateVisible(true)}e.preventDefault();e.stopPropagation()}function o(e){if(e.ctrlKey||e.metaKey){return true}te=e.shiftKey?true:false;var t=te?10:1;switch(e.keyCode){case 37:r(e,-t,0);break;case 39:r(e,t,0);break;case 38:r(e,0,-t);break;case 40:r(e,0,t);break;case 27:if(S.allowSelect)W.release();break;case 9:return true}return false}if(S.keySupport){t.keydown(o).blur(n);if(v||!S.fixedSupport){t.css({position:"absolute",left:"-20px"});e.append(t).insertBefore(R)}else{t.insertBefore(R)}t.hide()}return{watchKeys:i}}();function ne(e){p.removeClass().addClass(k("holder")).addClass(e)}function re(e,t){var i=e[0]/x,n=e[1]/T,r=e[2]/x,o=e[3]/T;if(ee){return}var a=G.flipCoords(i,n,r,o),s=G.getFixed(),l=[s.x,s.y,s.x2,s.y2],u=l,c=S.animationDelay,d=a[0]-l[0],f=a[1]-l[1],p=a[2]-l[2],h=a[3]-l[3],g=0,v=S.swingSpeed;i=u[0];n=u[1];r=u[2];o=u[3];W.animMode(true);var m;function y(){window.setTimeout(b,c)}var b=function(){return function(){g+=(100-g)/v;u[0]=Math.round(i+g/100*d);u[1]=Math.round(n+g/100*f);u[2]=Math.round(r+g/100*p);u[3]=Math.round(o+g/100*h);if(g>=99.8){g=100}if(g<100){ae(u);y()}else{W.done();W.animMode(false);if(typeof t==="function"){t.call(H)}}}}();y()}function oe(e){ae([e[0]/x,e[1]/T,e[2]/x,e[3]/T]);S.onSelect.call(H,O(G.getFixed()));W.enableHandles()}function ae(e){G.setPressed([e[0],e[1]]);G.setCurrent([e[2],e[3]]);W.update()}function se(){return O(G.getFixed())}function le(){return G.getFixed()}function ue(e){y(e);ve()}function ce(){S.disabled=true;W.disableHandles();W.setCursor("default");g.setCursor("default")}function de(){S.disabled=false;ve()}function fe(){W.done();g.activateHandlers(null,null)}function pe(){p.remove();n.show();n.css("visibility","visible");me(e).removeData("Jcrop")}function he(r,o){W.release();ce();var a=new Image;a.onload=function(){var e=a.width;var t=a.height;var i=S.boxWidth;var n=S.boxHeight;R.width(e).height(t);R.attr("src",r);N.attr("src",r);U(R,i,n);_=R.width();w=R.height();N.width(_).height(w);f.width(_+u*2).height(w+u*2);p.width(_).height(w);$.resize(_,w);de();if(typeof o==="function"){o.call(H)}};a.src=r}function ge(e,t,i){var n=t||S.bgColor;if(S.bgFade&&m()&&S.fadeTime&&!i){e.animate({backgroundColor:n},{queue:false,duration:S.fadeTime})}else{e.css("backgroundColor",n)}}function ve(e){if(S.allowResize){if(e){W.enableOnly()}else{W.enableHandles()}}else{W.disableHandles()}g.setCursor(S.allowSelect?"crosshair":"default");W.setCursor(S.allowMove?"move":"default");if(S.hasOwnProperty("trueSize")){x=S.trueSize[0]/_;T=S.trueSize[1]/w}if(S.hasOwnProperty("setSelect")){oe(S.setSelect);W.done();delete S.setSelect}$.refresh();if(S.bgColor!=Z){ge(S.shade?$.getShades():p,S.shade?S.shadeColor||S.bgColor:S.bgColor);Z=S.bgColor}if(L!=S.bgOpacity){L=S.bgOpacity;if(S.shade)$.refresh();else W.setBgOpacity(L)}c=S.maxSize[0]||0;C=S.maxSize[1]||0;A=S.minSize[0]||0;E=S.minSize[1]||0;if(S.hasOwnProperty("outerImage")){R.attr("src",S.outerImage);delete S.outerImage}W.refresh()}if(F.support)f.bind("touchstart.jcrop",F.newSelection);P.hide();ve(true);var H={setImage:he,animateTo:re,setSelect:oe,setOptions:ue,tellSelect:se,tellScaled:le,setClass:ne,disable:ce,enable:de,cancel:fe,release:W.release,destroy:pe,focus:ie.watchKeys,getBounds:function(){return[_*x,w*T]},getWidgetSize:function(){return[_,w]},getScaleFactor:function(){return[x,T]},getOptions:function(){return S},ui:{holder:p,selection:M}};if(o)p.bind("selectstart",function(){return false});n.data("Jcrop",H);return H};me.fn.Jcrop=function(e,t){var i;this.each(function(){if(me(this).data("Jcrop")){if(e==="api")return me(this).data("Jcrop");else me(this).data("Jcrop").setOptions(e)}else{if(this.tagName=="IMG")me.Jcrop.Loader(this,function(){me(this).css({display:"block",visibility:"hidden"});i=me.Jcrop(this,e);if(me.isFunction(t))t.call(i)});else{me(this).css({display:"block",visibility:"hidden"});i=me.Jcrop(this,e);if(me.isFunction(t))t.call(i)}}});return this};me.Jcrop.Loader=function(e,t,i){var n=me(e),r=n[0];function o(){if(r.complete){n.unbind(".jcloader");if(me.isFunction(t))t.call(r)}else window.setTimeout(o,50)}n.bind("load.jcloader",o).bind("error.jcloader",function(e){n.unbind(".jcloader");if(me.isFunction(i))i.call(r)});if(r.complete&&me.isFunction(t)){n.unbind(".jcloader");t.call(r)}};me.Jcrop.defaults={allowSelect:true,allowMove:true,allowResize:true,trackDocument:true,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:false,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:true,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:true,dragEdges:true,fixedSupport:true,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery);(function(e,t){if(typeof define==="function"&&define.amd){define(["jquery"],t)}else{t(e.jQuery)}})(this,function(d){"use strict";d.extendext=function(){var e,t,i,n,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=false,c="default";if(typeof a==="boolean"){u=a;a=arguments[s++]||{}}if(typeof a==="string"){c=d([a.toLowerCase(),"default"]).filter(["default","concat","replace","extend"])[0];a=arguments[s++]||{}}if(typeof a!=="object"&&!d.isFunction(a)){a={}}if(s===l){a=this;s--}for(;s<l;s++){if((e=arguments[s])!==null){if(d.isArray(e)&&c!=="default"){o=a&&d.isArray(a)?a:[];switch(c){case"concat":a=o.concat(d.extend(u,[],e));break;case"replace":a=d.extend(u,[],e);break;case"extend":e.forEach(function(e,t){if(typeof e==="object"){var i=d.isArray(e)?[]:{};o[t]=d.extendext(u,c,o[t]||i,e)}else if(o.indexOf(e)===-1){o.push(e)}});a=o;break}}else{for(t in e){i=a[t];n=e[t];if(a===n){continue}if(u&&n&&(d.isPlainObject(n)||(r=d.isArray(n)))){if(r){r=false;o=i&&d.isArray(i)?i:[]}else{o=i&&d.isPlainObject(i)?i:{}}a[t]=d.extendext(u,c,o,n)}else if(n!==undefined){a[t]=n}}}}}return a}});(function(){"use strict";var l={version:"1.0.3",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false,doNotSkipEncoded:false},template:undefined,compile:undefined},u;l.encodeHTMLSource=function(e){var t={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},i=e?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(e){return e?e.toString().replace(i,function(e){return t[e]||e}):""}};u=function(){return this||(0,eval)("this")}();if(typeof module!=="undefined"&&module.exports){module.exports=l}else if(typeof define==="function"&&define.amd){define(function(){return l})}else{u.doT=l}var c={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},d=/$^/;function f(r,e,o){return(typeof e==="string"?e:e.toString()).replace(r.define||d,function(e,n,t,i){if(n.indexOf("def.")===0){n=n.substring(4)}if(!(n in o)){if(t===":"){if(r.defineParams)i.replace(r.defineParams,function(e,t,i){o[n]={arg:t,text:i}});if(!(n in o))o[n]=i}else{new Function("def","def['"+n+"']="+i)(o)}}return""}).replace(r.use||d,function(e,t){if(r.useParams)t=t.replace(r.useParams,function(e,t,i,n){if(o[i]&&o[i].arg&&n){var r=(i+":"+n).replace(/'|\\/g,"_");o.__exp=o.__exp||{};o.__exp[r]=o[i].text.replace(new RegExp("(^|[^\\w$])"+o[i].arg+"([^\\w$])","g"),"$1"+n+"$2");return t+"def.__exp['"+r+"']"}});var i=new Function("def","return "+t)(o);return i?f(r,i,o):i})}function p(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}l.template=function(e,t,i){t=t||l.templateSettings;var n=t.append?c.append:c.split,r,o=0,a,s=t.use||t.define?f(t,e,i||{}):e;s=("var out='"+(t.strip?s.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):s).replace(/'|\\/g,"\\$&").replace(t.interpolate||d,function(e,t){return n.start+p(t)+n.end}).replace(t.encode||d,function(e,t){r=true;return n.startencode+p(t)+n.end}).replace(t.conditional||d,function(e,t,i){return t?i?"';}else if("+p(i)+"){out+='":"';}else{out+='":i?"';if("+p(i)+"){out+='":"';}out+='"}).replace(t.iterate||d,function(e,t,i,n){if(!t)return"';} } out+='";o+=1;a=n||"i"+o;t=p(t);return"';var arr"+o+"="+t+";if(arr"+o+"){var "+i+","+a+"=-1,l"+o+"=arr"+o+".length-1;while("+a+"<l"+o+"){"+i+"=arr"+o+"["+a+"+=1];out+='"}).replace(t.evaluate||d,function(e,t){return"';"+p(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"");if(r){if(!t.selfcontained&&u&&!u._encodeHTML)u._encodeHTML=l.encodeHTMLSource(t.doNotSkipEncoded);s="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+l.encodeHTMLSource.toString()+"("+(t.doNotSkipEncoded||"")+"));"+s}try{return new Function(t.varname,s)}catch(e){if(typeof console!=="undefined")console.log("Could not create a template function: "+s);throw e}};l.compile=function(e,t){return l.template(e,null,t)}})();(function e(t,i){if(typeof exports==="object"&&typeof module==="object")module.exports=i();else if(typeof define==="function"&&define.amd)define([],i);else if(typeof exports==="object")exports["agGrid"]=i();else t["agGrid"]=i()})(this,function(){return function(i){var n={};function r(e){if(n[e]){return n[e].exports}var t=n[e]={i:e,l:false,exports:{}};i[e].call(t.exports,t,t.exports,r);t.l=true;return t.exports}r.m=i;r.c=n;r.d=function(e,t,i){if(!r.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:i})}};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=119)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var n=function(){function e(e,t){this.beans={};this.componentsMappedByName={};this.destroyed=false;if(!e||!e.beans){return}this.contextParams=e;this.logger=t;this.logger.log(">> creating ag-Application Context");this.setupComponents();this.createBeans();var i=a.Utils.mapObject(this.beans,function(e){return e.beanInstance});this.wireBeans(i);this.logger.log(">> ag-Application Context ready - component is alive")}e.prototype.setupComponents=function(){var t=this;if(this.contextParams.components){this.contextParams.components.forEach(function(e){return t.addComponent(e)})}};e.prototype.addComponent=function(e){var t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();var i=t.toUpperCase();this.componentsMappedByName[i]=e.theClass};e.prototype.createComponent=function(e,t){var i=e.nodeName;if(this.componentsMappedByName&&this.componentsMappedByName[i]){var n=new this.componentsMappedByName[i];this.wireBean(n,t);return n}else{return null}};e.prototype.wireBean=function(e,t){if(!e){throw Error("Can't wire to bean since it is null")}this.wireBeans([e],t)};e.prototype.wireBeans=function(e,t){this.autoWireBeans(e);this.methodWireBeans(e);this.preConstruct(e);if(a.Utils.exists(t)){e.forEach(t)}this.postConstruct(e)};e.prototype.createBeans=function(){var o=this;this.contextParams.beans.forEach(this.createBeanEntry.bind(this));if(this.contextParams.overrideBeans){this.contextParams.overrideBeans.forEach(this.createBeanEntry.bind(this))}a.Utils.iterateObject(this.beans,function(e,t){var i;if(t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor){i=t.bean.__agBeanMetaData.autowireMethods.agConstructor}var n=o.getBeansForParameters(i,t.bean.name);var r=s(t.bean,n);t.beanInstance=r;o.logger.log("bean "+o.getBeanName(r)+" created")})};e.prototype.createBeanEntry=function(e){var t=e.__agBeanMetaData;if(!t){var i=void 0;if(e.prototype.constructor){i=e.prototype.constructor.name}else{i=""+e}console.error("context item "+i+" is not a bean");return}var n={bean:e,beanInstance:null,beanName:t.beanName};this.beans[t.beanName]=n};e.prototype.autoWireBeans=function(e){var t=this;e.forEach(function(e){return t.autoWireBean(e)})};e.prototype.methodWireBeans=function(e){var t=this;e.forEach(function(e){if(!e){throw Error("Can't wire to bean since it is null")}return t.methodWireBean(e)})};e.prototype.autoWireBean=function(n){var r=this;var o=n;var e=function(){var e=o.constructor;if(e.__agBeanMetaData&&e.__agBeanMetaData.agClassAttributes){var t=e.__agBeanMetaData.agClassAttributes;if(!t){return{value:void 0}}var i=a.getBeanName(e);t.forEach(function(e){var t=r.lookupBeanInstance(i,e.beanName,e.optional);n[e.attributeName]=t})}o=Object.getPrototypeOf(o)?Object.getPrototypeOf(o):null};var a=this;while(o!=null){var t=e();if(typeof t==="object")return t.value}};e.prototype.getBeanName=function(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName){return e.__agBeanMetaData.beanName}var t=e.toString();var i=t.substring(9,t.indexOf("("));return i};e.prototype.methodWireBean=function(r){var o=this;var e;if(r.constructor.__agBeanMetaData&&r.constructor.__agBeanMetaData.autowireMethods){e=r.constructor.__agBeanMetaData.autowireMethods}a.Utils.iterateObject(e,function(e,t){if(e==="agConstructor"){return}var i=o.getBeanName(r.constructor);var n=o.getBeansForParameters(t,i);r[e].apply(r,n)})};e.prototype.getBeansForParameters=function(e,n){var r=this;var o=[];if(e){a.Utils.iterateObject(e,function(e,t){var i=r.lookupBeanInstance(n,t);o[Number(e)]=i})}return o};e.prototype.lookupBeanInstance=function(e,t,i){if(i===void 0){i=false}if(t==="context"){return this}else if(this.contextParams.seed&&this.contextParams.seed.hasOwnProperty(t)){return this.contextParams.seed[t]}else{var n=this.beans[t];if(n){return n.beanInstance}if(!i){console.error("ag-Grid: unable to find bean reference "+t+" while initialising "+e)}return null}};e.prototype.postConstruct=function(e){e.forEach(function(t){if(t.constructor.__agBeanMetaData&&t.constructor.__agBeanMetaData.postConstructMethods){t.constructor.__agBeanMetaData&&t.constructor.__agBeanMetaData.postConstructMethods.forEach(function(e){return t[e]()})}})};e.prototype.preConstruct=function(e){e.forEach(function(t){if(t.constructor.__agBeanMetaData&&t.constructor.__agBeanMetaData.preConstructMethods){t.constructor.__agBeanMetaData.preConstructMethods.forEach(function(e){return t[e]()})}})};e.prototype.getBean=function(e){return this.lookupBeanInstance("getBean",e,true)};e.prototype.destroy=function(){if(this.destroyed){return}this.logger.log(">> Shutting down ag-Application Context");a.Utils.iterateObject(this.beans,function(e,t){var i=t.beanInstance;if(i.constructor.__agBeanMetaData&&i.constructor.__agBeanMetaData.preDestroyMethods){i.constructor.__agBeanMetaData.preDestroyMethods.forEach(function(e){return i[e]()})}});this.destroyed=true;this.logger.log(">> ag-Application Context shut down - component is dead")};return e}();t.Context=n;function s(e,t){var i=[null].concat(t);var n=e.bind.apply(e,i);return new n}function r(e,t,i){var n=h(e.constructor);if(!n.postConstructMethods){n.preConstructMethods=[]}n.preConstructMethods.push(t)}t.PreConstruct=r;function o(e,t,i){var n=h(e.constructor);if(!n.postConstructMethods){n.postConstructMethods=[]}n.postConstructMethods.push(t)}t.PostConstruct=o;function l(e,t,i){var n=h(e.constructor);if(!n.preDestroyMethods){n.preDestroyMethods=[]}n.preDestroyMethods.push(t)}t.PreDestroy=l;function u(i){return function(e){var t=h(e);t.beanName=i}}t.Bean=u;function c(n){return function(e,t,i){f(e,n,false,e,t,null)}}t.Autowired=c;function d(n){return function(e,t,i){f(e,n,true,e,t,null)}}t.Optional=d;function f(e,t,i,n,r,o){if(t===null){console.error("ag-Grid: Autowired name should not be null");return}if(typeof o==="number"){console.error("ag-Grid: Autowired should be on an attribute");return}var a=h(e.constructor);if(!a.agClassAttributes){a.agClassAttributes=[]}a.agClassAttributes.push({attributeName:r,beanName:t,optional:i})}function p(a){return function(e,t,i){var n=typeof e=="function"?e:e.constructor;var r;if(typeof i==="number"){var o=void 0;if(t){r=h(n);o=t}else{r=h(n);o="agConstructor"}if(!r.autowireMethods){r.autowireMethods={}}if(!r.autowireMethods[o]){r.autowireMethods[o]={}}r.autowireMethods[o][i]=a}}}t.Qualifier=p;function h(e){if(!e.hasOwnProperty("__agBeanMetaData")){e.__agBeanMetaData={}}return e.__agBeanMetaData}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:true});var r=t(9);var n=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;var a=/([^\s,]+)/g;var i="__ag_Grid_Stop_Propagation";var s=function(){function e(){this.timestamp=(new Date).getTime()}e.prototype.print=function(e){var t=(new Date).getTime()-this.timestamp;console.log(e+" = "+t);this.timestamp=(new Date).getTime()};return e}();o.Timer=s;var l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var u=/[&<>"']/g;var c=function(){function f(){}f.doOnce=function(e,t){if(this.doOnceFlags[t]){return}e();this.doOnceFlags[t]=true};f.areEventsNear=function(e,t,i){if(i===0){return false}var n=Math.abs(e.clientX-t.clientX);var r=Math.abs(e.clientY-t.clientY);return Math.max(n,r)<=i};f.shallowCompare=function(e,t){if(this.missing(e)&&this.missing(t)){return true}if(this.missing(e)||this.missing(t)){return false}if(e.length!==t.length){return false}for(var i=0;i<e.length;i++){if(e[i]!==t[i]){return false}}return true};f.getNameOfClass=function(e){var t=/function (.{1,})\(/;var i=e.toString();var n=t.exec(i);return n&&n.length>1?n[1]:""};f.values=function(e){var i=[];this.iterateObject(e,function(e,t){i.push(t)});return i};f.getValueUsingField=function(e,t,i){if(!t||!e){return}if(!i){return e[t]}else{var n=t.split(".");var r=e;for(var o=0;o<n.length;o++){r=r[n[o]];if(this.missing(r)){return null}}return r}};f.getScrollLeft=function(e,t){var i=e.scrollLeft;if(t){i=Math.abs(i);if(this.isBrowserSafari()||this.isBrowserChrome()){i=e.scrollWidth-e.clientWidth-i}}return i};f.cleanNumber=function(e){if(typeof e==="string"){e=parseInt(e)}if(typeof e==="number"){e=Math.floor(e)}else{e=null}return e};f.setScrollLeft=function(e,t,i){if(i){if(this.isBrowserSafari()||this.isBrowserChrome()){t=e.scrollWidth-e.clientWidth-t}if(this.isBrowserFirefox()){t*=-1}}e.scrollLeft=t};f.iterateNamedNodeMap=function(e,t){if(!e){return}for(var i=0;i<e.length;i++){var n=e[i];t(n.name,n.value)}};f.iterateObject=function(e,i){if(this.missing(e)){return}if(Array.isArray(e)){e.forEach(function(e,t){i(t+"",e)})}else{var t=Object.keys(e);for(var n=0;n<t.length;n++){var r=t[n];var o=e[r];i(r,o)}}};f.cloneObject=function(e){var t={};var i=Object.keys(e);for(var n=0;n<i.length;n++){var r=i[n];var o=e[r];t[r]=o}return t};f.map=function(e,t){var i=[];for(var n=0;n<e.length;n++){var r=e[n];var o=t(r);i.push(o)}return i};f.mapObject=function(e,i){var n=[];f.iterateObject(e,function(e,t){n.push(i(t))});return n};f.forEach=function(e,t){if(!e){return}for(var i=0;i<e.length;i++){var n=e[i];t(n,i)}};f.filter=function(e,t){var i=[];e.forEach(function(e){if(t(e)){i.push(e)}});return i};f.getAllKeysInObjects=function(e){var t={};e.forEach(function(e){if(e){Object.keys(e).forEach(function(e){return t[e]=null})}});return Object.keys(t)};f.mergeDeep=function(n,e){if(this.exists(e)){this.iterateObject(e,function(e,t){var i=n[e];if(i===t){return}if(typeof i==="object"&&typeof t==="object"){f.mergeDeep(i,t)}else{n[e]=t}})}};f.assign=function(i){var t=this;var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}e.forEach(function(e){if(t.exists(e)){t.iterateObject(e,function(e,t){i[e]=t})}});return i};f.parseYyyyMmDdToDate=function(e,t){try{if(!e)return null;if(e.indexOf(t)===-1)return null;var i=e.split(t);if(i.length!=3)return null;return new Date(Number(i[0]),Number(i[1])-1,Number(i[2]))}catch(e){return null}};f.serializeDateToYyyyMmDd=function(e,t){if(!e)return null;return e.getFullYear()+t+f.pad(e.getMonth()+1,2)+t+f.pad(e.getDate(),2)};f.pad=function(e,t){var i=e+"";while(i.length<t)i="0"+i;return i};f.pushAll=function(t,e){if(this.missing(e)||this.missing(t)){return}e.forEach(function(e){return t.push(e)})};f.createArrayOfNumbers=function(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i};f.getFunctionParameters=function(e){var t=e.toString().replace(n,"");var i=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(a);if(i===null){return[]}else{return i}};f.find=function(e,t,i){if(e===null||e===undefined){return null}if(!Array.isArray(e)){var n=this.values(e);return this.find(n,t,i)}var r=e;var o;for(var a=0;a<r.length;a++){var s=r[a];if(typeof t==="string"){if(s[t]===i){o=s;break}}else{var l=t;if(l(s)){o=s;break}}}return o};f.toStrings=function(e){return this.map(e,function(e){if(e===undefined||e===null||!e.toString){return null}else{return e.toString()}})};f.iterateArray=function(e,t){for(var i=0;i<e.length;i++){var n=e[i];t(n,i)}};f.isNode=function(e){return typeof Node==="function"?e instanceof Node:e&&typeof e==="object"&&typeof e.nodeType==="number"&&typeof e.nodeName==="string"};f.isElement=function(e){return typeof HTMLElement==="function"?e instanceof HTMLElement:e&&typeof e==="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName==="string"};f.isNodeOrElement=function(e){return this.isNode(e)||this.isElement(e)};f.copyNodeList=function(e){var t=e?e.length:0;var i=[];for(var n=0;n<t;n++){i.push(e[n])}return i};f.isEventFromPrintableCharacter=function(e){var t=String.fromCharCode(e.charCode);if(this.isKeyPressed(e,r.Constants.KEY_NEW_LINE)){return false}if(o._.exists(e.key)){var i=e.key.length===1;var n=f.isNumpadDelWithNumlockOnForEdgeOrIe(e);return i||n}else{return f.PRINTABLE_CHARACTERS.indexOf(t)>=0}};f.addChangeListener=function(e,t){e.addEventListener("changed",t);e.addEventListener("paste",t);e.addEventListener("input",t);e.addEventListener("keydown",t);e.addEventListener("keyup",t)};f.makeNull=function(e){var t=e;if(e===null||e===undefined||t===""){return null}else{return e}};f.missing=function(e){return!this.exists(e)};f.missingOrEmpty=function(e){return this.missing(e)||e.length===0};f.missingOrEmptyObject=function(e){return this.missing(e)||Object.keys(e).length===0};f.exists=function(e){if(e===null||e===undefined||e===""){return false}else{return true}};f.firstExistingValue=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}for(var i=0;i<e.length;i++){var n=e[i];if(o._.exists(n))return n}return null};f.anyExists=function(e){if(e){for(var t=0;t<e.length;t++){if(this.exists(e[t])){return true}}}return false};f.existsAndNotEmpty=function(e){return this.exists(e)&&e.length>0};f.removeAllChildren=function(e){if(e){while(e.hasChildNodes()){e.removeChild(e.lastChild)}}};f.removeElement=function(e,t){this.removeFromParent(e.querySelector(t))};f.removeFromParent=function(e){if(e&&e.parentNode){e.parentNode.removeChild(e)}};f.isVisible=function(e){return e.offsetParent!==null};f.loadTemplate=function(e){var t=document.createElement("div");t.innerHTML=e;return t.firstChild};f.appendHtml=function(e,t){if(e.lastChild){e.insertAdjacentHTML("afterbegin",t)}else{e.innerHTML=t}};f.addOrRemoveCssClass=function(e,t,i){if(i){this.addCssClass(e,t)}else{this.removeCssClass(e,t)}};f.callIfPresent=function(e){if(e){e()}};f.addCssClass=function(t,e){var i=this;if(!e||e.length===0){return}if(e.indexOf(" ")>=0){e.split(" ").forEach(function(e){return i.addCssClass(t,e)});return}if(t.classList){if(!t.classList.contains(e)){t.classList.add(e)}}else{if(t.className&&t.className.length>0){var n=t.className.split(" ");if(n.indexOf(e)<0){n.push(e);t.className=n.join(" ")}}else{t.className=e}}};f.containsClass=function(e,t){if(e.classList){return e.classList.contains(t)}else if(e.className){var i=e.className===t;var n=e.className.indexOf(" "+t+" ")>=0;var r=e.className.indexOf(t+" ")===0;var o=e.className.lastIndexOf(" "+t)===e.className.length-t.length-1;return i||n||r||o}else{return false}};f.getElementAttribute=function(e,t){if(e.attributes){if(e.attributes[t]){var i=e.attributes[t];return i.value}else{return null}}else{return null}};f.offsetHeight=function(e){return e&&e.clientHeight?e.clientHeight:0};f.offsetWidth=function(e){return e&&e.clientWidth?e.clientWidth:0};f.sortNumberArray=function(e){e.sort(function(e,t){return e-t})};f.removeCssClass=function(e,t){if(e.classList){if(e.classList.contains(t)){e.classList.remove(t)}}else{if(e.className&&e.className.length>0){var i=e.className.split(" ");if(i.indexOf(t)>=0){while(i.indexOf(t)>=0){i.splice(i.indexOf(t),1)}e.className=i.join(" ")}}}};f.removeRepeatsFromArray=function(e,t){if(!e){return}for(var i=e.length-2;i>=0;i--){var n=e[i]===t;var r=e[i+1]===t;if(n&&r){e.splice(i+1,1)}}};f.removeFromArray=function(e,t){if(e.indexOf(t)>=0){e.splice(e.indexOf(t),1)}};f.removeAllFromArray=function(t,e){e.forEach(function(e){if(t.indexOf(e)>=0){t.splice(t.indexOf(e),1)}})};f.insertIntoArray=function(e,t,i){e.splice(i,0,t)};f.insertArrayIntoArray=function(e,t,i){if(this.missing(e)||this.missing(t)){return}for(var n=t.length-1;n>=0;n--){var r=t[n];this.insertIntoArray(e,r,i)}};f.moveInArray=function(t,e,i){var n=this;e.forEach(function(e){n.removeFromArray(t,e)});e.slice().reverse().forEach(function(e){n.insertIntoArray(t,e,i)})};f.defaultComparator=function(t,i,e){if(e===void 0){e=false}var n=t===null||t===undefined;var r=i===null||i===undefined;if(t&&t.toNumber){t=t.toNumber()}if(i&&i.toNumber){i=i.toNumber()}if(n&&r){return 0}if(n){return-1}if(r){return 1}if(typeof t==="string"){if(!e){return o(t,i)}else{try{return t.localeCompare(i)}catch(e){return o(t,i)}}}if(t<i){return-1}else if(t>i){return 1}else{return 0}function o(e,t){return e>t?1:e<t?-1:0}};f.compareArrays=function(e,t){if(this.missing(e)&&this.missing(t)){return true}if(this.missing(e)||this.missing(t)){return false}if(e.length!==t.length){return false}for(var i=0;i<e.length;i++){if(e[i]!==t[i]){return false}}return true};f.ensureDomOrder=function(e,t,i){if(i&&i.nextSibling===t){return}if(i){if(i.nextSibling){e.insertBefore(t,i.nextSibling)}else{e.appendChild(t)}}else{if(e.firstChild){e.insertBefore(t,e.firstChild)}}};f.insertWithDomOrder=function(e,t,i){if(i){if(i.nextSibling){e.insertBefore(t,i.nextSibling)}else{e.appendChild(t)}}else{if(e.firstChild){e.insertBefore(t,e.firstChild)}else{e.appendChild(t)}}};f.insertTemplateWithDomOrder=function(e,t,i){var n;if(i){i.insertAdjacentHTML("afterend",t);n=i.nextSibling}else{if(e.firstChild){e.insertAdjacentHTML("afterbegin",t)}else{e.innerHTML=t}n=e.firstChild}return n};f.every=function(e,t){if(!e||e.length===0){return true}for(var i=0;i<e.length;i++){if(!t(e[i])){return false}}return true};f.toStringOrNull=function(e){if(this.exists(e)&&e.toString){return e.toString()}else{return null}};f.formatWidth=function(e){if(typeof e==="number"){return e+"px"}else{return e}};f.formatNumberTwoDecimalPlacesAndCommas=function(e){if(typeof e!=="number"){return""}return(Math.round(e*100)/100).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")};f.formatNumberCommas=function(e){if(typeof e!=="number"){return""}return e.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")};f.prependDC=function(e,t){if(this.exists(e.firstChild)){e.insertBefore(t,e.firstChild)}else{e.appendChild(t)}};f.createIcon=function(e,t,i){var n=this.createIconNoSpan(e,t,i);if(n.className.indexOf("ag-icon")>-1){return n}else{var r=document.createElement("span");r.appendChild(n);return r}};f.createIconNoSpan=function(e,t,i){var n;if(i&&i.getColDef().icons){n=i.getColDef().icons[e]}if(!n&&t.getIcons()){n=t.getIcons()[e]}if(n){var r=void 0;if(typeof n==="function"){r=n()}else if(typeof n==="string"){r=n}else{throw"icon from grid options needs to be a string or a function"}if(typeof r==="string"){return this.loadTemplate(r)}else if(this.isNodeOrElement(r)){return r}else{throw"iconRenderer should return back a string or a dom object"}}else{var o=document.createElement("span");var a=this.iconNameClassMap[e];if(!a){throw new Error(e+" did not find class")}o.setAttribute("class","ag-icon ag-icon-"+a);return o}};f.addStylesToElement=function(i,n){var r=this;if(!n){return}Object.keys(n).forEach(function(e){var t=r.hyphenToCamelCase(e);i.style[t]=n[e]})};f.isHorizontalScrollShowing=function(e){return e.clientWidth<e.scrollWidth};f.isVerticalScrollShowing=function(e){return e.clientHeight<e.scrollHeight};f.getMaxDivHeight=function(){if(!document.body){return-1}var e=1e6;var t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9;var i=this.loadTemplate("<div/>");document.body.appendChild(i);while(true){var n=e*2;i.style.height=n+"px";if(n>t||i.clientHeight!==n){break}else{e=n}}document.body.removeChild(i);return e};f.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden";e.style.width="100px";e.style.msOverflowStyle="scrollbar";document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%";e.appendChild(i);var n=i.offsetWidth;e.parentNode.removeChild(e);return t-n};f.isKeyPressed=function(e,t){var i=e.which||e.keyCode;return i===t};f.setVisible=function(e,t){this.addOrRemoveCssClass(e,"ag-hidden",!t)};f.setHidden=function(e,t){this.addOrRemoveCssClass(e,"ag-visibility-hidden",t)};f.isBrowserIE=function(){if(this.isIE===undefined){this.isIE=false||!!document.documentMode}return this.isIE};f.isBrowserEdge=function(){if(this.isEdge===undefined){this.isEdge=!this.isBrowserIE()&&!!window.StyleMedia}return this.isEdge};f.isBrowserSafari=function(){if(this.isSafari===undefined){var e=window;this.isSafari=Object.prototype.toString.call(e.HTMLElement).indexOf("Constructor")>0||function(e){return e.toString()==="[object SafariRemoteNotification]"}(!e.safari||e.safari.pushNotification)}return this.isSafari};f.isBrowserChrome=function(){if(this.isChrome===undefined){var e=window;this.isChrome=!!e.chrome&&!!e.chrome.webstore}return this.isChrome};f.isBrowserFirefox=function(){if(this.isFirefox===undefined){var e=window;this.isFirefox=typeof e.InstallTrigger!=="undefined"}return this.isFirefox};f.isUserAgentIPad=function(){if(this.isIPad===undefined){this.isIPad=navigator.userAgent.match(/iPad|iPhone/i)!=null}return this.isIPad};f.getTarget=function(e){var t=e;return t.target||t.srcElement};f.isElementInEventPath=function(e,t){if(!t||!e){return false}var i=o._.getEventPath(t);return i.indexOf(e)>=0};f.createEventPath=function(e){var t=[];var i=o._.getTarget(e);while(i){t.push(i);i=i.parentElement}return t};f.addAgGridEventPath=function(e){e.__agGridEventPath=this.getEventPath(e)};f.getEventPath=function(e){var t=e;if(e.deepPath){return e.deepPath()}else if(t.path){return t.path}else if(t.composedPath){return t.composedPath()}else if(t.__agGridEventPath){return t.__agGridEventPath}else{return this.createEventPath(e)}};f.forEachSnapshotFirst=function(e,t){if(e){var i=e.slice(0);i.forEach(t)}};f.getBodyWidth=function(){if(document.body){return document.body.clientWidth}if(window.innerHeight){return window.innerWidth}if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}return-1};f.getBodyHeight=function(){if(document.body){return document.body.clientHeight}if(window.innerHeight){return window.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}return-1};f.setCheckboxState=function(e,t){if(typeof t==="boolean"){e.checked=t;e.indeterminate=false}else{e.indeterminate=true}};f.traverseNodesWithKey=function(e,i){var n=[];r(e);function r(e){e.forEach(function(e){if(e.group||e.hasChildren()){n.push(e.key);var t=n.join("|");i(e,t);r(e.childrenAfterGroup);n.pop()}})}};f.camelCaseToHyphen=function(e){if(e===null||e===undefined){return null}return e.replace(/([A-Z])/g,function(e){return"-"+e[0].toLowerCase()})};f.hyphenToCamelCase=function(e){if(e===null||e===undefined){return null}return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};f.cssStyleObjectToMarkup=function(e){var n=this;if(!e){return""}var r=[];this.iterateObject(e,function(e,t){var i=n.camelCaseToHyphen(e);r.push(i+": "+t+";")});return r.join(" ")};f.isNumeric=function(e){if(e==="")return false;return!isNaN(parseFloat(e))&&isFinite(e)};f.escape=function(e){if(e===null||e===undefined||!e.replace){return e}return e.replace(u,function(e){return l[e]})};f.normalizeWheel=function(e){var t=10;var i=40;var n=800;var r=0;var o=0;var a=0;var s=0;if("detail"in e){o=e.detail}if("wheelDelta"in e){o=-e.wheelDelta/120}if("wheelDeltaY"in e){o=-e.wheelDeltaY/120}if("wheelDeltaX"in e){r=-e.wheelDeltaX/120}if("axis"in e&&e.axis===e.HORIZONTAL_AXIS){r=o;o=0}a=r*t;s=o*t;if("deltaY"in e){s=e.deltaY}if("deltaX"in e){a=e.deltaX}if((a||s)&&e.deltaMode){if(e.deltaMode==1){a*=i;s*=i}else{a*=n;s*=n}}if(a&&!r){r=a<1?-1:1}if(s&&!o){o=s<1?-1:1}return{spinX:r,spinY:o,pixelX:a,pixelY:s}};f.debounce=function(n,r,o){if(o===void 0){o=false}var a;return function(){var e=this,t=arguments;var i=o&&!a;clearTimeout(a);a=setTimeout(function(){a=null;if(!o){n.apply(e,t)}},r);if(i)n.apply(e,t)}};f.stopPropagationForAgGrid=function(e){e[i]=true};f.isStopPropagationForAgGrid=function(e){return e[i]===true};f.executeInAWhile=function(e){this.executeAfter(e,400)};f.executeNextVMTurn=function(e){this.executeAfter(e,0)};f.executeAfter=function(e,t){if(e.length>0){setTimeout(function(){e.forEach(function(e){return e()})},t)}};f.referenceCompare=function(e,t){if(e==null&&t==null)return true;if(e==null&&t)return false;if(e&&t==null)return false;return e===t};f.get=function(e,t,i){if(e==null)return i;if(t.indexOf(".")>-1){var n=t.split(".");var r=n[0];var o=e[r];if(o!=null){return f.get(o,n.slice(1,n.length).join("."),i)}else{return i}}else{var o=e[t];return o!=null?o:i}};f.addSafePassiveEventListener=function(e,t,i){e.addEventListener(t,i,f.passiveEvents.indexOf(t)>-1?{passive:true}:undefined)};f.camelCaseToHumanText=function(e){if(e==null)return null;var t=/([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;var i=e.replace(t,"$1$4 $2$3$5").replace("."," ").split(" ");return i.map(function(e){return e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")}).join(" ")};f.message=function(e){var t=document.createElement("div");t.innerHTML=e;var i=document.querySelector("#__ag__message");if(!i){var n='<div id="__ag__message" style="display: inline-block; position: absolute; top: 0px; left: 0px; color: white; background-color: black; z-index: 20; padding: 2px; border: 1px solid darkred; height: 200px; overflow-y: auto;"></div>';i=this.loadTemplate(n);if(document.body){document.body.appendChild(i)}}i.appendChild(t)};f.sortRowNodesByOrder=function(e,l){if(!e){return}e.sort(function(e,t){var i=l[e.id];var n=l[t.id];var r=i!==undefined;var o=n!==undefined;var a=r&&o;var s=!r&&!o;if(a){return i-n}else if(s){return e.id>t.id?1:-1}else if(r){return 1}else{return-1}})};f.fuzzyCheckStrings=function(e,i,t){var n=this;var r={};var o=e.filter(function(t){return!i.some(function(e){return e===t})});if(o.length>0){o.forEach(function(e){return r[e]=n.fuzzySuggestions(e,i,t)})}return r};f.fuzzySuggestions=function(r,e,t){var i=t.slice(0);i.sort(function(e,t){var i=o._.string_similarity(e.toLowerCase(),r.toLowerCase());var n=o._.string_similarity(t.toLowerCase(),r.toLowerCase());return i>n?-1:i===n?0:1});return i};f.get_bigrams=function(e){var t,i,n,r,o;r=e.toLowerCase();o=new Array(r.length-1);for(t=i=0,n=o.length;i<=n;t=i+=1){o[t]=r.slice(t,t+2)}return o};f.isNumpadDelWithNumlockOnForEdgeOrIe=function(e){if(f.isBrowserEdge()||f.isBrowserIE()){return e.key===f.NUMPAD_DEL_NUMLOCK_ON_KEY&&e.charCode===f.NUMPAD_DEL_NUMLOCK_ON_CHARCODE}return false};f.PRINTABLE_CHARACTERS="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!\"£$%^&*()_+-=[];'#,./\\|<>?:@~{}";f.NUMPAD_DEL_NUMLOCK_ON_KEY="Del";f.NUMPAD_DEL_NUMLOCK_ON_CHARCODE=46;f.doOnceFlags={};f.iconNameClassMap={columnMovePin:"pin",columnMoveAdd:"plus",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"expanded",groupExpanded:"contracted",checkboxChecked:"checkbox-checked",checkboxUnchecked:"checkbox-unchecked",checkboxIndeterminate:"checkbox-indeterminate",checkboxCheckedReadOnly:"checkbox-checked-readonly",checkboxUncheckedReadOnly:"checkbox-unchecked-readonly",checkboxIndeterminateReadOnly:"checkbox-indeterminate-readonly",groupLoading:"loading",menu:"menu",filter:"filter",columns:"columns",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none"};f.passiveEvents=["touchstart","touchend","touchmove","touchcancel"];f.string_similarity=function(e,t){var i,n,r,o,a,s,l,u,c,d;if(e.length>0&&t.length>0){s=f.get_bigrams(e);l=f.get_bigrams(t);u=s.length+l.length;i=0;for(n=0,o=s.length;n<o;n++){c=s[n];for(r=0,a=l.length;r<a;r++){d=l[r];if(c===d){i++}}}if(i>0){return 2*i/u}}return 0};return f}();o.Utils=c;var d=function(){function e(e,t){if(e===void 0){e=0}if(t===void 0){t=1}this.nextValue=e;this.step=t}e.prototype.next=function(){var e=this.nextValue;this.nextValue+=this.step;return e};e.prototype.peek=function(){return this.nextValue};e.prototype.skip=function(e){this.nextValue+=e};return e}();o.NumberSequence=d;o._=c;var f;(function(e){e[e["IN_PROGRESS"]=0]="IN_PROGRESS";e[e["RESOLVED"]=1]="RESOLVED"})(f=o.PromiseStatus||(o.PromiseStatus={}));var p=function(){function n(e){this.status=f.IN_PROGRESS;this.resolution=null;this.listOfWaiters=[];e(this.onDone.bind(this),this.onReject.bind(this))}n.all=function(e){return new n(function(i){var n=[];var r=e.length;e.forEach(function(e,t){e.then(function(e){r--;n[t]=e;if(r==0){i(n)}});n.push(null)})})};n.resolve=function(t){return new n(function(e){return e(t)})};n.external=function(){var t;var e=new n(function(e){t=e});return{promise:e,resolve:function(e){t(e)}}};n.prototype.then=function(e){if(this.status===f.IN_PROGRESS){this.listOfWaiters.push(e)}else{e(this.resolution)}};n.prototype.firstOneOnly=function(e){if(this.status===f.IN_PROGRESS){if(this.listOfWaiters.length===0){this.listOfWaiters.push(e)}}else{e(this.resolution)}};n.prototype.map=function(i){var e=this;return new n(function(t){e.then(function(e){t(i(e))})})};n.prototype.resolveNow=function(e,t){if(this.status==f.IN_PROGRESS)return e;return t(this.resolution)};n.prototype.onDone=function(t){this.status=f.RESOLVED;this.resolution=t;this.listOfWaiters.forEach(function(e){return e(t)})};n.prototype.onReject=function(e){console.warn("TBI")};return n}();o.Promise=p},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(3);var s=i(9);var l=i(62);var u=i(6);var c=i(0);var d=i(7);var f=i(4);var p=i(1);var h=i(41);var g=i(90);var v=i(106);var m=i(25);var y=i(79);var b=25;var _=300;var w=5;var C=5;var A=["ag-fresh","ag-bootstrap","ag-blue","ag-dark","ag-material"];function E(e){return e===true||e==="true"}function x(e,t){if(e>=0){return e}else{return t}}function T(e,t){if(e>0){return e}else{return t}}var S=function(){function e(){this.propertyEventService=new a.EventService;this.domDataKey="__AG_"+Math.random().toString()}i=e;e.prototype.agWire=function(e,t){this.gridOptions.api=e;this.gridOptions.columnApi=t;this.checkForDeprecated()};e.prototype.destroy=function(){this.gridOptions.api=null;this.gridOptions.columnApi=null};e.prototype.init=function(){if(!(this.gridOptions.suppressPropertyNamesCheck===true)){this.checkGridOptionsProperties();this.checkColumnDefProperties()}var e=this.useAsyncEvents();this.eventService.addGlobalListener(this.globalEventHandler.bind(this),e);if(this.isGroupSelectsChildren()&&this.isSuppressParentsInRowNodes()){console.warn("ag-Grid: groupSelectsChildren does not work wth suppressParentsInRowNodes, this selection method needs the part in rowNode to work")}if(this.isGroupSelectsChildren()){if(!this.isRowSelectionMulti()){console.warn("ag-Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense")}if(this.isRowModelServerSide()){console.warn("ag-Grid: group selects children is NOT support for Server Side Row Model. "+"This is because the rows are lazy loaded, so selecting a group is not possible as"+"the grid has no way of knowing what the children are.")}}if(this.isGroupRemoveSingleChildren()&&this.isGroupHideOpenParents()){console.warn("ag-Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don't ask us how to us these together on our support forum either you will get the same answer!")}};e.prototype.checkColumnDefProperties=function(){var n=this;if(this.gridOptions.columnDefs==null)return;this.gridOptions.columnDefs.forEach(function(e){var t=Object.getOwnPropertyNames(e);var i=v.ColDefUtil.ALL_PROPERTIES;n.checkProperties(t,i,i,"colDef","https://www.ag-grid.com/javascript-grid-column-properties/")})};e.prototype.checkGridOptionsProperties=function(){var e=Object.getOwnPropertyNames(this.gridOptions);var t=g.PropertyKeys.ALL_PROPERTIES;Object.keys(m.Events).forEach(function(e){return t.push(l.ComponentUtil.getCallbackForEvent(m.Events[e]))});var i=t.concat("api","columnApi");this.checkProperties(e,i,t,"gridOptions","https://www.ag-grid.com/javascript-grid-properties/")};e.prototype.checkProperties=function(e,t,i,n,r){var o=p.Utils.fuzzyCheckStrings(e,t,i);var a=Object.keys(o);a.forEach(function(e){var t=o[e];console.warn("ag-grid: invalid "+n+" property '"+e+"' did you mean any of these: "+t.slice(0,8).join(","))});if(a.length>0){console.warn("ag-grid: to see all the valid "+n+" properties please check: "+r)}};e.prototype.getDomData=function(e,t){var i=e[this.domDataKey];if(i){return i[t]}else{return undefined}};e.prototype.setDomData=function(e,t,i){var n=e[this.domDataKey];if(p.Utils.missing(n)){n={};e[this.domDataKey]=n}n[t]=i};e.prototype.isEnterprise=function(){return this.enterprise};e.prototype.isRowSelection=function(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"};e.prototype.isRowDeselection=function(){return E(this.gridOptions.rowDeselection)};e.prototype.isRowSelectionMulti=function(){return this.gridOptions.rowSelection==="multiple"};e.prototype.isRowMultiSelectWithClick=function(){return E(this.gridOptions.rowMultiSelectWithClick)};e.prototype.getContext=function(){return this.gridOptions.context};e.prototype.isPivotMode=function(){return E(this.gridOptions.pivotMode)};e.prototype.isPivotTotals=function(){return E(this.gridOptions.pivotTotals)};e.prototype.getPivotColumnGroupTotals=function(){return this.gridOptions.pivotColumnGroupTotals};e.prototype.getPivotRowTotals=function(){return this.gridOptions.pivotRowTotals};e.prototype.isRowModelInfinite=function(){return this.gridOptions.rowModelType===s.Constants.ROW_MODEL_TYPE_INFINITE};e.prototype.isRowModelViewport=function(){return this.gridOptions.rowModelType===s.Constants.ROW_MODEL_TYPE_VIEWPORT};e.prototype.isRowModelServerSide=function(){return this.gridOptions.rowModelType===s.Constants.ROW_MODEL_TYPE_SERVER_SIDE};e.prototype.isRowModelDefault=function(){return p.Utils.missing(this.gridOptions.rowModelType)||this.gridOptions.rowModelType===s.Constants.ROW_MODEL_TYPE_CLIENT_SIDE||this.gridOptions.rowModelType===s.Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL};e.prototype.isFullRowEdit=function(){return this.gridOptions.editType==="fullRow"};e.prototype.isSuppressFocusAfterRefresh=function(){return E(this.gridOptions.suppressFocusAfterRefresh)};e.prototype.isShowToolPanel=function(){return E(this.gridOptions.showToolPanel)};e.prototype.isToolPanelSuppressValues=function(){return E(this.gridOptions.toolPanelSuppressValues)};e.prototype.isToolPanelSuppressPivots=function(){return E(this.gridOptions.toolPanelSuppressPivots)||this.isTreeData()};e.prototype.isToolPanelSuppressRowGroups=function(){return E(this.gridOptions.toolPanelSuppressRowGroups)||this.isTreeData()};e.prototype.isToolPanelSuppressSideButtons=function(){return E(this.gridOptions.toolPanelSuppressSideButtons)};e.prototype.isToolPanelSuppressPivotMode=function(){return E(this.gridOptions.toolPanelSuppressPivotMode)||this.isTreeData()};e.prototype.isContractColumnSelection=function(){return E(this.gridOptions.contractColumnSelection)};e.prototype.isToolPanelSuppressColumnFilter=function(){return E(this.gridOptions.toolPanelSuppressColumnFilter)};e.prototype.isToolPanelSuppressColumnSelectAll=function(){return E(this.gridOptions.toolPanelSuppressColumnSelectAll)};e.prototype.isToolPanelSuppressColumnExpandAll=function(){return E(this.gridOptions.toolPanelSuppressColumnExpandAll)};e.prototype.isSuppressTouch=function(){return E(this.gridOptions.suppressTouch)};e.prototype.isSuppressRowTransform=function(){return E(this.gridOptions.suppressRowTransform)};e.prototype.useAsyncEvents=function(){return!E(this.gridOptions.suppressAsyncEvents)};e.prototype.isEnableCellChangeFlash=function(){return E(this.gridOptions.enableCellChangeFlash)};e.prototype.isGroupSelectsChildren=function(){var e=E(this.gridOptions.groupSelectsChildren);if(e&&this.isTreeData()){console.warn("ag-Grid: groupSelectsChildren does not work with tree data");return false}else{return e}};e.prototype.isSuppressRowHoverHighlight=function(){return E(this.gridOptions.suppressRowHoverHighlight)};e.prototype.isGroupSelectsFiltered=function(){return E(this.gridOptions.groupSelectsFiltered)};e.prototype.isGroupHideOpenParents=function(){return E(this.gridOptions.groupHideOpenParents)};e.prototype.isGroupMultiAutoColumn=function(){return E(this.gridOptions.groupMultiAutoColumn)||E(this.gridOptions.groupHideOpenParents)};e.prototype.isGroupRemoveSingleChildren=function(){return E(this.gridOptions.groupRemoveSingleChildren)};e.prototype.isGroupRemoveLowestSingleChildren=function(){return E(this.gridOptions.groupRemoveLowestSingleChildren)};e.prototype.isGroupIncludeFooter=function(){return E(this.gridOptions.groupIncludeFooter)};e.prototype.isGroupIncludeTotalFooter=function(){return E(this.gridOptions.groupIncludeTotalFooter)};e.prototype.isGroupSuppressBlankHeader=function(){return E(this.gridOptions.groupSuppressBlankHeader)};e.prototype.isSuppressRowClickSelection=function(){return E(this.gridOptions.suppressRowClickSelection)};e.prototype.isSuppressCellSelection=function(){return E(this.gridOptions.suppressCellSelection)};e.prototype.isSuppressMultiSort=function(){return E(this.gridOptions.suppressMultiSort)};e.prototype.isMultiSortKeyCtrl=function(){return this.gridOptions.multiSortKey==="ctrl"};e.prototype.isGroupSuppressAutoColumn=function(){return E(this.gridOptions.groupSuppressAutoColumn)};e.prototype.isSuppressDragLeaveHidesColumns=function(){return E(this.gridOptions.suppressDragLeaveHidesColumns)};e.prototype.isSuppressScrollOnNewData=function(){return E(this.gridOptions.suppressScrollOnNewData)};e.prototype.isRowDragManaged=function(){return E(this.gridOptions.rowDragManaged)};e.prototype.isSuppressRowDrag=function(){return E(this.gridOptions.suppressRowDrag)};e.prototype.isGridAutoHeight=function(){return E(this.gridOptions.gridAutoHeight)};e.prototype.isSuppressHorizontalScroll=function(){return E(this.gridOptions.suppressHorizontalScroll)};e.prototype.isSuppressLoadingOverlay=function(){return E(this.gridOptions.suppressLoadingOverlay)};e.prototype.isSuppressNoRowsOverlay=function(){return E(this.gridOptions.suppressNoRowsOverlay)};e.prototype.isSuppressFieldDotNotation=function(){return E(this.gridOptions.suppressFieldDotNotation)};e.prototype.getPinnedTopRowData=function(){return this.gridOptions.pinnedTopRowData};e.prototype.getPinnedBottomRowData=function(){return this.gridOptions.pinnedBottomRowData};e.prototype.isFunctionsPassive=function(){return E(this.gridOptions.functionsPassive)};e.prototype.isSuppressTabbing=function(){return E(this.gridOptions.suppressTabbing)};e.prototype.isSuppressChangeDetection=function(){return E(this.gridOptions.suppressChangeDetection)};e.prototype.isSuppressAnimationFrame=function(){return E(this.gridOptions.suppressAnimationFrame)};e.prototype.getQuickFilterText=function(){return this.gridOptions.quickFilterText};e.prototype.isCacheQuickFilter=function(){return E(this.gridOptions.cacheQuickFilter)};e.prototype.isUnSortIcon=function(){return E(this.gridOptions.unSortIcon)};e.prototype.isSuppressMenuHide=function(){return E(this.gridOptions.suppressMenuHide)};e.prototype.isEnterMovesDownAfterEdit=function(){return E(this.gridOptions.enterMovesDownAfterEdit)};e.prototype.isEnterMovesDown=function(){return E(this.gridOptions.enterMovesDown)};e.prototype.getRowStyle=function(){return this.gridOptions.rowStyle};e.prototype.getRowClass=function(){return this.gridOptions.rowClass};e.prototype.getRowStyleFunc=function(){return this.gridOptions.getRowStyle};e.prototype.getRowClassFunc=function(){return this.gridOptions.getRowClass};e.prototype.rowClassRules=function(){return this.gridOptions.rowClassRules};e.prototype.getPopupParent=function(){return this.gridOptions.popupParent};e.prototype.getPostProcessPopupFunc=function(){return this.gridOptions.postProcessPopup};e.prototype.getDoesDataFlowerFunc=function(){return this.gridOptions.doesDataFlower};e.prototype.getPaginationNumberFormatterFunc=function(){return this.gridOptions.paginationNumberFormatter};e.prototype.getChildCountFunc=function(){return this.gridOptions.getChildCount};e.prototype.getDefaultGroupSortComparator=function(){return this.gridOptions.defaultGroupSortComparator};e.prototype.getIsFullWidthCellFunc=function(){return this.gridOptions.isFullWidthCell};e.prototype.getFullWidthCellRendererParams=function(){return this.gridOptions.fullWidthCellRendererParams};e.prototype.isEmbedFullWidthRows=function(){return E(this.gridOptions.embedFullWidthRows)};e.prototype.getBusinessKeyForNodeFunc=function(){return this.gridOptions.getBusinessKeyForNode};e.prototype.getApi=function(){return this.gridOptions.api};e.prototype.getColumnApi=function(){return this.gridOptions.columnApi};e.prototype.isDeltaRowDataMode=function(){return E(this.gridOptions.deltaRowDataMode)};e.prototype.isEnsureDomOrder=function(){return E(this.gridOptions.ensureDomOrder)};e.prototype.isEnableColResize=function(){return E(this.gridOptions.enableColResize)};e.prototype.isSingleClickEdit=function(){return E(this.gridOptions.singleClickEdit)};e.prototype.isSuppressClickEdit=function(){return E(this.gridOptions.suppressClickEdit)};e.prototype.isStopEditingWhenGridLosesFocus=function(){return E(this.gridOptions.stopEditingWhenGridLosesFocus)};e.prototype.getGroupDefaultExpanded=function(){return this.gridOptions.groupDefaultExpanded};e.prototype.getMaxConcurrentDatasourceRequests=function(){return this.gridOptions.maxConcurrentDatasourceRequests};e.prototype.getMaxBlocksInCache=function(){return this.gridOptions.maxBlocksInCache};e.prototype.getCacheOverflowSize=function(){return this.gridOptions.cacheOverflowSize};e.prototype.getPaginationPageSize=function(){return this.gridOptions.paginationPageSize};e.prototype.getCacheBlockSize=function(){return this.gridOptions.cacheBlockSize};e.prototype.getInfiniteInitialRowCount=function(){return this.gridOptions.infiniteInitialRowCount};e.prototype.isPurgeClosedRowNodes=function(){return E(this.gridOptions.purgeClosedRowNodes)};e.prototype.isSuppressPaginationPanel=function(){return E(this.gridOptions.suppressPaginationPanel)};e.prototype.getRowData=function(){return this.gridOptions.rowData};e.prototype.isGroupUseEntireRow=function(){return E(this.gridOptions.groupUseEntireRow)};e.prototype.isEnableRtl=function(){return E(this.gridOptions.enableRtl)};e.prototype.getAutoGroupColumnDef=function(){return this.gridOptions.autoGroupColumnDef};e.prototype.isGroupSuppressRow=function(){return E(this.gridOptions.groupSuppressRow)};e.prototype.getRowGroupPanelShow=function(){return this.gridOptions.rowGroupPanelShow};e.prototype.getPivotPanelShow=function(){return this.gridOptions.pivotPanelShow};e.prototype.isAngularCompileRows=function(){return E(this.gridOptions.angularCompileRows)};e.prototype.isAngularCompileFilters=function(){return E(this.gridOptions.angularCompileFilters)};e.prototype.isAngularCompileHeaders=function(){return E(this.gridOptions.angularCompileHeaders)};e.prototype.isDebug=function(){return E(this.gridOptions.debug)};e.prototype.getColumnDefs=function(){return this.gridOptions.columnDefs};e.prototype.getColumnTypes=function(){return this.gridOptions.columnTypes};e.prototype.getDatasource=function(){return this.gridOptions.datasource};e.prototype.getViewportDatasource=function(){return this.gridOptions.viewportDatasource};e.prototype.getServerSideDatasource=function(){return this.gridOptions.serverSideDatasource};e.prototype.isEnableSorting=function(){return E(this.gridOptions.enableSorting)||E(this.gridOptions.enableServerSideSorting)};e.prototype.isAccentedSort=function(){return E(this.gridOptions.accentedSort)};e.prototype.isEnableCellExpressions=function(){return E(this.gridOptions.enableCellExpressions)};e.prototype.isEnableGroupEdit=function(){return E(this.gridOptions.enableGroupEdit)};e.prototype.isSuppressMiddleClickScrolls=function(){return E(this.gridOptions.suppressMiddleClickScrolls)};e.prototype.isSuppressPreventDefaultOnMouseWheel=function(){return E(this.gridOptions.suppressPreventDefaultOnMouseWheel)};e.prototype.isSuppressColumnVirtualisation=function(){return E(this.gridOptions.suppressColumnVirtualisation)};e.prototype.isSuppressContextMenu=function(){return E(this.gridOptions.suppressContextMenu)};e.prototype.isAllowContextMenuWithControlKey=function(){return E(this.gridOptions.allowContextMenuWithControlKey)};e.prototype.isSuppressCopyRowsToClipboard=function(){return E(this.gridOptions.suppressCopyRowsToClipboard)};e.prototype.isSuppressClipboardPaste=function(){return E(this.gridOptions.suppressClipboardPaste)};e.prototype.isEnableFilter=function(){return E(this.gridOptions.enableFilter)||E(this.gridOptions.enableServerSideFilter)};e.prototype.isPagination=function(){return E(this.gridOptions.pagination)};e.prototype.isSuppressEnterpriseResetOnNewColumns=function(){return E(this.gridOptions.suppressEnterpriseResetOnNewColumns)};e.prototype.getProcessDataFromClipboardFunc=function(){return this.gridOptions.processDataFromClipboard};e.prototype.getBatchUpdateWaitMillis=function(){return p.Utils.exists(this.gridOptions.batchUpdateWaitMillis)?this.gridOptions.batchUpdateWaitMillis:s.Constants.BATCH_WAIT_MILLIS};e.prototype.isEnableServerSideFilter=function(){return this.gridOptions.enableServerSideFilter};e.prototype.isEnableServerSideSorting=function(){return E(this.gridOptions.enableServerSideSorting)};e.prototype.isSuppressMovableColumns=function(){return E(this.gridOptions.suppressMovableColumns)};e.prototype.isAnimateRows=function(){if(this.isEnsureDomOrder()){return false}return E(this.gridOptions.animateRows)};e.prototype.isSuppressColumnMoveAnimation=function(){return E(this.gridOptions.suppressColumnMoveAnimation)};e.prototype.isSuppressAggFuncInHeader=function(){return E(this.gridOptions.suppressAggFuncInHeader)};e.prototype.isSuppressAggAtRootLevel=function(){return E(this.gridOptions.suppressAggAtRootLevel)};e.prototype.isEnableRangeSelection=function(){return E(this.gridOptions.enableRangeSelection)};e.prototype.isSuppressMultiRangeSelection=function(){return E(this.gridOptions.suppressMultiRangeSelection)};e.prototype.isPaginationAutoPageSize=function(){return E(this.gridOptions.paginationAutoPageSize)};e.prototype.isRememberGroupStateWhenNewData=function(){return E(this.gridOptions.rememberGroupStateWhenNewData)};e.prototype.getIcons=function(){return this.gridOptions.icons};e.prototype.getAggFuncs=function(){return this.gridOptions.aggFuncs};e.prototype.getSortingOrder=function(){return this.gridOptions.sortingOrder};e.prototype.getAlignedGrids=function(){return this.gridOptions.alignedGrids};e.prototype.isMasterDetail=function(){var e=this;var t=E(this.gridOptions.masterDetail);p.Utils.doOnce(function(){if(t&&!e.enterprise){console.warn("ag-grid: Master Detail is an Enterprise feature of ag-Grid.")}},"MasterDetailEnterpriseCheck");return t&&this.enterprise};e.prototype.getIsRowMasterFunc=function(){return this.gridOptions.isRowMaster};e.prototype.getIsRowSelectableFunc=function(){return this.gridOptions.isRowSelectable};e.prototype.getGroupRowRendererParams=function(){return this.gridOptions.groupRowRendererParams};e.prototype.getOverlayLoadingTemplate=function(){return this.gridOptions.overlayLoadingTemplate};e.prototype.getOverlayNoRowsTemplate=function(){return this.gridOptions.overlayNoRowsTemplate};e.prototype.isSuppressAutoSize=function(){return E(this.gridOptions.suppressAutoSize)};e.prototype.isSuppressParentsInRowNodes=function(){return E(this.gridOptions.suppressParentsInRowNodes)};e.prototype.isEnableStatusBar=function(){return E(this.gridOptions.enableStatusBar)};e.prototype.isAlwaysShowStatusBar=function(){return E(this.gridOptions.alwaysShowStatusBar)};e.prototype.isFunctionsReadOnly=function(){return E(this.gridOptions.functionsReadOnly)};e.prototype.isFloatingFilter=function(){return this.gridOptions.floatingFilter};e.prototype.isEnableOldSetFilterModel=function(){return E(this.gridOptions.enableOldSetFilterModel)};e.prototype.getDefaultColDef=function(){return this.gridOptions.defaultColDef};e.prototype.getDefaultColGroupDef=function(){return this.gridOptions.defaultColGroupDef};e.prototype.getDefaultExportParams=function(){return this.gridOptions.defaultExportParams};e.prototype.isSuppressCsvExport=function(){return E(this.gridOptions.suppressCsvExport)};e.prototype.isSuppressExcelExport=function(){return E(this.gridOptions.suppressExcelExport)};e.prototype.isSuppressMakeColumnVisibleAfterUnGroup=function(){return E(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup)};e.prototype.getNodeChildDetailsFunc=function(){return this.gridOptions.getNodeChildDetails};e.prototype.getDataPathFunc=function(){return this.gridOptions.getDataPath};e.prototype.getGroupRowAggNodesFunc=function(){return this.gridOptions.groupRowAggNodes};e.prototype.getContextMenuItemsFunc=function(){return this.gridOptions.getContextMenuItems};e.prototype.getMainMenuItemsFunc=function(){return this.gridOptions.getMainMenuItems};e.prototype.getRowNodeIdFunc=function(){return this.gridOptions.getRowNodeId};e.prototype.getNavigateToNextCellFunc=function(){return this.gridOptions.navigateToNextCell};e.prototype.getTabToNextCellFunc=function(){return this.gridOptions.tabToNextCell};e.prototype.isTreeData=function(){return E(this.gridOptions.treeData)};e.prototype.isValueCache=function(){return E(this.gridOptions.valueCache)};e.prototype.isValueCacheNeverExpires=function(){return E(this.gridOptions.valueCacheNeverExpires)};e.prototype.isAggregateOnlyChangedColumns=function(){return E(this.gridOptions.aggregateOnlyChangedColumns)};e.prototype.getProcessSecondaryColDefFunc=function(){return this.gridOptions.processSecondaryColDef};e.prototype.getProcessSecondaryColGroupDefFunc=function(){return this.gridOptions.processSecondaryColGroupDef};e.prototype.getSendToClipboardFunc=function(){return this.gridOptions.sendToClipboard};e.prototype.getProcessRowPostCreateFunc=function(){return this.gridOptions.processRowPostCreate};e.prototype.getProcessCellForClipboardFunc=function(){return this.gridOptions.processCellForClipboard};e.prototype.getProcessHeaderForClipboardFunc=function(){return this.gridOptions.processHeaderForClipboard};e.prototype.getProcessCellFromClipboardFunc=function(){return this.gridOptions.processCellFromClipboard};e.prototype.getViewportRowModelPageSize=function(){return T(this.gridOptions.viewportRowModelPageSize,w)};e.prototype.getViewportRowModelBufferSize=function(){return x(this.gridOptions.viewportRowModelBufferSize,C)};e.prototype.getPostSortFunc=function(){return this.gridOptions.postSort};e.prototype.getClipboardDeliminator=function(){return p.Utils.exists(this.gridOptions.clipboardDeliminator)?this.gridOptions.clipboardDeliminator:"\t"};e.prototype.setProperty=function(e,t){var i=this.gridOptions;var n=i[e];if(n!==t){i[e]=t;var r={type:e,currentValue:t,previousValue:n};this.propertyEventService.dispatchEvent(r)}};e.prototype.addEventListener=function(e,t){i.checkEventDeprecation(e);this.propertyEventService.addEventListener(e,t)};e.checkEventDeprecation=function(e){if(e===m.Events.DEPRECATED_EVENT_GRID_SIZE_CHANGED){console.warn("ag-Grid: Since ag-Grid v18 event "+m.Events.DEPRECATED_EVENT_GRID_SIZE_CHANGED+" no longer exists.")}if(e==="floatingRowDataChanged"){console.warn("ag-Grid: floatingRowDataChanged is now called pinnedRowDataChanged")}};e.prototype.removeEventListener=function(e,t){this.propertyEventService.removeEventListener(e,t)};e.prototype.getAutoSizePadding=function(){return this.gridOptions.autoSizePadding>0?this.gridOptions.autoSizePadding:20};e.prototype.getHeaderHeight=function(){if(typeof this.gridOptions.headerHeight==="number"){return this.gridOptions.headerHeight}else{return this.specialForNewMaterial(25,"headerHeight")}};e.prototype.getFloatingFiltersHeight=function(){if(typeof this.gridOptions.floatingFiltersHeight==="number"){return this.gridOptions.floatingFiltersHeight}else{return this.specialForNewMaterial(25,"headerHeight")}};e.prototype.getGroupHeaderHeight=function(){if(typeof this.gridOptions.groupHeaderHeight==="number"){return this.gridOptions.groupHeaderHeight}else{return this.getHeaderHeight()}};e.prototype.getPivotHeaderHeight=function(){if(typeof this.gridOptions.pivotHeaderHeight==="number"){return this.gridOptions.pivotHeaderHeight}else{return this.getHeaderHeight()}};e.prototype.getPivotGroupHeaderHeight=function(){if(typeof this.gridOptions.pivotGroupHeaderHeight==="number"){return this.gridOptions.pivotGroupHeaderHeight}else{return this.getGroupHeaderHeight()}};e.prototype.isExternalFilterPresent=function(){if(typeof this.gridOptions.isExternalFilterPresent==="function"){return this.gridOptions.isExternalFilterPresent()}else{return false}};e.prototype.doesExternalFilterPass=function(e){if(typeof this.gridOptions.doesExternalFilterPass==="function"){return this.gridOptions.doesExternalFilterPass(e)}else{return false}};e.prototype.getDocument=function(){var e;if(p.Utils.exists(this.gridOptions.getDocument)){e=this.gridOptions.getDocument()}if(p.Utils.exists(e)){return e}else{return document}};e.prototype.getLayoutInterval=function(){if(typeof this.gridOptions.layoutInterval==="number"){return this.gridOptions.layoutInterval}else{return s.Constants.LAYOUT_INTERVAL}};e.prototype.getMinColWidth=function(){if(this.gridOptions.minColWidth>i.MIN_COL_WIDTH){return this.gridOptions.minColWidth}else{return i.MIN_COL_WIDTH}};e.prototype.getMaxColWidth=function(){if(this.gridOptions.maxColWidth>i.MIN_COL_WIDTH){return this.gridOptions.maxColWidth}else{return null}};e.prototype.getColWidth=function(){if(typeof this.gridOptions.colWidth!=="number"||this.gridOptions.colWidth<i.MIN_COL_WIDTH){return 200}else{return this.gridOptions.colWidth}};e.prototype.getRowBuffer=function(){if(typeof this.gridOptions.rowBuffer==="number"){if(this.gridOptions.rowBuffer<0){console.warn("ag-Grid: rowBuffer should not be negative")}return this.gridOptions.rowBuffer}else{return s.Constants.ROW_BUFFER_SIZE}};e.prototype.getScrollbarWidth=function(){var e=this.gridOptions.scrollbarWidth;if(typeof e!=="number"||e<0){e=p.Utils.getScrollbarWidth()}return e};e.prototype.checkForDeprecated=function(){var e=this.gridOptions;if(e.suppressUnSort){console.warn("ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortingOrder instead.")}if(e.suppressDescSort){console.warn("ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortingOrder instead.")}if(e.groupAggFields){console.warn("ag-grid: as of v3 groupAggFields is not used. Please add appropriate agg fields to your columns.")}if(e.groupHidePivotColumns){console.warn("ag-grid: as of v3 groupHidePivotColumns is not used as pivot columns are now called rowGroup columns. Please refer to the documentation")}if(e.groupKeys){console.warn("ag-grid: as of v3 groupKeys is not used. You need to set rowGroupIndex on the columns to group. Please refer to the documentation")}if(typeof e.groupDefaultExpanded==="boolean"){console.warn("ag-grid: groupDefaultExpanded can no longer be boolean. for groupDefaultExpanded=true, use groupDefaultExpanded=9999 instead, to expand all the groups")}if(e.onRowDeselected||e.rowDeselected){console.warn("ag-grid: since version 3.4 event rowDeselected no longer exists, please check the docs")}if(e.rowsAlreadyGrouped){console.warn("ag-grid: since version 3.4 rowsAlreadyGrouped no longer exists, please use getNodeChildDetails() instead")}if(e.groupAggFunction){console.warn("ag-grid: since version 4.3.x groupAggFunction is now called groupRowAggNodes")}if(e.checkboxSelection){console.warn("ag-grid: since version 8.0.x checkboxSelection is not supported as a grid option. "+"If you want this on all columns, use defaultColDef instead and set it there")}if(e.paginationInitialRowCount){console.warn("ag-grid: since version 9.0.x paginationInitialRowCount is now called infiniteInitialRowCount")}if(e.infinitePageSize){console.warn("ag-grid: since version 9.0.x infinitePageSize is now called cacheBlockSize")}if(e.infiniteBlockSize){console.warn("ag-grid: since version 10.0.x infiniteBlockSize is now called cacheBlockSize")}if(e.maxPagesInCache){console.warn("ag-grid: since version 10.0.x maxPagesInCache is now called maxBlocksInCache")}if(e.paginationOverflowSize){console.warn("ag-grid: since version 10.0.x paginationOverflowSize is now called cacheOverflowSize")}if(e.forPrint){console.warn('ag-grid: since version 10.1.x, use property domLayout="forPrint" instead of forPrint=true')}if(e.suppressMenuFilterPanel){console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','columnsMenuTab'] instead of suppressMenuFilterPanel=true")}if(e.suppressMenuMainPanel){console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['filterMenuTab','columnsMenuTab'] instead of suppressMenuMainPanel=true")}if(e.suppressMenuColumnPanel){console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','filterMenuTab'] instead of suppressMenuColumnPanel=true")}if(e.suppressUseColIdForGroups){console.warn("ag-grid: since version 11.0.x, this is not in use anymore. You should be able to remove it from your definition")}if(e.groupColumnDef){console.warn("ag-grid: since version 11.0.x, groupColumnDef has been renamed, this property is now called autoGroupColumnDef. Please change your configuration accordingly")}if(e.slaveGrids){console.warn("ag-grid: since version 12.x, slaveGrids has been renamed, this property is now called alignedGrids. Please change your configuration accordingly")}if(e.floatingTopRowData){console.warn("ag-grid: since version 12.x, floatingTopRowData is now called pinnedTopRowData")}if(e.floatingBottomRowData){console.warn("ag-grid: since version 12.x, floatingBottomRowData is now called pinnedBottomRowData")}if(e.paginationStartPage){console.warn("ag-grid: since version 12.x, paginationStartPage is gone, please call api.paginationGoToPage("+e.paginationStartPage+") instead.")}if(e.getHeaderCellTemplate){console.warn("ag-grid: since version 15.x, getHeaderCellTemplate is gone, please check the header documentation on how to set header templates.")}if(e.headerCellTemplate){console.warn("ag-grid: since version 15.x, headerCellTemplate is gone, please check the header documentation on how to set header templates.")}if(e.headerCellRenderer){console.warn("ag-grid: since version 15.x, headerCellRenderer is gone, please check the header documentation on how to set header templates.")}if(e.angularCompileHeaders){console.warn("ag-grid: since version 15.x, angularCompileHeaders is gone, please see the getting started for Angular 1 docs to see how to do headers in Angular 1.x.")}if(e.domLayout==="forPrint"){console.warn("ag-grid: since version 18.x, forPrint is no longer supported, as same can be achieved using autoHeight (and set the grid width accordingly). please use autoHeight instead.")}if(e.domLayout==="autoHeight"){console.warn("ag-grid: since version 18.x, domLayout is gone, instead if doing auto-height, set gridAutoHeight=true.");e.gridAutoHeight=true}if(e.pivotTotals){console.warn("ag-grid: since version 18.x, pivotTotals has been removed, instead if using pivotTotals, set pivotColumnGroupTotals='before'|'after'.");e.pivotColumnGroupTotals="before"}if(e.rowModelType==="inMemory"){console.warn("ag-grid: since version 18.x, The In Memory Row Model has been renamed to the Client Side Row Model, set rowModelType='clientSide' instead.");e.rowModelType="clientSide"}if(e.rowModelType==="enterprise"){console.warn("ag-grid: since version 18.x, The Enterprise Row Model has been renamed to the Server Side Row Model, set rowModelType='serverSide' instead.");e.rowModelType="serverSide"}};e.prototype.getLocaleTextFunc=function(){if(this.gridOptions.localeTextFunc){return this.gridOptions.localeTextFunc}var n=this;return function(e,t){var i=n.gridOptions.localeText;if(i&&i[e]){return i[e]}else{return t}}};e.prototype.globalEventHandler=function(e,t){var i=l.ComponentUtil.getCallbackForEvent(e);if(typeof this.gridOptions[i]==="function"){this.gridOptions[i](t)}};e.prototype.getRowHeightAsNumber=function(){var e=this.gridOptions.rowHeight;if(p.Utils.missing(e)){return this.getDefaultRowHeight()}else if(this.isNumeric(this.gridOptions.rowHeight)){return this.gridOptions.rowHeight}else{console.warn("ag-Grid row height must be a number if not using standard row model");return this.getDefaultRowHeight()}};e.prototype.getRowHeightForNode=function(e){if(typeof this.gridOptions.getRowHeight==="function"){var t={node:e,data:e.data,api:this.gridOptions.api,context:this.gridOptions.context};return this.gridOptions.getRowHeight(t)}else if(e.detail&&this.isMasterDetail()){if(this.isNumeric(this.gridOptions.detailRowHeight)){return this.gridOptions.detailRowHeight}else{return _}}else{var i=this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:this.getDefaultRowHeight();if(this.columnController.isAutoRowHeightActive()){var n=this.autoHeightCalculator.getPreferredHeightForRow(e);if(n>i){return n}else{return i}}else{return i}}};e.prototype.isDynamicRowHeight=function(){return typeof this.gridOptions.getRowHeight==="function"};e.prototype.getVirtualItemHeight=function(){return this.specialForNewMaterial(20,"virtualItemHeight")};e.prototype.isNumeric=function(e){return!isNaN(e)&&typeof e==="number"};e.prototype.specialForNewMaterial=function(e,t){var i=this.environment.getTheme();if(i.indexOf("ag-theme")===0){return this.environment.getSassVariable(i,t)}else{return e}};e.prototype.getDefaultRowHeight=function(){return this.specialForNewMaterial(b,"rowHeight")};e.MIN_COL_WIDTH=10;e.PROP_HEADER_HEIGHT="headerHeight";e.PROP_GROUP_REMOVE_SINGLE_CHILDREN="groupRemoveSingleChildren";e.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN="groupRemoveLowestSingleChildren";e.PROP_PIVOT_HEADER_HEIGHT="pivotHeaderHeight";e.PROP_SUPPRESS_CLIPBOARD_PASTE="suppressClipboardPaste";e.PROP_GROUP_HEADER_HEIGHT="groupHeaderHeight";e.PROP_PIVOT_GROUP_HEADER_HEIGHT="pivotGroupHeaderHeight";e.PROP_FLOATING_FILTERS_HEIGHT="floatingFiltersHeight";e.PROP_SUPPRESS_ROW_DRAG="suppressRowDrag";e.PROP_POPUP_PARENT="popupParent";e.PROP_GRID_AUTO_HEIGHT="gridAutoHeight";n([c.Autowired("gridOptions"),r("design:type",Object)],e.prototype,"gridOptions",void 0);n([c.Autowired("columnController"),r("design:type",f.ColumnController)],e.prototype,"columnController",void 0);n([c.Autowired("eventService"),r("design:type",a.EventService)],e.prototype,"eventService",void 0);n([c.Autowired("enterprise"),r("design:type",Boolean)],e.prototype,"enterprise",void 0);n([c.Autowired("frameworkFactory"),r("design:type",Object)],e.prototype,"frameworkFactory",void 0);n([c.Autowired("gridApi"),r("design:type",u.GridApi)],e.prototype,"gridApi",void 0);n([c.Autowired("columnApi"),r("design:type",d.ColumnApi)],e.prototype,"columnApi",void 0);n([c.Autowired("environment"),r("design:type",h.Environment)],e.prototype,"environment",void 0);n([c.Autowired("autoHeightCalculator"),r("design:type",y.AutoHeightCalculator)],e.prototype,"autoHeightCalculator",void 0);n([o(0,c.Qualifier("gridApi")),o(1,c.Qualifier("columnApi")),r("design:type",Function),r("design:paramtypes",[u.GridApi,d.ColumnApi]),r("design:returntype",void 0)],e.prototype,"agWire",null);n([c.PreDestroy,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"destroy",null);n([c.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=i=n([c.Bean("gridOptionsWrapper")],e);return e;var i}();t.GridOptionsWrapper=S},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(12);var l=i(1);var u=i(0);var c=i(0);var d=i(2);var s=function(){function e(){this.allSyncListeners={};this.allAsyncListeners={};this.globalSyncListeners=[];this.globalAsyncListeners=[];this.asyncFunctionsQueue=[];this.scheduled=false}s=e;e.prototype.setBeans=function(e,t,i){if(i===void 0){i=null}this.logger=e.create("EventService");if(i){var n=t.useAsyncEvents();this.addGlobalListener(i,n)}};e.prototype.getListenerList=function(e,t){var i=t?this.allAsyncListeners:this.allSyncListeners;var n=i[e];if(!n){n=[];i[e]=n}return n};e.prototype.addEventListener=function(e,t,i){if(i===void 0){i=false}var n=this.getListenerList(e,i);if(n.indexOf(t)<0){n.push(t)}};e.prototype.addModalPriorityEventListener=function(e,t,i){if(i===void 0){i=false}this.addEventListener(e+s.PRIORITY,t,i)};e.prototype.addGlobalListener=function(e,t){if(t===void 0){t=false}if(t){this.globalAsyncListeners.push(e)}else{this.globalSyncListeners.push(e)}};e.prototype.removeEventListener=function(e,t,i){if(i===void 0){i=false}var n=this.getListenerList(e,i);l.Utils.removeFromArray(n,t)};e.prototype.removeGlobalListener=function(e,t){if(t===void 0){t=false}if(t){l.Utils.removeFromArray(this.globalAsyncListeners,e)}else{l.Utils.removeFromArray(this.globalSyncListeners,e)}};e.prototype.dispatchEvent=function(e){this.dispatchToListeners(e,true);this.dispatchToListeners(e,false)};e.prototype.dispatchToListeners=function(t,i){var n=this;var e=i?this.globalAsyncListeners:this.globalSyncListeners;var r=t.type;var o=this.getListenerList(r+s.PRIORITY,i);l.Utils.forEachSnapshotFirst(o,function(e){if(i){n.dispatchAsync(function(){return e(t)})}else{e(t)}});var a=this.getListenerList(r,i);l.Utils.forEachSnapshotFirst(a,function(e){if(i){n.dispatchAsync(function(){return e(t)})}else{e(t)}});l.Utils.forEachSnapshotFirst(e,function(e){if(i){n.dispatchAsync(function(){return e(r,t)})}else{e(r,t)}})};e.prototype.dispatchAsync=function(e){this.asyncFunctionsQueue.push(e);if(!this.scheduled){setTimeout(this.flushAsyncQueue.bind(this),0);this.scheduled=true}};e.prototype.flushAsyncQueue=function(){this.scheduled=false;var e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];e.forEach(function(e){return e()})};e.PRIORITY="-P1";n([o(0,c.Qualifier("loggerFactory")),o(1,c.Qualifier("gridOptionsWrapper")),o(2,c.Qualifier("globalEventListener")),r("design:type",Function),r("design:paramtypes",[a.LoggerFactory,d.GridOptionsWrapper,Function]),r("design:returntype",void 0)],e.prototype,"setBeans",null);e=s=n([u.Bean("eventService")],e);return e;var s}();t.EventService=s},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var v=i(1);var s=i(26);var c=i(10);var a=i(2);var l=i(19);var u=i(38);var d=i(48);var f=i(39);var p=i(3);var h=i(31);var g=i(12);var m=i(5);var y=i(32);var b=i(83);var _=i(0);var w=i(53);var C=i(104);var A=i(33);var E=i(6);var x=i(7);var T=function(){function e(){this.primaryHeaderRowCount=0;this.secondaryHeaderRowCount=0;this.secondaryColumnsPresent=false;this.gridHeaderRowCount=0;this.displayedLeftColumns=[];this.displayedRightColumns=[];this.displayedCenterColumns=[];this.allDisplayedColumns=[];this.allDisplayedVirtualColumns=[];this.allDisplayedCenterVirtualColumns=[];this.rowGroupColumns=[];this.valueColumns=[];this.pivotColumns=[];this.ready=false;this.autoGroupsNeedBuilding=false;this.pivotMode=false;this.bodyWidth=0;this.leftWidth=0;this.rightWidth=0;this.bodyWidthDirty=true}e.prototype.init=function(){var e=this.gridOptionsWrapper.isPivotMode();this.suppressColumnVirtualisation=this.gridOptionsWrapper.isSuppressColumnVirtualisation();if(this.isPivotSettingAllowed(e)){this.pivotMode=e}this.usingTreeData=this.gridOptionsWrapper.isTreeData()};e.prototype.isAutoRowHeightActive=function(){return this.autoRowHeightColumns&&this.autoRowHeightColumns.length>0};e.prototype.getAllAutoRowHeightCols=function(){return this.autoRowHeightColumns};e.prototype.setVirtualViewportLeftAndRight=function(){if(this.gridOptionsWrapper.isEnableRtl()){this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth;this.viewportRight=this.bodyWidth-this.scrollPosition}else{this.viewportLeft=this.scrollPosition;this.viewportRight=this.scrollWidth+this.scrollPosition}};e.prototype.getDisplayedColumnsStartingAt=function(e){var t=e;var i=[];while(v.Utils.exists(t)){i.push(t);t=this.getDisplayedColAfter(t)}return i};e.prototype.checkDisplayedVirtualColumns=function(){if(v.Utils.exists(this.displayedCenterColumns)){var e=this.allDisplayedVirtualColumns.map(function(e){return e.getId()}).join("#");this.updateVirtualSets();var t=this.allDisplayedVirtualColumns.map(function(e){return e.getId()}).join("#");if(e!==t){var i={type:m.Events.EVENT_VIRTUAL_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i)}}};e.prototype.setVirtualViewportPosition=function(e,t){if(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty){this.scrollWidth=e;this.scrollPosition=t;this.bodyWidthDirty=true;this.setVirtualViewportLeftAndRight();if(this.ready){this.checkDisplayedVirtualColumns()}}};e.prototype.isPivotMode=function(){return this.pivotMode};e.prototype.isPivotSettingAllowed=function(e){if(e){if(this.gridOptionsWrapper.isTreeData()){console.warn("ag-Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'");return false}else{return true}}else{return true}};e.prototype.setPivotMode=function(e,t){if(t===void 0){t="api"}if(e===this.pivotMode){return}if(!this.isPivotSettingAllowed(this.pivotMode)){return}this.pivotMode=e;this.updateDisplayedColumns(t);var i={type:m.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i)};e.prototype.getSecondaryPivotColumn=function(o,e){if(!this.secondaryColumnsPresent){return null}var a=this.getPrimaryColumn(e);var s=null;this.secondaryColumns.forEach(function(e){var t=e.getColDef().pivotKeys;var i=e.getColDef().pivotValueColumn;var n=v.Utils.compareArrays(t,o);var r=i===a;if(n&&r){s=e}});return s};e.prototype.setBeans=function(e){this.logger=e.create("ColumnController")};e.prototype.setFirstRightAndLastLeftPinned=function(t){var i;var n;if(this.gridOptionsWrapper.isEnableRtl()){i=this.displayedLeftColumns?this.displayedLeftColumns[0]:null;n=this.displayedRightColumns?this.displayedRightColumns[this.displayedRightColumns.length-1]:null}else{i=this.displayedLeftColumns?this.displayedLeftColumns[this.displayedLeftColumns.length-1]:null;n=this.displayedRightColumns?this.displayedRightColumns[0]:null}this.gridColumns.forEach(function(e){e.setLastLeftPinned(e===i,t);e.setFirstRightPinned(e===n,t)})};e.prototype.autoSizeColumns=function(e,n){var r=this;if(n===void 0){n="api"}var o=[];var a=-1;while(a!==0){a=0;this.actionOnGridColumns(e,function(e){if(o.indexOf(e)>=0){return}var t=r.autoWidthCalculator.getPreferredWidthForColumn(e);if(t>0){var i=r.normaliseColumnWidth(e,t);e.setActualWidth(i,n);o.push(e);a++}return true},n)}if(o.length>0){var t={type:m.Events.EVENT_COLUMN_RESIZED,columns:o,column:o.length===1?o[0]:null,finished:true,api:this.gridApi,columnApi:this.columnApi,source:"autosizeColumns"};this.eventService.dispatchEvent(t)}};e.prototype.autoSizeColumn=function(e,t){if(t===void 0){t="api"}this.autoSizeColumns([e],t)};e.prototype.autoSizeAllColumns=function(e){if(e===void 0){e="api"}var t=this.getAllDisplayedColumns();this.autoSizeColumns(t,e)};e.prototype.getColumnsFromTree=function(e){var n=[];r(e);return n;function r(e){for(var t=0;t<e.length;t++){var i=e[t];if(i instanceof c.Column){n.push(i)}else if(i instanceof y.OriginalColumnGroup){r(i.getChildren())}}}};e.prototype.getAllDisplayedColumnGroups=function(){if(this.displayedLeftColumnTree&&this.displayedRightColumnTree&&this.displayedCentreColumnTree){return this.displayedLeftColumnTree.concat(this.displayedCentreColumnTree).concat(this.displayedRightColumnTree)}else{return null}};e.prototype.getPrimaryColumnTree=function(){return this.primaryBalancedTree};e.prototype.getHeaderRowCount=function(){return this.gridHeaderRowCount};e.prototype.getLeftDisplayedColumnGroups=function(){return this.displayedLeftColumnTree};e.prototype.getRightDisplayedColumnGroups=function(){return this.displayedRightColumnTree};e.prototype.getCenterDisplayedColumnGroups=function(){return this.displayedCentreColumnTree};e.prototype.getDisplayedColumnGroups=function(e){switch(e){case c.Column.PINNED_LEFT:return this.getLeftDisplayedColumnGroups();case c.Column.PINNED_RIGHT:return this.getRightDisplayedColumnGroups();default:return this.getCenterDisplayedColumnGroups()}};e.prototype.isColumnDisplayed=function(e){return this.getAllDisplayedColumns().indexOf(e)>=0};e.prototype.getAllDisplayedColumns=function(){return this.allDisplayedColumns};e.prototype.getAllDisplayedVirtualColumns=function(){return this.allDisplayedVirtualColumns};e.prototype.getDisplayedLeftColumnsForRow=function(e){if(!this.colSpanActive){return this.displayedLeftColumns}else{return this.getDisplayedColumnsForRow(e,this.displayedLeftColumns)}};e.prototype.getDisplayedRightColumnsForRow=function(e){if(!this.colSpanActive){return this.displayedRightColumns}else{return this.getDisplayedColumnsForRow(e,this.displayedRightColumns)}};e.prototype.getDisplayedColumnsForRow=function(l,u,c,d){var f=[];var p=null;var e=function(e){var t=u[e];var i=t.getColSpan(l);var n=[t];if(i>1){var r=i-1;for(var o=1;o<=r;o++){n.push(u[e+o])}e+=r}var a;if(c){a=false;n.forEach(function(e){if(c(e))a=true})}else{a=true}if(a){if(f.length===0&&p){var s=d?d(t):false;if(s){f.push(p)}}f.push(t)}p=t;h=e};var h;for(var t=0;t<u.length;t++){e(t);t=h}return f};e.prototype.getAllDisplayedCenterVirtualColumnsForRow=function(e){var t=this;if(!this.colSpanActive){return this.allDisplayedCenterVirtualColumns}var i=function(e){return e.getLeft()>t.viewportLeft};var n=this.suppressColumnVirtualisation?null:this.isColumnInViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedCenterColumns,n,i)};e.prototype.isColumnInViewport=function(e){var t=e.getLeft();var i=e.getLeft()+e.getActualWidth();var n=t<this.viewportLeft&&i<this.viewportLeft;var r=t>this.viewportRight&&i>this.viewportRight;return!n&&!r};e.prototype.getPinnedLeftContainerWidth=function(){return this.getWidthOfColsInList(this.displayedLeftColumns)};e.prototype.getPinnedRightContainerWidth=function(){return this.getWidthOfColsInList(this.displayedRightColumns)};e.prototype.updatePrimaryColumnList=function(e,i,n,r,t,o){var a=this;if(o===void 0){o="api"}if(v.Utils.missingOrEmpty(e)){return}var s=false;e.forEach(function(e){var t=a.getPrimaryColumn(e);if(!t){return}if(n){if(i.indexOf(t)>=0){return}i.push(t)}else{if(i.indexOf(t)<0){return}v.Utils.removeFromArray(i,t)}r(t);s=true});if(!s){return}if(this.autoGroupsNeedBuilding){this.updateGridColumns()}this.updateDisplayedColumns(o);var l={type:t,columns:i,column:i.length===1?i[0]:null,api:this.gridApi,columnApi:this.columnApi,source:o};this.eventService.dispatchEvent(l)};e.prototype.setRowGroupColumns=function(e,t){if(t===void 0){t="api"}this.autoGroupsNeedBuilding=true;this.setPrimaryColumnList(e,this.rowGroupColumns,m.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.setRowGroupActive.bind(this),t)};e.prototype.setRowGroupActive=function(e,t,i){if(e===t.isRowGroupActive()){return}t.setRowGroupActive(e,i);if(!e&&!this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()){t.setVisible(true,i)}};e.prototype.addRowGroupColumn=function(e,t){if(t===void 0){t="api"}this.addRowGroupColumns([e],t)};e.prototype.addRowGroupColumns=function(e,t){if(t===void 0){t="api"}this.autoGroupsNeedBuilding=true;this.updatePrimaryColumnList(e,this.rowGroupColumns,true,this.setRowGroupActive.bind(this,true),m.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t)};e.prototype.removeRowGroupColumns=function(e,t){if(t===void 0){t="api"}this.autoGroupsNeedBuilding=true;this.updatePrimaryColumnList(e,this.rowGroupColumns,false,this.setRowGroupActive.bind(this,false),m.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t)};e.prototype.removeRowGroupColumn=function(e,t){if(t===void 0){t="api"}this.removeRowGroupColumns([e],t)};e.prototype.addPivotColumns=function(e,t){if(t===void 0){t="api"}this.updatePrimaryColumnList(e,this.pivotColumns,true,function(e){return e.setPivotActive(true,t)},m.Events.EVENT_COLUMN_PIVOT_CHANGED,t)};e.prototype.setPivotColumns=function(e,i){if(i===void 0){i="api"}this.setPrimaryColumnList(e,this.pivotColumns,m.Events.EVENT_COLUMN_PIVOT_CHANGED,function(e,t){t.setPivotActive(e,i)},i)};e.prototype.addPivotColumn=function(e,t){if(t===void 0){t="api"}this.addPivotColumns([e],t)};e.prototype.removePivotColumns=function(e,t){if(t===void 0){t="api"}this.updatePrimaryColumnList(e,this.pivotColumns,false,function(e){return e.setPivotActive(false,t)},m.Events.EVENT_COLUMN_PIVOT_CHANGED,t)};e.prototype.removePivotColumn=function(e,t){if(t===void 0){t="api"}this.removePivotColumns([e],t)};e.prototype.setPrimaryColumnList=function(e,i,t,n,r){var o=this;i.length=0;if(v.Utils.exists(e)){e.forEach(function(e){var t=o.getPrimaryColumn(e);i.push(t)})}this.primaryColumns.forEach(function(e){var t=i.indexOf(e)>=0;n(t,e)});if(this.autoGroupsNeedBuilding){this.updateGridColumns()}this.updateDisplayedColumns(r);var a={type:t,columns:i,column:i.length===1?i[0]:null,api:this.gridApi,columnApi:this.columnApi,source:r};this.eventService.dispatchEvent(a)};e.prototype.setValueColumns=function(e,t){if(t===void 0){t="api"}this.setPrimaryColumnList(e,this.valueColumns,m.Events.EVENT_COLUMN_VALUE_CHANGED,this.setValueActive.bind(this),t)};e.prototype.setValueActive=function(e,t,i){if(e===t.isValueActive()){return}t.setValueActive(e,i);if(e&&!t.getAggFunc()){var n=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(n)}};e.prototype.addValueColumns=function(e,t){if(t===void 0){t="api"}this.updatePrimaryColumnList(e,this.valueColumns,true,this.setValueActive.bind(this,true),m.Events.EVENT_COLUMN_VALUE_CHANGED,t)};e.prototype.addValueColumn=function(e,t){if(t===void 0){t="api"}this.addValueColumns([e],t)};e.prototype.removeValueColumn=function(e,t){if(t===void 0){t="api"}this.removeValueColumns([e],t)};e.prototype.removeValueColumns=function(e,t){if(t===void 0){t="api"}this.updatePrimaryColumnList(e,this.valueColumns,false,this.setValueActive.bind(this,false),m.Events.EVENT_COLUMN_VALUE_CHANGED,t)};e.prototype.normaliseColumnWidth=function(e,t){if(t<e.getMinWidth()){t=e.getMinWidth()}if(e.isGreaterThanMax(t)){t=e.getMaxWidth()}return t};e.prototype.getPrimaryOrGridColumn=function(e){var t=this.getPrimaryColumn(e);if(t){return t}else{return this.getGridColumn(e)}};e.prototype.setColumnWidth=function(e,t,i,n,r){if(r===void 0){r="api"}var o=this.getPrimaryOrGridColumn(e);if(!o){return}var a=[];a.push({width:t,ratios:[1],columns:[o]});if(i){var s=this.getDisplayedColAfter(o);if(!s){return}var l=o.getActualWidth()-t;var u=s.getActualWidth()+l;a.push({width:u,ratios:[1],columns:[s]})}this.resizeColumnSets(a,n,r)};e.prototype.checkMinAndMaxWidthsForSet=function(e){var t=e.columns,i=e.width;var n=0;var r=0;var o=true;t.forEach(function(e){n+=e.getMinWidth();if(e.getMaxWidth()>0){r+=e.getMaxWidth()}else{o=false}});var a=i>=n;var s=!o||i<=r;return a&&s};e.prototype.resizeColumnSets=function(e,t,i){var n=v.Utils.every(e,this.checkMinAndMaxWidthsForSet.bind(this));if(!n){return}var o=[];var a=[];e.forEach(function(e){var u=e.width,t=e.columns,c=e.ratios;var d={};var f={};t.forEach(function(e){return a.push(e)});var p=true;var i=0;var n=function(){i++;if(i>1e3){console.error("ag-Grid: infinite loop in resizeColumnSets");return"break"}p=false;var r=[];var o=[];var a=0;var s=u;t.forEach(function(e,t){var i=f[e.getId()];if(i){s-=d[e.getId()]}else{r.push(e);var n=c[t];a+=n;o.push(n)}});var l=1/a;r.forEach(function(e,t){var i=t===r.length-1;var n;if(i){n=s}else{n=Math.round(c[t]*u*l);s-=n}if(n<e.getMinWidth()){n=e.getMinWidth();f[e.getId()]=true;p=true}else if(e.getMaxWidth()>0&&n>e.getMaxWidth()){n=e.getMaxWidth();f[e.getId()]=true;p=true}d[e.getId()]=n})};while(p){var r=n();if(r==="break")break}t.forEach(function(e){var t=d[e.getId()];if(e.getActualWidth()!==t){e.setActualWidth(t);o.push(e)}})});var r=o.length>0;if(r){this.setLeftValues(i);this.updateBodyWidths();this.checkDisplayedVirtualColumns()}if(r||t){var s={type:m.Events.EVENT_COLUMN_RESIZED,columns:a,column:a.length===1?a[0]:null,finished:t,api:this.gridApi,columnApi:this.columnApi,source:i};this.eventService.dispatchEvent(s)}};e.prototype.setColumnAggFunc=function(e,t,i){if(i===void 0){i="api"}e.setAggFunc(t);var n={type:m.Events.EVENT_COLUMN_VALUE_CHANGED,columns:[e],column:e,api:this.gridApi,columnApi:this.columnApi,source:i};this.eventService.dispatchEvent(n)};e.prototype.moveRowGroupColumn=function(e,t,i){if(i===void 0){i="api"}var n=this.rowGroupColumns[e];this.rowGroupColumns.splice(e,1);this.rowGroupColumns.splice(t,0,n);var r={type:m.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:this.rowGroupColumns,column:this.rowGroupColumns.length===1?this.rowGroupColumns[0]:null,api:this.gridApi,columnApi:this.columnApi,source:i};this.eventService.dispatchEvent(r)};e.prototype.moveColumns=function(e,t,i){if(i===void 0){i="api"}this.columnAnimationService.start();if(t>this.gridColumns.length-e.length){console.warn("ag-Grid: tried to insert columns in invalid location, toIndex = "+t);console.warn("ag-Grid: remember that you should not count the moving columns when calculating the new index");return}var n=this.getGridColumns(e);var r=!this.doesMovePassRules(n,t);if(r){return}v.Utils.moveInArray(this.gridColumns,n,t);this.updateDisplayedColumns(i);var o={type:m.Events.EVENT_COLUMN_MOVED,columns:n,column:n.length===1?n[0]:null,toIndex:t,api:this.gridApi,columnApi:this.columnApi,source:i};this.eventService.dispatchEvent(o);this.columnAnimationService.finish()};e.prototype.doesMovePassRules=function(e,t){var i=this.gridColumns.slice();v.Utils.moveInArray(i,e,t);if(!this.doesMovePassMarryChildren(i)){return false}if(!this.doesMovePassLockedPositions(i)){return false}return true};e.prototype.doesMovePassLockedPositions=function(e){var t=false;var i=true;e.forEach(function(e){if(e.isLockPosition()){if(t){i=false}}else{t=true}});return i};e.prototype.doesMovePassMarryChildren=function(l){var u=true;this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree,function(e){if(!(e instanceof y.OriginalColumnGroup)){return}var t=e;var i=t.getColGroupDef()&&t.getColGroupDef().marryChildren;if(!i){return}var n=[];t.getLeafColumns().forEach(function(e){var t=l.indexOf(e);n.push(t)});var r=Math.max.apply(Math,n);var o=Math.min.apply(Math,n);var a=r-o;var s=t.getLeafColumns().length-1;if(a>s){u=false}});return u};e.prototype.moveColumn=function(e,t,i){if(i===void 0){i="api"}this.moveColumns([e],t,i)};e.prototype.moveColumnByIndex=function(e,t,i){if(i===void 0){i="api"}var n=this.gridColumns[e];this.moveColumn(n,t,i)};e.prototype.getBodyContainerWidth=function(){return this.bodyWidth};e.prototype.getContainerWidth=function(e){switch(e){case c.Column.PINNED_LEFT:return this.leftWidth;case c.Column.PINNED_RIGHT:return this.rightWidth;default:return this.bodyWidth}};e.prototype.updateBodyWidths=function(){var e=this.getWidthOfColsInList(this.displayedCenterColumns);var t=this.getWidthOfColsInList(this.displayedLeftColumns);var i=this.getWidthOfColsInList(this.displayedRightColumns);this.bodyWidthDirty=this.bodyWidth!==e;var n=this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i;if(n){this.bodyWidth=e;this.leftWidth=t;this.rightWidth=i;var r={type:m.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}};e.prototype.getValueColumns=function(){return this.valueColumns?this.valueColumns:[]};e.prototype.getPivotColumns=function(){return this.pivotColumns?this.pivotColumns:[]};e.prototype.isPivotActive=function(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode};e.prototype.getRowGroupColumns=function(){return this.rowGroupColumns?this.rowGroupColumns:[]};e.prototype.getDisplayedCenterColumns=function(){return this.displayedCenterColumns};e.prototype.getDisplayedLeftColumns=function(){return this.displayedLeftColumns};e.prototype.getDisplayedRightColumns=function(){return this.displayedRightColumns};e.prototype.getDisplayedColumns=function(e){switch(e){case c.Column.PINNED_LEFT:return this.getDisplayedLeftColumns();case c.Column.PINNED_RIGHT:return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}};e.prototype.getAllPrimaryColumns=function(){return this.primaryColumns};e.prototype.getAllColumnsForQuickFilter=function(){return this.columnsForQuickFilter};e.prototype.getAllGridColumns=function(){return this.gridColumns};e.prototype.isEmpty=function(){return v.Utils.missingOrEmpty(this.gridColumns)};e.prototype.isRowGroupEmpty=function(){return v.Utils.missingOrEmpty(this.rowGroupColumns)};e.prototype.setColumnVisible=function(e,t,i){if(i===void 0){i="api"}this.setColumnsVisible([e],t,i)};e.prototype.setColumnsVisible=function(e,t,i){var n=this;if(i===void 0){i="api"}this.columnAnimationService.start();this.actionOnGridColumns(e,function(e){if(e.isVisible()!==t){e.setVisible(t,i);return true}else{return false}},i,function(){var e={type:m.Events.EVENT_COLUMN_VISIBLE,visible:t,column:null,columns:null,api:n.gridApi,columnApi:n.columnApi,source:i};return e});this.columnAnimationService.finish()};e.prototype.setColumnPinned=function(e,t,i){if(i===void 0){i="api"}this.setColumnsPinned([e],t,i)};e.prototype.setColumnsPinned=function(e,t,i){var n=this;if(i===void 0){i="api"}this.columnAnimationService.start();var r;if(t===true||t===c.Column.PINNED_LEFT){r=c.Column.PINNED_LEFT}else if(t===c.Column.PINNED_RIGHT){r=c.Column.PINNED_RIGHT}else{r=null}this.actionOnGridColumns(e,function(e){if(e.getPinned()!==r){e.setPinned(r);return true}else{return false}},i,function(){var e={type:m.Events.EVENT_COLUMN_PINNED,pinned:r,column:null,columns:null,api:n.gridApi,columnApi:n.columnApi,source:i};return e});this.columnAnimationService.finish()};e.prototype.actionOnGridColumns=function(e,n,t,i){var r=this;if(v.Utils.missingOrEmpty(e)){return}var o=[];e.forEach(function(e){var t=r.getGridColumn(e);if(!t){return}var i=n(t);if(i!==false){o.push(t)}});if(o.length===0){return}this.updateDisplayedColumns(t);if(v.Utils.exists(i)){var a=i();a.columns=o;a.column=o.length===1?o[0]:null;this.eventService.dispatchEvent(a)}};e.prototype.getDisplayedColBefore=function(e){var t=this.getAllDisplayedColumns();var i=t.indexOf(e);if(i>0){return t[i-1]}else{return null}};e.prototype.getDisplayedColAfter=function(e){var t=this.getAllDisplayedColumns();var i=t.indexOf(e);if(i<t.length-1){return t[i+1]}else{return null}};e.prototype.getDisplayedGroupAfter=function(e){var t=e.getDisplayedLeafColumns()[0];var i=e.getOriginalColumnGroup().getLevel();while(true){t=this.getDisplayedColAfter(t);if(!t){return null}var n=t.getParent();while(n.getOriginalColumnGroup().getLevel()!==i){n=n.getParent()}if(n!==e){return n}}};e.prototype.isPinningLeft=function(){return this.displayedLeftColumns.length>0};e.prototype.isPinningRight=function(){return this.displayedRightColumns.length>0};e.prototype.getPrimaryAndSecondaryAndAutoColumns=function(){var t=this.primaryColumns?this.primaryColumns.slice(0):[];if(v.Utils.exists(this.groupAutoColumns)){this.groupAutoColumns.forEach(function(e){return t.push(e)})}if(this.secondaryColumnsPresent){this.secondaryColumns.forEach(function(e){return t.push(e)})}return t};e.prototype.createStateItemFromColumn=function(e){var t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null;var i=e.isPivotActive()?this.pivotColumns.indexOf(e):null;var n=e.isValueActive()?e.getAggFunc():null;return{colId:e.getColId(),hide:!e.isVisible(),aggFunc:n,width:e.getActualWidth(),pivotIndex:i,pinned:e.getPinned(),rowGroupIndex:t}};e.prototype.getColumnState=function(){if(v.Utils.missing(this.primaryColumns)){return[]}var e=this.primaryColumns.map(this.createStateItemFromColumn.bind(this));if(!this.pivotMode){this.orderColumnStateList(e)}return e};e.prototype.orderColumnStateList=function(e){var r=this.gridColumns.map(function(e){return e.getColId()});e.sort(function(e,t){var i=r.indexOf(e.colId);var n=r.indexOf(t.colId);return i-n})};e.prototype.resetColumnState=function(e){if(e===void 0){e="api"}var t=this.getColumnsFromTree(this.primaryBalancedTree);var i=[];if(t){t.forEach(function(e){i.push({colId:e.getColId(),aggFunc:e.getColDef().aggFunc,hide:e.getColDef().hide,pinned:e.getColDef().pinned,rowGroupIndex:e.getColDef().rowGroupIndex,pivotIndex:e.getColDef().pivotIndex,width:e.getColDef().width})})}this.setColumnState(i,e)};e.prototype.setColumnState=function(e,i){var n=this;if(i===void 0){i="api"}if(v.Utils.missingOrEmpty(this.primaryColumns)){return false}this.autoGroupsNeedBuilding=true;var r=this.primaryColumns.slice();this.rowGroupColumns=[];this.valueColumns=[];this.pivotColumns=[];var o=true;var a={};var s={};if(e){e.forEach(function(e){var t=n.getPrimaryColumn(e.colId);if(!t){console.warn("ag-grid: column "+e.colId+" not found");o=false}else{n.syncColumnWithStateItem(t,e,a,s,i);v.Utils.removeFromArray(r,t)}})}r.forEach(this.syncColumnWithNoState.bind(this));this.rowGroupColumns.sort(this.sortColumnListUsingIndexes.bind(this,a));this.pivotColumns.sort(this.sortColumnListUsingIndexes.bind(this,s));this.updateGridColumns();if(e){var l=e.map(function(e){return e.colId});this.gridColumns.sort(function(e,t){var i=l.indexOf(e.getId());var n=l.indexOf(t.getId());return i-n})}this.updateDisplayedColumns(i);var t={type:m.Events.EVENT_COLUMN_EVERYTHING_CHANGED,api:this.gridApi,columnApi:this.columnApi,source:i};this.eventService.dispatchEvent(t);return o};e.prototype.sortColumnListUsingIndexes=function(e,t,i){var n=e[t.getId()];var r=e[i.getId()];return n-r};e.prototype.syncColumnWithNoState=function(e,t){e.setVisible(false,t);e.setAggFunc(null);e.setPinned(null);e.setRowGroupActive(false,t);e.setPivotActive(false,t);e.setValueActive(false,t)};e.prototype.syncColumnWithStateItem=function(e,t,i,n,r){e.setVisible(!t.hide,r);e.setPinned(t.pinned);if(t.width>=this.gridOptionsWrapper.getMinColWidth()){e.setActualWidth(t.width,r)}if(typeof t.aggFunc==="string"){e.setAggFunc(t.aggFunc);e.setValueActive(true,r);this.valueColumns.push(e)}else{if(v.Utils.exists(t.aggFunc)){console.warn("ag-Grid: stateItem.aggFunc must be a string. if using your own aggregation "+"functions, register the functions first before using them in get/set state. This is because it is"+"intended for the column state to be stored and retrieved as simple JSON.")}e.setAggFunc(null);e.setValueActive(false,r)}if(typeof t.rowGroupIndex==="number"){this.rowGroupColumns.push(e);e.setRowGroupActive(true,r);i[e.getId()]=t.rowGroupIndex}else{e.setRowGroupActive(false,r)}if(typeof t.pivotIndex==="number"){this.pivotColumns.push(e);e.setPivotActive(true,r);n[e.getId()]=t.pivotIndex}else{e.setPivotActive(false,r)}};e.prototype.getGridColumns=function(e){return this.getColumns(e,this.getGridColumn.bind(this))};e.prototype.getColumns=function(e,i){var n=[];if(e){e.forEach(function(e){var t=i(e);if(t){n.push(t)}})}return n};e.prototype.getColumnWithValidation=function(e){var t=this.getPrimaryColumn(e);if(!t){console.warn("ag-Grid: could not find column "+t)}return t};e.prototype.getPrimaryColumn=function(e){return this.getColumn(e,this.primaryColumns)};e.prototype.getGridColumn=function(e){return this.getColumn(e,this.gridColumns)};e.prototype.getColumn=function(e,t){if(!e){return null}for(var i=0;i<t.length;i++){if(this.columnsMatch(t[i],e)){return t[i]}}return this.getAutoColumn(e)};e.prototype.getAutoColumn=function(t){var i=this;if(!v.Utils.exists(this.groupAutoColumns)||v.Utils.missing(this.groupAutoColumns)){return null}return v.Utils.find(this.groupAutoColumns,function(e){return i.columnsMatch(e,t)})};e.prototype.columnsMatch=function(e,t){var i=e===t;var n=e.getColDef()===t;var r=e.getColId()==t;return i||n||r};e.prototype.getDisplayNameForColumn=function(e,t,i){if(i===void 0){i=false}var n=this.getHeaderName(e.getColDef(),e,null,null,t);if(i){return this.wrapHeaderNameWithAggFunc(e,n)}else{return n}};e.prototype.getDisplayNameForOriginalColumnGroup=function(e,t,i){var n=t.getColGroupDef();if(n){return this.getHeaderName(n,null,e,t,i)}else{return null}};e.prototype.getDisplayNameForColumnGroup=function(e,t){return this.getDisplayNameForOriginalColumnGroup(e,e.getOriginalColumnGroup(),t)};e.prototype.getHeaderName=function(e,t,i,n,r){var o=e.headerValueGetter;if(o){var a={colDef:e,column:t,columnGroup:i,originalColumnGroup:n,location:r,api:this.gridOptionsWrapper.getApi(),context:this.gridOptionsWrapper.getContext()};if(typeof o==="function"){return o(a)}else if(typeof o==="string"){return this.expressionService.evaluate(o,a)}else{console.warn("ag-grid: headerValueGetter must be a function or a string");return""}}else if(e.headerName!=null){return e.headerName}else if(e.field){return v.Utils.camelCaseToHumanText(e.field)}else{return""}};e.prototype.wrapHeaderNameWithAggFunc=function(e,t){if(this.gridOptionsWrapper.isSuppressAggFuncInHeader()){return t}var i=e.getColDef().pivotValueColumn;var n=v.Utils.exists(i);var r=null;var o;if(n){r=i.getAggFunc();o=true}else{var a=e.isValueActive();var s=this.pivotMode||!this.isRowGroupEmpty();if(a&&s){r=e.getAggFunc();o=true}else{o=false}}if(o){var l=typeof r==="string"?r:"func";var u=this.gridOptionsWrapper.getLocaleTextFunc();var c=u(l,l);return c+"("+t+")"}else{return t}};e.prototype.getColumnGroup=function(n,r){if(!n){return null}if(n instanceof s.ColumnGroup){return n}var e=this.getAllDisplayedColumnGroups();var o=typeof r==="number";var a=null;this.columnUtils.depthFirstAllColumnTreeSearch(e,function(e){if(e instanceof s.ColumnGroup){var t=e;var i=void 0;if(o){i=n===t.getGroupId()&&r===t.getInstanceId()}else{i=n===t.getGroupId()}if(i){a=t}}});return a};e.prototype.setColumnDefs=function(e,t){if(t===void 0){t="api"}this.valueCache.expire();this.autoGroupsNeedBuilding=true;var i=this.balancedColumnTreeBuilder.createBalancedColumnGroups(e,true);this.primaryBalancedTree=i.balancedTree;this.primaryHeaderRowCount=i.treeDept+1;this.primaryColumns=this.getColumnsFromTree(this.primaryBalancedTree);this.autoRowHeightColumns=this.primaryColumns.filter(function(e){return e.getColDef().autoHeight});this.extractRowGroupColumns(t);this.extractPivotColumns(t);this.createValueColumns(t);this.updateGridColumns();this.updateDisplayedColumns(t);this.checkDisplayedVirtualColumns();this.ready=true;var n={type:m.Events.EVENT_COLUMN_EVERYTHING_CHANGED,api:this.gridApi,columnApi:this.columnApi,source:t};this.eventService.dispatchEvent(n);var r={type:m.Events.EVENT_NEW_COLUMNS_LOADED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)};e.prototype.isReady=function(){return this.ready};e.prototype.extractRowGroupColumns=function(t){var i=this;this.rowGroupColumns.forEach(function(e){return e.setRowGroupActive(false,t)});this.rowGroupColumns=[];this.primaryColumns.forEach(function(e){if(typeof e.getColDef().rowGroupIndex==="number"){i.rowGroupColumns.push(e);e.setRowGroupActive(true,t)}});this.rowGroupColumns.sort(function(e,t){return e.getColDef().rowGroupIndex-t.getColDef().rowGroupIndex});this.primaryColumns.forEach(function(e){if(e.getColDef().rowGroup){if(i.rowGroupColumns.indexOf(e)>=0){return}i.rowGroupColumns.push(e);e.setRowGroupActive(true,t)}})};e.prototype.extractPivotColumns=function(t){var i=this;this.pivotColumns.forEach(function(e){return e.setPivotActive(false,t)});this.pivotColumns=[];this.primaryColumns.forEach(function(e){if(typeof e.getColDef().pivotIndex==="number"){i.pivotColumns.push(e);e.setPivotActive(true,t)}});this.pivotColumns.sort(function(e,t){return e.getColDef().pivotIndex-t.getColDef().pivotIndex});this.primaryColumns.forEach(function(e){if(e.getColDef().pivot){if(i.pivotColumns.indexOf(e)>=0){return}i.pivotColumns.push(e);e.setPivotActive(true,t)}})};e.prototype.resetColumnGroupState=function(e){if(e===void 0){e="api"}var i=[];this.columnUtils.depthFirstOriginalTreeSearch(this.primaryBalancedTree,function(e){if(e instanceof y.OriginalColumnGroup){var t={groupId:e.getGroupId(),open:e.getColGroupDef().openByDefault};i.push(t)}});this.setColumnGroupState(i,e)};e.prototype.getColumnGroupState=function(){var i=[];this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree,function(e){if(e instanceof y.OriginalColumnGroup){var t=e;i.push({groupId:t.getGroupId(),open:t.isExpanded()})}});return i};e.prototype.setColumnGroupState=function(e,t){var r=this;if(t===void 0){t="api"}this.columnAnimationService.start();var o=[];e.forEach(function(e){var t=e.groupId;var i=e.open;var n=r.getOriginalColumnGroup(t);if(!n){return}if(n.isExpanded()===i){return}r.logger.log("columnGroupOpened("+n.getGroupId()+","+i+")");n.setExpanded(i);o.push(n)});this.updateGroupsAndDisplayedColumns(t);o.forEach(function(e){var t={type:m.Events.EVENT_COLUMN_GROUP_OPENED,columnGroup:e,api:r.gridApi,columnApi:r.columnApi};r.eventService.dispatchEvent(t)});this.columnAnimationService.finish()};e.prototype.setColumnGroupOpened=function(e,t,i){if(i===void 0){i="api"}var n;if(e instanceof y.OriginalColumnGroup){n=e.getId()}else{n=e}this.setColumnGroupState([{groupId:n,open:t}],i)};e.prototype.getOriginalColumnGroup=function(i){if(i instanceof y.OriginalColumnGroup){return i}if(typeof i!=="string"){console.error("ag-Grid: group key must be a string")}var n=null;this.columnUtils.depthFirstOriginalTreeSearch(this.gridBalancedTree,function(e){if(e instanceof y.OriginalColumnGroup){var t=e;if(t.getId()===i){n=t}}});return n};e.prototype.calculateColumnsForDisplay=function(){var n=this;var e;if(this.pivotMode&&!this.secondaryColumnsPresent){e=v.Utils.filter(this.gridColumns,function(e){var t=n.groupAutoColumns&&n.groupAutoColumns.indexOf(e)>=0;var i=n.valueColumns&&n.valueColumns.indexOf(e)>=0;return t||i})}else{e=v.Utils.filter(this.gridColumns,function(e){var t=n.groupAutoColumns&&n.groupAutoColumns.indexOf(e)>=0;return t||e.isVisible()})}return e};e.prototype.checkColSpanActiveInCols=function(e){var t=false;e.forEach(function(e){if(v.Utils.exists(e.getColDef().colSpan)){t=true}});return t};e.prototype.calculateColumnsForGroupDisplay=function(){var i=this;this.groupDisplayColumns=[];var e=function(e){var t=e.getColDef();if(t&&v.Utils.exists(t.showRowGroup)){i.groupDisplayColumns.push(e)}};this.gridColumns.forEach(e);if(this.groupAutoColumns){this.groupAutoColumns.forEach(e)}};e.prototype.getGroupDisplayColumns=function(){return this.groupDisplayColumns};e.prototype.updateDisplayedColumns=function(e){var t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t);this.calculateColumnsForGroupDisplay();this.updateGroupsAndDisplayedColumns(e);this.setFirstRightAndLastLeftPinned(e)};e.prototype.isSecondaryColumnsPresent=function(){return this.secondaryColumnsPresent};e.prototype.setSecondaryColumns=function(e,t){if(t===void 0){t="api"}var i=e&&e.length>0;if(!i&&!this.secondaryColumnsPresent){return}if(i){this.processSecondaryColumnDefinitions(e);var n=this.balancedColumnTreeBuilder.createBalancedColumnGroups(e,false);this.secondaryBalancedTree=n.balancedTree;this.secondaryHeaderRowCount=n.treeDept+1;this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree);this.secondaryColumnsPresent=true}else{this.secondaryBalancedTree=null;this.secondaryHeaderRowCount=-1;this.secondaryColumns=null;this.secondaryColumnsPresent=false}this.updateGridColumns();this.updateDisplayedColumns(t)};e.prototype.processSecondaryColumnDefinitions=function(e){var r=this.gridOptionsWrapper.getProcessSecondaryColDefFunc();var o=this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();if(!r&&!o){return}a(e);function a(e){e.forEach(function(e){var t=v.Utils.exists(e.children);if(t){var i=e;if(o){o(i)}a(i.children)}else{var n=e;if(r){r(n)}}})}};e.prototype.updateGridColumns=function(){if(this.gridColsArePrimary){this.lastPrimaryOrder=this.gridColumns}if(this.secondaryColumns){this.gridBalancedTree=this.secondaryBalancedTree.slice();this.gridHeaderRowCount=this.secondaryHeaderRowCount;this.gridColumns=this.secondaryColumns.slice();this.gridColsArePrimary=false}else{this.gridBalancedTree=this.primaryBalancedTree.slice();this.gridHeaderRowCount=this.primaryHeaderRowCount;this.gridColumns=this.primaryColumns.slice();this.gridColsArePrimary=true;this.orderGridColsLikeLastPrimary()}this.putFixedColumnsFirst();this.addAutoGroupToGridColumns();this.setupQuickFilterColumns();this.clearDisplayedColumns();this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns);var e={type:m.Events.EVENT_GRID_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)};e.prototype.orderGridColsLikeLastPrimary=function(){var r=this;if(v.Utils.missing(this.lastPrimaryOrder)){return}var t=false;this.gridColumns.forEach(function(e){if(r.lastPrimaryOrder.indexOf(e)<0){t=true}});if(t){return}this.gridColumns.sort(function(e,t){var i=r.lastPrimaryOrder.indexOf(e);var n=r.lastPrimaryOrder.indexOf(t);return i-n})};e.prototype.isPrimaryColumnGroupsPresent=function(){return this.primaryHeaderRowCount>1};e.prototype.setupQuickFilterColumns=function(){if(this.groupAutoColumns){this.columnsForQuickFilter=this.primaryColumns.concat(this.groupAutoColumns)}else{this.columnsForQuickFilter=this.primaryColumns}};e.prototype.putFixedColumnsFirst=function(){var e=this.gridColumns.filter(function(e){return e.isLockPosition()});var t=this.gridColumns.filter(function(e){return!e.isLockPosition()});this.gridColumns=e.concat(t)};e.prototype.addAutoGroupToGridColumns=function(){this.createGroupAutoColumnsIfNeeded();if(v.Utils.missing(this.groupAutoColumns)){return}this.gridColumns=this.groupAutoColumns.concat(this.gridColumns);var e=this.balancedColumnTreeBuilder.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.gridBalancedTree=e.concat(this.gridBalancedTree)};e.prototype.clearDisplayedColumns=function(){this.displayedLeftColumnTree=[];this.displayedRightColumnTree=[];this.displayedCentreColumnTree=[];this.displayedLeftHeaderRows={};this.displayedRightHeaderRows={};this.displayedCentreHeaderRows={};this.displayedLeftColumns=[];this.displayedRightColumns=[];this.displayedCenterColumns=[];this.allDisplayedColumns=[];this.allDisplayedVirtualColumns=[]};e.prototype.updateGroupsAndDisplayedColumns=function(e){this.updateOpenClosedVisibilityInColumnGroups();this.updateDisplayedColumnsFromTrees(e);this.updateVirtualSets();this.updateBodyWidths();var t={type:m.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)};e.prototype.updateDisplayedColumnsFromTrees=function(e){this.addToDisplayedColumns(this.displayedLeftColumnTree,this.displayedLeftColumns);this.addToDisplayedColumns(this.displayedCentreColumnTree,this.displayedCenterColumns);this.addToDisplayedColumns(this.displayedRightColumnTree,this.displayedRightColumns);this.setupAllDisplayedColumns();this.setLeftValues(e)};e.prototype.setupAllDisplayedColumns=function(){if(this.gridOptionsWrapper.isEnableRtl()){this.allDisplayedColumns=this.displayedRightColumns.concat(this.displayedCenterColumns).concat(this.displayedLeftColumns)}else{this.allDisplayedColumns=this.displayedLeftColumns.concat(this.displayedCenterColumns).concat(this.displayedRightColumns)}};e.prototype.setLeftValues=function(e){this.setLeftValuesOfColumns(e);this.setLeftValuesOfGroups()};e.prototype.setLeftValuesOfColumns=function(n){var r=this;var o=this.primaryColumns.slice(0);var a=this.gridOptionsWrapper.isEnableRtl();[this.displayedLeftColumns,this.displayedRightColumns,this.displayedCenterColumns].forEach(function(e){if(a){var t=r.getWidthOfColsInList(e);e.forEach(function(e){t-=e.getActualWidth();e.setLeft(t,n)})}else{var i=0;e.forEach(function(e){e.setLeft(i,n);i+=e.getActualWidth()})}v.Utils.removeAllFromArray(o,e)});o.forEach(function(e){e.setLeft(null,n)})};e.prototype.setLeftValuesOfGroups=function(){[this.displayedLeftColumnTree,this.displayedRightColumnTree,this.displayedCentreColumnTree].forEach(function(e){e.forEach(function(e){if(e instanceof s.ColumnGroup){var t=e;t.checkLeft()}})})};e.prototype.addToDisplayedColumns=function(e,t){t.length=0;this.columnUtils.depthFirstDisplayedColumnTreeSearch(e,function(e){if(e instanceof c.Column){t.push(e)}})};e.prototype.updateDisplayedCenterVirtualColumns=function(){if(this.suppressColumnVirtualisation){this.allDisplayedCenterVirtualColumns=this.displayedCenterColumns}else{this.allDisplayedCenterVirtualColumns=this.filterOutColumnsWithinViewport()}this.allDisplayedVirtualColumns=this.allDisplayedCenterVirtualColumns.concat(this.displayedLeftColumns).concat(this.displayedRightColumns);var t={};this.allDisplayedVirtualColumns.forEach(function(e){t[e.getId()]=true});return t};e.prototype.getVirtualHeaderGroupRow=function(e,t){var i;switch(e){case c.Column.PINNED_LEFT:i=this.displayedLeftHeaderRows[t];break;case c.Column.PINNED_RIGHT:i=this.displayedRightHeaderRows[t];break;default:i=this.displayedCentreHeaderRows[t];break}if(v.Utils.missing(i)){i=[]}return i};e.prototype.updateDisplayedVirtualGroups=function(l){this.displayedLeftHeaderRows={};this.displayedRightHeaderRows={};this.displayedCentreHeaderRows={};u(this.displayedLeftColumnTree,this.displayedLeftHeaderRows,0);u(this.displayedRightColumnTree,this.displayedRightHeaderRows,0);u(this.displayedCentreColumnTree,this.displayedCentreHeaderRows,0);function u(e,t,i){var n=false;for(var r=0;r<e.length;r++){var o=e[r];var a=void 0;if(o instanceof c.Column){a=l[o.getId()]===true}else{var s=o;a=u(s.getDisplayedChildren(),t,i+1)}if(a){n=true;if(!t[i]){t[i]=[]}t[i].push(o)}}return n}};e.prototype.updateVirtualSets=function(){var e=this.updateDisplayedCenterVirtualColumns();this.updateDisplayedVirtualGroups(e)};e.prototype.filterOutColumnsWithinViewport=function(){return v.Utils.filter(this.displayedCenterColumns,this.isColumnInViewport.bind(this))};e.prototype.sizeColumnsToFit=function(e,t){var i=this;if(t===void 0){t="api"}var n=this.getAllDisplayedColumns();if(e<=0||n.length===0){return}var r=v.Utils.filter(n,function(e){return e.getColDef().suppressSizeToFit===true});var o=v.Utils.filter(n,function(e){return e.getColDef().suppressSizeToFit!==true});var a=o.slice(0);var s=false;while(!s){s=true;var l=e-this.getWidthOfColsInList(r);if(l<=0){o.forEach(function(e){e.setMinimum(t)})}else{var u=l/this.getWidthOfColsInList(o);var c=l;for(var d=o.length-1;d>=0;d--){var f=o[d];var p=Math.round(f.getActualWidth()*u);if(p<f.getMinWidth()){f.setMinimum(t);g(f);s=false}else if(f.isGreaterThanMax(p)){f.setActualWidth(f.getMaxWidth(),t);g(f);s=false}else{var h=d===0;if(h){f.setActualWidth(c,t)}else{f.setActualWidth(p,t)}}c-=p}}}this.setLeftValues(t);this.updateBodyWidths();a.forEach(function(e){var t={type:m.Events.EVENT_COLUMN_RESIZED,column:e,columns:[e],finished:true,api:i.gridApi,columnApi:i.columnApi,source:"sizeColumnsToFit"};i.eventService.dispatchEvent(t)});function g(e){v.Utils.removeFromArray(o,e);r.push(e)}};e.prototype.buildDisplayedTrees=function(e){var t=v.Utils.filter(e,function(e){return e.getPinned()==="left"});var i=v.Utils.filter(e,function(e){return e.getPinned()==="right"});var n=v.Utils.filter(e,function(e){return e.getPinned()!=="left"&&e.getPinned()!=="right"});var r=new b.GroupInstanceIdCreator;this.displayedLeftColumnTree=this.displayedGroupCreator.createDisplayedGroups(t,this.gridBalancedTree,r,this.displayedLeftColumnTree);this.displayedRightColumnTree=this.displayedGroupCreator.createDisplayedGroups(i,this.gridBalancedTree,r,this.displayedRightColumnTree);this.displayedCentreColumnTree=this.displayedGroupCreator.createDisplayedGroups(n,this.gridBalancedTree,r,this.displayedCentreColumnTree)};e.prototype.updateOpenClosedVisibilityInColumnGroups=function(){var e=this.getAllDisplayedColumnGroups();this.columnUtils.depthFirstAllColumnTreeSearch(e,function(e){if(e instanceof s.ColumnGroup){var t=e;t.calculateDisplayedColumns()}})};e.prototype.getGroupAutoColumns=function(){return this.groupAutoColumns};e.prototype.createGroupAutoColumnsIfNeeded=function(){if(!this.autoGroupsNeedBuilding){return}this.autoGroupsNeedBuilding=false;var e=(this.rowGroupColumns.length>0||this.usingTreeData)&&!this.gridOptionsWrapper.isGroupSuppressAutoColumn()&&!this.gridOptionsWrapper.isGroupUseEntireRow()&&!this.gridOptionsWrapper.isGroupSuppressRow();if(e){this.groupAutoColumns=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns)}else{this.groupAutoColumns=null}};e.prototype.createValueColumns=function(t){this.valueColumns.forEach(function(e){return e.setValueActive(false,t)});this.valueColumns=[];for(var e=0;e<this.primaryColumns.length;e++){var i=this.primaryColumns[e];if(i.getColDef().aggFunc){i.setAggFunc(i.getColDef().aggFunc);this.valueColumns.push(i);i.setValueActive(true,t)}}};e.prototype.getWidthOfColsInList=function(e){var t=0;for(var i=0;i<e.length;i++){t+=e[i].getActualWidth()}return t};e.prototype.getGridBalancedTree=function(){return this.gridBalancedTree};n([_.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([_.Autowired("expressionService"),r("design:type",l.ExpressionService)],e.prototype,"expressionService",void 0);n([_.Autowired("balancedColumnTreeBuilder"),r("design:type",u.BalancedColumnTreeBuilder)],e.prototype,"balancedColumnTreeBuilder",void 0);n([_.Autowired("displayedGroupCreator"),r("design:type",d.DisplayedGroupCreator)],e.prototype,"displayedGroupCreator",void 0);n([_.Autowired("autoWidthCalculator"),r("design:type",f.AutoWidthCalculator)],e.prototype,"autoWidthCalculator",void 0);n([_.Autowired("eventService"),r("design:type",p.EventService)],e.prototype,"eventService",void 0);n([_.Autowired("columnUtils"),r("design:type",h.ColumnUtils)],e.prototype,"columnUtils",void 0);n([_.Autowired("context"),r("design:type",_.Context)],e.prototype,"context",void 0);n([_.Autowired("columnAnimationService"),r("design:type",w.ColumnAnimationService)],e.prototype,"columnAnimationService",void 0);n([_.Autowired("autoGroupColService"),r("design:type",C.AutoGroupColService)],e.prototype,"autoGroupColService",void 0);n([_.Optional("aggFuncService"),r("design:type",Object)],e.prototype,"aggFuncService",void 0);n([_.Optional("valueCache"),r("design:type",A.ValueCache)],e.prototype,"valueCache",void 0);n([_.Autowired("columnApi"),r("design:type",x.ColumnApi)],e.prototype,"columnApi",void 0);n([_.Autowired("gridApi"),r("design:type",E.GridApi)],e.prototype,"gridApi",void 0);n([_.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);n([o(0,_.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[g.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);e=n([_.Bean("columnController")],e);return e}();t.ColumnController=T},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(25);t.Events=n.Events},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(47);var a=i(20);var s=i(18);var l=i(4);var u=i(17);var c=i(2);var d=i(16);var f=i(3);var p=i(9);var h=i(0);var g=i(42);var v=i(24);var m=i(22);var y=i(23);var b=i(1);var _=i(55);var w=i(54);var C=i(29);var A=i(105);var E=i(33);var x=i(58);var T=i(30);var S=i(37);var D=function(){function e(){this.detailGridInfoMap={}}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.registerHeaderRootComp=function(e){this.headerRootComp=e};e.prototype.init=function(){switch(this.rowModel.getType()){case p.Constants.ROW_MODEL_TYPE_CLIENT_SIDE:this.clientSideRowModel=this.rowModel;break;case p.Constants.ROW_MODEL_TYPE_INFINITE:this.infinitePageRowModel=this.rowModel;break;case p.Constants.ROW_MODEL_TYPE_SERVER_SIDE:this.serverSideRowModel=this.rowModel;break}};e.prototype.__getAlignedGridService=function(){return this.alignedGridsService};e.prototype.addDetailGridInfo=function(e,t){this.detailGridInfoMap[e]=t};e.prototype.removeDetailGridInfo=function(e){this.detailGridInfoMap[e]=undefined};e.prototype.getDetailGridInfo=function(e){return this.detailGridInfoMap[e]};e.prototype.forEachDetailGridInfo=function(i){var n=0;b.Utils.iterateObject(this.detailGridInfoMap,function(e,t){if(b.Utils.exists(t)){i(t,n);n++}})};e.prototype.getDataAsCsv=function(e){return this.csvCreator.getDataAsCsv(e)};e.prototype.exportDataAsCsv=function(e){this.csvCreator.exportDataAsCsv(e)};e.prototype.getDataAsExcel=function(e){if(!this.excelCreator){console.warn("ag-Grid: Excel export is only available in ag-Grid Enterprise")}return this.excelCreator.getDataAsExcelXml(e)};e.prototype.exportDataAsExcel=function(e){if(!this.excelCreator){console.warn("ag-Grid: Excel export is only available in ag-Grid Enterprise")}this.excelCreator.exportDataAsExcel(e)};e.prototype.setEnterpriseDatasource=function(e){console.warn("ag-grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()");this.setServerSideDatasource(e)};e.prototype.setServerSideDatasource=function(e){if(this.gridOptionsWrapper.isRowModelServerSide()){this.rowModel.setDatasource(e)}else{console.warn("ag-Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '"+p.Constants.ROW_MODEL_TYPE_SERVER_SIDE+"'")}};e.prototype.setDatasource=function(e){if(this.gridOptionsWrapper.isRowModelInfinite()){this.rowModel.setDatasource(e)}else{console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '"+p.Constants.ROW_MODEL_TYPE_INFINITE+"'")}};e.prototype.setViewportDatasource=function(e){if(this.gridOptionsWrapper.isRowModelViewport()){this.rowModel.setViewportDatasource(e)}else{console.warn("ag-Grid: you can only use a viewport datasource when gridOptions.rowModelType is '"+p.Constants.ROW_MODEL_TYPE_VIEWPORT+"'")}};e.prototype.setRowData=function(e){if(this.gridOptionsWrapper.isRowModelDefault()){if(this.gridOptionsWrapper.isDeltaRowDataMode()){var t=this.immutableService.createTransactionForRowData(e),i=t[0],n=t[1];this.clientSideRowModel.updateRowData(i,n)}else{this.selectionController.reset();this.clientSideRowModel.setRowData(e)}}else{console.log("cannot call setRowData unless using normal row model")}};e.prototype.setFloatingTopRowData=function(e){console.warn("ag-Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()");this.setPinnedTopRowData(e)};e.prototype.setFloatingBottomRowData=function(e){console.warn("ag-Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()");this.setPinnedBottomRowData(e)};e.prototype.getFloatingTopRowCount=function(){console.warn("ag-Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()");return this.getPinnedTopRowCount()};e.prototype.getFloatingBottomRowCount=function(){console.warn("ag-Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()");return this.getPinnedBottomRowCount()};e.prototype.getFloatingTopRow=function(e){console.warn("ag-Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()");return this.getPinnedTopRow(e)};e.prototype.getFloatingBottomRow=function(e){console.warn("ag-Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()");return this.getPinnedBottomRow(e)};e.prototype.setPinnedTopRowData=function(e){this.pinnedRowModel.setPinnedTopRowData(e)};e.prototype.setPinnedBottomRowData=function(e){this.pinnedRowModel.setPinnedBottomRowData(e)};e.prototype.getPinnedTopRowCount=function(){return this.pinnedRowModel.getPinnedTopRowCount()};e.prototype.getPinnedBottomRowCount=function(){return this.pinnedRowModel.getPinnedBottomRowCount()};e.prototype.getPinnedTopRow=function(e){return this.pinnedRowModel.getPinnedTopRow(e)};e.prototype.getPinnedBottomRow=function(e){return this.pinnedRowModel.getPinnedBottomRow(e)};e.prototype.setColumnDefs=function(e,t){if(t===void 0){t="api"}this.columnController.setColumnDefs(e,t)};e.prototype.expireValueCache=function(){this.valueCache.expire()};e.prototype.getVerticalPixelRange=function(){return this.gridPanel.getVScrollPosition()};e.prototype.refreshToolPanel=function(){if(this.toolPanelComp){this.toolPanelComp.refresh()}};e.prototype.refreshCells=function(e){if(e===void 0){e={}}if(Array.isArray(e)){console.warn("since ag-Grid v11.1, refreshCells() now takes parameters, please see the documentation.");return}this.rowRenderer.refreshCells(e)};e.prototype.flashCells=function(e){if(e===void 0){e={}}this.rowRenderer.flashCells(e)};e.prototype.redrawRows=function(e){if(e===void 0){e={}}if(e&&e.rowNodes){this.rowRenderer.redrawRows(e.rowNodes)}else{this.rowRenderer.redrawAfterModelUpdate()}};e.prototype.timeFullRedraw=function(o){if(o===void 0){o=1}var a=0;var s=0;var l=0;var e=this;u();function u(){var n=(new Date).getTime();e.rowRenderer.redrawAfterModelUpdate();var r=(new Date).getTime();setTimeout(function(){var e=(new Date).getTime();var t=r-n;var i=e-r;console.log("duration:  processing = "+t+"ms, reflow = "+i+"ms");a++;s+=t;l+=i;if(a<o){setTimeout(u,1e3)}else{c()}},0)}function c(){console.log("tests complete. iteration count = "+a);console.log("average processing = "+s/a+"ms");console.log("average reflow = "+l/a+"ms")}};e.prototype.refreshView=function(){console.warn("ag-Grid: since v11.1, refreshView() is deprecated, please call refreshCells() or redrawRows() instead");this.redrawRows()};e.prototype.refreshRows=function(e){console.warn("since ag-Grid v11.1, refreshRows() is deprecated, please use refreshCells({rowNodes: rows}) or redrawRows({rowNodes: rows}) instead");this.refreshCells({rowNodes:e})};e.prototype.rowDataChanged=function(e){console.log("ag-Grid: rowDataChanged is deprecated, either call refreshView() to refresh everything, or call rowNode.setRowData(newData) to set value on a particular node");this.redrawRows()};e.prototype.softRefreshView=function(){console.error("ag-Grid: since v16, softRefreshView() is no longer supported. Please check the documentation on how to refresh.")};e.prototype.refreshGroupRows=function(){console.warn("ag-Grid: since v11.1, refreshGroupRows() is no longer supported, call refreshCells() instead. "+"Because refreshCells() now does dirty checking, it will only refresh cells that have changed, so it should "+"not be necessary to only refresh the group rows.");this.refreshCells()};e.prototype.setFunctionsReadOnly=function(e){this.gridOptionsWrapper.setProperty("functionsReadOnly",e)};e.prototype.refreshHeader=function(){this.headerRootComp.refreshHeader();this.gridPanel.setBodyAndHeaderHeights()};e.prototype.isAnyFilterPresent=function(){return this.filterManager.isAnyFilterPresent()};e.prototype.isAdvancedFilterPresent=function(){return this.filterManager.isAdvancedFilterPresent()};e.prototype.isQuickFilterPresent=function(){return this.filterManager.isQuickFilterPresent()};e.prototype.getModel=function(){return this.rowModel};e.prototype.onGroupExpandedOrCollapsed=function(e){if(b.Utils.missing(this.clientSideRowModel)){console.log("ag-Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model")}if(b.Utils.exists(e)){console.log("ag-Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows")}this.clientSideRowModel.refreshModel({step:p.Constants.STEP_MAP})};e.prototype.refreshInMemoryRowModel=function(e){console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()");this.refreshClientSideRowModel(e)};e.prototype.refreshClientSideRowModel=function(e){if(b.Utils.missing(this.clientSideRowModel)){console.log("cannot call refreshClientSideRowModel unless using normal row model")}var t=p.Constants.STEP_EVERYTHING;var i={group:p.Constants.STEP_EVERYTHING,filter:p.Constants.STEP_FILTER,map:p.Constants.STEP_MAP,aggregate:p.Constants.STEP_AGGREGATE,sort:p.Constants.STEP_SORT,pivot:p.Constants.STEP_PIVOT};if(b.Utils.exists(e)){t=i[e]}if(b.Utils.missing(t)){console.error("ag-Grid: invalid step "+e+", available steps are "+Object.keys(i).join(", "));return}var n={step:t,keepRenderedRows:true,animate:true,keepEditingRows:true};this.clientSideRowModel.refreshModel(n)};e.prototype.isAnimationFrameQueueEmpty=function(){return this.animationFrameService.isQueueEmpty()};e.prototype.getRowNode=function(e){return this.rowModel.getRowNode(e)};e.prototype.expandAll=function(){if(b.Utils.missing(this.clientSideRowModel)){console.warn("ag-Grid: cannot call expandAll unless using normal row model");return}this.clientSideRowModel.expandOrCollapseAll(true)};e.prototype.collapseAll=function(){if(b.Utils.missing(this.clientSideRowModel)){console.warn("ag-Grid: cannot call collapseAll unless using normal row model");return}this.clientSideRowModel.expandOrCollapseAll(false)};e.prototype.addVirtualRowListener=function(e,t,i){if(typeof e!=="string"){console.log("ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.")}this.addRenderedRowListener(e,t,i)};e.prototype.addRenderedRowListener=function(e,t,i){if(e==="virtualRowSelected"){console.log("ag-Grid: event virtualRowSelected is deprecated, to register for individual row "+"selection events, add a listener directly to the row node.")}this.rowRenderer.addRenderedRowListener(e,t,i)};e.prototype.setQuickFilter=function(e){this.filterManager.setQuickFilter(e)};e.prototype.selectIndex=function(e,t,i){console.log("ag-Grid: do not use api for selection, call node.setSelected(value) instead");if(i){console.log("ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it")}this.selectionController.selectIndex(e,t)};e.prototype.deselectIndex=function(e,t){if(t===void 0){t=false}console.log("ag-Grid: do not use api for selection, call node.setSelected(value) instead");if(t){console.log("ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it")}this.selectionController.deselectIndex(e)};e.prototype.selectNode=function(e,t,i){if(t===void 0){t=false}if(i===void 0){i=false}console.log("ag-Grid: API for selection is deprecated, call node.setSelected(value) instead");if(i){console.log("ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it")}e.setSelectedParams({newValue:true,clearSelection:!t})};e.prototype.deselectNode=function(e,t){if(t===void 0){t=false}console.log("ag-Grid: API for selection is deprecated, call node.setSelected(value) instead");if(t){console.log("ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it")}e.setSelectedParams({newValue:false})};e.prototype.selectAll=function(){this.selectionController.selectAllRowNodes()};e.prototype.deselectAll=function(){this.selectionController.deselectAllRowNodes()};e.prototype.selectAllFiltered=function(){this.selectionController.selectAllRowNodes(true)};e.prototype.deselectAllFiltered=function(){this.selectionController.deselectAllRowNodes(true)};e.prototype.recomputeAggregates=function(){if(b.Utils.missing(this.clientSideRowModel)){console.warn("cannot call recomputeAggregates unless using normal row model")}console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead");this.clientSideRowModel.refreshModel({step:p.Constants.STEP_AGGREGATE})};e.prototype.sizeColumnsToFit=function(){this.gridPanel.sizeColumnsToFit()};e.prototype.showLoadingOverlay=function(){this.gridPanel.showLoadingOverlay()};e.prototype.showNoRowsOverlay=function(){this.gridPanel.showNoRowsOverlay()};e.prototype.hideOverlay=function(){this.gridPanel.hideOverlay()};e.prototype.isNodeSelected=function(e){console.log("ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead");return e.isSelected()};e.prototype.getSelectedNodesById=function(){console.error("ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead");return null};e.prototype.getSelectedNodes=function(){return this.selectionController.getSelectedNodes()};e.prototype.getSelectedRows=function(){return this.selectionController.getSelectedRows()};e.prototype.getBestCostNodeSelection=function(){return this.selectionController.getBestCostNodeSelection()};e.prototype.getRenderedNodes=function(){return this.rowRenderer.getRenderedNodes()};e.prototype.ensureColIndexVisible=function(e){console.warn("ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.")};e.prototype.ensureColumnVisible=function(e){this.gridPanel.ensureColumnVisible(e)};e.prototype.ensureIndexVisible=function(e,t){this.gridPanel.ensureIndexVisible(e,t)};e.prototype.ensureNodeVisible=function(e,t){this.gridCore.ensureNodeVisible(e,t)};e.prototype.forEachLeafNode=function(e){if(b.Utils.missing(this.clientSideRowModel)){console.log("cannot call forEachNode unless using normal row model")}this.clientSideRowModel.forEachLeafNode(e)};e.prototype.forEachNode=function(e){this.rowModel.forEachNode(e)};e.prototype.forEachNodeAfterFilter=function(e){if(b.Utils.missing(this.clientSideRowModel)){console.log("cannot call forEachNodeAfterFilter unless using normal row model")}this.clientSideRowModel.forEachNodeAfterFilter(e)};e.prototype.forEachNodeAfterFilterAndSort=function(e){if(b.Utils.missing(this.clientSideRowModel)){console.log("cannot call forEachNodeAfterFilterAndSort unless using normal row model")}this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)};e.prototype.getFilterApiForColDef=function(e){console.warn("ag-grid API method getFilterApiForColDef deprecated, use getFilterApi instead");return this.getFilterInstance(e)};e.prototype.getFilterInstance=function(e){var t=this.columnController.getPrimaryColumn(e);if(t){return this.filterManager.getFilterComponent(t).resolveNow(null,function(e){return e})}};e.prototype.getFilterApi=function(e){console.warn("ag-Grid: getFilterApi is deprecated, use getFilterInstance instead");return this.getFilterInstance(e)};e.prototype.destroyFilter=function(e){var t=this.columnController.getPrimaryColumn(e);if(t){return this.filterManager.destroyFilter(t,"filterDestroyed")}};e.prototype.getColumnDef=function(e){var t=this.columnController.getPrimaryColumn(e);if(t){return t.getColDef()}else{return null}};e.prototype.onFilterChanged=function(){this.filterManager.onFilterChanged()};e.prototype.onSortChanged=function(){this.sortController.onSortChanged()};e.prototype.setSortModel=function(e,t){if(t===void 0){t="api"}this.sortController.setSortModel(e,t)};e.prototype.getSortModel=function(){return this.sortController.getSortModel()};e.prototype.setFilterModel=function(e){this.filterManager.setFilterModel(e)};e.prototype.getFilterModel=function(){return this.filterManager.getFilterModel()};e.prototype.getFocusedCell=function(){return this.focusedCellController.getFocusedCell()};e.prototype.clearFocusedCell=function(){return this.focusedCellController.clearFocusedCell()};e.prototype.setFocusedCell=function(e,t,i){this.focusedCellController.setFocusedCell(e,t,i,true)};e.prototype.setSuppressRowDrag=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG,e)};e.prototype.setHeaderHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_HEADER_HEIGHT,e);this.doLayout()};e.prototype.setGridAutoHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_GRID_AUTO_HEIGHT,e)};e.prototype.getPreferredWidth=function(){return this.gridCore.getPreferredWidth()};e.prototype.setGroupHeaderHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT,e);this.doLayout()};e.prototype.setFloatingFiltersHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT,e);this.doLayout()};e.prototype.setPivotGroupHeaderHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT,e);this.doLayout()};e.prototype.setPivotHeaderHeight=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT,e);this.doLayout()};e.prototype.showToolPanel=function(e){this.gridCore.showToolPanel(e)};e.prototype.setSuppressClipboardPaste=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_SUPPRESS_CLIPBOARD_PASTE,e)};e.prototype.isToolPanelShowing=function(){return this.gridCore.isToolPanelShowing()};e.prototype.doLayout=function(){this.gridPanel.checkViewportAndScrolls()};e.prototype.resetRowHeights=function(){if(b.Utils.exists(this.clientSideRowModel)){this.clientSideRowModel.resetRowHeights()}};e.prototype.setGroupRemoveSingleChildren=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,e)};e.prototype.setGroupRemoveLowestSingleChildren=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,e)};e.prototype.onRowHeightChanged=function(){if(b.Utils.exists(this.clientSideRowModel)){this.clientSideRowModel.onRowHeightChanged()}};e.prototype.getValue=function(e,t){var i=this.columnController.getPrimaryColumn(e);if(b.Utils.missing(i)){i=this.columnController.getGridColumn(e)}if(b.Utils.missing(i)){return null}else{return this.valueService.getValue(i,t)}};e.prototype.addEventListener=function(e,t){var i=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addEventListener(e,t,i)};e.prototype.addGlobalListener=function(e){var t=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addGlobalListener(e,t)};e.prototype.removeEventListener=function(e,t){var i=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeEventListener(e,t,i)};e.prototype.removeGlobalListener=function(e){var t=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeGlobalListener(e,t)};e.prototype.dispatchEvent=function(e){this.eventService.dispatchEvent(e)};e.prototype.destroy=function(){this.context.destroy()};e.prototype.resetQuickFilter=function(){this.rowModel.forEachNode(function(e){return e.quickFilterAggregateText=null})};e.prototype.getRangeSelections=function(){if(this.rangeController){return this.rangeController.getCellRanges()}else{console.warn("ag-Grid: cell range selection is only available in ag-Grid Enterprise");return null}};e.prototype.camelCaseToHumanReadable=function(e){return b.Utils.camelCaseToHumanText(e)};e.prototype.addRangeSelection=function(e){if(!this.rangeController){console.warn("ag-Grid: cell range selection is only available in ag-Grid Enterprise")}this.rangeController.addRange(e)};e.prototype.clearRangeSelection=function(){if(!this.rangeController){console.warn("ag-Grid: cell range selection is only available in ag-Grid Enterprise")}this.rangeController.clearSelection()};e.prototype.copySelectedRowsToClipboard=function(e,t){if(!this.clipboardService){console.warn("ag-Grid: clipboard is only available in ag-Grid Enterprise")}this.clipboardService.copySelectedRowsToClipboard(e,t)};e.prototype.copySelectedRangeToClipboard=function(e){if(!this.clipboardService){console.warn("ag-Grid: clipboard is only available in ag-Grid Enterprise")}this.clipboardService.copySelectedRangeToClipboard(e)};e.prototype.copySelectedRangeDown=function(){if(!this.clipboardService){console.warn("ag-Grid: clipboard is only available in ag-Grid Enterprise")}this.clipboardService.copyRangeDown()};e.prototype.showColumnMenuAfterButtonClick=function(e,t){var i=this.columnController.getPrimaryColumn(e);this.menuFactory.showMenuAfterButtonClick(i,t)};e.prototype.showColumnMenuAfterMouseClick=function(e,t){var i=this.columnController.getPrimaryColumn(e);this.menuFactory.showMenuAfterMouseEvent(i,t)};e.prototype.hidePopupMenu=function(){if(this.contextMenuFactory){this.contextMenuFactory.hideActiveMenu()}this.menuFactory.hideActiveMenu()};e.prototype.setPopupParent=function(e){this.gridOptionsWrapper.setProperty(c.GridOptionsWrapper.PROP_POPUP_PARENT,e)};e.prototype.tabToNextCell=function(){return this.rowRenderer.tabToNextCell(false)};e.prototype.tabToPreviousCell=function(){return this.rowRenderer.tabToNextCell(true)};e.prototype.getCellRendererInstances=function(e){if(e===void 0){e={}}return this.rowRenderer.getCellRendererInstances(e)};e.prototype.getCellEditorInstances=function(e){if(e===void 0){e={}}return this.rowRenderer.getCellEditorInstances(e)};e.prototype.getEditingCells=function(){return this.rowRenderer.getEditingCells()};e.prototype.stopEditing=function(e){if(e===void 0){e=false}this.rowRenderer.stopEditing(e)};e.prototype.startEditingCell=function(e){var t=this.columnController.getGridColumn(e.colKey);if(!t){console.warn("ag-Grid: no column found for "+e.colKey);return}var i={rowIndex:e.rowIndex,floating:e.rowPinned,column:t};var n=new y.GridCell(i);var r=b.Utils.missing(e.rowPinned);if(r){this.gridPanel.ensureIndexVisible(e.rowIndex)}this.rowRenderer.startEditingCell(n,e.keyPress,e.charPress)};e.prototype.addAggFunc=function(e,t){if(this.aggFuncService){this.aggFuncService.addAggFunc(e,t)}};e.prototype.addAggFuncs=function(e){if(this.aggFuncService){this.aggFuncService.addAggFuncs(e)}};e.prototype.clearAggFuncs=function(){if(this.aggFuncService){this.aggFuncService.clear()}};e.prototype.updateRowData=function(e){var t=null;if(this.clientSideRowModel){t=this.clientSideRowModel.updateRowData(e)}else if(this.infinitePageRowModel){this.infinitePageRowModel.updateRowData(e)}else{console.error("ag-Grid: updateRowData() only works with ClientSideRowModel and InfiniteRowModel.")}if(!this.gridOptionsWrapper.isSuppressChangeDetection()){this.rowRenderer.refreshCells()}return t};e.prototype.batchUpdateRowData=function(e,t){if(!this.clientSideRowModel){console.error("ag-Grid: api.batchUpdateRowData() only works with ClientSideRowModel.");return}this.clientSideRowModel.batchUpdateRowData(e,t)};e.prototype.insertItemsAtIndex=function(e,t,i){if(i===void 0){i=false}console.warn("ag-Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead.");this.updateRowData({add:t,addIndex:e,update:null,remove:null})};e.prototype.removeItems=function(e,t){if(t===void 0){t=false}console.warn("ag-Grid: removeItems() is deprecated, use updateRowData(transaction) instead.");var i=e.map(function(e){return e.data});this.updateRowData({add:null,addIndex:null,update:null,remove:i})};e.prototype.addItems=function(e,t){if(t===void 0){t=false}console.warn("ag-Grid: addItems() is deprecated, use updateRowData(transaction) instead.");this.updateRowData({add:e,addIndex:null,update:null,remove:null})};e.prototype.refreshVirtualPageCache=function(){console.warn("ag-Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead");this.refreshInfiniteCache()};e.prototype.refreshInfinitePageCache=function(){console.warn("ag-Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead");this.refreshInfiniteCache()};e.prototype.refreshInfiniteCache=function(){if(this.infinitePageRowModel){this.infinitePageRowModel.refreshCache()}else{console.warn("ag-Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.")}};e.prototype.purgeVirtualPageCache=function(){console.warn("ag-Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead");this.purgeInfinitePageCache()};e.prototype.purgeInfinitePageCache=function(){console.warn("ag-Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead");this.purgeInfiniteCache()};e.prototype.purgeInfiniteCache=function(){if(this.infinitePageRowModel){this.infinitePageRowModel.purgeCache()}else{console.warn("ag-Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.")}};e.prototype.purgeEnterpriseCache=function(e){console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()");this.purgeServerSideCache(e)};e.prototype.purgeServerSideCache=function(e){if(this.serverSideRowModel){this.serverSideRowModel.purgeCache(e)}else{console.warn("ag-Grid: api.purgeServerSideCache is only available when rowModelType='enterprise'.")}};e.prototype.getVirtualRowCount=function(){console.warn("ag-Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead");return this.getInfiniteRowCount()};e.prototype.getInfiniteRowCount=function(){if(this.infinitePageRowModel){return this.infinitePageRowModel.getVirtualRowCount()}else{console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.")}};e.prototype.isMaxRowFound=function(){if(this.infinitePageRowModel){return this.infinitePageRowModel.isMaxRowFound()}else{console.warn("ag-Grid: api.isMaxRowFound is only available when rowModelType='virtual'.")}};e.prototype.setVirtualRowCount=function(e,t){console.warn("ag-Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead");this.setInfiniteRowCount(e,t)};e.prototype.setInfiniteRowCount=function(e,t){if(this.infinitePageRowModel){this.infinitePageRowModel.setVirtualRowCount(e,t)}else{console.warn("ag-Grid: api.setVirtualRowCount is only available when rowModelType='virtual'.")}};e.prototype.getVirtualPageState=function(){console.warn("ag-Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead");return this.getCacheBlockState()};e.prototype.getInfinitePageState=function(){console.warn("ag-Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead");return this.getCacheBlockState()};e.prototype.getCacheBlockState=function(){if(this.infinitePageRowModel){return this.infinitePageRowModel.getBlockState()}else if(this.serverSideRowModel){return this.serverSideRowModel.getBlockState()}else{console.warn("ag-Grid: api.getCacheBlockState() is only available when rowModelType='infinite' or rowModelType='serverSide'.")}};e.prototype.checkGridSize=function(){this.gridPanel.setBodyAndHeaderHeights()};e.prototype.getFirstRenderedRow=function(){console.log("in ag-Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()");return this.getFirstDisplayedRow()};e.prototype.getFirstDisplayedRow=function(){return this.rowRenderer.getFirstVirtualRenderedRow()};e.prototype.getLastRenderedRow=function(){console.log("in ag-Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()");return this.getLastDisplayedRow()};e.prototype.getLastDisplayedRow=function(){return this.rowRenderer.getLastVirtualRenderedRow()};e.prototype.getDisplayedRowAtIndex=function(e){return this.rowModel.getRow(e)};e.prototype.getDisplayedRowCount=function(){return this.rowModel.getRowCount()};e.prototype.paginationIsLastPageFound=function(){return this.paginationProxy.isLastPageFound()};e.prototype.paginationGetPageSize=function(){return this.paginationProxy.getPageSize()};e.prototype.paginationSetPageSize=function(e){this.gridOptionsWrapper.setProperty("paginationPageSize",e)};e.prototype.paginationGetCurrentPage=function(){return this.paginationProxy.getCurrentPage()};e.prototype.paginationGetTotalPages=function(){return this.paginationProxy.getTotalPages()};e.prototype.paginationGetRowCount=function(){return this.paginationProxy.getTotalRowCount()};e.prototype.paginationGoToNextPage=function(){this.paginationProxy.goToNextPage()};e.prototype.paginationGoToPreviousPage=function(){this.paginationProxy.goToPreviousPage()};e.prototype.paginationGoToFirstPage=function(){this.paginationProxy.goToFirstPage()};e.prototype.paginationGoToLastPage=function(){this.paginationProxy.goToLastPage()};e.prototype.paginationGoToPage=function(e){this.paginationProxy.goToPage(e)};n([h.Autowired("immutableService"),r("design:type",A.ImmutableService)],e.prototype,"immutableService",void 0);n([h.Autowired("csvCreator"),r("design:type",o.CsvCreator)],e.prototype,"csvCreator",void 0);n([h.Optional("excelCreator"),r("design:type",Object)],e.prototype,"excelCreator",void 0);n([h.Autowired("gridCore"),r("design:type",g.GridCore)],e.prototype,"gridCore",void 0);n([h.Autowired("rowRenderer"),r("design:type",a.RowRenderer)],e.prototype,"rowRenderer",void 0);n([h.Autowired("filterManager"),r("design:type",s.FilterManager)],e.prototype,"filterManager",void 0);n([h.Autowired("columnController"),r("design:type",l.ColumnController)],e.prototype,"columnController",void 0);n([h.Autowired("selectionController"),r("design:type",u.SelectionController)],e.prototype,"selectionController",void 0);n([h.Autowired("gridOptionsWrapper"),r("design:type",c.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([h.Autowired("valueService"),r("design:type",d.ValueService)],e.prototype,"valueService",void 0);n([h.Autowired("alignedGridsService"),r("design:type",x.AlignedGridsService)],e.prototype,"alignedGridsService",void 0);n([h.Autowired("eventService"),r("design:type",f.EventService)],e.prototype,"eventService",void 0);n([h.Autowired("pinnedRowModel"),r("design:type",T.PinnedRowModel)],e.prototype,"pinnedRowModel",void 0);n([h.Autowired("context"),r("design:type",h.Context)],e.prototype,"context",void 0);n([h.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([h.Autowired("sortController"),r("design:type",v.SortController)],e.prototype,"sortController",void 0);n([h.Autowired("paginationProxy"),r("design:type",C.PaginationProxy)],e.prototype,"paginationProxy",void 0);n([h.Autowired("focusedCellController"),r("design:type",m.FocusedCellController)],e.prototype,"focusedCellController",void 0);n([h.Optional("rangeController"),r("design:type",Object)],e.prototype,"rangeController",void 0);n([h.Optional("clipboardService"),r("design:type",Object)],e.prototype,"clipboardService",void 0);n([h.Optional("aggFuncService"),r("design:type",Object)],e.prototype,"aggFuncService",void 0);n([h.Autowired("menuFactory"),r("design:type",Object)],e.prototype,"menuFactory",void 0);n([h.Optional("contextMenuFactory"),r("design:type",Object)],e.prototype,"contextMenuFactory",void 0);n([h.Autowired("cellRendererFactory"),r("design:type",_.CellRendererFactory)],e.prototype,"cellRendererFactory",void 0);n([h.Autowired("cellEditorFactory"),r("design:type",w.CellEditorFactory)],e.prototype,"cellEditorFactory",void 0);n([h.Autowired("valueCache"),r("design:type",E.ValueCache)],e.prototype,"valueCache",void 0);n([h.Optional("toolPanelComp"),r("design:type",Object)],e.prototype,"toolPanelComp",void 0);n([h.Autowired("animationFrameService"),r("design:type",S.AnimationFrameService)],e.prototype,"animationFrameService",void 0);n([h.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([h.Bean("gridApi")],e);return e}();t.GridApi=D},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(4);var a=i(0);var s=function(){function e(){}e.prototype.sizeColumnsToFit=function(e){this.columnController.sizeColumnsToFit(e,"api")};e.prototype.setColumnGroupOpened=function(e,t){this.columnController.setColumnGroupOpened(e,t,"api")};e.prototype.getColumnGroup=function(e,t){return this.columnController.getColumnGroup(e,t)};e.prototype.getOriginalColumnGroup=function(e){return this.columnController.getOriginalColumnGroup(e)};e.prototype.getDisplayNameForColumn=function(e,t){return this.columnController.getDisplayNameForColumn(e,t)};e.prototype.getDisplayNameForColumnGroup=function(e,t){return this.columnController.getDisplayNameForColumnGroup(e,t)};e.prototype.getColumn=function(e){return this.columnController.getPrimaryColumn(e)};e.prototype.setColumnState=function(e){return this.columnController.setColumnState(e,"api")};e.prototype.getColumnState=function(){return this.columnController.getColumnState()};e.prototype.resetColumnState=function(){this.columnController.resetColumnState("api")};e.prototype.getColumnGroupState=function(){return this.columnController.getColumnGroupState()};e.prototype.setColumnGroupState=function(e){this.columnController.setColumnGroupState(e,"api")};e.prototype.resetColumnGroupState=function(){this.columnController.resetColumnGroupState("api")};e.prototype.isPinning=function(){return this.columnController.isPinningLeft()||this.columnController.isPinningRight()};e.prototype.isPinningLeft=function(){return this.columnController.isPinningLeft()};e.prototype.isPinningRight=function(){return this.columnController.isPinningRight()};e.prototype.getDisplayedColAfter=function(e){return this.columnController.getDisplayedColAfter(e)};e.prototype.getDisplayedColBefore=function(e){return this.columnController.getDisplayedColBefore(e)};e.prototype.setColumnVisible=function(e,t){this.columnController.setColumnVisible(e,t,"api")};e.prototype.setColumnsVisible=function(e,t){this.columnController.setColumnsVisible(e,t,"api")};e.prototype.setColumnPinned=function(e,t){this.columnController.setColumnPinned(e,t,"api")};e.prototype.setColumnsPinned=function(e,t){this.columnController.setColumnsPinned(e,t,"api")};e.prototype.getAllColumns=function(){return this.columnController.getAllPrimaryColumns()};e.prototype.getAllGridColumns=function(){return this.columnController.getAllGridColumns()};e.prototype.getDisplayedLeftColumns=function(){return this.columnController.getDisplayedLeftColumns()};e.prototype.getDisplayedCenterColumns=function(){return this.columnController.getDisplayedCenterColumns()};e.prototype.getDisplayedRightColumns=function(){return this.columnController.getDisplayedRightColumns()};e.prototype.getAllDisplayedColumns=function(){return this.columnController.getAllDisplayedColumns()};e.prototype.getAllDisplayedVirtualColumns=function(){return this.columnController.getAllDisplayedVirtualColumns()};e.prototype.moveColumn=function(e,t){if(typeof e==="number"){console.log("ag-Grid: you are using moveColumn(fromIndex, toIndex) - moveColumn takes a column key and a destination index, not two indexes, to move with indexes use moveColumnByIndex(from,to) instead");this.columnController.moveColumnByIndex(e,t,"api")}else{this.columnController.moveColumn(e,t,"api")}};e.prototype.moveColumnByIndex=function(e,t){this.columnController.moveColumnByIndex(e,t,"api")};e.prototype.moveColumns=function(e,t){this.columnController.moveColumns(e,t,"api")};e.prototype.moveRowGroupColumn=function(e,t){this.columnController.moveRowGroupColumn(e,t)};e.prototype.setColumnAggFunc=function(e,t){this.columnController.setColumnAggFunc(e,t)};e.prototype.setColumnWidth=function(e,t,i){if(i===void 0){i=true}this.columnController.setColumnWidth(e,t,false,i)};e.prototype.setPivotMode=function(e){this.columnController.setPivotMode(e)};e.prototype.isPivotMode=function(){return this.columnController.isPivotMode()};e.prototype.getSecondaryPivotColumn=function(e,t){return this.columnController.getSecondaryPivotColumn(e,t)};e.prototype.setValueColumns=function(e){this.columnController.setValueColumns(e,"api")};e.prototype.getValueColumns=function(){return this.columnController.getValueColumns()};e.prototype.removeValueColumn=function(e){this.columnController.removeValueColumn(e,"api")};e.prototype.removeValueColumns=function(e){this.columnController.removeValueColumns(e,"api")};e.prototype.addValueColumn=function(e){this.columnController.addValueColumn(e,"api")};e.prototype.addValueColumns=function(e){this.columnController.addValueColumns(e,"api")};e.prototype.setRowGroupColumns=function(e){this.columnController.setRowGroupColumns(e,"api")};e.prototype.removeRowGroupColumn=function(e){this.columnController.removeRowGroupColumn(e,"api")};e.prototype.removeRowGroupColumns=function(e){this.columnController.removeRowGroupColumns(e,"api")};e.prototype.addRowGroupColumn=function(e){this.columnController.addRowGroupColumn(e,"api")};e.prototype.addRowGroupColumns=function(e){this.columnController.addRowGroupColumns(e,"api")};e.prototype.getRowGroupColumns=function(){return this.columnController.getRowGroupColumns()};e.prototype.setPivotColumns=function(e){this.columnController.setPivotColumns(e,"api")};e.prototype.removePivotColumn=function(e){this.columnController.removePivotColumn(e,"api")};e.prototype.removePivotColumns=function(e){this.columnController.removePivotColumns(e,"api")};e.prototype.addPivotColumn=function(e){this.columnController.addPivotColumn(e,"api")};e.prototype.addPivotColumns=function(e){this.columnController.addPivotColumns(e,"api")};e.prototype.getPivotColumns=function(){return this.columnController.getPivotColumns()};e.prototype.getLeftDisplayedColumnGroups=function(){return this.columnController.getLeftDisplayedColumnGroups()};e.prototype.getCenterDisplayedColumnGroups=function(){return this.columnController.getCenterDisplayedColumnGroups()};e.prototype.getRightDisplayedColumnGroups=function(){return this.columnController.getRightDisplayedColumnGroups()};e.prototype.getAllDisplayedColumnGroups=function(){return this.columnController.getAllDisplayedColumnGroups()};e.prototype.autoSizeColumn=function(e){return this.columnController.autoSizeColumn(e,"api")};e.prototype.autoSizeColumns=function(e){return this.columnController.autoSizeColumns(e,"api")};e.prototype.autoSizeAllColumns=function(){this.columnController.autoSizeAllColumns("api")};e.prototype.setSecondaryColumns=function(e){this.columnController.setSecondaryColumns(e,"api")};e.prototype.columnGroupOpened=function(e,t){console.error("ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened");this.setColumnGroupOpened(e,t)};e.prototype.hideColumns=function(e,t){console.error("ag-Grid: hideColumns is deprecated, use setColumnsVisible");this.columnController.setColumnsVisible(e,!t,"api")};e.prototype.hideColumn=function(e,t){console.error("ag-Grid: hideColumn is deprecated, use setColumnVisible");this.columnController.setColumnVisible(e,!t,"api")};e.prototype.setState=function(e){console.error("ag-Grid: setState is deprecated, use setColumnState");return this.setColumnState(e)};e.prototype.getState=function(){console.error("ag-Grid: getState is deprecated, use getColumnState");return this.getColumnState()};e.prototype.resetState=function(){console.error("ag-Grid: resetState is deprecated, use resetColumnState");this.resetColumnState()};e.prototype.getAggregationColumns=function(){console.error("ag-Grid: getAggregationColumns is deprecated, use getValueColumns");return this.columnController.getValueColumns()};e.prototype.removeAggregationColumn=function(e){console.error("ag-Grid: removeAggregationColumn is deprecated, use removeValueColumn");this.columnController.removeValueColumn(e,"api")};e.prototype.removeAggregationColumns=function(e){console.error("ag-Grid: removeAggregationColumns is deprecated, use removeValueColumns");this.columnController.removeValueColumns(e,"api")};e.prototype.addAggregationColumn=function(e){console.error("ag-Grid: addAggregationColumn is deprecated, use addValueColumn");this.columnController.addValueColumn(e,"api")};e.prototype.addAggregationColumns=function(e){console.error("ag-Grid: addAggregationColumns is deprecated, use addValueColumns");this.columnController.addValueColumns(e,"api")};e.prototype.setColumnAggFunction=function(e,t){console.error("ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc");this.columnController.setColumnAggFunc(e,t,"api")};e.prototype.getDisplayNameForCol=function(e){console.error("ag-Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn");return this.getDisplayNameForColumn(e,null)};n([a.Autowired("columnController"),r("design:type",o.ColumnController)],e.prototype,"columnController",void 0);e=n([a.Bean("columnApi")],e);return e}();t.ColumnApi=s},function(e,t,i){"use strict";var r=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var u=i(1);var n=i(13);var o=new u.NumberSequence;var a=function(i){r(n,i);function n(e){var t=i.call(this)||this;t.childComponents=[];t.annotatedEventListeners=[];t.visible=true;t.compId=o.next();if(e){t.setTemplate(e)}return t}n.prototype.getCompId=function(){return this.compId};n.prototype.instantiate=function(e){this.instantiateRecurse(this.getGui(),e)};n.prototype.instantiateRecurse=function(n,r){var o=this;var e=u.Utils.copyNodeList(n.childNodes);e.forEach(function(i){var e=r.createComponent(i,function(e){var t=o.getAttrLists(i);o.copyAttributesFromNode(t,e.getGui());o.createChildAttributes(t,e);o.addEventListenersToComponent(t,e)});if(e){o.swapComponentForNode(e,n,i)}else{if(i.childNodes){o.instantiateRecurse(i,r)}if(i instanceof HTMLElement){var t=o.getAttrLists(i);o.addEventListenersToElement(t,i)}}})};n.prototype.getAttrLists=function(e){var o={bindings:[],events:[],normal:[]};u.Utils.iterateNamedNodeMap(e.attributes,function(e,t){var i=e.substr(0,1);if(i==="("){var n=e.replace("(","").replace(")","");o.events.push({name:n,value:t})}else if(i==="["){var r=e.replace("[","").replace("]","");o.bindings.push({name:r,value:t})}else{o.normal.push({name:e,value:t})}});return o};n.prototype.addEventListenersToElement=function(e,i){var n=this;this.addEventListenerCommon(e,function(e,t){n.addDestroyableEventListener(i,e,t)})};n.prototype.addEventListenersToComponent=function(e,i){var n=this;this.addEventListenerCommon(e,function(e,t){n.addDestroyableEventListener(i,e,t)})};n.prototype.addEventListenerCommon=function(e,a){var s=this;var l=this.getAgComponentMetaData("methods");e.events.forEach(function(e){var t=e.value;var i=u.Utils.find(l,"alias",t);var n=u.Utils.exists(i)?i.methodName:t;var r=s[n];if(typeof r!=="function"){console.warn("ag-Grid: count not find callback "+t);return}var o=u.Utils.hyphenToCamelCase(e.name);a(o,r.bind(s))})};n.prototype.createChildAttributes=function(e,t){var i=this;var n={};e.normal.forEach(function(e){var t=u.Utils.hyphenToCamelCase(e.name);n[t]=e.value});e.bindings.forEach(function(e){var t=u.Utils.hyphenToCamelCase(e.name);n[t]=i[e.value]});t.props=n};n.prototype.copyAttributesFromNode=function(e,t){e.normal.forEach(function(e){t.setAttribute(e.name,e.value)})};n.prototype.swapComponentForNode=function(e,t,i){var n=e.getGui();t.replaceChild(n,i);t.insertBefore(document.createComment(i.nodeName),n);this.childComponents.push(e);this.swapInComponentForQuerySelectors(e,i)};n.prototype.swapInComponentForQuerySelectors=function(t,i){var e=Object.getPrototypeOf(this);var n=this;while(e!=null){var r=e.__agComponentMetaData;var o=e.constructor.name;if(r&&r[o]&&r[o].querySelectors){r[o].querySelectors.forEach(function(e){if(n[e.attributeName]===i){n[e.attributeName]=t}})}e=Object.getPrototypeOf(e)}};n.prototype.setTemplate=function(e){var t=u.Utils.loadTemplate(e);this.setTemplateFromElement(t)};n.prototype.setTemplateFromElement=function(e){this.eGui=e;this.eGui.__agComponent=this;this.addAnnotatedEventListeners();this.wireQuerySelectors()};n.prototype.wireQuerySelectors=function(){var r=this;if(!this.eGui){return}var i=Object.getPrototypeOf(this);var e=function(){var e=i.__agComponentMetaData;var t=i.constructor.name;if(e&&e[t]&&e[t].querySelectors){var n=o;e[t].querySelectors.forEach(function(e){var t=r.eGui.querySelector(e.querySelector);if(t){var i=t.__agComponent;if(i){n[e.attributeName]=i}else{n[e.attributeName]=t}}else{}})}i=Object.getPrototypeOf(i)};var o=this;while(i!=null){e()}};n.prototype.addAnnotatedEventListeners=function(){var i=this;this.removeAnnotatedEventListeners();if(!this.eGui){return}var e=this.getAgComponentMetaData("listenerMethods");if(u.Utils.missingOrEmpty(e)){return}if(!this.annotatedEventListeners){this.annotatedEventListeners=[]}e.forEach(function(e){var t=i[e.methodName].bind(i);i.eGui.addEventListener(e.eventName,t);i.annotatedEventListeners.push({eventName:e.eventName,listener:t})})};n.prototype.getAgComponentMetaData=function(e){var t=[];var i=Object.getPrototypeOf(this);while(i!=null){var n=i.__agComponentMetaData;var r=i.constructor.name;if(n&&n[r]&&n[r][e]){t=t.concat(n[r][e])}i=Object.getPrototypeOf(i)}return t};n.prototype.removeAnnotatedEventListeners=function(){var t=this;if(!this.annotatedEventListeners){return}if(!this.eGui){return}this.annotatedEventListeners.forEach(function(e){t.eGui.removeEventListener(e.eventName,e.listener)});this.annotatedEventListeners=null};n.prototype.getGui=function(){return this.eGui};n.prototype.setGui=function(e){this.eGui=e};n.prototype.queryForHtmlElement=function(e){return this.eGui.querySelector(e)};n.prototype.queryForHtmlInputElement=function(e){return this.eGui.querySelector(e)};n.prototype.appendChild=function(e){if(u.Utils.isNodeOrElement(e)){this.eGui.appendChild(e)}else{var t=e;this.eGui.appendChild(t.getGui());this.childComponents.push(t)}};n.prototype.addFeature=function(e,t){e.wireBean(t);if(t.destroy){this.addDestroyFunc(t.destroy.bind(t))}};n.prototype.isVisible=function(){return this.visible};n.prototype.setVisible=function(e){if(e!==this.visible){this.visible=e;u.Utils.addOrRemoveCssClass(this.eGui,"ag-hidden",!e);var t={type:n.EVENT_VISIBLE_CHANGED,visible:this.visible};this.dispatchEvent(t)}};n.prototype.addOrRemoveCssClass=function(e,t){u.Utils.addOrRemoveCssClass(this.eGui,e,t)};n.prototype.destroy=function(){i.prototype.destroy.call(this);this.childComponents.forEach(function(e){return e.destroy()});this.childComponents.length=0;this.removeAnnotatedEventListeners()};n.prototype.addGuiEventListener=function(e,t){var i=this;this.getGui().addEventListener(e,t);this.addDestroyFunc(function(){return i.getGui().removeEventListener(e,t)})};n.prototype.addCssClass=function(e){u.Utils.addCssClass(this.getGui(),e)};n.prototype.removeCssClass=function(e){u.Utils.removeCssClass(this.getGui(),e)};n.prototype.getAttribute=function(e){var t=this.getGui();if(t){return t.getAttribute(e)}else{return null}};n.prototype.getRefElement=function(e){return this.queryForHtmlElement('[ref="'+e+'"]')};n.EVENT_VISIBLE_CHANGED="visibleChanged";return n}(n.BeanStub);t.Component=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.STEP_EVERYTHING=0;e.STEP_FILTER=1;e.STEP_SORT=2;e.STEP_MAP=3;e.STEP_AGGREGATE=4;e.STEP_PIVOT=5;e.ROW_BUFFER_SIZE=10;e.LAYOUT_INTERVAL=500;e.BATCH_WAIT_MILLIS=50;e.EXPORT_TYPE_DRAG_COPY="dragCopy";e.EXPORT_TYPE_CLIPBOARD="clipboard";e.EXPORT_TYPE_EXCEL="excel";e.EXPORT_TYPE_CSV="csv";e.KEY_BACKSPACE=8;e.KEY_TAB=9;e.KEY_NEW_LINE=10;e.KEY_ENTER=13;e.KEY_SHIFT=16;e.KEY_ESCAPE=27;e.KEY_SPACE=32;e.KEY_LEFT=37;e.KEY_UP=38;e.KEY_RIGHT=39;e.KEY_DOWN=40;e.KEY_DELETE=46;e.KEY_A=65;e.KEY_C=67;e.KEY_V=86;e.KEY_D=68;e.KEY_F2=113;e.KEY_PAGE_UP=33;e.KEY_PAGE_DOWN=34;e.KEY_PAGE_HOME=36;e.KEY_PAGE_END=35;e.ROW_MODEL_TYPE_INFINITE="infinite";e.ROW_MODEL_TYPE_VIEWPORT="viewport";e.ROW_MODEL_TYPE_CLIENT_SIDE="clientSide";e.ROW_MODEL_TYPE_SERVER_SIDE="serverSide";e.DEPRECATED_ROW_MODEL_TYPE_NORMAL="normal";e.ALWAYS="always";e.ONLY_WHEN_GROUPING="onlyWhenGrouping";e.PINNED_TOP="top";e.PINNED_BOTTOM="bottom";return e}();t.Constants=n},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(3);var s=i(1);var l=i(0);var u=i(2);var c=i(31);var d=i(7);var f=i(6);var n=function(){function n(e,t,i){this.moving=false;this.menuVisible=false;this.filterActive=false;this.eventService=new a.EventService;this.rowGroupActive=false;this.pivotActive=false;this.aggregationActive=false;this.colDef=e;this.visible=!e.hide;this.sort=e.sort;this.sortedAt=e.sortedAt;this.colId=t;this.primary=i;this.lockPosition=e.lockPosition===true;this.lockPinned=e.lockPinned===true;this.lockVisible=e.lockVisible===true}n.prototype.isLockPosition=function(){return this.lockPosition};n.prototype.isLockVisible=function(){return this.lockVisible};n.prototype.isLockPinned=function(){return this.lockPinned};n.prototype.setParent=function(e){this.parent=e};n.prototype.getParent=function(){return this.parent};n.prototype.initialise=function(){this.setPinned(this.colDef.pinned);var e=this.gridOptionsWrapper.getMinColWidth();var t=this.gridOptionsWrapper.getMaxColWidth();if(this.colDef.minWidth){this.minWidth=this.colDef.minWidth}else{this.minWidth=e}if(this.colDef.maxWidth){this.maxWidth=this.colDef.maxWidth}else{this.maxWidth=t}this.actualWidth=this.columnUtils.calculateColInitialWidth(this.colDef);var i=this.gridOptionsWrapper.isSuppressFieldDotNotation();this.fieldContainsDots=s.Utils.exists(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!i;this.tooltipFieldContainsDots=s.Utils.exists(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!i;this.validate()};n.prototype.isEmptyGroup=function(){return false};n.prototype.isRowGroupDisplayed=function(e){if(s.Utils.missing(this.colDef)||s.Utils.missing(this.colDef.showRowGroup)){return false}var t=this.colDef.showRowGroup===true;var i=this.colDef.showRowGroup===e;return t||i};n.prototype.getUniqueId=function(){return this.getId()};n.prototype.isPrimary=function(){return this.primary};n.prototype.isFilterAllowed=function(){return this.primary&&!this.colDef.suppressFilter};n.prototype.isFieldContainsDots=function(){return this.fieldContainsDots};n.prototype.isTooltipFieldContainsDots=function(){return this.tooltipFieldContainsDots};n.prototype.validate=function(){var t=this.colDef;if(!this.gridOptionsWrapper.isEnterprise()){var e=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","pivot","pivotIndex","aggFunc"];e.forEach(function(e){if(s.Utils.exists(t[e])){console.warn("ag-Grid: "+e+" is only valid in ag-Grid-Enterprise, your column definition should not have "+e)}})}if(this.gridOptionsWrapper.isTreeData()){var i=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","pivot","pivotIndex"];i.forEach(function(e){if(s.Utils.exists(t[e])){console.warn("ag-Grid: "+e+" is not possible when doing tree data, your column definition should not have "+e)}})}if(s.Utils.exists(this.colDef.width)&&typeof this.colDef.width!=="number"){console.warn("ag-Grid: colDef.width should be a number, not "+typeof this.colDef.width)}if(s.Utils.get(this,"colDef.cellRendererParams.restrictToOneGroup",null)){console.warn("ag-Grid: Since ag-grid 11.0.0 cellRendererParams.restrictToOneGroup is deprecated. You should use showRowGroup")}if(s.Utils.get(this,"colDef.cellRendererParams.keyMap",null)){console.warn("ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator")}if(s.Utils.get(this,"colDef.cellRendererParams.keyMap",null)){console.warn("ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator")}if(t.floatingCellRenderer){console.warn("ag-Grid: since v11, floatingCellRenderer is now pinnedRowCellRenderer");this.colDef.pinnedRowCellRenderer=t.floatingCellRenderer}if(t.floatingRendererFramework){console.warn("ag-Grid: since v11, floatingRendererFramework is now pinnedRowCellRendererFramework");this.colDef.pinnedRowCellRendererFramework=t.floatingRendererFramework}if(t.floatingRendererParams){console.warn("ag-Grid: since v11, floatingRendererParams is now pinnedRowCellRendererParams");this.colDef.pinnedRowCellRendererParams=t.floatingRendererParams}if(t.floatingValueFormatter){console.warn("ag-Grid: since v11, floatingValueFormatter is now pinnedRowValueFormatter");this.colDef.pinnedRowValueFormatter=t.floatingValueFormatter}if(t.cellFormatter){console.warn("ag-Grid: since v12, cellFormatter is now valueFormatter");if(s.Utils.missing(this.colDef.valueFormatter)){this.colDef.valueFormatter=t.cellFormatter}}if(t.headerCellTemplate){console.warn("ag-Grid: since v15, headerCellTemplate is gone, use header component instead.")}if(t.headerCellRenderer){console.warn("ag-Grid: since v15, headerCellRenderer is gone, use header component instead.")}if(t.volatile){console.warn("ag-Grid: since v16, colDef.volatile is gone, please check refresh docs on how to refresh specific cells.")}};n.prototype.addEventListener=function(e,t){this.eventService.addEventListener(e,t)};n.prototype.removeEventListener=function(e,t){this.eventService.removeEventListener(e,t)};n.prototype.createIsColumnFuncParams=function(e){return{node:e,data:e.data,column:this,colDef:this.colDef,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()}};n.prototype.isSuppressNavigable=function(e){if(typeof this.colDef.suppressNavigable==="boolean"){return this.colDef.suppressNavigable}if(typeof this.colDef.suppressNavigable==="function"){var t=this.createIsColumnFuncParams(e);var i=this.colDef.suppressNavigable;return i(t)}return false};n.prototype.isCellEditable=function(e){if(e.group&&!this.gridOptionsWrapper.isEnableGroupEdit()){return false}return this.isColumnFunc(e,this.colDef.editable)};n.prototype.isRowDrag=function(e){return this.isColumnFunc(e,this.colDef.rowDrag)};n.prototype.isCellCheckboxSelection=function(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)};n.prototype.isSuppressPaste=function(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)};n.prototype.isResizable=function(){var e=this.gridOptionsWrapper.isEnableColResize();var t=this.colDef&&this.colDef.suppressResize;return e&&!t};n.prototype.isColumnFunc=function(e,t){if(typeof t==="boolean"){return t}if(typeof t==="function"){var i=this.createIsColumnFuncParams(e);var n=t;return n(i)}return false};n.prototype.setMoving=function(e,t){if(t===void 0){t="api"}this.moving=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_MOVING_CHANGED,t))};n.prototype.createColumnEvent=function(e,t){return{api:this.gridApi,columnApi:this.columnApi,type:e,column:this,columns:[this],source:t}};n.prototype.isMoving=function(){return this.moving};n.prototype.getSort=function(){return this.sort};n.prototype.setSort=function(e,t){if(t===void 0){t="api"}if(this.sort!==e){this.sort=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_SORT_CHANGED,t))}};n.prototype.setMenuVisible=function(e,t){if(t===void 0){t="api"}if(this.menuVisible!==e){this.menuVisible=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_MENU_VISIBLE_CHANGED,t))}};n.prototype.isMenuVisible=function(){return this.menuVisible};n.prototype.isSortAscending=function(){return this.sort===n.SORT_ASC};n.prototype.isSortDescending=function(){return this.sort===n.SORT_DESC};n.prototype.isSortNone=function(){return s.Utils.missing(this.sort)};n.prototype.isSorting=function(){return s.Utils.exists(this.sort)};n.prototype.getSortedAt=function(){return this.sortedAt};n.prototype.setSortedAt=function(e){this.sortedAt=e};n.prototype.setAggFunc=function(e){this.aggFunc=e};n.prototype.getAggFunc=function(){return this.aggFunc};n.prototype.getLeft=function(){return this.left};n.prototype.getOldLeft=function(){return this.oldLeft};n.prototype.getRight=function(){return this.left+this.actualWidth};n.prototype.setLeft=function(e,t){if(t===void 0){t="api"}this.oldLeft=this.left;if(this.left!==e){this.left=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_LEFT_CHANGED,t))}};n.prototype.isFilterActive=function(){return this.filterActive};n.prototype.setFilterActive=function(e,t){if(t===void 0){t="api"}if(this.filterActive!==e){this.filterActive=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_FILTER_ACTIVE_CHANGED,t))}this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_FILTER_CHANGED,t))};n.prototype.setPinned=function(e){if(e===true||e===n.PINNED_LEFT){this.pinned=n.PINNED_LEFT}else if(e===n.PINNED_RIGHT){this.pinned=n.PINNED_RIGHT}else{this.pinned=null}};n.prototype.setFirstRightPinned=function(e,t){if(t===void 0){t="api"}if(this.firstRightPinned!==e){this.firstRightPinned=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_FIRST_RIGHT_PINNED_CHANGED,t))}};n.prototype.setLastLeftPinned=function(e,t){if(t===void 0){t="api"}if(this.lastLeftPinned!==e){this.lastLeftPinned=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_LAST_LEFT_PINNED_CHANGED,t))}};n.prototype.isFirstRightPinned=function(){return this.firstRightPinned};n.prototype.isLastLeftPinned=function(){return this.lastLeftPinned};n.prototype.isPinned=function(){return this.pinned===n.PINNED_LEFT||this.pinned===n.PINNED_RIGHT};n.prototype.isPinnedLeft=function(){return this.pinned===n.PINNED_LEFT};n.prototype.isPinnedRight=function(){return this.pinned===n.PINNED_RIGHT};n.prototype.getPinned=function(){return this.pinned};n.prototype.setVisible=function(e,t){if(t===void 0){t="api"}var i=e===true;if(this.visible!==i){this.visible=i;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_VISIBLE_CHANGED,t))}};n.prototype.isVisible=function(){return this.visible};n.prototype.getColDef=function(){return this.colDef};n.prototype.getColumnGroupShow=function(){return this.colDef.columnGroupShow};n.prototype.getColId=function(){return this.colId};n.prototype.getId=function(){return this.getColId()};n.prototype.getDefinition=function(){return this.colDef};n.prototype.getActualWidth=function(){return this.actualWidth};n.prototype.createBaseColDefParams=function(e){var t={node:e,data:e.data,colDef:this.colDef,column:this,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};return t};n.prototype.getColSpan=function(e){if(s.Utils.missing(this.colDef.colSpan)){return 1}else{var t=this.createBaseColDefParams(e);var i=this.colDef.colSpan(t);if(i>1){return i}else{return 1}}};n.prototype.getRowSpan=function(e){if(s.Utils.missing(this.colDef.rowSpan)){return 1}else{var t=this.createBaseColDefParams(e);var i=this.colDef.rowSpan(t);if(i>1){return i}else{return 1}}};n.prototype.setActualWidth=function(e,t){if(t===void 0){t="api"}if(this.actualWidth!==e){this.actualWidth=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_WIDTH_CHANGED,t))}};n.prototype.isGreaterThanMax=function(e){if(this.maxWidth){return e>this.maxWidth}else{return false}};n.prototype.getMinWidth=function(){return this.minWidth};n.prototype.getMaxWidth=function(){return this.maxWidth};n.prototype.setMinimum=function(e){if(e===void 0){e="api"}this.setActualWidth(this.minWidth,e)};n.prototype.setRowGroupActive=function(e,t){if(t===void 0){t="api"}if(this.rowGroupActive!==e){this.rowGroupActive=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_ROW_GROUP_CHANGED,t))}};n.prototype.isRowGroupActive=function(){return this.rowGroupActive};n.prototype.setPivotActive=function(e,t){if(t===void 0){t="api"}if(this.pivotActive!==e){this.pivotActive=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_PIVOT_CHANGED,t))}};n.prototype.isPivotActive=function(){return this.pivotActive};n.prototype.isAnyFunctionActive=function(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()};n.prototype.isAnyFunctionAllowed=function(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()};n.prototype.setValueActive=function(e,t){if(t===void 0){t="api"}if(this.aggregationActive!==e){this.aggregationActive=e;this.eventService.dispatchEvent(this.createColumnEvent(n.EVENT_VALUE_CHANGED,t))}};n.prototype.isValueActive=function(){return this.aggregationActive};n.prototype.isAllowPivot=function(){return this.colDef.enablePivot===true};n.prototype.isAllowValue=function(){return this.colDef.enableValue===true};n.prototype.isAllowRowGroup=function(){return this.colDef.enableRowGroup===true};n.prototype.getMenuTabs=function(e){var t=this.getColDef().menuTabs;if(t==null){t=e}return t};n.EVENT_MOVING_CHANGED="movingChanged";n.EVENT_LEFT_CHANGED="leftChanged";n.EVENT_WIDTH_CHANGED="widthChanged";n.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged";n.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged";n.EVENT_VISIBLE_CHANGED="visibleChanged";n.EVENT_FILTER_CHANGED="filterChanged";n.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged";n.EVENT_SORT_CHANGED="sortChanged";n.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged";n.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged";n.EVENT_PIVOT_CHANGED="columnPivotChanged";n.EVENT_VALUE_CHANGED="columnValueChanged";n.PINNED_RIGHT="right";n.PINNED_LEFT="left";n.SORT_ASC="asc";n.SORT_DESC="desc";r([l.Autowired("gridOptionsWrapper"),o("design:type",u.GridOptionsWrapper)],n.prototype,"gridOptionsWrapper",void 0);r([l.Autowired("columnUtils"),o("design:type",c.ColumnUtils)],n.prototype,"columnUtils",void 0);r([l.Autowired("frameworkFactory"),o("design:type",Object)],n.prototype,"frameworkFactory",void 0);r([l.Autowired("columnApi"),o("design:type",d.ColumnApi)],n.prototype,"columnApi",void 0);r([l.Autowired("gridApi"),o("design:type",f.GridApi)],n.prototype,"gridApi",void 0);r([l.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],n.prototype,"initialise",null);return n}();t.Column=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});function n(e){return o.bind(this,e)}t.QuerySelector=n;function r(e){return o.bind(this,"[ref="+e+"]")}t.RefSelector=r;function o(e,t,i,n){if(e===null){console.error("ag-Grid: QuerySelector selector should not be null");return}if(typeof n==="number"){console.error("ag-Grid: QuerySelector should be on an attribute");return}c(t,"querySelectors",{attributeName:i,querySelector:e})}function a(e){return s.bind(this,e)}t.Listener=a;function s(e,t,i){if(e===null){console.error("ag-Grid: EventListener eventName should not be null");return}c(t,"listenerMethods",{methodName:i,eventName:e})}function l(e){return u.bind(this,e)}t.Method=l;function u(e,t,i){if(e===null){console.error("ag-Grid: EventListener eventName should not be null");return}c(t,"methods",{methodName:i,alias:e})}function c(e,t,i){var n=d(e,e.constructor.name);if(!n[t]){n[t]=[]}n[t].push(i)}function d(e,t){if(!e.__agComponentMetaData){e.__agComponentMetaData={}}if(!e.__agComponentMetaData[t]){e.__agComponentMetaData[t]={}}return e.__agComponentMetaData[t]}},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(2);var s=i(0);var l=i(0);var u=function(){function e(){}e.prototype.setBeans=function(e){this.logging=e.isDebug()};e.prototype.create=function(e){return new c(e,this.isLogging.bind(this))};e.prototype.isLogging=function(){return this.logging};n([o(0,l.Qualifier("gridOptionsWrapper")),r("design:type",Function),r("design:paramtypes",[a.GridOptionsWrapper]),r("design:returntype",void 0)],e.prototype,"setBeans",null);e=n([s.Bean("loggerFactory")],e);return e}();t.LoggerFactory=u;var c=function(){function e(e,t){this.name=e;this.isLoggingFunc=t}e.prototype.isLogging=function(){return this.isLoggingFunc()};e.prototype.log=function(e){if(this.isLoggingFunc()){console.log("ag-Grid."+this.name+": "+e)}};return e}();t.Logger=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(3);var r=i(2);var o=i(1);var a=function(){function e(){this.destroyFunctions=[];this.destroyed=false}e.prototype.destroy=function(){this.destroyFunctions.forEach(function(e){return e()});this.destroyFunctions.length=0;this.destroyed=true;this.dispatchEvent({type:e.EVENT_DESTROYED})};e.prototype.addEventListener=function(e,t){if(!this.localEventService){this.localEventService=new n.EventService}this.localEventService.addEventListener(e,t)};e.prototype.removeEventListener=function(e,t){if(this.localEventService){this.localEventService.removeEventListener(e,t)}};e.prototype.dispatchEventAsync=function(e){var t=this;setTimeout(function(){return t.dispatchEvent(e)},0)};e.prototype.dispatchEvent=function(e){if(this.localEventService){this.localEventService.dispatchEvent(e)}};e.prototype.addDestroyableEventListener=function(e,t,i){if(this.destroyed){return}if(e instanceof HTMLElement){o._.addSafePassiveEventListener(e,t,i)}else if(e instanceof Window){e.addEventListener(t,i)}else if(e instanceof r.GridOptionsWrapper){e.addEventListener(t,i)}else{e.addEventListener(t,i)}this.destroyFunctions.push(function(){if(e instanceof HTMLElement){e.removeEventListener(t,i)}else if(e instanceof Window){e.removeEventListener(t,i)}else if(e instanceof r.GridOptionsWrapper){e.removeEventListener(t,i)}else{e.removeEventListener(t,i)}})};e.prototype.isAlive=function(){return!this.destroyed};e.prototype.addDestroyFunc=function(e){if(this.isAlive()){this.destroyFunctions.push(e)}else{e()}};e.EVENT_DESTROYED="destroyed";return e}();t.BeanStub=a},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(3);var g=i(5);var s=i(2);var l=i(17);var u=i(16);var c=i(4);var d=i(7);var f=i(0);var p=i(9);var h=i(1);var v=i(33);var m=i(6);var n=function(){function n(){this.childrenMapped={};this.selectable=true;this.selected=false}n.prototype.setData=function(e){var t=this.data;this.data=e;this.valueCache.onDataChanged();this.updateDataOnDetailNode();this.checkRowSelectable();var i=this.createDataChangedEvent(e,t,false);this.dispatchLocalEvent(i)};n.prototype.updateDataOnDetailNode=function(){if(this.detailNode){this.detailNode.data=this.data}};n.prototype.createDataChangedEvent=function(e,t,i){return{type:n.EVENT_DATA_CHANGED,node:this,oldData:t,newData:e,update:i}};n.prototype.createLocalRowEvent=function(e){return{type:e,node:this}};n.prototype.updateData=function(e){var t=this.data;this.data=e;this.updateDataOnDetailNode();this.checkRowSelectable();this.updateDataOnDetailNode();var i=this.createDataChangedEvent(e,t,true);this.dispatchLocalEvent(i)};n.prototype.getRowIndexString=function(){if(this.rowPinned===p.Constants.PINNED_TOP){return"t-"+this.rowIndex}else if(this.rowPinned===p.Constants.PINNED_BOTTOM){return"b-"+this.rowIndex}else{return this.rowIndex.toString()}};n.prototype.createDaemonNode=function(){var e=new n;this.context.wireBean(e);e.id=this.id;e.data=this.data;e.daemon=true;e.selected=this.selected;e.level=this.level;return e};n.prototype.setDataAndId=function(e,t){var i=h.Utils.exists(this.id)?this.createDaemonNode():null;var n=this.data;this.data=e;this.updateDataOnDetailNode();this.setId(t);this.selectionController.syncInRowNode(this,i);this.checkRowSelectable();var r=this.createDataChangedEvent(e,n,false);this.dispatchLocalEvent(r)};n.prototype.checkRowSelectable=function(){var e=this.gridOptionsWrapper.getIsRowSelectableFunc();var t=e&&h.Utils.exists(this);this.setRowSelectable(t?e(this):true)};n.prototype.setRowSelectable=function(e){if(this.selectable!==e){this.selectable=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_SELECTABLE_CHANGED))}}};n.prototype.setId=function(e){var t=this.gridOptionsWrapper.getRowNodeIdFunc();if(t){if(this.data){this.id=t(this.data)}else{this.id=undefined}}else{this.id=e}};n.prototype.isPixelInRange=function(e){return e>=this.rowTop&&e<this.rowTop+this.rowHeight};n.prototype.clearRowTop=function(){this.oldRowTop=this.rowTop;this.setRowTop(null)};n.prototype.setFirstChild=function(e){if(this.firstChild===e){return}this.firstChild=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_FIRST_CHILD_CHANGED))}};n.prototype.setLastChild=function(e){if(this.lastChild===e){return}this.lastChild=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_LAST_CHILD_CHANGED))}};n.prototype.setChildIndex=function(e){if(this.childIndex===e){return}this.childIndex=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_CHILD_INDEX_CHANGED))}};n.prototype.setRowTop=function(e){if(this.rowTop===e){return}this.rowTop=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_TOP_CHANGED))}};n.prototype.setDragging=function(e){if(this.dragging===e){return}this.dragging=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_DRAGGING_CHANGED))}};n.prototype.setAllChildrenCount=function(e){if(this.allChildrenCount===e){return}this.allChildrenCount=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_ALL_CHILDREN_COUNT_CHANGED))}};n.prototype.setRowHeight=function(e){this.rowHeight=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_HEIGHT_CHANGED))}};n.prototype.setRowIndex=function(e){this.rowIndex=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_ROW_INDEX_CHANGED))}};n.prototype.setUiLevel=function(e){if(this.uiLevel===e){return}this.uiLevel=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_UI_LEVEL_CHANGED))}};n.prototype.setExpanded=function(e){if(this.expanded===e){return}this.expanded=e;if(this.eventService){this.eventService.dispatchEvent(this.createLocalRowEvent(n.EVENT_EXPANDED_CHANGED))}var t=this.createGlobalRowEvent(g.Events.EVENT_ROW_GROUP_OPENED);this.mainEventService.dispatchEvent(t)};n.prototype.createGlobalRowEvent=function(e){var t={type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};return t};n.prototype.dispatchLocalEvent=function(e){if(this.eventService){this.eventService.dispatchEvent(e)}};n.prototype.setDataValue=function(e,t){var i=this.columnController.getPrimaryColumn(e);this.valueService.setValue(this,i,t);this.dispatchCellChangedEvent(i,t)};n.prototype.setGroupValue=function(e,t){var i=this.columnController.getGridColumn(e);if(h.Utils.missing(this.groupData)){this.groupData={}}this.groupData[i.getColId()]=t;this.dispatchCellChangedEvent(i,t)};n.prototype.setAggData=function(e){var n=this;var t=h.Utils.getAllKeysInObjects([this.aggData,e]);this.aggData=e;if(this.eventService){t.forEach(function(e){var t=n.columnController.getGridColumn(e);var i=n.aggData?n.aggData[e]:undefined;n.dispatchCellChangedEvent(t,i)})}};n.prototype.hasChildren=function(){return this.group||this.childrenAfterGroup&&this.childrenAfterGroup.length>0};n.prototype.isEmptyFillerNode=function(){return this.group&&h.Utils.missingOrEmpty(this.childrenAfterGroup)};n.prototype.dispatchCellChangedEvent=function(e,t){var i={type:n.EVENT_CELL_CHANGED,node:this,column:e,newValue:t};this.dispatchLocalEvent(i)};n.prototype.resetQuickFilterAggregateText=function(){this.quickFilterAggregateText=null};n.prototype.isExpandable=function(){return this.hasChildren()||this.master};n.prototype.isSelected=function(){if(this.footer){return this.sibling.isSelected()}return this.selected};n.prototype.depthFirstSearch=function(t){if(this.childrenAfterGroup){this.childrenAfterGroup.forEach(function(e){return e.depthFirstSearch(t)})}t(this)};n.prototype.calculateSelectedFromChildren=function(){var e=false;var t=false;var i=false;var n;if(this.childrenAfterGroup){for(var r=0;r<this.childrenAfterGroup.length;r++){var o=this.childrenAfterGroup[r];if(!o.selectable)continue;var a=o.isSelected();switch(a){case true:e=true;break;case false:t=true;break;default:i=true;break}}}if(i){n=undefined}else if(e&&!t){n=true}else if(!e&&t){n=false}else{n=undefined}this.selectThisNode(n)};n.prototype.calculateSelectedFromChildrenBubbleUp=function(){this.calculateSelectedFromChildren();if(this.parent){this.parent.calculateSelectedFromChildrenBubbleUp()}};n.prototype.setSelectedInitialValue=function(e){this.selected=e};n.prototype.setSelected=function(e,t,i){if(t===void 0){t=false}if(i===void 0){i=false}this.setSelectedParams({newValue:e,clearSelection:t,tailingNodeInSequence:i,rangeSelect:false})};n.prototype.isRowPinned=function(){return this.rowPinned===p.Constants.PINNED_TOP||this.rowPinned===p.Constants.PINNED_BOTTOM};n.prototype.setSelectedParams=function(e){var t=this.gridOptionsWrapper.isGroupSelectsChildren();var i=e.newValue===true;var n=e.clearSelection===true;var r=e.tailingNodeInSequence===true;var o=e.rangeSelect===true;var a=t&&e.groupSelectsFiltered===true;if(this.id===undefined){console.warn("ag-Grid: cannot select node until id for node is known");return 0}if(this.rowPinned){console.log("ag-Grid: cannot select pinned rows");return 0}if(this.footer){var s=this.sibling.setSelectedParams(e);return s}if(o){var l=this.selectionController.getLastSelectedNode()!==this;var u=this.gridOptionsWrapper.isRowSelectionMulti();if(l&&u){return this.doRowRangeSelection()}}var c=0;var d=a&&this.group;if(!d){var f=this.selectThisNode(i);if(f){c++}}if(t&&this.group){c+=this.selectChildNodes(i,a)}var p=!r;if(p){if(i&&(n||!this.gridOptionsWrapper.isRowSelectionMulti())){c+=this.selectionController.clearOtherNodes(this)}if(c>0){if(a){this.calculatedSelectedForAllGroupNodes()}else{if(t&&this.parent){this.parent.calculateSelectedFromChildrenBubbleUp()}}var h={type:g.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.mainEventService.dispatchEvent(h)}if(i){this.selectionController.setLastSelectedNode(this)}}return c};n.prototype.doRowRangeSelection=function(){var i=0;var n=this.gridOptionsWrapper.isGroupSelectsChildren();var e=this.selectionController.getLastSelectedNode();var t=this.rowModel.getNodesInRangeForSelection(e,this);t.forEach(function(e){if(e.group&&n){return}var t=e.selectThisNode(true);if(t){i++}});if(n){this.calculatedSelectedForAllGroupNodes()}var r={type:g.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.mainEventService.dispatchEvent(r);return i};n.prototype.isParentOfNode=function(e){var t=this.parent;while(t){if(t===e){return true}t=t.parent}return false};n.prototype.calculatedSelectedForAllGroupNodes=function(){var e=this.rowModel;e.getTopLevelNodes().forEach(function(e){if(e.group){e.depthFirstSearch(function(e){if(e.group){e.calculateSelectedFromChildren()}});e.calculateSelectedFromChildren()}})};n.prototype.selectThisNode=function(e){if(!this.selectable||this.selected===e)return false;this.selected=e;if(this.eventService){this.dispatchLocalEvent(this.createLocalRowEvent(n.EVENT_ROW_SELECTED))}var t=this.createGlobalRowEvent(g.Events.EVENT_ROW_SELECTED);this.mainEventService.dispatchEvent(t);return true};n.prototype.selectChildNodes=function(e,t){var i=t?this.childrenAfterFilter:this.childrenAfterGroup;var n=0;if(h.Utils.missing(i)){return}for(var r=0;r<i.length;r++){n+=i[r].setSelectedParams({newValue:e,clearSelection:false,tailingNodeInSequence:true,groupSelectsFiltered:t})}return n};n.prototype.addEventListener=function(e,t){if(!this.eventService){this.eventService=new a.EventService}this.eventService.addEventListener(e,t)};n.prototype.removeEventListener=function(e,t){this.eventService.removeEventListener(e,t)};n.prototype.onMouseEnter=function(){this.dispatchLocalEvent(this.createLocalRowEvent(n.EVENT_MOUSE_ENTER))};n.prototype.onMouseLeave=function(){this.dispatchLocalEvent(this.createLocalRowEvent(n.EVENT_MOUSE_LEAVE))};n.prototype.getFirstChildOfFirstChild=function(e){var t=this;var i=true;var n=false;var r;while(i&&!n){var o=t.parent;var a=h.Utils.exists(o)&&t.firstChild;if(a){if(o.rowGroupColumn===e){n=true;r=o}}else{i=false}t=o}return n?r:null};n.EVENT_ROW_SELECTED="rowSelected";n.EVENT_DATA_CHANGED="dataChanged";n.EVENT_CELL_CHANGED="cellChanged";n.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged";n.EVENT_MOUSE_ENTER="mouseEnter";n.EVENT_MOUSE_LEAVE="mouseLeave";n.EVENT_HEIGHT_CHANGED="heightChanged";n.EVENT_TOP_CHANGED="topChanged";n.EVENT_FIRST_CHILD_CHANGED="firstChildChanged";n.EVENT_LAST_CHILD_CHANGED="lastChildChanged";n.EVENT_CHILD_INDEX_CHANGED="childIndexChanged";n.EVENT_ROW_INDEX_CHANGED="rowIndexChanged";n.EVENT_EXPANDED_CHANGED="expandedChanged";n.EVENT_SELECTABLE_CHANGED="selectableChanged";n.EVENT_UI_LEVEL_CHANGED="uiLevelChanged";n.EVENT_DRAGGING_CHANGED="draggingChanged";r([f.Autowired("eventService"),o("design:type",a.EventService)],n.prototype,"mainEventService",void 0);r([f.Autowired("gridOptionsWrapper"),o("design:type",s.GridOptionsWrapper)],n.prototype,"gridOptionsWrapper",void 0);r([f.Autowired("selectionController"),o("design:type",l.SelectionController)],n.prototype,"selectionController",void 0);r([f.Autowired("columnController"),o("design:type",c.ColumnController)],n.prototype,"columnController",void 0);r([f.Autowired("valueService"),o("design:type",u.ValueService)],n.prototype,"valueService",void 0);r([f.Autowired("rowModel"),o("design:type",Object)],n.prototype,"rowModel",void 0);r([f.Autowired("context"),o("design:type",f.Context)],n.prototype,"context",void 0);r([f.Autowired("valueCache"),o("design:type",v.ValueCache)],n.prototype,"valueCache",void 0);r([f.Autowired("columnApi"),o("design:type",d.ColumnApi)],n.prototype,"columnApi",void 0);r([f.Autowired("gridApi"),o("design:type",m.GridApi)],n.prototype,"gridApi",void 0);return n}();t.RowNode=n},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var a=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var s=i(12);var l=i(0);var c=i(1);var u=i(2);var d=i(40);var f=i(4);var p=i(41);var h;(function(e){e[e["ToolPanel"]=0]="ToolPanel";e[e["HeaderCell"]=1]="HeaderCell";e[e["RowDrag"]=2]="RowDrag"})(h=t.DragSourceType||(t.DragSourceType={}));var g;(function(e){e[e["Up"]=0]="Up";e[e["Down"]=1]="Down"})(g=t.VDirection||(t.VDirection={}));var v;(function(e){e[e["Left"]=0]="Left";e[e["Right"]=1]="Right"})(v=t.HDirection||(t.HDirection={}));var n=function(){function e(){this.dragSourceAndParamsList=[];this.dropTargets=[]}n=e;e.prototype.init=function(){this.ePinnedIcon=c.Utils.createIcon("columnMovePin",this.gridOptionsWrapper,null);this.ePlusIcon=c.Utils.createIcon("columnMoveAdd",this.gridOptionsWrapper,null);this.eHiddenIcon=c.Utils.createIcon("columnMoveHide",this.gridOptionsWrapper,null);this.eMoveIcon=c.Utils.createIcon("columnMoveMove",this.gridOptionsWrapper,null);this.eLeftIcon=c.Utils.createIcon("columnMoveLeft",this.gridOptionsWrapper,null);this.eRightIcon=c.Utils.createIcon("columnMoveRight",this.gridOptionsWrapper,null);this.eGroupIcon=c.Utils.createIcon("columnMoveGroup",this.gridOptionsWrapper,null);this.eAggregateIcon=c.Utils.createIcon("columnMoveValue",this.gridOptionsWrapper,null);this.ePivotIcon=c.Utils.createIcon("columnMovePivot",this.gridOptionsWrapper,null);this.eDropNotAllowedIcon=c.Utils.createIcon("dropNotAllowed",this.gridOptionsWrapper,null)};e.prototype.setBeans=function(e){this.logger=e.create("OldToolPanelDragAndDropService")};e.prototype.getStringType=function(e){switch(e){case h.RowDrag:return"row";case h.HeaderCell:return"headerCell";case h.ToolPanel:return"toolPanel";default:console.warn("ag-Grid: bug - unknown drag type "+e);return null}};e.prototype.addDragSource=function(e,t){if(t===void 0){t=false}var i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this)};this.dragSourceAndParamsList.push({params:i,dragSource:e});this.dragService.addDragSource(i,t)};e.prototype.removeDragSource=function(t){var e=c.Utils.find(this.dragSourceAndParamsList,function(e){return e.dragSource===t});if(e){this.dragService.removeDragSource(e.params);c.Utils.removeFromArray(this.dragSourceAndParamsList,e)}};e.prototype.destroy=function(){var t=this;this.dragSourceAndParamsList.forEach(function(e){t.dragService.removeDragSource(e.params)});this.dragSourceAndParamsList.length=0};e.prototype.nudge=function(){if(this.dragging){this.onDragging(this.eventLastTime,true)}};e.prototype.onDragStart=function(e,t){this.dragging=true;this.dragSource=e;this.eventLastTime=t;this.dragItem=this.dragSource.dragItemCallback();this.lastDropTarget=this.dragSource.dragSourceDropTarget;if(this.dragSource.dragStarted){this.dragSource.dragStarted()}this.createGhost()};e.prototype.onDragStop=function(e){this.eventLastTime=null;this.dragging=false;if(this.dragSource.dragStopped){this.dragSource.dragStopped()}if(this.lastDropTarget&&this.lastDropTarget.onDragStop){var t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,false);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null;this.dragItem=null;this.removeGhost()};e.prototype.onDragging=function(e,t){var i=this.workOutHDirection(e);var n=this.workOutVDirection(e);this.eventLastTime=e;this.positionGhost(e);var r=c.Utils.find(this.dropTargets,this.isMouseOnDropTarget.bind(this,e));if(r!==this.lastDropTarget){this.leaveLastTargetIfExists(e,i,n,t);this.enterDragTargetIfExists(r,e,i,n,t);this.lastDropTarget=r}else if(r){var o=this.createDropTargetEvent(r,e,i,n,t);r.onDragging(o)}};e.prototype.enterDragTargetIfExists=function(e,t,i,n,r){if(!e){return}var o=this.createDropTargetEvent(e,t,i,n,r);e.onDragEnter(o);this.setGhostIcon(e.getIconName?e.getIconName():null)};e.prototype.leaveLastTargetIfExists=function(e,t,i,n){if(!this.lastDropTarget){return}var r=this.createDropTargetEvent(this.lastDropTarget,e,t,i,n);this.lastDropTarget.onDragLeave(r);this.setGhostIcon(null)};e.prototype.getAllContainersFromDropTarget=function(e){var t=[e.getContainer()];var i=e.getSecondaryContainers?e.getSecondaryContainers():null;if(i){t=t.concat(i)}return t};e.prototype.isMouseOnDropTarget=function(r,e){var t=this.getAllContainersFromDropTarget(e);var o=false;t.forEach(function(e){if(!e){return}var t=e.getBoundingClientRect();if(t.width===0||t.height===0){return}var i=r.clientX>=t.left&&r.clientX<=t.right;var n=r.clientY>=t.top&&r.clientY<=t.bottom;if(i&&n){o=true}});if(o){var i=e.isInterestedIn(this.dragSource.type);return i}else{return false}};e.prototype.addDropTarget=function(e){this.dropTargets.push(e)};e.prototype.workOutHDirection=function(e){if(this.eventLastTime.clientX>e.clientX){return v.Left}else if(this.eventLastTime.clientX<e.clientX){return v.Right}else{return null}};e.prototype.workOutVDirection=function(e){if(this.eventLastTime.clientY>e.clientY){return g.Up}else if(this.eventLastTime.clientY<e.clientY){return g.Down}else{return null}};e.prototype.createDropTargetEvent=function(e,t,i,n,r){var o=e.getContainer().getBoundingClientRect();var a=t.clientX-o.left;var s=t.clientY-o.top;var l={event:t,x:a,y:s,vDirection:n,hDirection:i,dragSource:this.dragSource,fromNudge:r,dragItem:this.dragItem};return l};e.prototype.positionGhost=function(e){var t=this.eGhost.getBoundingClientRect();var i=t.height;var n=c.Utils.getBodyWidth()-2;var r=c.Utils.getBodyHeight()-2;var o=e.pageY-i/2;var a=e.pageX-30;var s=this.gridOptionsWrapper.getDocument();var l=window.pageYOffset||s.documentElement.scrollTop;var u=window.pageXOffset||s.documentElement.scrollLeft;if(n>0){if(a+this.eGhost.clientWidth>n+u){a=n+u-this.eGhost.clientWidth}}if(a<0){a=0}if(r>0){if(o+this.eGhost.clientHeight>r+l){o=r+l-this.eGhost.clientHeight}}if(o<0){o=0}this.eGhost.style.left=a+"px";this.eGhost.style.top=o+"px"};e.prototype.removeGhost=function(){if(this.eGhost&&this.eGhostParent){this.eGhostParent.removeChild(this.eGhost)}this.eGhost=null};e.prototype.createGhost=function(){this.eGhost=c.Utils.loadTemplate(n.GHOST_TEMPLATE);c.Utils.addCssClass(this.eGhost,this.environment.getTheme());this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon");this.setGhostIcon(null);var e=this.eGhost.querySelector(".ag-dnd-ghost-label");e.innerHTML=this.dragSource.dragItemName;this.eGhost.style.height="25px";this.eGhost.style.top="20px";this.eGhost.style.left="20px";var t=this.gridOptionsWrapper.getDocument();this.eGhostParent=t.querySelector("body");if(!this.eGhostParent){console.warn("ag-Grid: could not find document body, it is needed for dragging columns")}else{this.eGhostParent.appendChild(this.eGhost)}};e.prototype.setGhostIcon=function(e,t){if(t===void 0){t=false}c.Utils.removeAllChildren(this.eGhostIcon);var i;switch(e){case n.ICON_ADD:i=this.ePlusIcon;break;case n.ICON_PINNED:i=this.ePinnedIcon;break;case n.ICON_MOVE:i=this.eMoveIcon;break;case n.ICON_LEFT:i=this.eLeftIcon;break;case n.ICON_RIGHT:i=this.eRightIcon;break;case n.ICON_GROUP:i=this.eGroupIcon;break;case n.ICON_AGGREGATE:i=this.eAggregateIcon;break;case n.ICON_PIVOT:i=this.ePivotIcon;break;case n.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;default:i=this.eHiddenIcon;break}this.eGhostIcon.appendChild(i);c.Utils.addOrRemoveCssClass(this.eGhostIcon,"ag-shake-left-to-right",t)};e.ICON_PINNED="pinned";e.ICON_ADD="add";e.ICON_MOVE="move";e.ICON_LEFT="left";e.ICON_RIGHT="right";e.ICON_GROUP="group";e.ICON_AGGREGATE="aggregate";e.ICON_PIVOT="pivot";e.ICON_NOT_ALLOWED="notAllowed";e.GHOST_TEMPLATE='<div class="ag-dnd-ghost">'+'  <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>'+'  <div class="ag-dnd-ghost-label">'+"  </div>"+"</div>";r([l.Autowired("gridOptionsWrapper"),o("design:type",u.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);r([l.Autowired("dragService"),o("design:type",d.DragService)],e.prototype,"dragService",void 0);r([l.Autowired("environment"),o("design:type",p.Environment)],e.prototype,"environment",void 0);r([l.Autowired("columnController"),o("design:type",f.ColumnController)],e.prototype,"columnController",void 0);r([l.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"init",null);r([a(0,l.Qualifier("loggerFactory")),o("design:type",Function),o("design:paramtypes",[s.LoggerFactory]),o("design:returntype",void 0)],e.prototype,"setBeans",null);r([l.PreDestroy,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"destroy",null);e=n=r([l.Bean("dragAndDropService")],e);return e;var n}();t.DragAndDropService=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(2);var a=i(19);var s=i(4);var l=i(0);var f=i(1);var p=i(5);var u=i(3);var c=i(33);var d=function(){function e(){this.initialised=false}e.prototype.init=function(){this.cellExpressions=this.gridOptionsWrapper.isEnableCellExpressions();this.initialised=true};e.prototype.getValue=function(e,t,i,n){if(i===void 0){i=false}if(n===void 0){n=false}if(!this.initialised){this.init()}var r=e.getColDef();var o=r.field;var a=e.getId();var s=t.data;var l;var u=t.groupData&&t.groupData[a]!==undefined;var c=!n&&t.aggData&&t.aggData[a]!==undefined;if(i&&r.filterValueGetter){l=this.executeValueGetter(r.filterValueGetter,s,e,t)}else if(u){l=t.groupData[a]}else if(c){l=t.aggData[a]}else if(r.valueGetter){l=this.executeValueGetter(r.valueGetter,s,e,t)}else if(o&&s){l=f._.getValueUsingField(s,o,e.isFieldContainsDots())}else{l=undefined}if(this.cellExpressions&&typeof l==="string"&&l.indexOf("=")===0){var d=l.substring(1);l=this.executeValueGetter(d,s,e,t)}return l};e.prototype.setValue=function(e,t,i){var n=this.columnController.getPrimaryColumn(t);if(!e||!n){return}var r=e.data;if(f._.missing(r)){e.data={}}var o=n.getColDef(),a=o.field,s=o.newValueHandler,l=o.valueSetter;if(f._.missing(a)&&f._.missing(s)&&f._.missing(l)){console.warn("ag-Grid: you need either field or valueSetter set on colDef for editing to work");return}var u={node:e,data:e.data,oldValue:this.getValue(n,e),newValue:i,colDef:n.getColDef(),column:n,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};u.newValue=i;var c;if(f._.exists(s)){c=s(u)}else if(f._.exists(l)){c=this.expressionService.evaluate(l,u)}else{c=this.setValueUsingField(r,a,i,n.isFieldContainsDots())}if(c===undefined){c=true}if(!c){return}e.resetQuickFilterAggregateText();this.valueCache.onDataChanged();u.newValue=this.getValue(n,e);if(typeof n.getColDef().onCellValueChanged==="function"){setTimeout(function(){return n.getColDef().onCellValueChanged(u)},0)}var d={type:p.Events.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:u.column,api:u.api,colDef:u.colDef,columnApi:u.columnApi,context:u.context,data:e.data,node:e,oldValue:u.oldValue,newValue:u.newValue,value:u.newValue};this.eventService.dispatchEvent(d)};e.prototype.setValueUsingField=function(e,t,i,n){var r;if(!n){e[t]=i}else{var o=t.split(".");var a=e;while(o.length>0&&a){var s=o.shift();if(o.length===0){a[s]=i}else{a=a[s]}}}return!r};e.prototype.executeValueGetter=function(e,t,i,n){var r=i.getId();var o=this.valueCache.getValue(n,r);if(o!==undefined){return o}var a={data:t,node:n,column:i,colDef:i.getColDef(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),getValue:this.getValueCallback.bind(this,n)};var s=this.expressionService.evaluate(e,a);this.valueCache.setValue(n,r,s);return s};e.prototype.getValueCallback=function(e,t){var i=this.columnController.getPrimaryColumn(t);if(i){return this.getValue(i,e)}else{return null}};e.prototype.getKeyForNode=function(e,t){var i=this.getValue(e,t);var n;var r=e.getColDef().keyCreator;if(r){n=r({value:i})}else{n=i}if(typeof n==="string"||n===null||n===undefined){return n}n=String(n);if(n==="[object Object]"){f._.doOnce(function(){console.warn("ag-Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se ag-Grid docs) or b) to toString() on the object to return a key")},"getKeyForNode - warn about [object,object]")}return n};n([l.Autowired("gridOptionsWrapper"),r("design:type",o.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([l.Autowired("expressionService"),r("design:type",a.ExpressionService)],e.prototype,"expressionService",void 0);n([l.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);n([l.Autowired("eventService"),r("design:type",u.EventService)],e.prototype,"eventService",void 0);n([l.Autowired("valueCache"),r("design:type",c.ValueCache)],e.prototype,"valueCache",void 0);n([l.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([l.Bean("valueService")],e);return e}();t.ValueService=d},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var s=i(1);var a=i(0);var l=i(0);var u=i(12);var c=i(3);var d=i(5);var f=i(0);var p=i(2);var h=i(0);var g=i(9);var v=i(7);var m=i(6);var y=function(){function e(){}e.prototype.setBeans=function(e){this.logger=e.create("SelectionController");this.reset();if(this.gridOptionsWrapper.isRowModelDefault()){this.eventService.addEventListener(d.Events.EVENT_ROW_DATA_CHANGED,this.reset.bind(this))}else{this.logger.log("dont know what to do here")}};e.prototype.init=function(){this.groupSelectsChildren=this.gridOptionsWrapper.isGroupSelectsChildren();this.eventService.addEventListener(d.Events.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))};e.prototype.setLastSelectedNode=function(e){this.lastSelectedNode=e};e.prototype.getLastSelectedNode=function(){return this.lastSelectedNode};e.prototype.getSelectedNodes=function(){var i=[];s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t){i.push(t)}});return i};e.prototype.getSelectedRows=function(){var i=[];s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t&&t.data){i.push(t.data)}});return i};e.prototype.removeGroupsFromSelection=function(){var i=this;s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t&&t.group){i.selectedNodes[t.id]=undefined}})};e.prototype.updateGroupsFromChildrenSelections=function(){if(this.rowModel.getType()!==g.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){console.warn("updateGroupsFromChildrenSelections not available when rowModel is not normal")}var e=this.rowModel;e.getTopLevelNodes().forEach(function(e){e.depthFirstSearch(function(e){if(e.group){e.calculateSelectedFromChildren()}})})};e.prototype.getNodeForIdIfSelected=function(e){return this.selectedNodes[e]};e.prototype.clearOtherNodes=function(n){var r=this;var o={};var a=0;s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t&&t.id!==n.id){var i=r.selectedNodes[t.id];a+=i.setSelectedParams({newValue:false,clearSelection:false,tailingNodeInSequence:true});if(r.groupSelectsChildren&&t.parent){o[t.parent.id]=t.parent}}});s.Utils.iterateObject(o,function(e,t){t.calculateSelectedFromChildren()});return a};e.prototype.onRowSelected=function(e){var t=e.node;if(this.groupSelectsChildren&&t.group){return}if(t.isSelected()){this.selectedNodes[t.id]=t}else{this.selectedNodes[t.id]=undefined}};e.prototype.syncInRowNode=function(e,t){this.syncInOldRowNode(e,t);this.syncInNewRowNode(e)};e.prototype.syncInOldRowNode=function(e,t){var i=s.Utils.exists(t)&&e.id!==t.id;if(i){var n=s.Utils.exists(this.selectedNodes[t.id]);if(n){this.selectedNodes[t.id]=t}}};e.prototype.syncInNewRowNode=function(e){if(s.Utils.exists(this.selectedNodes[e.id])){e.setSelectedInitialValue(true);this.selectedNodes[e.id]=e}else{e.setSelectedInitialValue(false)}};e.prototype.reset=function(){this.logger.log("reset");this.selectedNodes={};this.lastSelectedNode=null};e.prototype.getBestCostNodeSelection=function(){if(this.rowModel.getType()!==g.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){console.warn("getBestCostNodeSelection is only avilable when using normal row model")}var e=this.rowModel;var t=e.getTopLevelNodes();if(t===null){console.warn("selectAll not available doing rowModel=virtual");return}var r=[];function o(e){for(var t=0,i=e.length;t<i;t++){var n=e[t];if(n.isSelected()){r.push(n)}else{if(n.group&&n.children){o(n.children)}}}}o(t);return r};e.prototype.setRowModel=function(e){this.rowModel=e};e.prototype.isEmpty=function(){var i=0;s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t){i++}});return i===0};e.prototype.deselectAllRowNodes=function(e){if(e===void 0){e=false}var i=function(e){return e.selectThisNode(false)};var t=this.rowModel.getType()===g.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;if(e){if(!t){console.error("ag-Grid: selecting just filtered only works with In Memory Row Model");return}var n=this.rowModel;n.forEachNodeAfterFilter(i)}else{s.Utils.iterateObject(this.selectedNodes,function(e,t){if(t){i(t)}});this.reset()}if(t&&this.groupSelectsChildren){this.updateGroupsFromChildrenSelections()}var r={type:d.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)};e.prototype.selectAllRowNodes=function(e){if(e===void 0){e=false}if(this.rowModel.getType()!==g.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){throw"selectAll only available with normal row model, ie not "+this.rowModel.getType()}var t=this.rowModel;var i=function(e){return e.selectThisNode(true)};if(e){t.forEachNodeAfterFilter(i)}else{t.forEachNode(i)}if(this.rowModel.getType()===g.Constants.ROW_MODEL_TYPE_CLIENT_SIDE&&this.groupSelectsChildren){this.updateGroupsFromChildrenSelections()}var n={type:d.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)};e.prototype.selectNode=function(e,t){e.setSelectedParams({newValue:true,clearSelection:!t})};e.prototype.deselectIndex=function(e){var t=this.rowModel.getRow(e);this.deselectNode(t)};e.prototype.deselectNode=function(e){e.setSelectedParams({newValue:false,clearSelection:false})};e.prototype.selectIndex=function(e,t){var i=this.rowModel.getRow(e);this.selectNode(i,t)};n([f.Autowired("eventService"),r("design:type",c.EventService)],e.prototype,"eventService",void 0);n([f.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([f.Autowired("gridOptionsWrapper"),r("design:type",p.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([f.Autowired("columnApi"),r("design:type",v.ColumnApi)],e.prototype,"columnApi",void 0);n([f.Autowired("gridApi"),r("design:type",m.GridApi)],e.prototype,"gridApi",void 0);n([o(0,l.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[u.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);n([h.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([a.Bean("selectionController")],e);return e}();t.SelectionController=y},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var u=i(1);var o=i(2);var a=i(35);var s=i(16);var l=i(4);var c=i(7);var d=i(0);var f=i(3);var p=i(5);var h=i(6);var g=i(27);var v=function(){function e(){this.allFilters={};this.quickFilter=null;this.quickFilterParts=null}t=e;e.prototype.init=function(){this.eventService.addEventListener(p.Events.EVENT_ROW_DATA_CHANGED,this.onNewRowsLoaded.bind(this));this.eventService.addEventListener(p.Events.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this));this.quickFilter=this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText());this.setQuickFilterParts();this.checkExternalFilter()};e.prototype.setQuickFilterParts=function(){if(this.quickFilter){this.quickFilterParts=this.quickFilter.split(" ")}else{this.quickFilterParts=null}};e.prototype.setFilterModel=function(n){var r=this;var o=[];if(n){var a=Object.keys(n);u.Utils.iterateObject(this.allFilters,function(e,t){u.Utils.removeFromArray(a,e);var i=n[e];r.setModelOnFilterWrapper(t.filterPromise,i);o.push(t.filterPromise)});u.Utils.iterateArray(a,function(e){var t=r.columnController.getPrimaryColumn(e);if(!t){console.warn("Warning ag-grid setFilterModel - no column found for colId "+e);return}var i=r.getOrCreateFilterWrapper(t);r.setModelOnFilterWrapper(i.filterPromise,n[e]);o.push(i.filterPromise)})}else{u.Utils.iterateObject(this.allFilters,function(e,t){r.setModelOnFilterWrapper(t.filterPromise,null);o.push(t.filterPromise)})}u.Promise.all(o).then(function(e){r.onFilterChanged()})};e.prototype.setModelOnFilterWrapper=function(e,t){e.then(function(e){if(typeof e.setModel!=="function"){console.warn("Warning ag-grid - filter missing setModel method, which is needed for setFilterModel");return}e.setModel(t)})};e.prototype.getFilterModel=function(){var o={};u.Utils.iterateObject(this.allFilters,function(e,t){var i=t.filterPromise;var n=i.resolveNow(null,function(e){return e});if(n==null){return null}if(typeof n.getModel!=="function"){console.warn("Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel");return}var r=n.getModel();if(u.Utils.exists(r)){o[e]=r}});return o};e.prototype.isAdvancedFilterPresent=function(){return this.advancedFilterPresent};e.prototype.setAdvancedFilterPresent=function(){var i=false;u.Utils.iterateObject(this.allFilters,function(e,t){if(t.filterPromise.resolveNow(false,function(e){return e.isFilterActive()})){i=true}});this.advancedFilterPresent=i};e.prototype.updateFilterFlagInColumns=function(n){u.Utils.iterateObject(this.allFilters,function(e,t){var i=t.filterPromise.resolveNow(false,function(e){return e.isFilterActive()});t.column.setFilterActive(i,n)})};e.prototype.isAnyFilterPresent=function(){return this.isQuickFilterPresent()||this.advancedFilterPresent||this.externalFilterPresent};e.prototype.doesFilterPass=function(e,t){var i=e.data;var n=Object.keys(this.allFilters);for(var r=0,o=n.length;r<o;r++){var a=n[r];var s=this.allFilters[a];if(s===undefined){continue}var l=s.filterPromise.resolveNow(undefined,function(e){return e});if(l===undefined){continue}if(l===t){continue}if(!l.isFilterActive()){continue}if(!l.doesFilterPass){console.error("Filter is missing method doesFilterPass")}var u={node:e,data:i};if(!l.doesFilterPass(u)){return false}}return true};e.prototype.parseQuickFilter=function(e){if(u.Utils.missing(e)||e===""){return null}if(this.gridOptionsWrapper.isRowModelInfinite()){console.warn("ag-grid: cannot do quick filtering when doing virtual paging");return null}return e.toUpperCase()};e.prototype.setQuickFilter=function(e){var t=this.parseQuickFilter(e);if(this.quickFilter!==t){this.quickFilter=t;this.setQuickFilterParts();this.onFilterChanged()}};e.prototype.checkExternalFilter=function(){this.externalFilterPresent=this.gridOptionsWrapper.isExternalFilterPresent()};e.prototype.onFilterChanged=function(){this.setAdvancedFilterPresent();this.updateFilterFlagInColumns("filterChanged");this.checkExternalFilter();u.Utils.iterateObject(this.allFilters,function(e,t){t.filterPromise.then(function(e){if(e.onAnyFilterChanged){e.onAnyFilterChanged()}})});var e={type:p.Events.EVENT_FILTER_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)};e.prototype.isQuickFilterPresent=function(){return this.quickFilter!==null};e.prototype.doesRowPassOtherFilters=function(e,t){return this.doesRowPassFilter(t,e)};e.prototype.doesRowPassQuickFilterNoCache=function(i,n){var r=this;var e=this.columnController.getAllColumnsForQuickFilter();var o=false;e.forEach(function(e){if(o){return}var t=r.getQuickFilterTextForColumn(e,i);if(u.Utils.exists(t)){if(t.indexOf(n)>=0){o=true}}});return o};e.prototype.doesRowPassQuickFilterCache=function(e,t){if(!e.quickFilterAggregateText){this.aggregateRowForQuickFilter(e)}var i=e.quickFilterAggregateText.indexOf(t)>=0;return i};e.prototype.doesRowPassQuickFilter=function(i){var n=this;var r=true;var o=this.gridOptionsWrapper.isCacheQuickFilter();this.quickFilterParts.forEach(function(e){var t=o?n.doesRowPassQuickFilterCache(i,e):n.doesRowPassQuickFilterNoCache(i,e);if(!t){r=false}});return r};e.prototype.doesRowPassFilter=function(e,t){if(this.isQuickFilterPresent()){if(!this.doesRowPassQuickFilter(e)){return false}}if(this.externalFilterPresent){if(!this.gridOptionsWrapper.doesExternalFilterPass(e)){return false}}if(this.advancedFilterPresent){if(!this.doesFilterPass(e,t)){return false}}return true};e.prototype.getQuickFilterTextForColumn=function(e,t){var i=this.valueService.getValue(e,t,true);var n;var r=e.getColDef();if(e.getColDef().getQuickFilterText){var o={value:i,node:t,data:t.data,column:e,colDef:r};n=e.getColDef().getQuickFilterText(o)}else{n=i}if(n&&n!==""){return n.toString().toUpperCase()}else{return null}};e.prototype.aggregateRowForQuickFilter=function(i){var n=this;var r=[];var e=this.columnController.getAllColumnsForQuickFilter();e.forEach(function(e){var t=n.getQuickFilterTextForColumn(e,i);if(u.Utils.exists(t)){r.push(t)}});i.quickFilterAggregateText=r.join(t.QUICK_FILTER_SEPARATOR)};e.prototype.onNewRowsLoaded=function(e){u.Utils.iterateObject(this.allFilters,function(e,t){t.filterPromise.then(function(e){if(e.onNewRowsLoaded){e.onNewRowsLoaded()}})});this.updateFilterFlagInColumns(e);this.setAdvancedFilterPresent()};e.prototype.createValueGetter=function(t){var i=this;return function(e){return i.valueService.getValue(t,e,true)}};e.prototype.getFilterComponent=function(e){var t=this.getOrCreateFilterWrapper(e);return t.filterPromise};e.prototype.getOrCreateFilterWrapper=function(e){var t=this.cachedFilter(e);if(!t){t=this.createFilterWrapper(e);this.allFilters[e.getColId()]=t}return t};e.prototype.cachedFilter=function(e){return this.allFilters[e.getColId()]};e.prototype.createFilterInstance=function(e,t){var i=this;var n="agTextColumnFilter";if(this.gridOptionsWrapper.isEnterprise()){n="agSetColumnFilter"}var r=u.Utils.cloneObject(e.getColDef());var o={type:p.Events.EVENT_FILTER_MODIFIED,api:this.gridApi,columnApi:this.columnApi};var a=this.onFilterChanged.bind(this);var s=function(){return i.eventService.dispatchEvent(o)};var l={column:e,colDef:r,rowModel:this.rowModel,filterChangedCallback:a,filterModifiedCallback:s,valueGetter:this.createValueGetter(e),context:this.gridOptionsWrapper.getContext(),doesRowPassOtherFilter:null,$scope:t};return this.componentResolver.createAgGridComponent(r,l,"filter",{api:this.gridApi,columnApi:this.columnApi,column:e,colDef:r},n,true,function(e,t){return u.Utils.assign(e,{doesRowPassOtherFilter:i.doesRowPassOtherFilters.bind(i,t)})})};e.prototype.createFilterWrapper=function(e){var t={column:e,filterPromise:null,scope:null,compiledElement:null,guiPromise:u.Promise.external()};t.scope=this.gridOptionsWrapper.isAngularCompileFilters()?this.$scope.$new():null;t.filterPromise=this.createFilterInstance(e,t.scope);this.putIntoGui(t);return t};e.prototype.putIntoGui=function(n){var r=this;var o=document.createElement("div");o.className="ag-filter";n.filterPromise.then(function(e){var t=e.getGui();if(u.Utils.missing(t)){console.warn("getGui method from filter returned "+t+", it should be a DOM element or an HTML template string.")}if(typeof t==="string"){t=u.Utils.loadTemplate(t)}o.appendChild(t);if(n.scope){var i=r.$compile(o)(n.scope);n.compiledElement=i;setTimeout(function(){return n.scope.$apply()},0)}n.guiPromise.resolve(o)})};e.prototype.onNewColumnsLoaded=function(){this.destroy()};e.prototype.destroyFilter=function(e,t){if(t===void 0){t="api"}var i=this.allFilters[e.getColId()];if(i){this.disposeFilterWrapper(i,t);this.onFilterChanged()}};e.prototype.disposeFilterWrapper=function(t,i){var n=this;t.filterPromise.then(function(e){e.setModel(null);if(e.destroy){e.destroy()}t.column.setFilterActive(false,i);if(t.scope){if(t.compiledElement){t.compiledElement.remove()}t.scope.$destroy()}delete n.allFilters[t.column.getColId()]})};e.prototype.destroy=function(){var i=this;u.Utils.iterateObject(this.allFilters,function(e,t){i.disposeFilterWrapper(t,"filterDestroyed")})};e.QUICK_FILTER_SEPARATOR="\n";n([d.Autowired("$compile"),r("design:type",Object)],e.prototype,"$compile",void 0);n([d.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);n([d.Autowired("gridOptionsWrapper"),r("design:type",o.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([d.Autowired("gridCore"),r("design:type",Object)],e.prototype,"gridCore",void 0);n([d.Autowired("popupService"),r("design:type",a.PopupService)],e.prototype,"popupService",void 0);n([d.Autowired("valueService"),r("design:type",s.ValueService)],e.prototype,"valueService",void 0);n([d.Autowired("columnController"),r("design:type",l.ColumnController)],e.prototype,"columnController",void 0);n([d.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([d.Autowired("eventService"),r("design:type",f.EventService)],e.prototype,"eventService",void 0);n([d.Autowired("enterprise"),r("design:type",Boolean)],e.prototype,"enterprise",void 0);n([d.Autowired("context"),r("design:type",d.Context)],e.prototype,"context",void 0);n([d.Autowired("columnApi"),r("design:type",c.ColumnApi)],e.prototype,"columnApi",void 0);n([d.Autowired("gridApi"),r("design:type",h.GridApi)],e.prototype,"gridApi",void 0);n([d.Autowired("componentResolver"),r("design:type",g.ComponentResolver)],e.prototype,"componentResolver",void 0);n([d.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);n([d.PreDestroy,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"destroy",null);e=t=n([d.Bean("filterManager")],e);return e;var t}();t.FilterManager=v},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(12);var s=i(0);var l=i(0);var u=function(){function e(){this.expressionToFunctionCache={}}e.prototype.setBeans=function(e){this.logger=e.create("ExpressionService")};e.prototype.evaluate=function(e,t){if(typeof e==="function"){var i=e;return i(t)}else if(typeof e==="string"){var n=e;return this.evaluateExpression(n,t)}else{console.error("ag-Grid: value should be either a string or a function",e)}};e.prototype.evaluateExpression=function(t,e){try{var i=this.createExpressionFunction(t);var n=i(e.value,e.context,e.oldValue,e.newValue,e.value,e.node,e.data,e.colDef,e.rowIndex,e.api,e.columnApi,e.getValue,e.column,e.columnGroup);return n}catch(e){console.log("Processing of the expression failed");console.log("Expression = "+t);console.log("Exception = "+e);return null}};e.prototype.createExpressionFunction=function(e){if(this.expressionToFunctionCache[e]){return this.expressionToFunctionCache[e]}var t=this.createFunctionBody(e);var i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);this.expressionToFunctionCache[e]=i;return i};e.prototype.createFunctionBody=function(e){if(e.indexOf("return")>=0){return e}else{return"return "+e+";"}};n([o(0,l.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[a.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);e=n([s.Bean("expressionService")],e);return e}();t.ExpressionService=u},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var a=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var f=i(1);var s=i(2);var l=i(19);var u=i(49);var c=i(16);var d=i(3);var p=i(50);var m=i(5);var h=i(9);var g=i(34);var v=i(0);var y=i(42);var b=i(7);var _=i(4);var w=i(12);var C=i(22);var A=i(82);var E=i(23);var x=i(13);var T=i(29);var S=i(6);var D=i(30);var k=i(28);var O=i(37);var R=i(57);var N=function(t){n(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.rowCompsByIndex={};e.floatingTopRowComps=[];e.floatingBottomRowComps=[];e.refreshInProgress=false;return e}e.prototype.agWire=function(e){this.logger=e.create("RowRenderer")};e.prototype.registerGridComp=function(e){this.gridPanel=e;this.rowContainers=this.gridPanel.getRowContainers();this.addDestroyableEventListener(this.eventService,m.Events.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this));this.addDestroyableEventListener(this.eventService,m.Events.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this));this.addDestroyableEventListener(this.eventService,m.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this));this.addDestroyableEventListener(this.eventService,m.Events.EVENT_BODY_SCROLL,this.redrawAfterScroll.bind(this));this.addDestroyableEventListener(this.eventService,m.Events.EVENT_BODY_HEIGHT_CHANGED,this.redrawAfterScroll.bind(this));this.redrawAfterModelUpdate()};e.prototype.onPageLoaded=function(e){if(f.Utils.missing(e)){e={type:m.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:false,keepRenderedRows:false,newData:false,newPage:false}}this.onModelUpdated(e)};e.prototype.getAllCellsForColumn=function(n){var r=[];f.Utils.iterateObject(this.rowCompsByIndex,e);f.Utils.iterateObject(this.floatingBottomRowComps,e);f.Utils.iterateObject(this.floatingTopRowComps,e);function e(e,t){var i=t.getCellForCol(n);if(i){r.push(i)}}return r};e.prototype.refreshFloatingRowComps=function(){this.refreshFloatingRows(this.floatingTopRowComps,this.pinnedRowModel.getPinnedTopRowData(),this.rowContainers.floatingTopPinnedLeft,this.rowContainers.floatingTopPinnedRight,this.rowContainers.floatingTop,this.rowContainers.floatingTopFullWidth);this.refreshFloatingRows(this.floatingBottomRowComps,this.pinnedRowModel.getPinnedBottomRowData(),this.rowContainers.floatingBottomPinnedLeft,this.rowContainers.floatingBottomPinnedRight,this.rowContainers.floatingBottom,this.rowContainers.floatingBottomFullWith)};e.prototype.refreshFloatingRows=function(i,e,n,r,o,a){var s=this;i.forEach(function(e){e.destroy()});i.length=0;if(e){e.forEach(function(e){var t=new p.RowComp(s.$scope,o,n,r,a,e,s.beans,false,false);t.init();i.push(t)})}this.flushContainers(i)};e.prototype.onPinnedRowDataChanged=function(){this.redrawAfterModelUpdate()};e.prototype.onModelUpdated=function(e){var t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:true};this.redrawAfterModelUpdate(t)};e.prototype.getRenderedIndexesForRowNodes=function(n){var r=[];if(f.Utils.missing(n)){return r}f.Utils.iterateObject(this.rowCompsByIndex,function(e,t){var i=t.getRowNode();if(n.indexOf(i)>=0){r.push(e)}});return r};e.prototype.redrawRows=function(e){if(!e||e.length==0){return}var t=this.getRenderedIndexesForRowNodes(e);this.removeRowComps(t);this.redrawAfterModelUpdate({recycleRows:true})};e.prototype.getCellToRestoreFocusToAfterRefresh=function(e){var t=e.suppressKeepFocus?null:this.focusedCellController.getFocusCellToUseAfterRefresh();if(f.Utils.missing(t)){return null}var i=document.activeElement;var n=this.gridOptionsWrapper.getDomData(i,g.CellComp.DOM_DATA_KEY_CELL_COMP);var r=f.Utils.missing(n);if(r){return null}return t};e.prototype.redrawAfterModelUpdate=function(e){if(e===void 0){e={}}this.getLockOnRefresh();var t=this.getCellToRestoreFocusToAfterRefresh(e);this.sizeContainerToPageHeight();this.scrollToTopIfNewData(e);var i=e.recycleRows;var n=e.animate&&this.gridOptionsWrapper.isAnimateRows();var r=this.binRowComps(i);this.redraw(r,n);if(!e.onlyBody){this.refreshFloatingRowComps()}this.restoreFocusedCell(t);this.releaseLockOnRefresh()};e.prototype.scrollToTopIfNewData=function(e){var t=e.newData||e.newPage;var i=this.gridOptionsWrapper.isSuppressScrollOnNewData();if(t&&!i){this.gridPanel.scrollToTop()}};e.prototype.sizeContainerToPageHeight=function(){var e=this.paginationProxy.getCurrentPageHeight();if(e===0){e=1}this.heightScaler.setModelHeight(e);var t=this.heightScaler.getUiContainerHeight();this.rowContainers.body.setHeight(t);this.rowContainers.fullWidth.setHeight(t);this.rowContainers.pinnedLeft.setHeight(t);this.rowContainers.pinnedRight.setHeight(t)};e.prototype.getLockOnRefresh=function(){if(this.refreshInProgress){throw new Error("ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. "+"Your code probably called a grid API method while the grid was in the render stage. To overcome "+"this, put the API call into a timeout, eg instead of api.refreshView(), "+"call setTimeout(function(){api.refreshView(),0}). To see what part of your code "+"that caused the refresh check this stacktrace.")}this.refreshInProgress=true};e.prototype.releaseLockOnRefresh=function(){this.refreshInProgress=false};e.prototype.restoreFocusedCell=function(e){if(e){this.focusedCellController.setFocusedCell(e.rowIndex,e.column,e.floating,true)}};e.prototype.stopEditing=function(i){if(i===void 0){i=false}this.forEachRowComp(function(e,t){t.stopEditing(i)})};e.prototype.forEachCellComp=function(i){this.forEachRowComp(function(e,t){return t.forEachCellComp(i)})};e.prototype.forEachRowComp=function(e){f.Utils.iterateObject(this.rowCompsByIndex,e);f.Utils.iterateObject(this.floatingTopRowComps,e);f.Utils.iterateObject(this.floatingBottomRowComps,e)};e.prototype.addRenderedRowListener=function(e,t,i){var n=this.rowCompsByIndex[t];if(n){n.addEventListener(e,i)}};e.prototype.flashCells=function(e){if(e===void 0){e={}}this.forEachCellCompFiltered(e.rowNodes,e.columns,function(e){return e.flashCell()})};e.prototype.refreshCells=function(e){if(e===void 0){e={}}var t={forceRefresh:e.force,newData:false};this.forEachCellCompFiltered(e.rowNodes,e.columns,function(e){return e.refreshCell(t)})};e.prototype.getCellRendererInstances=function(e){var i=[];this.forEachCellCompFiltered(e.rowNodes,e.columns,function(e){var t=e.getCellRenderer();if(t){i.push(t)}});return i};e.prototype.getCellEditorInstances=function(e){var i=[];this.forEachCellCompFiltered(e.rowNodes,e.columns,function(e){var t=e.getCellEditor();if(t){i.push(t)}});return i};e.prototype.getEditingCells=function(){var i=[];this.forEachCellComp(function(e){if(e.isEditing()){var t=e.getGridCell().getGridCellDef();i.push(t)}});return i};e.prototype.forEachCellCompFiltered=function(e,t,r){var i=this;var o;if(f.Utils.exists(e)){o={top:{},bottom:{},normal:{}};e.forEach(function(e){if(e.rowPinned===h.Constants.PINNED_TOP){o.top[e.id]=true}else if(e.rowPinned===h.Constants.PINNED_BOTTOM){o.bottom[e.id]=true}else{o.normal[e.id]=true}})}var a;if(f.Utils.exists(t)){a={};t.forEach(function(e){var t=i.columnController.getGridColumn(e);if(f.Utils.exists(t)){a[t.getId()]=true}})}var n=function(e){var t=e.getRowNode();var i=t.id;var n=t.rowPinned;if(f.Utils.exists(o)){if(n===h.Constants.PINNED_BOTTOM){if(!o.bottom[i]){return}}else if(n===h.Constants.PINNED_TOP){if(!o.top[i]){return}}else{if(!o.normal[i]){return}}}e.forEachCellComp(function(e){var t=e.getColumn().getId();var i=a&&!a[t];if(i){return}r(e)})};f.Utils.iterateObject(this.rowCompsByIndex,function(e,t){n(t)});if(this.floatingTopRowComps){this.floatingTopRowComps.forEach(n)}if(this.floatingBottomRowComps){this.floatingBottomRowComps.forEach(n)}};e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=Object.keys(this.rowCompsByIndex);this.removeRowComps(e)};e.prototype.binRowComps=function(e){var n=this;var r;var o={};if(e){r=[];f.Utils.iterateObject(this.rowCompsByIndex,function(e,t){var i=t.getRowNode();if(f.Utils.exists(i.id)){o[i.id]=t;delete n.rowCompsByIndex[e]}else{r.push(e)}})}else{r=Object.keys(this.rowCompsByIndex)}this.removeRowComps(r);return o};e.prototype.removeRowComps=function(e){var i=this;e.forEach(function(e){var t=i.rowCompsByIndex[e];t.destroy();delete i.rowCompsByIndex[e]})};e.prototype.redrawAfterScroll=function(){this.getLockOnRefresh();this.redraw(null,false,true);this.releaseLockOnRefresh()};e.prototype.removeRowCompsNotToDraw=function(e){var t={};e.forEach(function(e){return t[e]=true});var i=Object.keys(this.rowCompsByIndex);var n=f.Utils.filter(i,function(e){return!t[e]});this.removeRowComps(n)};e.prototype.calculateIndexesToDraw=function(){var n=this;var r=f.Utils.createArrayOfNumbers(this.firstRenderedRow,this.lastRenderedRow);f.Utils.iterateObject(this.rowCompsByIndex,function(e,t){var i=Number(e);if(i<n.firstRenderedRow||i>n.lastRenderedRow){if(n.keepRowBecauseEditing(t)){r.push(i)}}});r.sort(function(e,t){return e-t});return r};e.prototype.redraw=function(i,n,r){var o=this;if(n===void 0){n=false}if(r===void 0){r=false}this.heightScaler.update();this.workOutFirstAndLastRowsToRender();var e=this.calculateIndexesToDraw();this.removeRowCompsNotToDraw(e);var a=[];var s=[];e.forEach(function(e){var t=o.createOrUpdateRowComp(e,i,n,r);if(f.Utils.exists(t)){s.push(t);f.Utils.pushAll(a,t.getAndClearNextVMTurnFunctions())}});this.flushContainers(s);f.Utils.executeNextVMTurn(a);if(r&&!this.gridOptionsWrapper.isSuppressAnimationFrame()){this.beans.taskQueue.addP2Task(this.destroyRowComps.bind(this,i,n))}else{this.destroyRowComps(i,n)}this.checkAngularCompile()};e.prototype.flushContainers=function(e){f.Utils.iterateObject(this.rowContainers,function(e,t){if(t){t.flushRowTemplates()}});e.forEach(function(e){return e.afterFlush()})};e.prototype.onDisplayedColumnsChanged=function(){var e=this.columnController.isPinningLeft();var t=this.columnController.isPinningRight();var i=this.pinningLeft!==e||t!==this.pinningRight;if(i){this.pinningLeft=e;this.pinningRight=t;if(this.gridOptionsWrapper.isEmbedFullWidthRows()){this.redrawFullWidthEmbeddedRows()}}};e.prototype.redrawFullWidthEmbeddedRows=function(){var n=[];f.Utils.iterateObject(this.rowCompsByIndex,function(e,t){if(t.isFullWidth()){var i=t.getRowNode().rowIndex;n.push(i.toString())}});this.refreshFloatingRowComps();this.removeRowComps(n);this.redrawAfterScroll()};e.prototype.createOrUpdateRowComp=function(e,t,i,n){var r;var o=this.rowCompsByIndex[e];if(!o){r=this.paginationProxy.getRow(e);if(f.Utils.exists(r)&&f.Utils.exists(t)&&t[r.id]){o=t[r.id];t[r.id]=null}}var a=!o;if(a){if(!r){r=this.paginationProxy.getRow(e)}if(f.Utils.exists(r)){o=this.createRowComp(r,i,n)}else{return}}else{o.ensureDomOrder()}this.rowCompsByIndex[e]=o;return o};e.prototype.destroyRowComps=function(e,i){var n=[];f.Utils.iterateObject(e,function(e,t){if(!t){return}t.destroy(i);f.Utils.pushAll(n,t.getAndClearDelayedDestroyFunctions())});f.Utils.executeInAWhile(n)};e.prototype.checkAngularCompile=function(){var e=this;if(this.gridOptionsWrapper.isAngularCompileRows()){setTimeout(function(){e.$scope.$apply()},0)}};e.prototype.workOutFirstAndLastRowsToRender=function(){var e;var t;if(!this.paginationProxy.isRowsToRender()){e=0;t=-1}else{var i=this.paginationProxy.getPageFirstRow();var n=this.paginationProxy.getPageLastRow();var r=this.paginationProxy?this.paginationProxy.getPixelOffset():0;var o=this.heightScaler.getOffset();var a=this.gridPanel.getVScrollPosition();var s=a.top;var l=a.bottom;var u=s+r+o;var c=l+r+o;var d=this.paginationProxy.getRowIndexAtPixel(u);var f=this.paginationProxy.getRowIndexAtPixel(c);var p=this.gridOptionsWrapper.getRowBuffer();d=d-p;f=f+p;if(d<i){d=i}if(f>n){f=n}e=d;t=f}var h=e!==this.firstRenderedRow;var g=t!==this.lastRenderedRow;if(h||g){this.firstRenderedRow=e;this.lastRenderedRow=t;var v={type:m.Events.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(v)}};e.prototype.getFirstVirtualRenderedRow=function(){return this.firstRenderedRow};e.prototype.getLastVirtualRenderedRow=function(){return this.lastRenderedRow};e.prototype.keepRowBecauseEditing=function(e){var t=false;var i=true;var n=e.getRowNode();var r=this.focusedCellController.isRowNodeFocused(n);var o=e.isEditing();var a=r||o;if(!a){return t}var s=this.paginationProxy.isRowPresent(n);return s?i:t};e.prototype.createRowComp=function(e,t,i){var n=i&&!this.gridOptionsWrapper.isSuppressAnimationFrame();var r=new p.RowComp(this.$scope,this.rowContainers.body,this.rowContainers.pinnedLeft,this.rowContainers.pinnedRight,this.rowContainers.fullWidth,e,this.beans,t,n);r.init();return r};e.prototype.getRenderedNodes=function(){var t=this.rowCompsByIndex;return Object.keys(t).map(function(e){return t[e].getRowNode()})};e.prototype.navigateToNextCell=function(e,t,i,n){var r=i;while(true){r=this.cellNavigationService.getNextCellToFocus(t,r);if(f.Utils.missing(r)){break}var o=this.gridOptionsWrapper.isGroupUseEntireRow();if(o){var a=this.paginationProxy.getRow(r.rowIndex);if(!a.group){break}}else{break}}if(n){var s=this.gridOptionsWrapper.getNavigateToNextCellFunc();if(f.Utils.exists(s)){var l={key:t,previousCellDef:i,nextCellDef:r?r.getGridCellDef():null,event:e};var u=s(l);if(f.Utils.exists(u)){r=new E.GridCell(u)}else{r=null}}}if(!r){return}this.ensureCellVisible(r);this.focusedCellController.setFocusedCell(r.rowIndex,r.column,r.floating,true);if(this.rangeController){var c=new E.GridCell({rowIndex:r.rowIndex,floating:r.floating,column:r.column});this.rangeController.setRangeToCell(c)}};e.prototype.ensureCellVisible=function(e){if(f.Utils.missing(e.floating)){this.gridPanel.ensureIndexVisible(e.rowIndex)}if(!e.column.isPinned()){this.gridPanel.ensureColumnVisible(e.column)}this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();this.animationFrameService.flushAllFrames()};e.prototype.startEditingCell=function(e,t,i){var n=this.getComponentForCell(e);if(n){n.startRowOrCellEdit(t,i)}};e.prototype.getComponentForCell=function(e){var t;switch(e.floating){case h.Constants.PINNED_TOP:t=this.floatingTopRowComps[e.rowIndex];break;case h.Constants.PINNED_BOTTOM:t=this.floatingBottomRowComps[e.rowIndex];break;default:t=this.rowCompsByIndex[e.rowIndex];break}if(!t){return null}var i=t.getRenderedCellForColumn(e.column);return i};e.prototype.onTabKeyDown=function(e,t){var i=t.shiftKey;var n=this.moveToCellAfter(e,i);if(n){t.preventDefault()}};e.prototype.tabToNextCell=function(e){var t=this.focusedCellController.getFocusedCell();if(f.Utils.missing(t)){return false}var i=this.getComponentForCell(t);if(f.Utils.missing(i)){return false}var n=this.moveToCellAfter(i,e);return n};e.prototype.moveToCellAfter=function(e,t){var i=e.isEditing();var n;if(i){if(this.gridOptionsWrapper.isFullRowEdit()){n=this.moveToNextEditingRow(e,t)}else{n=this.moveToNextEditingCell(e,t)}}else{n=this.moveToNextCellNotEditing(e,t)}return n};e.prototype.moveToNextEditingCell=function(e,t){var i=e.getGridCell();e.stopEditing();var n=this.findNextCellToFocusOn(i,t,true);var r=f.Utils.exists(n);if(r){n.startEditingIfEnabled(null,null,true);n.focusCell(false)}return r};e.prototype.moveToNextEditingRow=function(e,t){var i=e.getGridCell();var n=this.findNextCellToFocusOn(i,t,true);var r=f.Utils.exists(n);if(r){this.moveEditToNextCellOrRow(e,n)}return r};e.prototype.moveToNextCellNotEditing=function(e,t){var i=e.getGridCell();var n=this.findNextCellToFocusOn(i,t,false);var r=f.Utils.exists(n);if(r){n.focusCell(true)}return r};e.prototype.moveEditToNextCellOrRow=function(e,t){var i=e.getGridCell();var n=t.getGridCell();var r=i.rowIndex===n.rowIndex&&i.floating===n.floating;if(r){e.setFocusOutOnEditor();t.setFocusInOnEditor()}else{var o=e.getRenderedRow();var a=t.getRenderedRow();e.setFocusOutOnEditor();o.stopEditing();a.startRowEditing();t.setFocusInOnEditor()}t.focusCell()};e.prototype.findNextCellToFocusOn=function(e,t,i){var n=e;while(true){n=this.cellNavigationService.getNextTabbedCell(n,t);var r=this.gridOptionsWrapper.getTabToNextCellFunc();if(f.Utils.exists(r)){var o={backwards:t,editing:i,previousCellDef:e.getGridCellDef(),nextCellDef:n?n.getGridCellDef():null};var a=r(o);if(f.Utils.exists(a)){n=new E.GridCell(a)}else{n=null}}if(!n){return null}if(i){var s=this.paginationProxy.getRow(n.rowIndex);var l=n.column.isCellEditable(s);if(!l){continue}}var u=f.Utils.missing(n.floating);if(u){this.gridPanel.ensureIndexVisible(n.rowIndex)}if(!n.column.isPinned()){this.gridPanel.ensureColumnVisible(n.column)}this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();this.animationFrameService.flushAllFrames();var c=this.getComponentForCell(n);if(f.Utils.missing(c)){continue}if(c.isSuppressNavigable()){continue}if(this.rangeController){var d=new E.GridCell({rowIndex:n.rowIndex,floating:n.floating,column:n.column});this.rangeController.setRangeToCell(d)}return c}};r([v.Autowired("paginationProxy"),o("design:type",T.PaginationProxy)],e.prototype,"paginationProxy",void 0);r([v.Autowired("columnController"),o("design:type",_.ColumnController)],e.prototype,"columnController",void 0);r([v.Autowired("gridOptionsWrapper"),o("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);r([v.Autowired("gridCore"),o("design:type",y.GridCore)],e.prototype,"gridCore",void 0);r([v.Autowired("$scope"),o("design:type",Object)],e.prototype,"$scope",void 0);r([v.Autowired("expressionService"),o("design:type",l.ExpressionService)],e.prototype,"expressionService",void 0);r([v.Autowired("templateService"),o("design:type",u.TemplateService)],e.prototype,"templateService",void 0);r([v.Autowired("valueService"),o("design:type",c.ValueService)],e.prototype,"valueService",void 0);r([v.Autowired("eventService"),o("design:type",d.EventService)],e.prototype,"eventService",void 0);r([v.Autowired("pinnedRowModel"),o("design:type",D.PinnedRowModel)],e.prototype,"pinnedRowModel",void 0);r([v.Autowired("context"),o("design:type",v.Context)],e.prototype,"context",void 0);r([v.Autowired("loggerFactory"),o("design:type",w.LoggerFactory)],e.prototype,"loggerFactory",void 0);r([v.Autowired("focusedCellController"),o("design:type",C.FocusedCellController)],e.prototype,"focusedCellController",void 0);r([v.Autowired("cellNavigationService"),o("design:type",A.CellNavigationService)],e.prototype,"cellNavigationService",void 0);r([v.Autowired("columnApi"),o("design:type",b.ColumnApi)],e.prototype,"columnApi",void 0);r([v.Autowired("gridApi"),o("design:type",S.GridApi)],e.prototype,"gridApi",void 0);r([v.Autowired("beans"),o("design:type",k.Beans)],e.prototype,"beans",void 0);r([v.Autowired("heightScaler"),o("design:type",R.HeightScaler)],e.prototype,"heightScaler",void 0);r([v.Autowired("animationFrameService"),o("design:type",O.AnimationFrameService)],e.prototype,"animationFrameService",void 0);r([v.Optional("rangeController"),o("design:type",Object)],e.prototype,"rangeController",void 0);r([a(0,v.Qualifier("loggerFactory")),o("design:type",Function),o("design:paramtypes",[w.LoggerFactory]),o("design:returntype",void 0)],e.prototype,"agWire",null);r([v.PreDestroy,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"destroy",null);e=r([v.Bean("rowRenderer")],e);return e}(x.BeanStub);t.RowRenderer=N},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var d=i(91);var a=i(2);var f=i(122);var s=i(18);var l=i(27);var p=i(1);var u=i(124);var h=i(6);var g=i(7);var c;(function(e){e[e["AG_GRID"]=0]="AG_GRID";e[e["FRAMEWORK"]=1]="FRAMEWORK"})(c||(c={}));var v=function(){function e(){}c=e;e.prototype.newDateComponent=function(e){return this.componentResolver.createAgGridComponent(this.gridOptions,e,"dateComponent",{api:this.gridApi,columnApi:this.columnApi},"agDateInput")};e.prototype.newHeaderComponent=function(e){return this.componentResolver.createAgGridComponent(e.column.getColDef(),e,"headerComponent",{api:this.gridApi,columnApi:this.columnApi,column:e.column,colDef:e.column.getColDef()},"agColumnHeader")};e.prototype.newHeaderGroupComponent=function(e){return this.componentResolver.createAgGridComponent(e.columnGroup.getColGroupDef(),e,"headerGroupComponent",{api:this.gridApi,columnApi:this.columnApi},"agColumnGroupHeader")};e.prototype.newFloatingFilterWrapperComponent=function(t,e){var i=this;var n=t.getColDef();if(n.suppressFilter){return this.newEmptyFloatingFilterWrapperComponent(t)}var r;if(!n.filter){r=this.gridOptionsWrapper.isEnterprise()?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}else if(typeof n.filter==="string"&&Object.keys(c.filterToFloatingFilterNames).indexOf(n.filter)>-1){r=c.filterToFloatingFilterNames[n.filter]}var o={column:t,colDef:n,api:this.gridApi,columnApi:this.columnApi};var a=this.componentResolver.createAgGridComponent(n,e,"floatingFilterComponent",o,r,false);var s={column:t,floatingFilterComp:a,suppressFilterButton:this.componentResolver.mergeParams(n,"floatingFilterComponent",o,e).suppressFilterButton};if(!a){var l=this.getFilterComponentPrototype(n);if(l&&!l.component.prototype.getModelAsString){return this.newEmptyFloatingFilterWrapperComponent(t)}var u=e.currentParentModel;e.currentParentModel=function(){var e=i.filterManager.getFilterComponent(t);return e.resolveNow(null,function(e){return e.getModelAsString?e.getModelAsString(u()):null})};s.floatingFilterComp=p.Promise.resolve(this.componentResolver.createInternalAgGridComponent(d.ReadModelAsStringFloatingFilterComp,e))}return this.componentResolver.createInternalAgGridComponent(f.FloatingFilterWrapperComp,s)};e.prototype.newFullWidthGroupRowInnerCellRenderer=function(e){return this.componentResolver.createAgGridComponent(this.gridOptions,e,"groupRowInnerRenderer",e,null,false)};e.prototype.newCellRenderer=function(e,t){return this.componentResolver.createAgGridComponent(e,t,"cellRenderer",t,null,false)};e.prototype.newInnerCellRenderer=function(e,t){return this.componentResolver.createAgGridComponent(e,t,"innerRenderer",t,null)};e.prototype.newFullRowGroupRenderer=function(e){return this.componentResolver.createAgGridComponent(this.gridOptionsWrapper,e,"fullWidthCellRenderer",e,null)};e.prototype.newOverlayWrapperComponent=function(){return this.componentResolver.createInternalAgGridComponent(u.OverlayWrapperComponent,null)};e.prototype.newLoadingOverlayComponent=function(){return this.componentResolver.createAgGridComponent(this.gridOptions,null,"loadingOverlayComponent",{api:this.gridApi,columnApi:this.columnApi},"agLoadingOverlay")};e.prototype.newNoRowsOverlayComponent=function(){return this.componentResolver.createAgGridComponent(this.gridOptions,null,"noRowsOverlayComponent",{api:this.gridApi,columnApi:this.columnApi},"agNoRowsOverlay")};e.prototype.getFilterComponentPrototype=function(e){return this.componentResolver.getComponentToUse(e,"filter",{api:this.gridApi,columnApi:this.columnApi,colDef:e})};e.prototype.newEmptyFloatingFilterWrapperComponent=function(e){var t={column:e,floatingFilterComp:null};return this.componentResolver.createInternalAgGridComponent(f.EmptyFloatingFilterWrapperComp,t)};e.filterToFloatingFilterNames={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};n([o.Autowired("componentResolver"),r("design:type",l.ComponentResolver)],e.prototype,"componentResolver",void 0);n([o.Autowired("gridOptions"),r("design:type",Object)],e.prototype,"gridOptions",void 0);n([o.Autowired("gridApi"),r("design:type",h.GridApi)],e.prototype,"gridApi",void 0);n([o.Autowired("columnApi"),r("design:type",g.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("filterManager"),r("design:type",s.FilterManager)],e.prototype,"filterManager",void 0);e=c=n([o.Bean("componentRecipes")],e);return e;var c}();t.ComponentRecipes=v},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(3);var s=i(5);var l=i(2);var u=i(7);var c=i(4);var d=i(1);var f=i(23);var p=i(6);var h=i(34);var g=function(){function e(){}e.prototype.init=function(){this.eventService.addEventListener(s.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_EVERYTHING_CHANGED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_GROUP_OPENED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_MOVED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_PINNED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearFocusedCell.bind(this));this.eventService.addEventListener(s.Events.EVENT_COLUMN_VISIBLE,this.clearFocusedCell.bind(this))};e.prototype.clearFocusedCell=function(){this.focusedCell=null;this.onCellFocused(false)};e.prototype.getFocusedCell=function(){return this.focusedCell};e.prototype.getFocusCellToUseAfterRefresh=function(){if(this.gridOptionsWrapper.isSuppressFocusAfterRefresh()){return null}if(!this.focusedCell){return null}var e=this.getGridCellForDomElement(document.activeElement);if(!e){return null}return this.focusedCell};e.prototype.getGridCellForDomElement=function(e){var t=e;while(t){var i=this.gridOptionsWrapper.getDomData(t,h.CellComp.DOM_DATA_KEY_CELL_COMP);if(i){return i.getGridCell()}t=t.parentNode}return null};e.prototype.setFocusedCell=function(e,t,i,n){if(n===void 0){n=false}var r=d.Utils.makeNull(this.columnController.getGridColumn(t));this.focusedCell=new f.GridCell({rowIndex:e,floating:d.Utils.makeNull(i),column:r});this.onCellFocused(n)};e.prototype.isCellFocused=function(e){if(d.Utils.missing(this.focusedCell)){return false}return this.focusedCell.column===e.column&&this.isRowFocused(e.rowIndex,e.floating)};e.prototype.isRowNodeFocused=function(e){return this.isRowFocused(e.rowIndex,e.rowPinned)};e.prototype.isAnyCellFocused=function(){return!!this.focusedCell};e.prototype.isRowFocused=function(e,t){if(d.Utils.missing(this.focusedCell)){return false}var i=d.Utils.makeNull(t);return this.focusedCell.rowIndex===e&&this.focusedCell.floating===i};e.prototype.onCellFocused=function(e){var t={type:s.Events.EVENT_CELL_FOCUSED,forceBrowserFocus:e,rowIndex:null,column:null,floating:null,api:this.gridApi,columnApi:this.columnApi,rowPinned:null};if(this.focusedCell){t.rowIndex=this.focusedCell.rowIndex;t.column=this.focusedCell.column;t.rowPinned=this.focusedCell.floating}this.eventService.dispatchEvent(t)};n([o.Autowired("eventService"),r("design:type",a.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("columnApi"),r("design:type",u.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridApi"),r("design:type",p.GridApi)],e.prototype,"gridApi",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("focusedCellController")],e);return e}();t.FocusedCellController=g},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(1);var r=i(64);var o=function(){function e(e){this.rowIndex=e.rowIndex;this.column=e.column;this.floating=n.Utils.makeNull(e.floating)}e.prototype.getGridCellDef=function(){return{rowIndex:this.rowIndex,column:this.column,floating:this.floating}};e.prototype.getGridRow=function(){return new r.GridRow(this.rowIndex,this.floating)};e.prototype.toString=function(){return"rowIndex = "+this.rowIndex+", floating = "+this.floating+", column = "+(this.column?this.column.getId():null)};e.prototype.createId=function(){return this.rowIndex+"."+this.floating+"."+this.column.getId()};e.prototype.equals=function(e){var t=this.column===e.column;var i=this.floating===e.floating;var n=this.rowIndex===e.rowIndex;return t&&i&&n};return e}();t.GridCell=o},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(10);var o=i(0);var l=i(2);var u=i(7);var c=i(4);var d=i(3);var f=i(5);var p=i(0);var h=i(1);var g=i(6);var a=function(){function e(){}a=e;e.prototype.progressSort=function(e,t,i){if(i===void 0){i="api"}var n=this.getNextSortDirection(e);this.setSortForColumn(e,n,t,i)};e.prototype.setSortForColumn=function(e,t,i,n){if(n===void 0){n="api"}if(t!==s.Column.SORT_ASC&&t!==s.Column.SORT_DESC){t=null}e.setSort(t,n);if(e.getSort()){var r=Number((new Date).valueOf());e.setSortedAt(r)}else{e.setSortedAt(null)}var o=i&&!this.gridOptionsWrapper.isSuppressMultiSort();if(!o){this.clearSortBarThisColumn(e,n)}this.dispatchSortChangedEvents()};e.prototype.onSortChanged=function(){this.dispatchSortChangedEvents()};e.prototype.dispatchSortChangedEvents=function(){var e={type:f.Events.EVENT_SORT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)};e.prototype.clearSortBarThisColumn=function(t,i){this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach(function(e){if(!(e===t)){e.setSort(null,i)}})};e.prototype.getNextSortDirection=function(e){var t;if(e.getColDef().sortingOrder){t=e.getColDef().sortingOrder}else if(this.gridOptionsWrapper.getSortingOrder()){t=this.gridOptionsWrapper.getSortingOrder()}else{t=a.DEFAULT_SORTING_ORDER}if(!Array.isArray(t)||t.length<=0){console.warn("ag-grid: sortingOrder must be an array with at least one element, currently it's "+t);return}var i=t.indexOf(e.getSort());var n=i<0;var r=i==t.length-1;var o;if(n||r){o=t[0]}else{o=t[i+1]}if(a.DEFAULT_SORTING_ORDER.indexOf(o)<0){console.warn("ag-grid: invalid sort type "+o);return null}return o};e.prototype.getSortModel=function(){var e=this.getColumnsWithSortingOrdered();return h.Utils.map(e,function(e){return{colId:e.getColId(),sort:e.getSort()}})};e.prototype.setSortModel=function(o,a){var s=this;if(a===void 0){a="api"}if(!this.gridOptionsWrapper.isEnableSorting()){console.warn("ag-grid: You are setting the sort model on a grid that does not have sorting enabled");return}var l=o&&o.length>0;var e=this.columnController.getPrimaryAndSecondaryAndAutoColumns();e.forEach(function(e){var t=null;var i=-1;if(l&&!e.getColDef().suppressSorting){for(var n=0;n<o.length;n++){var r=o[n];if(typeof r.colId==="string"&&typeof e.getColId()==="string"&&s.compareColIds(r,e)){t=r.sort;i=n}}}if(t){e.setSort(t,a);e.setSortedAt(i)}else{e.setSort(null,a);e.setSortedAt(null)}});this.dispatchSortChangedEvents()};e.prototype.compareColIds=function(e,t){return e.colId===t.getColId()};e.prototype.getColumnsWithSortingOrdered=function(){var e=this.columnController.getPrimaryAndSecondaryAndAutoColumns();var t=h.Utils.filter(e,function(e){return!!e.getSort()});t.sort(function(e,t){return e.sortedAt-t.sortedAt});return t};e.prototype.getSortForRowController=function(){var e=this.getColumnsWithSortingOrdered();return h.Utils.map(e,function(e){var t=e.getSort()===s.Column.SORT_ASC;return{inverter:t?1:-1,column:e}})};e.DEFAULT_SORTING_ORDER=[s.Column.SORT_ASC,s.Column.SORT_DESC,null];n([o.Autowired("gridOptionsWrapper"),r("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("eventService"),r("design:type",d.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("columnApi"),r("design:type",u.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridApi"),r("design:type",g.GridApi)],e.prototype,"gridApi",void 0);e=a=n([p.Bean("sortController")],e);return e;var a}();t.SortController=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged";e.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded";e.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged";e.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged";e.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged";e.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged";e.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged";e.EVENT_COLUMN_MOVED="columnMoved";e.EVENT_COLUMN_VISIBLE="columnVisible";e.EVENT_COLUMN_PINNED="columnPinned";e.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened";e.EVENT_COLUMN_RESIZED="columnResized";e.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged";e.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged";e.EVENT_ROW_GROUP_OPENED="rowGroupOpened";e.EVENT_ROW_DATA_CHANGED="rowDataChanged";e.EVENT_ROW_DATA_UPDATED="rowDataUpdated";e.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged";e.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged";e.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged";e.EVENT_MODEL_UPDATED="modelUpdated";e.EVENT_PASTE_START="pasteStart";e.EVENT_PASTE_END="pasteEnd";e.EVENT_CELL_CLICKED="cellClicked";e.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked";e.EVENT_CELL_MOUSE_DOWN="cellMouseDown";e.EVENT_CELL_CONTEXT_MENU="cellContextMenu";e.EVENT_CELL_VALUE_CHANGED="cellValueChanged";e.EVENT_ROW_VALUE_CHANGED="rowValueChanged";e.EVENT_CELL_FOCUSED="cellFocused";e.EVENT_ROW_SELECTED="rowSelected";e.EVENT_SELECTION_CHANGED="selectionChanged";e.EVENT_CELL_MOUSE_OVER="cellMouseOver";e.EVENT_CELL_MOUSE_OUT="cellMouseOut";e.EVENT_FILTER_CHANGED="filterChanged";e.EVENT_FILTER_MODIFIED="filterModified";e.EVENT_SORT_CHANGED="sortChanged";e.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved";e.EVENT_ROW_CLICKED="rowClicked";e.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked";e.EVENT_GRID_READY="gridReady";e.DEPRECATED_EVENT_GRID_SIZE_CHANGED="gridSizeChanged";e.EVENT_VIEWPORT_CHANGED="viewportChanged";e.EVENT_DRAG_STARTED="dragStarted";e.EVENT_DRAG_STOPPED="dragStopped";e.EVENT_ROW_EDITING_STARTED="rowEditingStarted";e.EVENT_ROW_EDITING_STOPPED="rowEditingStopped";e.EVENT_CELL_EDITING_STARTED="cellEditingStarted";e.EVENT_CELL_EDITING_STOPPED="cellEditingStopped";e.EVENT_BODY_SCROLL="bodyScroll";e.EVENT_ANIMATION_QUEUE_EMPTY="animationQueueEmpty";e.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged";e.EVENT_PAGINATION_CHANGED="paginationChanged";e.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged";e.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged";e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged";e.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged";e.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged";e.EVENT_FLASH_CELLS="flashCells";e.EVENT_ROW_DRAG_ENTER="rowDragEnter";e.EVENT_ROW_DRAG_MOVE="rowDragMove";e.EVENT_ROW_DRAG_LEAVE="rowDragLeave";e.EVENT_ROW_DRAG_END="rowDragEnd";e.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest";e.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest";e.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest";e.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest";return e}();t.Events=n},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(10);var s=i(3);var l=i(0);var u=i(2);var c=i(7);var d=i(6);var n=function(){function n(e,t,i){this.displayedChildren=[];this.localEventService=new s.EventService;this.groupId=t;this.instanceId=i;this.originalColumnGroup=e}n.createUniqueId=function(e,t){return e+"_"+t};n.prototype.reset=function(){this.parent=null;this.children=null;this.displayedChildren=null};n.prototype.getParent=function(){return this.parent};n.prototype.setParent=function(e){this.parent=e};n.prototype.getUniqueId=function(){return n.createUniqueId(this.groupId,this.instanceId)};n.prototype.isEmptyGroup=function(){return this.displayedChildren.length===0};n.prototype.isMoving=function(){var e=this.getOriginalColumnGroup().getLeafColumns();if(!e||e.length===0){return false}var t=true;e.forEach(function(e){if(!e.isMoving()){t=false}});return t};n.prototype.checkLeft=function(){this.displayedChildren.forEach(function(e){if(e instanceof n){e.checkLeft()}});if(this.displayedChildren.length>0){if(this.gridOptionsWrapper.isEnableRtl()){var e=this.displayedChildren[this.displayedChildren.length-1];var t=e.getLeft();this.setLeft(t)}else{var i=this.displayedChildren[0].getLeft();this.setLeft(i)}}else{this.setLeft(null)}};n.prototype.getLeft=function(){return this.left};n.prototype.getOldLeft=function(){return this.oldLeft};n.prototype.setLeft=function(e){this.oldLeft=e;if(this.left!==e){this.left=e;this.localEventService.dispatchEvent(this.createAgEvent(n.EVENT_LEFT_CHANGED))}};n.prototype.createAgEvent=function(e){return{type:e}};n.prototype.addEventListener=function(e,t){this.localEventService.addEventListener(e,t)};n.prototype.removeEventListener=function(e,t){this.localEventService.removeEventListener(e,t)};n.prototype.getGroupId=function(){return this.groupId};n.prototype.getInstanceId=function(){return this.instanceId};n.prototype.isChildInThisGroupDeepSearch=function(t){var i=false;this.children.forEach(function(e){if(t===e){i=true}if(e instanceof n){if(e.isChildInThisGroupDeepSearch(t)){i=true}}});return i};n.prototype.getActualWidth=function(){var t=0;if(this.displayedChildren){this.displayedChildren.forEach(function(e){t+=e.getActualWidth()})}return t};n.prototype.isResizable=function(){if(!this.displayedChildren){return false}var t=false;this.displayedChildren.forEach(function(e){if(e.isResizable()){t=true}});return t};n.prototype.getMinWidth=function(){var t=0;this.displayedChildren.forEach(function(e){t+=e.getMinWidth()});return t};n.prototype.addChild=function(e){if(!this.children){this.children=[]}this.children.push(e)};n.prototype.getDisplayedChildren=function(){return this.displayedChildren};n.prototype.getLeafColumns=function(){var e=[];this.addLeafColumns(e);return e};n.prototype.getDisplayedLeafColumns=function(){var e=[];this.addDisplayedLeafColumns(e);return e};n.prototype.getDefinition=function(){return this.originalColumnGroup.getColGroupDef()};n.prototype.getColGroupDef=function(){return this.originalColumnGroup.getColGroupDef()};n.prototype.isPadding=function(){return this.originalColumnGroup.isPadding()};n.prototype.isExpandable=function(){return this.originalColumnGroup.isExpandable()};n.prototype.isExpanded=function(){return this.originalColumnGroup.isExpanded()};n.prototype.setExpanded=function(e){this.originalColumnGroup.setExpanded(e)};n.prototype.addDisplayedLeafColumns=function(t){this.displayedChildren.forEach(function(e){if(e instanceof a.Column){t.push(e)}else if(e instanceof n){e.addDisplayedLeafColumns(t)}})};n.prototype.addLeafColumns=function(t){this.children.forEach(function(e){if(e instanceof a.Column){t.push(e)}else if(e instanceof n){e.addLeafColumns(t)}})};n.prototype.getChildren=function(){return this.children};n.prototype.getColumnGroupShow=function(){return this.originalColumnGroup.getColumnGroupShow()};n.prototype.getOriginalColumnGroup=function(){return this.originalColumnGroup};n.prototype.calculateDisplayedColumns=function(){var i=this;this.displayedChildren=[];if(!this.originalColumnGroup.isExpandable()){this.displayedChildren=this.children}else{this.children.forEach(function(e){var t=e.getColumnGroupShow();switch(t){case n.HEADER_GROUP_SHOW_OPEN:if(i.originalColumnGroup.isExpanded()){i.displayedChildren.push(e)}break;case n.HEADER_GROUP_SHOW_CLOSED:if(!i.originalColumnGroup.isExpanded()){i.displayedChildren.push(e)}break;default:i.displayedChildren.push(e);break}})}this.localEventService.dispatchEvent(this.createAgEvent(n.EVENT_DISPLAYED_CHILDREN_CHANGED))};n.HEADER_GROUP_SHOW_OPEN="open";n.HEADER_GROUP_SHOW_CLOSED="closed";n.EVENT_LEFT_CHANGED="leftChanged";n.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged";r([l.Autowired("gridOptionsWrapper"),o("design:type",u.GridOptionsWrapper)],n.prototype,"gridOptionsWrapper",void 0);r([l.Autowired("columnApi"),o("design:type",c.ColumnApi)],n.prototype,"columnApi",void 0);r([l.Autowired("gridApi"),o("design:type",d.GridApi)],n.prototype,"gridApi",void 0);return n}();t.ColumnGroup=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var p=i(1);var s=i(66);var l=i(76);var u=i(77);var h;(function(e){e[e["AG_GRID"]=0]="AG_GRID";e[e["FRAMEWORK"]=1]="FRAMEWORK"})(h=t.ComponentType||(t.ComponentType={}));var g;(function(e){e[e["DEFAULT"]=0]="DEFAULT";e[e["REGISTERED_BY_NAME"]=1]="REGISTERED_BY_NAME";e[e["HARDCODED"]=2]="HARDCODED"})(g=t.ComponentSource||(t.ComponentSource={}));var c=function(){function e(){}e.prototype.getComponentToUse=function(e,t,i,n){var r=null;var o=null;var a=null;var s=null;var l;if(e!=null){var u=e[t];if(u!=null){if(typeof u==="string"){r=u}else if(this.agComponentUtils.doesImplementIComponent(u)){o=u}else{a=u}}s=e[t+"Framework"];l=e[t+"Selector"]}if(o&&s||r&&s||a&&s){throw Error("ag-grid: you are trying to specify: "+t+" twice as a component.")}if(s&&!this.frameworkComponentWrapper){throw Error("ag-grid: you are specifying a framework component but you are not using a framework version of ag-grid for : "+t)}if(l&&(r||o||a||s)){throw Error("ag-grid: you can't specify both, the selector and the component of ag-grid for : "+t)}if(s){return{type:h.FRAMEWORK,component:s,source:g.HARDCODED,dynamicParams:null}}if(o){return{type:h.AG_GRID,component:o,source:g.HARDCODED,dynamicParams:null}}if(a){return this.agComponentUtils.adaptFunction(t,a,h.AG_GRID,g.HARDCODED)}if(l){var c=l(i);if(c!=null){if(c.component==null){c.component=n}var d=this.resolveByName(t,c.component);return p._.assign(d,{dynamicParams:c.params})}}var f;if(r){f=r}else{f=n}return f==null?null:this.resolveByName(t,f)};e.prototype.resolveByName=function(e,t){var i=t!=null?t:e;var n=this.componentProvider.retrieve(i);if(n==null)return null;if(n.type==h.FRAMEWORK){return{component:n.component,type:h.FRAMEWORK,source:g.REGISTERED_BY_NAME,dynamicParams:null}}if(this.agComponentUtils.doesImplementIComponent(n.component)){return{component:n.component,type:h.AG_GRID,source:n.source==s.RegisteredComponentSource.REGISTERED?g.REGISTERED_BY_NAME:g.DEFAULT,dynamicParams:null}}return this.agComponentUtils.adaptFunction(e,n.component,n.type,n.source==s.RegisteredComponentSource.REGISTERED?g.REGISTERED_BY_NAME:g.DEFAULT)};e.prototype.mergeParams=function(e,t,i,n,r){if(r===void 0){r=null}var o=e?e[t+"Params"]:null;var a={};p._.mergeDeep(a,i);if(o!=null){var s=null;if(typeof o==="function"){s=o(n)}else{s=o}p._.mergeDeep(a,s)}p._.mergeDeep(a,r);if(!a.api){a.api=this.gridOptions.api}return a};e.prototype.createAgGridComponent=function(e,t,i,n,r,o,a){if(o===void 0){o=true}var s=e==null?this.gridOptions:e;var l=this.newAgGridComponent(s,i,n,r,o);if(!l)return null;var u=this.mergeParams(s,i,t,n,l[1]);u.agGridReact=this.context.getBean("agGridReact")?p._.cloneObject(this.context.getBean("agGridReact")):{};u.frameworkComponentWrapper=this.context.getBean("frameworkComponentWrapper")?this.context.getBean("frameworkComponentWrapper"):{};var c=this.initialiseComponent(l[0],u,a);if(c==null){return p.Promise.resolve(l[0])}else{var d=c;return d.map(function(e){return l[0]})}};e.prototype.createInternalAgGridComponent=function(e,t,i){var n=new e;this.initialiseComponent(n,t,i);return n};e.prototype.newAgGridComponent=function(e,t,i,n,r){if(r===void 0){r=true}var o=this.getComponentToUse(e,t,i,n);if(!o||!o.component){if(r){console.error("Error creating component "+t+"=>"+n)}return null}if(o.type===h.AG_GRID){return[new o.component,o.dynamicParams]}var a=o.component;var s=this.componentMetadataProvider.retrieve(t);return[this.frameworkComponentWrapper.wrap(a,s.mandatoryMethodList,s.optionalMethodList,n),o.dynamicParams]};e.prototype.initialiseComponent=function(e,t,i){this.context.wireBean(e);if(i==null){return e.init(t)}else{return e.init(i(t,e))}};n([o.Autowired("gridOptions"),r("design:type",Object)],e.prototype,"gridOptions",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("context"),r("design:type",o.Context)],e.prototype,"context",void 0);n([o.Autowired("agComponentUtils"),r("design:type",l.AgComponentUtils)],e.prototype,"agComponentUtils",void 0);n([o.Autowired("componentMetadataProvider"),r("design:type",u.ComponentMetadataProvider)],e.prototype,"componentMetadataProvider",void 0);n([o.Autowired("componentProvider"),r("design:type",s.ComponentProvider)],e.prototype,"componentProvider",void 0);n([o.Optional("frameworkComponentWrapper"),r("design:type",Object)],e.prototype,"frameworkComponentWrapper",void 0);e=n([o.Bean("componentResolver")],e);return e}();t.ComponentResolver=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(7);var s=i(4);var l=i(6);var u=i(2);var c=i(19);var d=i(20);var f=i(49);var p=i(16);var h=i(3);var g=i(53);var v=i(22);var m=i(54);var y=i(55);var b=i(35);var _=i(56);var w=i(43);var C=i(73);var A=i(45);var E=i(29);var x=i(37);var T=i(27);var S=i(15);var D=i(24);var k=i(18);var O=i(57);var R=function(){function e(){}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.postConstruct=function(){this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()};n([o.Autowired("paginationProxy"),r("design:type",E.PaginationProxy)],e.prototype,"paginationProxy",void 0);n([o.Autowired("context"),r("design:type",o.Context)],e.prototype,"context",void 0);n([o.Autowired("columnApi"),r("design:type",a.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridApi"),r("design:type",l.GridApi)],e.prototype,"gridApi",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",u.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("expressionService"),r("design:type",c.ExpressionService)],e.prototype,"expressionService",void 0);n([o.Autowired("rowRenderer"),r("design:type",d.RowRenderer)],e.prototype,"rowRenderer",void 0);n([o.Autowired("$compile"),r("design:type",Object)],e.prototype,"$compile",void 0);n([o.Autowired("templateService"),r("design:type",f.TemplateService)],e.prototype,"templateService",void 0);n([o.Autowired("valueService"),r("design:type",p.ValueService)],e.prototype,"valueService",void 0);n([o.Autowired("eventService"),r("design:type",h.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("columnAnimationService"),r("design:type",g.ColumnAnimationService)],e.prototype,"columnAnimationService",void 0);n([o.Optional("rangeController"),r("design:type",Object)],e.prototype,"rangeController",void 0);n([o.Autowired("focusedCellController"),r("design:type",v.FocusedCellController)],e.prototype,"focusedCellController",void 0);n([o.Optional("contextMenuFactory"),r("design:type",Object)],e.prototype,"contextMenuFactory",void 0);n([o.Autowired("cellEditorFactory"),r("design:type",m.CellEditorFactory)],e.prototype,"cellEditorFactory",void 0);n([o.Autowired("cellRendererFactory"),r("design:type",y.CellRendererFactory)],e.prototype,"cellRendererFactory",void 0);n([o.Autowired("popupService"),r("design:type",b.PopupService)],e.prototype,"popupService",void 0);n([o.Autowired("cellRendererService"),r("design:type",_.CellRendererService)],e.prototype,"cellRendererService",void 0);n([o.Autowired("valueFormatterService"),r("design:type",w.ValueFormatterService)],e.prototype,"valueFormatterService",void 0);n([o.Autowired("stylingService"),r("design:type",C.StylingService)],e.prototype,"stylingService",void 0);n([o.Autowired("columnHoverService"),r("design:type",A.ColumnHoverService)],e.prototype,"columnHoverService",void 0);n([o.Autowired("enterprise"),r("design:type",Boolean)],e.prototype,"enterprise",void 0);n([o.Autowired("componentResolver"),r("design:type",T.ComponentResolver)],e.prototype,"componentResolver",void 0);n([o.Autowired("animationFrameService"),r("design:type",x.AnimationFrameService)],e.prototype,"taskQueue",void 0);n([o.Autowired("dragAndDropService"),r("design:type",S.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([o.Autowired("sortController"),r("design:type",D.SortController)],e.prototype,"sortController",void 0);n([o.Autowired("filterManager"),r("design:type",k.FilterManager)],e.prototype,"filterManager",void 0);n([o.Autowired("heightScaler"),r("design:type",O.HeightScaler)],e.prototype,"heightScaler",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);e=n([o.Bean("beans")],e);return e}();t.Beans=R},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(13);var s=i(3);var l=i(5);var u=i(1);var c=i(0);var d=i(2);var f=i(36);var p=i(17);var h=i(7);var g=i(6);var v=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.registerGridComp=function(e){this.gridPanel=e;this.addDestroyableEventListener(this.eventService,l.Events.EVENT_BODY_HEIGHT_CHANGED,this.onBodyHeightChanged.bind(this));this.addDestroyableEventListener(this.eventService,l.Events.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this));this.checkPageSize()};t.prototype.notActive=function(){return!this.gridOptionsWrapper.isPaginationAutoPageSize()};t.prototype.onScrollVisibilityChanged=function(){this.checkPageSize()};t.prototype.onBodyHeightChanged=function(){this.checkPageSize()};t.prototype.checkPageSize=function(){if(this.notActive()){return}var e=this.gridOptionsWrapper.getRowHeightAsNumber();var t=this.gridPanel.getBodyHeight();if(this.scrollVisibleService.isBodyHorizontalScrollShowing()){t=t-this.gridOptionsWrapper.getScrollbarWidth()}if(t>0){var i=Math.floor(t/e);this.gridOptionsWrapper.setProperty("paginationPageSize",i)}};r([c.Autowired("eventService"),o("design:type",s.EventService)],t.prototype,"eventService",void 0);r([c.Autowired("gridOptionsWrapper"),o("design:type",d.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([c.Autowired("scrollVisibleService"),o("design:type",f.ScrollVisibleService)],t.prototype,"scrollVisibleService",void 0);t=r([c.Bean("paginationAutoPageSizeService")],t);return t}(a.BeanStub);t.PaginationAutoPageSizeService=v;var m=function(t){n(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.currentPage=0;e.topRowIndex=0;e.bottomRowIndex=0;e.pixelOffset=0;return e}e.prototype.postConstruct=function(){this.active=this.gridOptionsWrapper.isPagination();this.addDestroyableEventListener(this.eventService,l.Events.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,"paginationPageSize",this.onModelUpdated.bind(this));this.onModelUpdated()};e.prototype.isLastRowFound=function(){return this.rowModel.isLastRowFound()};e.prototype.onModelUpdated=function(e){this.setIndexesAndBounds();var t={type:l.Events.EVENT_PAGINATION_CHANGED,animate:e?e.animate:false,newData:e?e.newData:false,newPage:e?e.newPage:false,keepRenderedRows:e?e.keepRenderedRows:false,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)};e.prototype.goToPage=function(e){if(!this.active){return}if(this.currentPage===e){return}this.currentPage=e;var t={type:l.Events.EVENT_MODEL_UPDATED,animate:false,keepRenderedRows:false,newData:false,newPage:true,api:this.gridApi,columnApi:this.columnApi};this.onModelUpdated(t)};e.prototype.getPixelOffset=function(){return this.pixelOffset};e.prototype.getRow=function(e){return this.rowModel.getRow(e)};e.prototype.getRowNode=function(e){return this.rowModel.getRowNode(e)};e.prototype.getRowIndexAtPixel=function(e){return this.rowModel.getRowIndexAtPixel(e)};e.prototype.getCurrentPageHeight=function(){if(u._.missing(this.topRowBounds)||u._.missing(this.bottomRowBounds)){return 0}return this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop};e.prototype.isRowPresent=function(e){if(!this.rowModel.isRowPresent(e)){return false}var t=e.rowIndex>=this.topRowIndex&&e.rowIndex<=this.bottomRowIndex;return t};e.prototype.isEmpty=function(){return this.rowModel.isEmpty()};e.prototype.isRowsToRender=function(){return this.rowModel.isRowsToRender()};e.prototype.getNodesInRangeForSelection=function(e,t){return this.rowModel.getNodesInRangeForSelection(e,t)};e.prototype.forEachNode=function(e){return this.rowModel.forEachNode(e)};e.prototype.getType=function(){return this.rowModel.getType()};e.prototype.getRowBounds=function(e){return this.rowModel.getRowBounds(e)};e.prototype.getPageFirstRow=function(){return this.pageSize*this.currentPage};e.prototype.getPageLastRow=function(){var e=this.pageSize*(this.currentPage+1)-1;var t=this.rowModel.getPageLastRow();if(t>e){return e}else{return t}};e.prototype.getRowCount=function(){return this.rowModel.getRowCount()};e.prototype.goToPageWithIndex=function(e){if(!this.active){return}var t=Math.floor(e/this.pageSize);this.goToPage(t)};e.prototype.getTotalRowCount=function(){return this.rowModel.getPageLastRow()+1};e.prototype.isLastPageFound=function(){return this.rowModel.isLastRowFound()};e.prototype.getCurrentPage=function(){return this.currentPage};e.prototype.goToNextPage=function(){this.goToPage(this.currentPage+1)};e.prototype.goToPreviousPage=function(){this.goToPage(this.currentPage-1)};e.prototype.goToFirstPage=function(){this.goToPage(0)};e.prototype.goToLastPage=function(){var e=this.rowModel.getPageLastRow()+1;var t=Math.floor(e/this.pageSize);this.goToPage(t)};e.prototype.getPageSize=function(){return this.pageSize};e.prototype.getTotalPages=function(){return this.totalPages};e.prototype.setPageSize=function(){this.pageSize=this.gridOptionsWrapper.getPaginationPageSize();if(!(this.pageSize>=1)){this.pageSize=100}};e.prototype.setIndexesAndBounds=function(){if(this.active){this.setPageSize();var e=this.getTotalRowCount();this.totalPages=Math.floor((e-1)/this.pageSize)+1;if(this.currentPage>=this.totalPages){this.currentPage=this.totalPages-1}if(!u._.isNumeric(this.currentPage)||this.currentPage<0){this.currentPage=0}this.topRowIndex=this.pageSize*this.currentPage;this.bottomRowIndex=this.pageSize*(this.currentPage+1)-1;var t=this.rowModel.getPageLastRow();if(this.bottomRowIndex>t){this.bottomRowIndex=t}}else{this.pageSize=this.rowModel.getPageLastRow()+1;this.totalPages=1;this.currentPage=0;this.topRowIndex=0;this.bottomRowIndex=this.rowModel.getPageLastRow()}this.topRowBounds=this.rowModel.getRowBounds(this.topRowIndex);this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomRowIndex);this.pixelOffset=u._.exists(this.topRowBounds)?this.topRowBounds.rowTop:0};r([c.Autowired("rowModel"),o("design:type",Object)],e.prototype,"rowModel",void 0);r([c.Autowired("eventService"),o("design:type",s.EventService)],e.prototype,"eventService",void 0);r([c.Autowired("gridOptionsWrapper"),o("design:type",d.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);r([c.Autowired("selectionController"),o("design:type",p.SelectionController)],e.prototype,"selectionController",void 0);r([c.Autowired("columnApi"),o("design:type",h.ColumnApi)],e.prototype,"columnApi",void 0);r([c.Autowired("gridApi"),o("design:type",g.GridApi)],e.prototype,"gridApi",void 0);r([c.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"postConstruct",null);e=r([c.Bean("paginationProxy")],e);return e}(a.BeanStub);t.PaginationProxy=m},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(2);var s=i(14);var a=i(0);var l=i(3);var u=i(0);var c=i(5);var d=i(0);var f=i(9);var p=i(1);var h=i(7);var g=i(6);var v=function(){function e(){}e.prototype.init=function(){this.setPinnedTopRowData(this.gridOptionsWrapper.getPinnedTopRowData());this.setPinnedBottomRowData(this.gridOptionsWrapper.getPinnedBottomRowData())};e.prototype.isEmpty=function(e){var t=e===f.Constants.PINNED_TOP?this.pinnedTopRows:this.pinnedBottomRows;return p.Utils.missingOrEmpty(t)};e.prototype.isRowsToRender=function(e){return!this.isEmpty(e)};e.prototype.getRowAtPixel=function(e,t){var i=t===f.Constants.PINNED_TOP?this.pinnedTopRows:this.pinnedBottomRows;if(p.Utils.missingOrEmpty(i)){return 0}for(var n=0;n<i.length;n++){var r=i[n];var o=r.rowTop+r.rowHeight-1;if(o>=e){return n}}return i.length-1};e.prototype.setPinnedTopRowData=function(e){this.pinnedTopRows=this.createNodesFromData(e,true);var t={type:c.Events.EVENT_PINNED_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)};e.prototype.setPinnedBottomRowData=function(e){this.pinnedBottomRows=this.createNodesFromData(e,false);var t={type:c.Events.EVENT_PINNED_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)};e.prototype.createNodesFromData=function(e,n){var r=this;var o=[];if(e){var a=0;e.forEach(function(e,t){var i=new s.RowNode;r.context.wireBean(i);i.data=e;i.rowPinned=n?f.Constants.PINNED_TOP:f.Constants.PINNED_BOTTOM;i.setRowTop(a);i.setRowHeight(r.gridOptionsWrapper.getRowHeightForNode(i));i.setRowIndex(t);a+=i.rowHeight;o.push(i)})}return o};e.prototype.getPinnedTopRowData=function(){return this.pinnedTopRows};e.prototype.getPinnedBottomRowData=function(){return this.pinnedBottomRows};e.prototype.getPinnedTopTotalHeight=function(){return this.getTotalHeight(this.pinnedTopRows)};e.prototype.getPinnedTopRowCount=function(){return this.pinnedTopRows?this.pinnedTopRows.length:0};e.prototype.getPinnedBottomRowCount=function(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0};e.prototype.getPinnedTopRow=function(e){return this.pinnedTopRows[e]};e.prototype.getPinnedBottomRow=function(e){return this.pinnedBottomRows[e]};e.prototype.forEachPinnedTopRow=function(e){if(p.Utils.missingOrEmpty(this.pinnedTopRows)){return}this.pinnedTopRows.forEach(e)};e.prototype.forEachPinnedBottomRow=function(e){if(p.Utils.missingOrEmpty(this.pinnedBottomRows)){return}this.pinnedBottomRows.forEach(e)};e.prototype.getPinnedBottomTotalHeight=function(){return this.getTotalHeight(this.pinnedBottomRows)};e.prototype.getTotalHeight=function(e){if(!e||e.length===0){return 0}else{var t=e[e.length-1];return t.rowTop+t.rowHeight}};n([u.Autowired("gridOptionsWrapper"),r("design:type",o.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([u.Autowired("eventService"),r("design:type",l.EventService)],e.prototype,"eventService",void 0);n([u.Autowired("context"),r("design:type",a.Context)],e.prototype,"context",void 0);n([u.Autowired("columnApi"),r("design:type",h.ColumnApi)],e.prototype,"columnApi",void 0);n([u.Autowired("gridApi"),r("design:type",g.GridApi)],e.prototype,"gridApi",void 0);n([d.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([a.Bean("pinnedRowModel")],e);return e}();t.PinnedRowModel=v},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(2);var a=i(26);var u=i(32);var s=i(0);var l=i(0);var c=function(){function e(){}e.prototype.calculateColInitialWidth=function(e){if(!e.width){return this.gridOptionsWrapper.getColWidth()}else if(e.width<this.gridOptionsWrapper.getMinColWidth()){return this.gridOptionsWrapper.getMinColWidth()}else{return e.width}};e.prototype.getOriginalPathForColumn=function(o,e){var a=[];var s=false;l(e,0);if(s){return a}else{return null}function l(e,t){for(var i=0;i<e.length;i++){if(s){return}var n=e[i];if(n instanceof u.OriginalColumnGroup){var r=n;l(r.getChildren(),t+1);a[t]=n}else{if(n===o){s=true}}}}};e.prototype.depthFirstOriginalTreeSearch=function(e,t){var i=this;if(!e){return}e.forEach(function(e){if(e instanceof u.OriginalColumnGroup){i.depthFirstOriginalTreeSearch(e.getChildren(),t)}t(e)})};e.prototype.depthFirstAllColumnTreeSearch=function(e,t){var i=this;if(!e){return}e.forEach(function(e){if(e instanceof a.ColumnGroup){i.depthFirstAllColumnTreeSearch(e.getChildren(),t)}t(e)})};e.prototype.depthFirstDisplayedColumnTreeSearch=function(e,t){var i=this;if(!e){return}e.forEach(function(e){if(e instanceof a.ColumnGroup){i.depthFirstDisplayedColumnTreeSearch(e.getDisplayedChildren(),t)}t(e)})};n([l.Autowired("gridOptionsWrapper"),r("design:type",o.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([s.Bean("columnUtils")],e);return e}();t.ColumnUtils=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var c=i(26);var o=i(10);var a=i(3);var s=i(0);var l=i(7);var d=i(6);var u=function(){function u(e,t,i,n){this.localEventService=new a.EventService;this.expandable=false;this.colGroupDef=e;this.groupId=t;this.expanded=e&&!!e.openByDefault;this.padding=i;this.level=n}u.prototype.getLevel=function(){return this.level};u.prototype.isVisible=function(){if(this.children){return this.children.some(function(e){return e.isVisible()})}else{return false}};u.prototype.isPadding=function(){return this.padding};u.prototype.setExpanded=function(e){this.expanded=e;var t={type:u.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(t)};u.prototype.isExpandable=function(){return this.expandable};u.prototype.isExpanded=function(){return this.expanded};u.prototype.getGroupId=function(){return this.groupId};u.prototype.getId=function(){return this.getGroupId()};u.prototype.setChildren=function(e){this.children=e};u.prototype.getChildren=function(){return this.children};u.prototype.getColGroupDef=function(){return this.colGroupDef};u.prototype.getLeafColumns=function(){var e=[];this.addLeafColumns(e);return e};u.prototype.addLeafColumns=function(t){if(!this.children){return}this.children.forEach(function(e){if(e instanceof o.Column){t.push(e)}else if(e instanceof u){e.addLeafColumns(t)}})};u.prototype.getColumnGroupShow=function(){if(!this.padding){return this.colGroupDef.columnGroupShow}else{return this.children[0].getColumnGroupShow()}};u.prototype.setupExpandable=function(){var t=this;this.setExpandable();this.getLeafColumns().forEach(function(e){return e.addEventListener(o.Column.EVENT_VISIBLE_CHANGED,t.onColumnVisibilityChanged.bind(t))})};u.prototype.setExpandable=function(){var e=false;var t=false;var i=false;for(var n=0,r=this.children.length;n<r;n++){var o=this.children[n];if(!o.isVisible()){continue}var a=o.getColumnGroupShow();if(a===c.ColumnGroup.HEADER_GROUP_SHOW_OPEN){e=true;i=true}else if(a===c.ColumnGroup.HEADER_GROUP_SHOW_CLOSED){t=true;i=true}else{e=true;t=true}}var s=e&&t&&i;if(this.expandable!==s){this.expandable=s;var l={type:u.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(l)}};u.prototype.onColumnVisibilityChanged=function(){this.setExpandable()};u.prototype.addEventListener=function(e,t){this.localEventService.addEventListener(e,t)};u.prototype.removeEventListener=function(e,t){this.localEventService.removeEventListener(e,t)};u.EVENT_EXPANDED_CHANGED="expandedChanged";u.EVENT_EXPANDABLE_CHANGED="expandableChanged";n([s.Autowired("columnApi"),r("design:type",l.ColumnApi)],u.prototype,"columnApi",void 0);n([s.Autowired("gridApi"),r("design:type",d.GridApi)],u.prototype,"gridApi",void 0);return u}();t.OriginalColumnGroup=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var s=function(){function e(){this.cacheVersion=0}e.prototype.init=function(){this.active=this.gridOptionsWrapper.isValueCache();this.neverExpires=this.gridOptionsWrapper.isValueCacheNeverExpires()};e.prototype.onDataChanged=function(){if(this.neverExpires){return}this.expire()};e.prototype.expire=function(){this.cacheVersion++};e.prototype.setValue=function(e,t,i){if(this.active){if(e.__cacheVersion!==this.cacheVersion){e.__cacheVersion=this.cacheVersion;e.__cacheData={}}e.__cacheData[t]=i}};e.prototype.getValue=function(e,t){var i=this.active&&e.__cacheVersion===this.cacheVersion&&e.__cacheData[t]!==undefined;if(i){return e.__cacheData[t]}else{return undefined}};n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("valueCache")],e);return e}();t.ValueCache=s},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var p=i(1);var r=i(10);var o=i(14);var a=i(9);var l=i(5);var u=i(23);var s=i(8);var c=i(65);var d=i(121);var f=function(s){n(i,s);function i(e,t,i,n,r,o){var a=s.call(this)||this;a.editingCell=false;a.cellEditorVersion=0;a.cellRendererVersion=0;a.scope=e;a.beans=t;a.column=i;a.rowNode=n;a.rowComp=r;a.autoHeightCell=o;a.createGridCellVo();a.rangeSelectionEnabled=t.enterprise&&t.gridOptionsWrapper.isEnableRangeSelection();a.cellFocused=a.beans.focusedCellController.isCellFocused(a.gridCell);a.firstRightPinned=a.column.isFirstRightPinned();a.lastLeftPinned=a.column.isLastLeftPinned();if(a.rangeSelectionEnabled){a.rangeCount=a.beans.rangeController.getCellRangeCount(a.gridCell)}a.getValueAndFormat();a.setUsingWrapper();a.chooseCellRenderer();a.setupColSpan();a.rowSpan=a.column.getRowSpan(a.rowNode);return a}i.prototype.getCreateTemplate=function(){var e=[];var t=this.column;var i=this.getCellWidth();var n=t.getLeft();var r=this.getInitialValueToRender();var o=p._.get(this.column,"colDef.template",null)?r:p._.escape(r);this.tooltip=this.getToolTip();var a=p._.escape(this.tooltip);var s=p._.escape(t.getId());var l;var u;var c=this.preProcessStylesFromColDef();var d=this.getInitialCssClasses();var f=this.getStylesForRowSpanning();if(this.usingWrapper){l='<span ref="eCellWrapper" class="ag-cell-wrapper"><span ref="eCellValue" class="ag-cell-value">';u="</span></span>"}e.push("<div");e.push(' tabindex="-1"');e.push(' role="gridcell"');e.push(' comp-id="'+this.getCompId()+'" ');e.push(' col-id="'+s+'"');e.push(' class="'+d.join(" ")+'"');e.push(a?' title="'+a+'"':"");e.push(' style="width: '+i+"px; left: "+n+"px; "+c+" "+f+'" >');e.push(l);e.push(o);e.push(u);e.push("</div>");return e.join("")};i.prototype.getStylesForRowSpanning=function(){if(this.rowSpan===1){return""}var e=this.beans.gridOptionsWrapper.getRowHeightAsNumber();var t=e*this.rowSpan;return"height: "+t+"px; z-index: 1;"};i.prototype.afterAttached=function(){var e='[comp-id="'+this.getCompId()+'"]';var t=this.eParentRow.querySelector(e);this.setGui(t);this.addDomData();this.populateTemplate();this.attachCellRenderer();this.angular1Compile();this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_CELL_FOCUSED,this.onCellFocused.bind(this));this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_FLASH_CELLS,this.onFlashCells.bind(this));this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_COLUMN_HOVER_CHANGED,this.onColumnHover.bind(this));this.addDestroyableEventListener(this.rowNode,o.RowNode.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this));this.addDestroyableEventListener(this.rowNode,o.RowNode.EVENT_CELL_CHANGED,this.onCellChanged.bind(this));this.addDestroyableEventListener(this.column,r.Column.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this));this.addDestroyableEventListener(this.column,r.Column.EVENT_WIDTH_CHANGED,this.onWidthChanged.bind(this));this.addDestroyableEventListener(this.column,r.Column.EVENT_FIRST_RIGHT_PINNED_CHANGED,this.onFirstRightPinnedChanged.bind(this));this.addDestroyableEventListener(this.column,r.Column.EVENT_LAST_LEFT_PINNED_CHANGED,this.onLastLeftPinnedChanged.bind(this));if(this.rangeSelectionEnabled){this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this))}};i.prototype.onColumnHover=function(){var e=this.beans.columnHoverService.isHovered(this.column);p._.addOrRemoveCssClass(this.getGui(),"ag-column-hover",e)};i.prototype.onCellChanged=function(e){var t=e.column===this.column;if(t){this.refreshCell({})}};i.prototype.getCellLeft=function(){var e;if(this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning){e=this.colsSpanning[this.colsSpanning.length-1]}else{e=this.column}return e.getLeft()};i.prototype.getCellWidth=function(){if(this.colsSpanning){var t=0;this.colsSpanning.forEach(function(e){return t+=e.getActualWidth()});return t}else{return this.column.getActualWidth()}};i.prototype.onFlashCells=function(e){var t=this.gridCell.createId();var i=e.cells[t];if(i){this.animateCell("highlight")}};i.prototype.setupColSpan=function(){if(p._.missing(this.column.getColDef().colSpan)){return}this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this));this.addDestroyableEventListener(this.beans.eventService,l.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this));this.colsSpanning=this.getColSpanningList()};i.prototype.getColSpanningList=function(){var e=this.column.getColSpan(this.rowNode);var t=[];if(e===1){t.push(this.column)}else{var i=this.column;var n=this.column.getPinned();for(var r=0;r<e;r++){t.push(i);i=this.beans.columnController.getDisplayedColAfter(i);if(p._.missing(i)){break}if(n!==i.getPinned()){break}}}return t};i.prototype.onDisplayColumnsChanged=function(){var e=this.getColSpanningList();if(!p._.compareArrays(this.colsSpanning,e)){this.colsSpanning=e;this.onWidthChanged();this.onLeftChanged()}};i.prototype.getInitialCssClasses=function(){var e=["ag-cell","ag-cell-not-inline-editing"];if(!this.autoHeightCell){e.push("ag-cell-with-height")}var t=!this.beans.gridOptionsWrapper.isSuppressCellSelection();if(t){e.push(this.cellFocused?"ag-cell-focus":"ag-cell-no-focus")}else{e.push("ag-cell-no-focus")}if(this.firstRightPinned){e.push("ag-cell-first-right-pinned")}if(this.lastLeftPinned){e.push("ag-cell-last-left-pinned")}if(this.beans.columnHoverService.isHovered(this.column)){e.push("ag-column-hover")}p._.pushAll(e,this.preProcessClassesFromColDef());p._.pushAll(e,this.preProcessCellClassRules());p._.pushAll(e,this.getRangeClasses());if(!this.usingWrapper){e.push("ag-cell-value")}return e};i.prototype.getInitialValueToRender=function(){if(this.usingCellRenderer){if(typeof this.cellRendererGui==="string"){return this.cellRendererGui}else{return""}}var e=this.column.getColDef();if(e.template){return e.template}else if(e.templateUrl){var t=this.beans.templateService.getTemplate(e.templateUrl,this.refreshCell.bind(this,true));if(t){return t}else{return""}}else{return this.getValueToUse()}};i.prototype.getRenderedRow=function(){return this.rowComp};i.prototype.isSuppressNavigable=function(){return this.column.isSuppressNavigable(this.rowNode)};i.prototype.getCellRenderer=function(){return this.cellRenderer};i.prototype.getCellEditor=function(){return this.cellEditor};i.prototype.refreshCell=function(e){if(this.editingCell){return}var t=e&&e.newData;var i=e&&e.suppressFlash||this.column.getColDef().suppressCellFlash;var n=e&&e.forceRefresh;var r=this.value;this.getValueAndFormat();var o=!this.valuesAreEqual(r,this.value);var a=n||o;if(a){var s=void 0;if(t||i){s=false}else{s=this.attemptCellRendererRefresh()}if(!s){this.replaceContentsAfterRefresh()}if(!i){var l=this.beans.gridOptionsWrapper.isEnableCellChangeFlash()||this.column.getColDef().enableCellChangeFlash;if(l){this.flashCell()}}this.postProcessStylesFromColDef();this.postProcessClassesFromColDef()}this.refreshToolTip();this.postProcessCellClassRules()};i.prototype.flashCell=function(){this.animateCell("data-changed")};i.prototype.animateCell=function(e){var t="ag-cell-"+e;var i="ag-cell-"+e+"-animation";var n=this.getGui();p._.addCssClass(n,t);p._.removeCssClass(n,i);setTimeout(function(){p._.removeCssClass(n,t);p._.addCssClass(n,i);setTimeout(function(){p._.removeCssClass(n,i)},1e3)},500)};i.prototype.replaceContentsAfterRefresh=function(){p._.removeAllChildren(this.eParentOfValue);if(this.cellRenderer&&this.cellRenderer.destroy){this.cellRenderer.destroy()}this.cellRenderer=null;this.cellRendererGui=null;this.putDataIntoCellAfterRefresh();this.angular1Compile()};i.prototype.angular1Compile=function(){if(this.beans.gridOptionsWrapper.isAngularCompileRows()){var e=this.getGui();var t=this.beans.$compile(e)(this.scope);this.addDestroyFunc(function(){t.remove()})}};i.prototype.postProcessStylesFromColDef=function(){var e=this.processStylesFromColDef();if(e){p._.addStylesToElement(this.getGui(),e)}};i.prototype.preProcessStylesFromColDef=function(){var e=this.processStylesFromColDef();return p._.cssStyleObjectToMarkup(e)};i.prototype.processStylesFromColDef=function(){var e=this.column.getColDef();if(e.cellStyle){var t=void 0;if(typeof e.cellStyle==="function"){var i={value:this.value,data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,$scope:this.scope,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi()};var n=e.cellStyle;t=n(i)}else{t=e.cellStyle}return t}};i.prototype.postProcessClassesFromColDef=function(){var t=this;this.processClassesFromColDef(function(e){return p._.addCssClass(t.getGui(),e)})};i.prototype.preProcessClassesFromColDef=function(){var t=[];this.processClassesFromColDef(function(e){return t.push(e)});return t};i.prototype.processClassesFromColDef=function(e){this.beans.stylingService.processStaticCellClasses(this.column.getColDef(),{value:this.value,data:this.rowNode.data,node:this.rowNode,colDef:this.column.getColDef(),rowIndex:this.rowNode.rowIndex,$scope:this.scope,api:this.beans.gridOptionsWrapper.getApi(),context:this.beans.gridOptionsWrapper.getContext()},e)};i.prototype.putDataIntoCellAfterRefresh=function(){var e=this.column.getColDef();if(e.template){this.eParentOfValue.innerHTML=e.template}else if(e.templateUrl){var t=this.beans.templateService.getTemplate(e.templateUrl,this.refreshCell.bind(this,true));if(t){this.eParentOfValue.innerHTML=t}}else if(this.usingCellRenderer){this.attachCellRenderer()}else{var i=this.getValueToUse();if(i!==null&&i!==undefined){this.eParentOfValue.innerText=i}}};i.prototype.attemptCellRendererRefresh=function(){if(p._.missing(this.cellRenderer)||p._.missing(this.cellRenderer.refresh)){return false}var e=this.createCellRendererParams();var t=this.cellRenderer.refresh(e);return t===true||t===undefined};i.prototype.refreshToolTip=function(){var e=this.getToolTip();if(this.tooltip!==e){this.tooltip=e;if(p._.exists(e)){var t=p._.escape(this.tooltip);this.eParentOfValue.setAttribute("title",t)}else{this.eParentOfValue.removeAttribute("title")}}};i.prototype.valuesAreEqual=function(e,t){var i=this.column.getColDef();var n=i?i.equals:null;if(n){return n(e,t)}else{return e===t}};i.prototype.getToolTip=function(){var e=this.column.getColDef();var t=this.rowNode.data;if(e.tooltipField&&p._.exists(t)){return p._.getValueUsingField(t,e.tooltipField,this.column.isTooltipFieldContainsDots())}else if(e.tooltip){return e.tooltip({value:this.value,valueFormatted:this.valueFormatted,data:this.rowNode.data,node:this.rowNode,colDef:this.column.getColDef(),api:this.beans.gridOptionsWrapper.getApi(),$scope:this.scope,context:this.beans.gridOptionsWrapper.getContext(),rowIndex:this.gridCell.rowIndex})}else{return null}};i.prototype.processCellClassRules=function(e,t){this.beans.stylingService.processClassRules(this.column.getColDef().cellClassRules,{value:this.value,data:this.rowNode.data,node:this.rowNode,colDef:this.column.getColDef(),rowIndex:this.gridCell.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),$scope:this.scope,context:this.beans.gridOptionsWrapper.getContext()},e,t)};i.prototype.postProcessCellClassRules=function(){var t=this;this.processCellClassRules(function(e){p._.addCssClass(t.getGui(),e)},function(e){p._.removeCssClass(t.getGui(),e)})};i.prototype.preProcessCellClassRules=function(){var t=[];this.processCellClassRules(function(e){t.push(e)},function(e){});return t};i.prototype.setUsingWrapper=function(){var e=this.column.getColDef();if(this.rowNode.rowPinned){this.usingWrapper=false;this.includeSelectionComponent=false;this.includeRowDraggingComponent=false;return}var t=typeof e.checkboxSelection==="function";var i=typeof e.rowDrag==="function";this.includeSelectionComponent=t||e.checkboxSelection===true;this.includeRowDraggingComponent=i||e.rowDrag===true;this.usingWrapper=this.includeRowDraggingComponent||this.includeSelectionComponent};i.prototype.chooseCellRenderer=function(){var e=this.column.getColDef();if(e.template||e.templateUrl){this.usingCellRenderer=false;return}var t=this.createCellRendererParams();var i=this.beans.componentResolver.getComponentToUse(e,"cellRenderer",t,null);var n=this.beans.componentResolver.getComponentToUse(e,"pinnedRowCellRenderer",t,null);if(n&&this.rowNode.rowPinned){this.cellRendererType="pinnedRowCellRenderer";this.usingCellRenderer=true}else if(i){this.cellRendererType="cellRenderer";this.usingCellRenderer=true}else{this.usingCellRenderer=false}};i.prototype.createCellRendererInstance=function(){var e=this.createCellRendererParams();this.cellRendererVersion++;var t=this.afterCellRendererCreated.bind(this,this.cellRendererVersion);this.beans.componentResolver.createAgGridComponent(this.column.getColDef(),e,this.cellRendererType,e,null).then(t)};i.prototype.afterCellRendererCreated=function(e,t){if(e!==this.cellRendererVersion){if(t.destroy){t.destroy()}return}this.cellRenderer=t;this.cellRendererGui=this.cellRenderer.getGui();if(p._.missing(this.cellRendererGui)){return}if(!this.editingCell){this.eParentOfValue.appendChild(this.cellRendererGui)}};i.prototype.attachCellRenderer=function(){if(!this.usingCellRenderer){return}this.createCellRendererInstance()};i.prototype.createCellRendererParams=function(){var i=this;var e={value:this.value,valueFormatted:this.valueFormatted,getValue:this.getValue.bind(this),setValue:function(e){i.beans.valueService.setValue(i.rowNode,i.column,e)},formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,colDef:this.column.getColDef(),column:this.column,$scope:this.scope,rowIndex:this.gridCell.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.eParentOfValue,addRowCompListener:this.rowComp?this.rowComp.addEventListener.bind(this.rowComp):null,addRenderedRowListener:function(e,t){console.warn("ag-Grid: since ag-Grid .v11, params.addRenderedRowListener() is now params.addRowCompListener()");if(i.rowComp){i.rowComp.addEventListener(e,t)}}};return e};i.prototype.formatValue=function(e){var t=this.beans.valueFormatterService.formatValue(this.column,this.rowNode,this.scope,e);var i=t!==null&&t!==undefined;return i?t:e};i.prototype.getValueToUse=function(){var e=this.valueFormatted!==null&&this.valueFormatted!==undefined;return e?this.valueFormatted:this.value};i.prototype.getValueAndFormat=function(){this.value=this.getValue();this.valueFormatted=this.beans.valueFormatterService.formatValue(this.column,this.rowNode,this.scope,this.value)};i.prototype.getValue=function(){var e=this.rowNode.leafGroup&&this.beans.columnController.isPivotMode();var t=this.rowNode.group&&this.rowNode.expanded&&!this.rowNode.footer&&!e;if(t&&this.beans.gridOptionsWrapper.isGroupIncludeFooter()){return this.beans.valueService.getValue(this.column,this.rowNode,false,true)}else{return this.beans.valueService.getValue(this.column,this.rowNode)}};i.prototype.onMouseEvent=function(e,t){if(p._.isStopPropagationForAgGrid(t)){return}switch(e){case"click":this.onCellClicked(t);break;case"mousedown":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}};i.prototype.dispatchCellContextMenuEvent=function(e){var t=this.column.getColDef();var i=this.createEvent(e,l.Events.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i);if(t.onCellContextMenu){setTimeout(function(){return t.onCellContextMenu(i)},0)}};i.prototype.createEvent=function(e,t){var i={node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridApi,columnApi:this.beans.columnApi,rowPinned:this.rowNode.rowPinned,event:e,type:t,rowIndex:this.rowNode.rowIndex};if(this.scope){i.$scope=this.scope}return i};i.prototype.onMouseOut=function(e){var t=this.createEvent(e,l.Events.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t);this.beans.columnHoverService.clearMouseOver()};i.prototype.onMouseOver=function(e){var t=this.createEvent(e,l.Events.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t);this.beans.columnHoverService.setMouseOver([this.column])};i.prototype.onCellDoubleClicked=function(e){var t=this.column.getColDef();var i=this.createEvent(e,l.Events.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i);if(typeof t.onCellDoubleClicked==="function"){setTimeout(function(){return t.onCellDoubleClicked(i)},0)}var n=!this.beans.gridOptionsWrapper.isSingleClickEdit()&&!this.beans.gridOptionsWrapper.isSuppressClickEdit();if(n){this.startRowOrCellEdit()}};i.prototype.startRowOrCellEdit=function(e,t){if(this.beans.gridOptionsWrapper.isFullRowEdit()){this.rowComp.startRowEditing(e,t,this)}else{this.startEditingIfEnabled(e,t,true)}};i.prototype.isCellEditable=function(){return this.column.isCellEditable(this.rowNode)};i.prototype.startEditingIfEnabled=function(e,t,i){if(e===void 0){e=null}if(t===void 0){t=null}if(i===void 0){i=false}if(!this.isCellEditable()){return}if(this.editingCell){return}this.editingCell=true;this.cellEditorVersion++;var n=this.afterCellEditorCreated.bind(this,this.cellEditorVersion);var r=this.createCellEditorParams(e,t,i);this.beans.cellEditorFactory.createCellEditor(this.column.getColDef(),r).then(n);var o=p._.missing(this.cellEditor);if(o&&i){this.focusCell(true)}};i.prototype.afterCellEditorCreated=function(e,t){var i=e!==this.cellEditorVersion;if(i||!this.editingCell){if(t.destroy){t.destroy()}return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){if(t.destroy){t.destroy()}this.editingCell=false;return}if(!t.getGui){console.warn("ag-Grid: cellEditor for column "+this.column.getId()+" is missing getGui() method");if(t.render){console.warn("ag-Grid: we found 'render' on the component, are you trying to set a React renderer but added it as colDef.cellEditor instead of colDef.cellEditorFmk?")}if(t.destroy){t.destroy()}this.editingCell=false;return}this.cellEditor=t;this.cellEditorInPopup=t.isPopup&&t.isPopup();this.setInlineEditingClass();if(this.cellEditorInPopup){this.addPopupCellEditor()}else{this.addInCellEditor()}if(t.afterGuiAttached){t.afterGuiAttached()}var n=this.createEvent(null,l.Events.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(n)};i.prototype.addInCellEditor=function(){p._.removeAllChildren(this.getGui());this.getGui().appendChild(this.cellEditor.getGui());this.angular1Compile()};i.prototype.addPopupCellEditor=function(){var e=this;var t=this.cellEditor.getGui();this.hideEditorPopup=this.beans.popupService.addAsModalPopup(t,true,function(){e.onPopupEditorClosed()});this.beans.popupService.positionPopupOverComponent({column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),ePopup:t,keepWithinBounds:true});this.angular1Compile()};i.prototype.onPopupEditorClosed=function(){if(this.editingCell){this.stopRowOrCellEdit();if(this.beans.focusedCellController.isCellFocused(this.gridCell)){this.focusCell(true)}}};i.prototype.setInlineEditingClass=function(){var e=this.editingCell&&!this.cellEditorInPopup;var t=this.editingCell&&this.cellEditorInPopup;p._.addOrRemoveCssClass(this.getGui(),"ag-cell-inline-editing",e);p._.addOrRemoveCssClass(this.getGui(),"ag-cell-not-inline-editing",!e);p._.addOrRemoveCssClass(this.getGui(),"ag-cell-popup-editing",t);p._.addOrRemoveCssClass(this.getGui().parentNode,"ag-row-inline-editing",e);p._.addOrRemoveCssClass(this.getGui().parentNode,"ag-row-not-inline-editing",!e)};i.prototype.createCellEditorParams=function(e,t,i){var n={value:this.getValue(),keyPress:e,charPress:t,column:this.column,rowIndex:this.gridCell.rowIndex,node:this.rowNode,api:this.beans.gridOptionsWrapper.getApi(),cellStartedEdit:i,columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),$scope:this.scope,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)};return n};i.prototype.stopEditingAndFocus=function(e){if(e===void 0){e=false}this.stopRowOrCellEdit();this.focusCell(true);if(!e){this.navigateAfterEdit()}};i.prototype.parseValue=function(e){var t={node:this.rowNode,data:this.rowNode.data,oldValue:this.value,newValue:e,colDef:this.column.getColDef(),column:this.column,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()};var i=this.column.getColDef().valueParser;return p._.exists(i)?this.beans.expressionService.evaluate(i,t):e};i.prototype.focusCell=function(e){if(e===void 0){e=false}this.beans.focusedCellController.setFocusedCell(this.gridCell.rowIndex,this.column,this.rowNode.rowPinned,e)};i.prototype.setFocusInOnEditor=function(){if(this.editingCell){if(this.cellEditor&&this.cellEditor.focusIn){this.cellEditor.focusIn()}else{this.focusCell(true)}}};i.prototype.isEditing=function(){return this.editingCell};i.prototype.onKeyDown=function(e){var t=e.which||e.keyCode;if(this.doesUserWantToCancelKeyboardEvent(e)){return}switch(t){case a.Constants.KEY_ENTER:this.onEnterKeyDown();break;case a.Constants.KEY_F2:this.onF2KeyDown();break;case a.Constants.KEY_ESCAPE:this.onEscapeKeyDown();break;case a.Constants.KEY_TAB:this.onTabKeyDown(e);break;case a.Constants.KEY_BACKSPACE:case a.Constants.KEY_DELETE:this.onBackspaceOrDeleteKeyPressed(t);break;case a.Constants.KEY_DOWN:case a.Constants.KEY_UP:case a.Constants.KEY_RIGHT:case a.Constants.KEY_LEFT:this.onNavigationKeyPressed(e,t);break}};i.prototype.doesUserWantToCancelKeyboardEvent=function(e){var t=this.column.getColDef().suppressKeyboardEvent;if(p._.missing(t)){return false}else{var i={event:e,editing:this.editingCell,column:this.column,api:this.beans.gridOptionsWrapper.getApi(),node:this.rowNode,data:this.rowNode.data,colDef:this.column.getColDef(),context:this.beans.gridOptionsWrapper.getContext(),columnApi:this.beans.gridOptionsWrapper.getColumnApi()};return t(i)}};i.prototype.setFocusOutOnEditor=function(){if(this.editingCell&&this.cellEditor&&this.cellEditor.focusOut){this.cellEditor.focusOut()}};i.prototype.onNavigationKeyPressed=function(e,t){if(this.editingCell){this.stopRowOrCellEdit()}if(e.shiftKey&&this.rangeSelectionEnabled){this.onShiftRangeSelect(t)}else{this.beans.rowRenderer.navigateToNextCell(e,t,this.gridCell,true)}e.preventDefault()};i.prototype.onShiftRangeSelect=function(e){var t=this.beans.rangeController.extendRangeInDirection(this.gridCell,e);if(!t){return}var i=this.beans.rangeController.getCellRanges();if(p._.missing(i)||i.length!==1){return}var n=i[0].end;this.beans.rowRenderer.ensureCellVisible(n)};i.prototype.onTabKeyDown=function(e){if(this.beans.gridOptionsWrapper.isSuppressTabbing()){return}this.beans.rowRenderer.onTabKeyDown(this,e)};i.prototype.onBackspaceOrDeleteKeyPressed=function(e){if(!this.editingCell){this.startRowOrCellEdit(e)}};i.prototype.onEnterKeyDown=function(){if(this.editingCell||this.rowComp.isEditing()){this.stopEditingAndFocus()}else{if(this.beans.gridOptionsWrapper.isEnterMovesDown()){this.beans.rowRenderer.navigateToNextCell(null,a.Constants.KEY_DOWN,this.gridCell,false)}else{this.startRowOrCellEdit(a.Constants.KEY_ENTER)}}};i.prototype.navigateAfterEdit=function(){var e=this.beans.gridOptionsWrapper.isFullRowEdit();if(e){return}var t=this.beans.gridOptionsWrapper.isEnterMovesDownAfterEdit();if(t){this.beans.rowRenderer.navigateToNextCell(null,a.Constants.KEY_DOWN,this.gridCell,false)}};i.prototype.onF2KeyDown=function(){if(!this.editingCell){this.startRowOrCellEdit(a.Constants.KEY_F2)}};i.prototype.onEscapeKeyDown=function(){if(this.editingCell){this.stopRowOrCellEdit(true);this.focusCell(true)}};i.prototype.onKeyPress=function(e){var t=p._.getTarget(e);var i=t!==this.getGui();if(i){return}if(!this.editingCell){var n=String.fromCharCode(e.charCode);if(n===" "){this.onSpaceKeyPressed(e)}else{if(p._.isEventFromPrintableCharacter(e)){this.startRowOrCellEdit(null,n);e.preventDefault()}}}};i.prototype.onSpaceKeyPressed=function(e){if(!this.editingCell&&this.beans.gridOptionsWrapper.isRowSelection()){var t=this.rowNode.isSelected();this.rowNode.setSelected(!t)}e.preventDefault()};i.prototype.onMouseDown=function(e){this.focusCell(false);if(this.beans.rangeController){var t=this.gridCell;if(e.shiftKey){this.beans.rangeController.extendRangeToCell(t)}else{var i=this.beans.rangeController.isCellInAnyRange(t);if(!i){var n=e.ctrlKey||e.metaKey;this.beans.rangeController.setRangeToCell(t,n)}}}var r=this.createEvent(e,l.Events.EVENT_CELL_MOUSE_DOWN);this.beans.eventService.dispatchEvent(r)};i.prototype.isDoubleClickOnIPad=function(){if(!p._.isUserAgentIPad()){return false}var e=(new Date).getTime();var t=e-this.lastIPadMouseClickEvent<200;this.lastIPadMouseClickEvent=e;return t};i.prototype.onCellClicked=function(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e);e.preventDefault();return}var t=this.createEvent(e,l.Events.EVENT_CELL_CLICKED);this.beans.eventService.dispatchEvent(t);var i=this.column.getColDef();if(i.onCellClicked){setTimeout(function(){return i.onCellClicked(t)},0)}var n=this.beans.gridOptionsWrapper.isSingleClickEdit()&&!this.beans.gridOptionsWrapper.isSuppressClickEdit();if(n){this.startRowOrCellEdit()}this.doIeFocusHack()};i.prototype.doIeFocusHack=function(){if(p._.isBrowserIE()||p._.isBrowserEdge()){if(p._.missing(document.activeElement)||document.activeElement===document.body){this.getGui().focus()}}};i.prototype.createGridCellVo=function(){var e={rowIndex:this.rowNode.rowIndex,floating:this.rowNode.rowPinned,column:this.column};this.gridCell=new u.GridCell(e)};i.prototype.getGridCell=function(){return this.gridCell};i.prototype.getParentRow=function(){return this.eParentRow};i.prototype.setParentRow=function(e){this.eParentRow=e};i.prototype.getColumn=function(){return this.column};i.prototype.detach=function(){this.eParentRow.removeChild(this.getGui())};i.prototype.destroy=function(){s.prototype.destroy.call(this);if(this.cellEditor&&this.cellEditor.destroy){this.cellEditor.destroy();this.cellEditor=null}if(this.cellRenderer&&this.cellRenderer.destroy){this.cellRenderer.destroy();this.cellRenderer=null}};i.prototype.onLeftChanged=function(){var e=this.getCellLeft();this.getGui().style.left=e+"px"};i.prototype.onWidthChanged=function(){var e=this.getCellWidth();this.getGui().style.width=e+"px"};i.prototype.getRangeClasses=function(){var e=[];if(!this.rangeSelectionEnabled){return e}if(this.rangeCount!==0){e.push("ag-cell-range-selected")}if(this.rangeCount===1){e.push("ag-cell-range-selected-1")}if(this.rangeCount===2){e.push("ag-cell-range-selected-2")}if(this.rangeCount===3){e.push("ag-cell-range-selected-3")}if(this.rangeCount>=4){e.push("ag-cell-range-selected-4")}return e};i.prototype.onRowIndexChanged=function(){this.createGridCellVo();this.onCellFocused();this.onRangeSelectionChanged()};i.prototype.onRangeSelectionChanged=function(){if(!this.beans.enterprise){return}var e=this.beans.rangeController.getCellRangeCount(this.gridCell);var t=this.getGui();if(this.rangeCount!==e){p._.addOrRemoveCssClass(t,"ag-cell-range-selected",e!==0);p._.addOrRemoveCssClass(t,"ag-cell-range-selected-1",e===1);p._.addOrRemoveCssClass(t,"ag-cell-range-selected-2",e===2);p._.addOrRemoveCssClass(t,"ag-cell-range-selected-3",e===3);p._.addOrRemoveCssClass(t,"ag-cell-range-selected-4",e>=4);this.rangeCount=e}};i.prototype.onFirstRightPinnedChanged=function(){var e=this.column.isFirstRightPinned();if(this.firstRightPinned!==e){this.firstRightPinned=e;p._.addOrRemoveCssClass(this.getGui(),"ag-cell-first-right-pinned",e)}};i.prototype.onLastLeftPinnedChanged=function(){var e=this.column.isLastLeftPinned();if(this.lastLeftPinned!==e){this.lastLeftPinned=e;p._.addOrRemoveCssClass(this.getGui(),"ag-cell-last-left-pinned",e)}};i.prototype.populateTemplate=function(){if(this.usingWrapper){this.eParentOfValue=this.getRefElement("eCellValue");this.eCellWrapper=this.getRefElement("eCellWrapper");if(this.includeRowDraggingComponent){this.addRowDragging()}if(this.includeSelectionComponent){this.addSelectionCheckbox()}}else{this.eParentOfValue=this.getGui()}};i.prototype.addRowDragging=function(){if(!this.beans.gridOptionsWrapper.isRowModelDefault()){p._.doOnce(function(){return console.warn("ag-Grid: row dragging is only allowed in the In Memory Row Model")},"CellComp.addRowDragging");return}if(this.beans.gridOptionsWrapper.isPagination()){p._.doOnce(function(){return console.warn("ag-Grid: row dragging is not possible when doing pagination")},"CellComp.addRowDragging");return}var e=new d.RowDragComp(this.rowNode,this.column,this.getValueToUse(),this.beans);this.addFeature(this.beans.context,e);this.eCellWrapper.insertBefore(e.getGui(),this.eParentOfValue)};i.prototype.addSelectionCheckbox=function(){var e=new c.CheckboxSelectionComponent;this.beans.context.wireBean(e);var t=this.column.getColDef().checkboxSelection;t=typeof t==="function"?t:null;e.init({rowNode:this.rowNode,column:this.column,visibleFunc:t});this.addDestroyFunc(function(){return e.destroy()});this.eCellWrapper.insertBefore(e.getGui(),this.eParentOfValue)};i.prototype.addDomData=function(){var e=this;var t=this.getGui();this.beans.gridOptionsWrapper.setDomData(t,i.DOM_DATA_KEY_CELL_COMP,this);this.addDestroyFunc(function(){return e.beans.gridOptionsWrapper.setDomData(t,i.DOM_DATA_KEY_CELL_COMP,null)})};i.prototype.onCellFocused=function(e){var t=this.beans.focusedCellController.isCellFocused(this.gridCell);if(t!==this.cellFocused){var i=!this.beans.gridOptionsWrapper.isSuppressCellSelection();if(i){p._.addOrRemoveCssClass(this.getGui(),"ag-cell-focus",t);p._.addOrRemoveCssClass(this.getGui(),"ag-cell-no-focus",!t)}this.cellFocused=t}if(t&&e&&e.forceBrowserFocus){this.getGui().focus()}var n=this.beans.gridOptionsWrapper.isFullRowEdit();if(!t&&!n&&this.editingCell){this.stopRowOrCellEdit()}};i.prototype.stopRowOrCellEdit=function(e){if(e===void 0){e=false}if(this.beans.gridOptionsWrapper.isFullRowEdit()){this.rowComp.stopRowEditing(e)}else{this.stopEditing(e)}};i.prototype.stopEditing=function(e){if(e===void 0){e=false}if(!this.editingCell){return}if(!this.cellEditor){this.editingCell=false;return}var t=false;var i;if(!e){var n=this.cellEditor.isCancelAfterEnd&&this.cellEditor.isCancelAfterEnd();if(!n){i=this.cellEditor.getValue();t=true}}this.editingCell=false;if(this.cellEditor.destroy){this.cellEditor.destroy()}this.cellEditor=null;if(this.cellEditorInPopup){this.hideEditorPopup();this.hideEditorPopup=null}else{p._.removeAllChildren(this.getGui());if(this.usingWrapper){this.getGui().appendChild(this.eCellWrapper)}else{if(this.cellRenderer){var r=this.cellRendererGui;if(r){this.getGui().appendChild(r)}}}}this.setInlineEditingClass();if(t){this.rowNode.setDataValue(this.column,i);this.getValueAndFormat()}this.refreshCell({forceRefresh:true,suppressFlash:true});var o=this.createEvent(null,l.Events.EVENT_CELL_EDITING_STOPPED);this.beans.eventService.dispatchEvent(o)};i.DOM_DATA_KEY_CELL_COMP="cellComp";return i}(s.Component);t.CellComp=f},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var h=i(1);var g=i(9);var o=i(0);var a=i(42);var s=i(2);var l=i(41);var u=function(){function e(){this.activePopupElements=[]}e.prototype.getPopupParent=function(){var e=this.gridOptionsWrapper.getPopupParent();if(e){return e}else{return this.gridCore.getRootGui()}};e.prototype.positionPopupForMenu=function(e){var t=e.eventSource.getBoundingClientRect();var i=this.getPopupParent().getBoundingClientRect();var n=t.top-i.top;n=this.keepYWithinBounds(e,n);var r=e.ePopup.clientWidth>0?e.ePopup.clientWidth:200;var o=i.right-i.left;var a=o-r;var s;if(this.gridOptionsWrapper.isEnableRtl()){s=u();if(s<0){s=l()}if(s>a){s=0}}else{s=l();if(s>a){s=u()}if(s<0){s=0}}e.ePopup.style.left=s+"px";e.ePopup.style.top=n+"px";function l(){return t.right-i.left-2}function u(){return t.left-i.left-r}};e.prototype.positionPopupUnderMouseEvent=function(e){var t=this.getPopupParent().getBoundingClientRect();this.positionPopup({ePopup:e.ePopup,x:e.mouseEvent.clientX-t.left,y:e.mouseEvent.clientY-t.top,keepWithinBounds:true});this.callPostProcessPopup(e.ePopup,null,e.mouseEvent,e.type,e.column,e.rowNode)};e.prototype.positionPopupUnderComponent=function(e){var t=e.eventSource.getBoundingClientRect();var i=this.getPopupParent().getBoundingClientRect();this.positionPopup({ePopup:e.ePopup,minWidth:e.minWidth,nudgeX:e.nudgeX,nudgeY:e.nudgeY,x:t.left-i.left,y:t.top-i.top+t.height,keepWithinBounds:e.keepWithinBounds});this.callPostProcessPopup(e.ePopup,e.eventSource,null,e.type,e.column,e.rowNode)};e.prototype.callPostProcessPopup=function(e,t,i,n,r,o){var a=this.gridOptionsWrapper.getPostProcessPopupFunc();if(a){var s={column:r,rowNode:o,ePopup:e,type:n,eventSource:t,mouseEvent:i};a(s)}};e.prototype.positionPopupOverComponent=function(e){var t=e.eventSource.getBoundingClientRect();var i=this.getPopupParent().getBoundingClientRect();this.positionPopup({ePopup:e.ePopup,minWidth:e.minWidth,nudgeX:e.nudgeX,nudgeY:e.nudgeY,x:t.left-i.left,y:t.top-i.top,keepWithinBounds:e.keepWithinBounds});this.callPostProcessPopup(e.ePopup,e.eventSource,null,e.type,e.column,e.rowNode)};e.prototype.positionPopup=function(e){var t=e.x;var i=e.y;if(e.nudgeX){t+=e.nudgeX}if(e.nudgeY){i+=e.nudgeY}if(e.keepWithinBounds){t=this.keepXWithinBounds(e,t);i=this.keepYWithinBounds(e,i)}e.ePopup.style.left=t+"px";e.ePopup.style.top=i+"px"};e.prototype.keepYWithinBounds=function(e,t){var i=this.getPopupParent().getBoundingClientRect();var n;if(e.ePopup.clientHeight>0){n=e.ePopup.clientHeight}else{n=200}var r=i.bottom-i.top;var o=r-n-5;if(t>o){return o}else if(t<0){return 0}else{return t}};e.prototype.keepXWithinBounds=function(e,t){var i=this.getPopupParent().getBoundingClientRect();var n;if(e.minWidth>0){n=e.minWidth}else if(e.ePopup.clientWidth>0){n=e.ePopup.clientWidth}else{n=200}var r=i.right-i.left;var o=r-n-5;if(t>o){return o}else if(t<0){return 0}else{return t}};e.prototype.addAsModalPopup=function(i,e,n,r){var o=this;var a=this.gridOptionsWrapper.getDocument();if(!a){console.warn("ag-grid: could not find the body of the document, document.body is empty");return}i.style.top="0px";i.style.left="0px";var t=h.Utils.isVisible(i);if(t){return}var s=this.getPopupParent();var l=document.createElement("div");h.Utils.addCssClass(l,this.environment.getTheme());l.appendChild(i);s.appendChild(l);this.activePopupElements.push(i);var u=false;var c=function(e){var t=e.which||e.keyCode;if(t===g.Constants.KEY_ESCAPE){p(null)}};var d=function(e){p(e)};var f=function(e){p(null,e)};var p=function(e,t){if(o.isEventFromCurrentPopup(e,t,i)){return}if(o.isEventSameChainAsOriginalEvent(r,e,t)){return}if(u){return}u=true;s.removeChild(l);h.Utils.removeFromArray(o.activePopupElements,i);a.removeEventListener("keydown",c);a.removeEventListener("click",d);a.removeEventListener("touchstart",f);a.removeEventListener("contextmenu",d);if(n){n()}};setTimeout(function(){if(e){a.addEventListener("keydown",c)}a.addEventListener("click",d);a.addEventListener("touchstart",f);a.addEventListener("contextmenu",d)},0);return p};e.prototype.isEventFromCurrentPopup=function(e,t,i){var n=e?e:t;if(n){var r=this.activePopupElements.indexOf(i);for(var o=r;o<this.activePopupElements.length;o++){var a=this.activePopupElements[o];if(h.Utils.isElementInEventPath(a,n)){return true}}}return false};e.prototype.isEventSameChainAsOriginalEvent=function(e,t,i){var n;if(t){n=t}else if(i){n=i.touches[0]}if(n&&e){var r=Math.abs(e.screenX-t.screenX)<5;var o=Math.abs(e.screenY-t.screenY)<5;if(r&&o){return true}}return false};n([o.Autowired("gridCore"),r("design:type",a.GridCore)],e.prototype,"gridCore",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("environment"),r("design:type",l.Environment)],e.prototype,"environment",void 0);e=n([o.Bean("popupService")],e);return e}();t.PopupService=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(3);var s=i(5);var l=i(4);var u=i(7);var c=i(6);var d=i(2);var f=function(){function e(){}e.prototype.setScrollsVisible=function(e){var t=this.bodyHorizontalScrollShowing!==e.bodyHorizontalScrollShowing||this.leftVerticalScrollShowing!==e.leftVerticalScrollShowing||this.rightVerticalScrollShowing!==e.rightVerticalScrollShowing;if(t){this.bodyHorizontalScrollShowing=e.bodyHorizontalScrollShowing;this.leftVerticalScrollShowing=e.leftVerticalScrollShowing;this.rightVerticalScrollShowing=e.rightVerticalScrollShowing;var i={type:s.Events.EVENT_SCROLL_VISIBILITY_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i)}};e.prototype.isBodyHorizontalScrollShowing=function(){return this.bodyHorizontalScrollShowing};e.prototype.isLeftVerticalScrollShowing=function(){return this.leftVerticalScrollShowing};e.prototype.isRightVerticalScrollShowing=function(){return this.rightVerticalScrollShowing};n([o.Autowired("eventService"),r("design:type",a.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("columnController"),r("design:type",l.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("columnApi"),r("design:type",u.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridApi"),r("design:type",c.GridApi)],e.prototype,"gridApi",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",d.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("scrollVisibleService")],e);return e}();t.ScrollVisibleService=f},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(123);var s=i(2);var l=i(25);var u=i(3);var c=function(){function e(){this.p1Tasks=new a.LinkedList;this.p2Tasks=new a.LinkedList;this.ticking=false}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.init=function(){this.useAnimationFrame=!this.gridOptionsWrapper.isSuppressAnimationFrame()};e.prototype.verifyAnimationFrameOn=function(e){if(this.useAnimationFrame===false){console.warn("ag-Grid: AnimationFrameService."+e+" called but animation frames are off")}};e.prototype.addP1Task=function(e){this.verifyAnimationFrameOn("addP1Task");this.p1Tasks.add(e);this.schedule()};e.prototype.addP2Task=function(e){this.verifyAnimationFrameOn("addP2Task");this.p2Tasks.add(e);this.schedule()};e.prototype.executeFrame=function(e){this.verifyAnimationFrameOn("executeFrame");var t=(new Date).getTime();var i=(new Date).getTime()-t;var n=true;var r=e<=0;while(r||i<e){if(n){n=this.gridPanel.executeFrame()}else if(!this.p1Tasks.isEmpty()){var o=this.p1Tasks.remove();o()}else if(!this.p2Tasks.isEmpty()){var o=this.p2Tasks.remove();o()}else{break}i=(new Date).getTime()-t}if(n||!this.p1Tasks.isEmpty()||!this.p2Tasks.isEmpty()){this.requestFrame()}else{this.stopTicking()}};e.prototype.stopTicking=function(){this.ticking=false;var e={type:l.Events.EVENT_ANIMATION_QUEUE_EMPTY,columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};this.eventService.dispatchEvent(e)};e.prototype.flushAllFrames=function(){if(!this.useAnimationFrame){return}this.executeFrame(-1)};e.prototype.schedule=function(){if(!this.useAnimationFrame){return}if(!this.ticking){this.ticking=true;this.requestFrame()}};e.prototype.requestFrame=function(){var e=this.executeFrame.bind(this,60);if(window.requestAnimationFrame){window.requestAnimationFrame(e)}else if(window.webkitRequestAnimationFrame){window.webkitRequestAnimationFrame(e)}else{setTimeout(e,0)}};e.prototype.isQueueEmpty=function(){return this.ticking};n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("eventService"),r("design:type",u.EventService)],e.prototype,"eventService",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("animationFrameService")],e);return e}();t.AnimationFrameService=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(2);var s=i(12);var l=i(31);var u=i(107);var p=i(32);var c=i(10);var d=i(0);var f=i(1);var h=i(134);var g=function(){function e(){}e.prototype.setBeans=function(e){this.logger=e.create("BalancedColumnTreeBuilder")};e.prototype.createForAutoGroups=function(e,i){var n=this;var r=[];e.forEach(function(e){var t=n.createAutoGroupTreeItem(i,e);r.push(t)});return r};e.prototype.createAutoGroupTreeItem=function(e,t){var i=this.findDept(e);var n=t;for(var r=i-1;r>=0;r--){var o=new p.OriginalColumnGroup(null,"FAKE_PATH_"+t.getId()+"}_"+r,true,r);this.context.wireBean(o);o.setChildren([n]);n=o}return n};e.prototype.findDept=function(e){var t=0;var i=e;while(i&&i[0]&&i[0]instanceof p.OriginalColumnGroup){t++;i=i[0].getChildren()}return t};e.prototype.createBalancedColumnGroups=function(e,t){var i=new u.ColumnKeyCreator;var n=this.recursivelyCreateColumns(e,0,i,t);var r=this.findMaxDept(n,0);this.logger.log("Number of levels for grouped columns is "+r);var o=this.balanceColumnTree(n,0,r,i);this.columnUtils.depthFirstOriginalTreeSearch(o,function(e){if(e instanceof p.OriginalColumnGroup){e.setupExpandable()}});return{balancedTree:o,treeDept:r}};e.prototype.balanceColumnTree=function(e,l,u,c){var d=this;var f=[];e.forEach(function(e){if(e instanceof p.OriginalColumnGroup){var t=e;var i=d.balanceColumnTree(t.getChildren(),l+1,u,c);t.setChildren(i);f.push(t)}else{var n=e;for(var r=u-1;r>=l;r--){var o=c.getUniqueKey(null,null);var a=d.createMergedColGroupDef(null);var s=new p.OriginalColumnGroup(a,o,true,l);d.context.wireBean(s);s.setChildren([n]);n=s}f.push(n)}});return f};e.prototype.findMaxDept=function(e,t){var i=t;for(var n=0;n<e.length;n++){var r=e[n];if(r instanceof p.OriginalColumnGroup){var o=r;var a=this.findMaxDept(o.getChildren(),t+1);if(i<a){i=a}}}return i};e.prototype.recursivelyCreateColumns=function(e,i,n,r){var o=this;var a=[];if(!e){return a}e.forEach(function(e){var t;if(o.isColumnGroup(e)){t=o.createColumnGroup(n,r,e,i)}else{t=o.createColumn(n,r,e)}a.push(t)});return a};e.prototype.createColumnGroup=function(e,t,i,n){var r=this.createMergedColGroupDef(i);var o=e.getUniqueKey(r.groupId,null);var a=new p.OriginalColumnGroup(r,o,false,n);this.context.wireBean(a);var s=this.recursivelyCreateColumns(r.children,n+1,e,t);a.setChildren(s);return a};e.prototype.createMergedColGroupDef=function(e){var t={};f.Utils.assign(t,this.gridOptionsWrapper.getDefaultColGroupDef());f.Utils.assign(t,e);this.checkForDeprecatedItems(t);return t};e.prototype.createColumn=function(e,t,i){var n=this.mergeColDefs(i);this.checkForDeprecatedItems(n);var r=e.getUniqueKey(n.colId,n.field);var o=new c.Column(n,r,t);this.context.wireBean(o);return o};e.prototype.mergeColDefs=function(e){var t={};f.Utils.assign(t,this.gridOptionsWrapper.getDefaultColDef());if(e.type){this.assignColumnTypes(e,t)}f.Utils.assign(t,e);return t};e.prototype.assignColumnTypes=function(e,i){var t;if(e.type instanceof Array){var n=e.type.some(function(e){return typeof e!=="string"});if(n){console.warn("ag-grid: if colDef.type is supplied an array it should be of type 'string[]'")}else{t=e.type}}else if(typeof e.type==="string"){t=e.type.split(",")}else{console.warn("ag-grid: colDef.type should be of type 'string' | 'string[]'");return}var r=f.Utils.assign({},this.gridOptionsWrapper.getColumnTypes(),h.DefaultColumnTypes);t.forEach(function(e){var t=r[e.trim()];if(t){f.Utils.assign(i,t)}else{console.warn("ag-grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")}})};e.prototype.checkForDeprecatedItems=function(e){if(e){var t=e;if(t.group!==undefined){console.warn("ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3")}if(t.headerGroup!==undefined){console.warn("ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3")}if(t.headerGroupShow!==undefined){console.warn("ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3")}if(t.suppressRowGroup!==undefined){console.warn("ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead")}if(t.suppressAggregation!==undefined){console.warn("ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead")}if(t.suppressRowGroup||t.suppressAggregation){console.warn("ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead")}if(t.displayName){console.warn("ag-grid: Found displayName "+t.displayName+", please use headerName instead, displayName is deprecated.");t.headerName=t.displayName}}};e.prototype.isColumnGroup=function(e){return e.children!==undefined};n([d.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([d.Autowired("columnUtils"),r("design:type",l.ColumnUtils)],e.prototype,"columnUtils",void 0);n([d.Autowired("context"),r("design:type",d.Context)],e.prototype,"context",void 0);n([o(0,d.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[s.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);e=n([d.Bean("balancedColumnTreeBuilder")],e);return e}();t.BalancedColumnTreeBuilder=g},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(20);var a=i(0);var s=i(2);var l=i(100);var u=function(){function e(){}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.registerHeaderRootComp=function(e){this.headerRootComp=e};e.prototype.getPreferredWidthForColumn=function(e){var t=this.getHeaderCellForColumn(e);if(!t){return-1}var i=document.createElement("span");i.style.position="fixed";var n=this.gridPanel.getBodyContainer();n.appendChild(i);this.putRowCellsIntoDummyContainer(e,i);this.cloneItemIntoDummy(t,i);var r=i.offsetWidth;n.removeChild(i);var o=this.gridOptionsWrapper.getAutoSizePadding();return r+o};e.prototype.getHeaderCellForColumn=function(i){var n=null;this.headerRootComp.forEachHeaderElement(function(e){if(e instanceof l.HeaderWrapperComp){var t=e;if(t.getColumn()===i){n=t}}});return n?n.getGui():null};e.prototype.putRowCellsIntoDummyContainer=function(e,t){var i=this;var n=this.rowRenderer.getAllCellsForColumn(e);n.forEach(function(e){return i.cloneItemIntoDummy(e,t)})};e.prototype.cloneItemIntoDummy=function(e,t){var i=e.cloneNode(true);i.style.width="";i.style.position="static";i.style.left="";var n=document.createElement("div");n.style.display="table-row";n.appendChild(i);t.appendChild(n)};n([a.Autowired("rowRenderer"),r("design:type",o.RowRenderer)],e.prototype,"rowRenderer",void 0);n([a.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([a.Bean("autoWidthCalculator")],e);return e}();t.AutoWidthCalculator=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(12);var s=i(1);var l=i(3);var u=i(5);var c=i(2);var d=i(7);var f=i(6);var p=function(){function e(){this.onMouseUpListener=this.onMouseUp.bind(this);this.onMouseMoveListener=this.onMouseMove.bind(this);this.onTouchEndListener=this.onTouchUp.bind(this);this.onTouchMoveListener=this.onTouchMove.bind(this);this.dragEndFunctions=[];this.dragSources=[]}e.prototype.init=function(){this.logger=this.loggerFactory.create("DragService")};e.prototype.destroy=function(){this.dragSources.forEach(this.removeListener.bind(this));this.dragSources.length=0};e.prototype.removeListener=function(e){var t=e.dragSource.eElement;var i=e.mouseDownListener;t.removeEventListener("mousedown",i);if(e.touchEnabled){var n=e.touchStartListener;t.removeEventListener("touchstart",n,{passive:true})}};e.prototype.removeDragSource=function(t){var e=s.Utils.find(this.dragSources,function(e){return e.dragSource===t});if(!e){return}this.removeListener(e);s.Utils.removeFromArray(this.dragSources,e)};e.prototype.setNoSelectToBody=function(e){var t=this.gridOptionsWrapper.getDocument();var i=t.querySelector("body");if(s.Utils.exists(i)){s.Utils.addOrRemoveCssClass(i,"ag-body-no-select",e)}};e.prototype.addDragSource=function(e,t){if(t===void 0){t=false}var i=this.onMouseDown.bind(this,e);e.eElement.addEventListener("mousedown",i);var n=null;var r=this.gridOptionsWrapper.isSuppressTouch();var o=t&&!r;if(o){n=this.onTouchStart.bind(this,e);e.eElement.addEventListener("touchstart",n,{passive:false})}this.dragSources.push({dragSource:e,mouseDownListener:i,touchStartListener:n,touchEnabled:t})};e.prototype.onTouchStart=function(e,t){var i=this;this.currentDragParams=e;this.dragging=false;var n=t.touches[0];this.touchLastTime=n;this.touchStart=n;t.preventDefault();e.eElement.addEventListener("touchmove",this.onTouchMoveListener,{passive:true});e.eElement.addEventListener("touchend",this.onTouchEndListener,{passive:true});e.eElement.addEventListener("touchcancel",this.onTouchEndListener,{passive:true});this.dragEndFunctions.push(function(){e.eElement.removeEventListener("touchmove",i.onTouchMoveListener,{passive:true});e.eElement.removeEventListener("touchend",i.onTouchEndListener,{passive:true});e.eElement.removeEventListener("touchcancel",i.onTouchEndListener,{passive:true})});if(e.dragStartPixels===0){this.onCommonMove(n,this.touchStart)}};e.prototype.onMouseDown=function(e,t){var i=this;if(e.skipMouseEvent){if(e.skipMouseEvent(t)){return}}if(t._alreadyProcessedByDragService){return}t._alreadyProcessedByDragService=true;if(t.button!==0){return}this.currentDragParams=e;this.dragging=false;this.mouseEventLastTime=t;this.mouseStartEvent=t;var n=this.gridOptionsWrapper.getDocument();n.addEventListener("mousemove",this.onMouseMoveListener);n.addEventListener("mouseup",this.onMouseUpListener);this.dragEndFunctions.push(function(){n.removeEventListener("mousemove",i.onMouseMoveListener);n.removeEventListener("mouseup",i.onMouseUpListener)});if(e.dragStartPixels===0){this.onMouseMove(t)}};e.prototype.isEventNearStartEvent=function(e,t){var i=s.Utils.exists(this.currentDragParams.dragStartPixels)?this.currentDragParams.dragStartPixels:4;return s.Utils.areEventsNear(e,t,i)};e.prototype.getFirstActiveTouch=function(e){for(var t=0;t<e.length;t++){var i=e[t].identifier===this.touchStart.identifier;if(i){return e[t]}}return null};e.prototype.onCommonMove=function(e,t){if(!this.dragging){var i=!this.dragging&&this.isEventNearStartEvent(e,t);if(i){return}else{this.dragging=true;var n={type:u.Events.EVENT_DRAG_STARTED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n);this.currentDragParams.onDragStart(t);this.setNoSelectToBody(true)}}this.currentDragParams.onDragging(e)};e.prototype.onTouchMove=function(e){var t=this.getFirstActiveTouch(e.touches);if(!t){return}this.onCommonMove(t,this.touchStart)};e.prototype.onMouseMove=function(e){this.onCommonMove(e,this.mouseStartEvent)};e.prototype.onTouchUp=function(e){var t=this.getFirstActiveTouch(e.changedTouches);if(!t){t=this.touchLastTime}this.onUpCommon(t)};e.prototype.onMouseUp=function(e){this.onUpCommon(e)};e.prototype.onUpCommon=function(e){if(this.dragging){this.dragging=false;this.currentDragParams.onDragStop(e);var t={type:u.Events.EVENT_DRAG_STOPPED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)}this.setNoSelectToBody(false);this.mouseStartEvent=null;this.mouseEventLastTime=null;this.touchStart=null;this.touchLastTime=null;this.currentDragParams=null;this.dragEndFunctions.forEach(function(e){return e()});this.dragEndFunctions.length=0};n([o.Autowired("loggerFactory"),r("design:type",a.LoggerFactory)],e.prototype,"loggerFactory",void 0);n([o.Autowired("eventService"),r("design:type",l.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",c.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("columnApi"),r("design:type",d.ColumnApi)],e.prototype,"columnApi",void 0);n([o.Autowired("gridApi"),r("design:type",f.GridApi)],e.prototype,"gridApi",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);n([o.PreDestroy,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"destroy",null);e=n([o.Bean("dragService")],e);return e}();t.DragService=p},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=["fresh","dark","blue","bootstrap","material","balham-dark","balham"];var s=a.concat(a.map(function(e){return"theme-"+e}));var l=new RegExp("ag-("+s.join("|")+")");var u=8;var c=4;var d=4;var f={"ag-theme-material":{headerHeight:u*7,virtualItemHeight:u*5,rowHeight:u*6},"ag-theme-classic":{headerHeight:25,virtualItemHeight:c*5,rowHeight:25},"ag-theme-balham":{headerHeight:d*8,virtualItemHeight:d*7,rowHeight:d*7}};var p=function(){function e(){this.sassVariables={}}e.prototype.loadSassVariables=function(){};e.prototype.getSassVariable=function(e,t){if(e=="ag-theme-material"){return f["ag-theme-material"][t]}else if(e=="ag-theme-balham"||e=="ag-theme-balham-dark"){return f["ag-theme-balham"][t]}return f["ag-theme-classic"][t]};e.prototype.getTheme=function(){var e;var t=this.eGridDiv;while(t!=document.documentElement&&e==null){e=t.className.match(l);t=t.parentElement;if(t==null){break}}if(e){return e[0]}else{return"ag-fresh"}};n([o.Autowired("eGridDiv"),r("design:type",HTMLElement)],e.prototype,"eGridDiv",void 0);e=n([o.Bean("environment")],e);return e}();t.Environment=p},function(e,t,i){"use strict";var r=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(2);var l=i(7);var u=i(4);var c=i(20);var d=i(18);var f=i(3);var p=i(78);var h=i(12);var g=i(35);var v=i(1);var m=i(0);var y=i(22);var n=i(8);var b=i(6);var _=i(11);var w=function(e){r(t,e);function t(){return e.call(this)||this}n=t;t.prototype.init=function(){var t=this;this.logger=this.loggerFactory.create("GridCore");var e=this.enterprise?n.TEMPLATE_ENTERPRISE:n.TEMPLATE_NORMAL;this.setTemplate(e);this.instantiate(this.context);if(this.enterprise){this.toolPanelComp.registerGridComp(this.gridPanel);this.statusBar.registerGridPanel(this.gridPanel)}this.gridOptionsWrapper.addEventListener(s.GridOptionsWrapper.PROP_GRID_AUTO_HEIGHT,this.addLayoutClass.bind(this));this.addLayoutClass();this.showToolPanel(this.gridOptionsWrapper.isShowToolPanel());this.eGridDiv.appendChild(this.getGui());this.addDestroyFunc(function(){t.eGridDiv.removeChild(t.getGui())});if(this.$scope){var i=this.$scope.$watch(this.quickFilterOnScope,function(e){return t.filterManager.setQuickFilter(e)});this.addDestroyFunc(i)}this.addRtlSupport();this.finished=false;this.addDestroyFunc(function(){return t.finished=true});this.logger.log("ready")};t.prototype.addLayoutClass=function(){var e=this.gridOptionsWrapper.isGridAutoHeight();this.addOrRemoveCssClass("ag-layout-auto-height",e);this.addOrRemoveCssClass("ag-layout-normal",!e);this.addOrRemoveCssClass("ag-scrolls",!e)};t.prototype.getPreferredWidth=function(){var e=this.columnController.getBodyContainerWidth()+this.columnController.getPinnedLeftContainerWidth()+this.columnController.getPinnedRightContainerWidth();var t=this.toolPanelComp?this.toolPanelComp.getPreferredWidth():0;return e+t};t.prototype.addRtlSupport=function(){var e=this.gridOptionsWrapper.isEnableRtl()?"ag-rtl":"ag-ltr";v.Utils.addCssClass(this.getGui(),e)};t.prototype.getRootGui=function(){return this.getGui()};t.prototype.showToolPanel=function(e){if(!this.toolPanelComp){if(e){console.warn("ag-Grid: toolPanel is only available in ag-Grid Enterprise")}return}this.toolPanelComp.showToolPanel(e)};t.prototype.isToolPanelShowing=function(){return this.toolPanelComp.isToolPanelShowing()};t.prototype.destroy=function(){e.prototype.destroy.call(this);this.logger.log("Grid DOM removed")};t.prototype.ensureNodeVisible=function(e,t){if(t===void 0){t="top"}if(this.doingVirtualPaging){throw"Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory"}var i=this.rowModel.getPageLastRow()+1;var n=typeof e==="function";var r=-1;for(var o=0;o<i;o++){var a=this.rowModel.getRow(o);if(n){if(e(a)){r=o;break}}else{if(e===a||e===a.data){r=o;break}}}if(r>=0){this.gridPanel.ensureIndexVisible(r,t)}};t.TEMPLATE_NORMAL='<div class="ag-root-wrapper">\n            <div class="ag-root-wrapper-body">\n                <ag-grid-comp ref="gridPanel"></ag-grid-comp>\n            </div>\n            <ag-pagination></ag-pagination>\n        </div>';t.TEMPLATE_ENTERPRISE='<div class="ag-root-wrapper">\n            <ag-header-column-drop></ag-header-column-drop>\n            <div class="ag-root-wrapper-body">\n                <ag-grid-comp ref="gridPanel"></ag-grid-comp>\n                <ag-tool-panel ref="toolPanel"></ag-tool-panel>\n            </div>\n            <ag-status-bar ref="statusBar"></ag-status-bar>\n            <ag-pagination></ag-pagination>\n        </div>';o([m.Autowired("enterprise"),a("design:type",Boolean)],t.prototype,"enterprise",void 0);o([m.Autowired("gridOptions"),a("design:type",Object)],t.prototype,"gridOptions",void 0);o([m.Autowired("gridOptionsWrapper"),a("design:type",s.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);o([m.Autowired("rowModel"),a("design:type",Object)],t.prototype,"rowModel",void 0);o([m.Autowired("frameworkFactory"),a("design:type",Object)],t.prototype,"frameworkFactory",void 0);o([m.Autowired("columnController"),a("design:type",u.ColumnController)],t.prototype,"columnController",void 0);o([m.Autowired("rowRenderer"),a("design:type",c.RowRenderer)],t.prototype,"rowRenderer",void 0);o([m.Autowired("filterManager"),a("design:type",d.FilterManager)],t.prototype,"filterManager",void 0);o([m.Autowired("eventService"),a("design:type",f.EventService)],t.prototype,"eventService",void 0);o([m.Autowired("eGridDiv"),a("design:type",HTMLElement)],t.prototype,"eGridDiv",void 0);o([m.Autowired("$scope"),a("design:type",Object)],t.prototype,"$scope",void 0);o([m.Autowired("quickFilterOnScope"),a("design:type",String)],t.prototype,"quickFilterOnScope",void 0);o([m.Autowired("popupService"),a("design:type",g.PopupService)],t.prototype,"popupService",void 0);o([m.Autowired("focusedCellController"),a("design:type",y.FocusedCellController)],t.prototype,"focusedCellController",void 0);o([m.Autowired("context"),a("design:type",m.Context)],t.prototype,"context",void 0);o([m.Autowired("loggerFactory"),a("design:type",h.LoggerFactory)],t.prototype,"loggerFactory",void 0);o([m.Autowired("columnApi"),a("design:type",l.ColumnApi)],t.prototype,"columnApi",void 0);o([m.Autowired("gridApi"),a("design:type",b.GridApi)],t.prototype,"gridApi",void 0);o([m.Optional("rowGroupCompFactory"),a("design:type",Object)],t.prototype,"rowGroupCompFactory",void 0);o([m.Optional("pivotCompFactory"),a("design:type",Object)],t.prototype,"pivotCompFactory",void 0);o([_.RefSelector("statusBar"),a("design:type",Object)],t.prototype,"statusBar",void 0);o([_.RefSelector("gridPanel"),a("design:type",p.GridPanel)],t.prototype,"gridPanel",void 0);o([_.RefSelector("toolPanel"),a("design:type",Object)],t.prototype,"toolPanelComp",void 0);o([m.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],t.prototype,"init",null);o([m.PreDestroy,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],t.prototype,"destroy",null);t=n=o([m.Bean("gridCore"),a("design:paramtypes",[])],t);return t;var n}(n.Component);t.GridCore=w},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var s=i(19);var l=function(){function e(){}e.prototype.formatValue=function(e,t,i,n){var r;var o=e.getColDef();if(t&&t.rowPinned){r=o.pinnedRowValueFormatter?o.pinnedRowValueFormatter:o.valueFormatter}else{r=o.valueFormatter}var a=null;if(r){var s={value:n,node:t,data:t?t.data:null,colDef:e.getColDef(),column:e,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};s.$scope=i;a=this.expressionService.evaluate(r,s)}else if(o.refData){return o.refData[n]}if((a===null||a===undefined)&&Array.isArray(n)){a=n.join(", ")}return a};n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("expressionService"),r("design:type",s.ExpressionService)],e.prototype,"expressionService",void 0);e=n([o.Bean("valueFormatterService")],e);return e}();t.ValueFormatterService=l},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var s=i(0);var l=i(1);var u=i(2);var c=i(34);var a=function(){function e(){this.gridInstanceId=a.gridInstanceSequence.next()}a=e;e.prototype.init=function(){this.stampDomElementWithGridInstance()};e.prototype.stampDomElementWithGridInstance=function(){this.eGridDiv[a.GRID_DOM_KEY]=this.gridInstanceId};e.prototype.getRenderedCellForEvent=function(e){var t=l.Utils.getTarget(e);while(t){var i=this.gridOptionsWrapper.getDomData(t,c.CellComp.DOM_DATA_KEY_CELL_COMP);if(i){return i}t=t.parentElement}return null};e.prototype.isEventFromThisGrid=function(e){var t=l.Utils.getEventPath(e);for(var i=0;i<t.length;i++){var n=t[i];var r=n[a.GRID_DOM_KEY];if(l.Utils.exists(r)){var o=r===this.gridInstanceId;return o}}return false};e.prototype.getGridCellForEvent=function(e){var t=this.getRenderedCellForEvent(e);return t?t.getGridCell():null};e.gridInstanceSequence=new l.NumberSequence;e.GRID_DOM_KEY="__ag_grid_instance";n([s.Autowired("gridOptionsWrapper"),r("design:type",u.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([s.Autowired("eGridDiv"),r("design:type",HTMLElement)],e.prototype,"eGridDiv",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=a=n([o.Bean("mouseEventService")],e);return e;var a}();t.MouseEventService=a},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(3);var s=i(0);var l=i(5);var u=i(13);var c=i(7);var d=i(6);var f=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.setMouseOver=function(e){this.selectedColumns=e;var t={type:l.Events.EVENT_COLUMN_HOVER_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)};t.prototype.clearMouseOver=function(){this.selectedColumns=null;var e={type:l.Events.EVENT_COLUMN_HOVER_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)};t.prototype.isHovered=function(e){return this.selectedColumns&&this.selectedColumns.indexOf(e)>=0};r([s.Autowired("eventService"),o("design:type",a.EventService)],t.prototype,"eventService",void 0);r([s.Autowired("columnApi"),o("design:type",c.ColumnApi)],t.prototype,"columnApi",void 0);r([s.Autowired("gridApi"),o("design:type",d.GridApi)],t.prototype,"gridApi",void 0);t=r([s.Bean("columnHoverService")],t);return t}(u.BeanStub);t.ColumnHoverService=f},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var a=i(3);var n=i(1);var r=function(){function o(e,t){if(t===void 0){t=false}var i=this;this.destroyFuncs=[];this.touching=false;this.eventService=new a.EventService;this.eElement=e;this.preventMouseClick=t;var n=this.onTouchStart.bind(this);var r=this.onTouchMove.bind(this);var o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",n,{passive:true});this.eElement.addEventListener("touchmove",r,{passive:true});this.eElement.addEventListener("touchend",o,{passive:false});this.destroyFuncs.push(function(){i.eElement.addEventListener("touchstart",n,{passive:true});i.eElement.addEventListener("touchmove",r,{passive:true});i.eElement.addEventListener("touchend",o,{passive:false})})}o.prototype.getActiveTouch=function(e){for(var t=0;t<e.length;t++){var i=e[t].identifier===this.touchStart.identifier;if(i){return e[t]}}return null};o.prototype.addEventListener=function(e,t){this.eventService.addEventListener(e,t)};o.prototype.removeEventListener=function(e,t){this.eventService.removeEventListener(e,t)};o.prototype.onTouchStart=function(i){var n=this;if(this.touching){return}this.touchStart=i.touches[0];this.touching=true;this.moved=false;var r=this.touchStart;setTimeout(function(){var e=n.touchStart===r;if(n.touching&&e&&!n.moved){n.moved=true;var t={type:o.EVENT_LONG_TAP,touchStart:n.touchStart,touchEvent:i};n.eventService.dispatchEvent(t)}},500)};o.prototype.onTouchMove=function(e){if(!this.touching){return}var t=this.getActiveTouch(e.touches);if(!t){return}var i=!n.Utils.areEventsNear(t,this.touchStart,4);if(i){this.moved=true}};o.prototype.onTouchEnd=function(e){if(!this.touching){return}if(!this.moved){var t={type:o.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t);this.checkForDoubleTap();if(this.preventMouseClick){e.preventDefault()}}this.touching=false};o.prototype.checkForDoubleTap=function(){var e=(new Date).getTime();if(this.lastTapTime>0){var t=e-this.lastTapTime;if(t>o.DOUBLE_TAP_MILLIS){var i={type:o.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(i);this.lastTapTime=null}else{this.lastTapTime=e}}else{this.lastTapTime=e}};o.prototype.destroy=function(){this.destroyFuncs.forEach(function(e){return e()})};o.EVENT_TAP="tap";o.EVENT_DOUBLE_TAP="doubleTap";o.EVENT_LONG_TAP="longTap";o.DOUBLE_TAP_MILLIS=500;return o}();t.TouchListener=r},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(0);var s=i(63);var l=i(84);var u=i(4);var c=i(16);var d=i(2);var f=i(9);var p=i(1);var h="\r\n";var g=function(l){n(e,l);function e(e,t,i,n,r,o,a){var s=l.call(this,e,t,i,n,r)||this;s.suppressQuotes=o;s.columnSeparator=a;s.result="";s.lineOpened=false;return s}e.prototype.prepare=function(e){};e.prototype.addCustomHeader=function(e){if(!e)return;this.result+=e+h};e.prototype.addCustomFooter=function(e){if(!e)return;this.result+=e+h};e.prototype.onNewHeaderGroupingRow=function(){if(this.lineOpened)this.result+=h;return{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}};e.prototype.onNewHeaderGroupingRowColumn=function(e,t,i){if(t!=0){this.result+=this.columnSeparator}this.result+=e;for(var n=1;n<=i;n++){this.result+=this.columnSeparator+this.putInQuotes("",this.suppressQuotes)}this.lineOpened=true};e.prototype.onNewHeaderRow=function(){if(this.lineOpened)this.result+=h;return{onColumn:this.onNewHeaderRowColumn.bind(this)}};e.prototype.onNewHeaderRowColumn=function(e,t,i){if(t!=0){this.result+=this.columnSeparator}this.result+=this.putInQuotes(this.extractHeaderValue(e),this.suppressQuotes);this.lineOpened=true};e.prototype.onNewBodyRow=function(){if(this.lineOpened)this.result+=h;return{onColumn:this.onNewBodyRowColumn.bind(this)}};e.prototype.onNewBodyRowColumn=function(e,t,i){if(t!=0){this.result+=this.columnSeparator}this.result+=this.putInQuotes(this.extractRowCellValue(e,t,f.Constants.EXPORT_TYPE_CSV,i),this.suppressQuotes);this.lineOpened=true};e.prototype.putInQuotes=function(e,t){if(t){return e}if(e===null||e===undefined){return'""'}var i;if(typeof e==="string"){i=e}else if(typeof e.toString==="function"){i=e.toString()}else{console.warn("unknown value type during csv conversion");i=""}var n=i.replace(/"/g,'""');return'"'+n+'"'};e.prototype.parse=function(){return this.result};return e}(s.BaseGridSerializingSession);t.CsvSerializingSession=g;var v=function(){function e(){}e.prototype.setBeans=function(e){this.beans=e};e.prototype.export=function(e){if(this.isExportSuppressed()){console.warn("ag-grid: Export canceled. Export is not allowed as per your configuration.");return""}var t=this.getMergedParamsAndData(e),i=t.mergedParams,n=t.data;var r=i&&i.fileName&&i.fileName.length!==0;var o=r?i.fileName:this.getDefaultFileName();if(o.indexOf(".")===-1){o=o+"."+this.getDefaultFileExtension()}this.beans.downloader.download(o,n,this.getMimeType());return n};e.prototype.getData=function(e){return this.getMergedParamsAndData(e).data};e.prototype.getMergedParamsAndData=function(e){var t=this.mergeDefaultParams(e);var i=this.beans.gridSerializer.serialize(this.createSerializingSession(t),t);return{mergedParams:t,data:i}};e.prototype.mergeDefaultParams=function(e){var t=this.beans.gridOptionsWrapper.getDefaultExportParams();var i={};p._.assign(i,t);p._.assign(i,e);return i};return e}();t.BaseCreator=v;var m=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.postConstruct=function(){this.setBeans({downloader:this.downloader,gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})};t.prototype.exportDataAsCsv=function(e){return this.export(e)};t.prototype.getDataAsCsv=function(e){return this.getData(e)};t.prototype.getMimeType=function(){return"text/csv;charset=utf-8;"};t.prototype.getDefaultFileName=function(){return"export.csv"};t.prototype.getDefaultFileExtension=function(){return"csv"};t.prototype.createSerializingSession=function(e){return new g(this.columnController,this.valueService,this.gridOptionsWrapper,e?e.processCellCallback:null,e?e.processHeaderCallback:null,e&&e.suppressQuotes,e&&e.columnSeparator||",")};t.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()};r([a.Autowired("columnController"),o("design:type",u.ColumnController)],t.prototype,"columnController",void 0);r([a.Autowired("valueService"),o("design:type",c.ValueService)],t.prototype,"valueService",void 0);r([a.Autowired("downloader"),o("design:type",l.Downloader)],t.prototype,"downloader",void 0);r([a.Autowired("gridSerializer"),o("design:type",s.GridSerializer)],t.prototype,"gridSerializer",void 0);r([a.Autowired("gridOptionsWrapper"),o("design:type",d.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([a.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"postConstruct",null);t=r([a.Bean("csvCreator")],t);return t}(v);t.CsvCreator=m},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(31);var s=i(26);var u=i(32);var a=i(0);var l=i(1);var c=i(0);var d=function(){function e(){}e.prototype.createDisplayedGroups=function(e,l,u,t){var c=this;var d=[];var f;var p;var h=this.mapOldGroupsById(t);e.forEach(function(e){var t=c.getOriginalPathForColumn(l,e);var i=[];var n=!p;for(var r=0;r<t.length;r++){if(n||t[r]!==p[r]){var o=c.createColumnGroup(t[r],u,h);i[r]=o;if(r==0){d.push(o)}else{i[r-1].addChild(o)}}else{i[r]=f[r]}}var a=i.length===0;if(a){d.push(e)}else{var s=i[i.length-1];s.addChild(e)}f=i;p=t});this.setupParentsIntoColumns(d,null);return d};e.prototype.createColumnGroup=function(e,t,i){var n=e.getGroupId();var r=t.getInstanceIdForKey(n);var o=s.ColumnGroup.createUniqueId(n,r);var a=i[o];if(a&&a.getOriginalColumnGroup()!==e){a=null}if(l.Utils.exists(a)){a.reset()}else{a=new s.ColumnGroup(e,n,r);this.context.wireBean(a)}return a};e.prototype.mapOldGroupsById=function(e){var i={};var n=function(e){e.forEach(function(e){if(e instanceof s.ColumnGroup){var t=e;i[e.getUniqueId()]=t;n(t.getChildren())}})};if(e){n(e)}return i};e.prototype.setupParentsIntoColumns=function(e,i){var n=this;e.forEach(function(e){e.setParent(i);if(e instanceof s.ColumnGroup){var t=e;n.setupParentsIntoColumns(t.getChildren(),t)}})};e.prototype.getOriginalPathForColumn=function(e,o){var a=[];var s=false;l(e,0);if(s){return a}else{console.log("could not get path");return null}function l(e,t){for(var i=0;i<e.length;i++){if(s){return}var n=e[i];if(n instanceof u.OriginalColumnGroup){var r=n;l(r.getChildren(),t+1);a[t]=n}else{if(n===o){s=true}}}}};n([c.Autowired("columnUtils"),r("design:type",o.ColumnUtils)],e.prototype,"columnUtils",void 0);n([c.Autowired("context"),r("design:type",a.Context)],e.prototype,"context",void 0);e=n([a.Bean("displayedGroupCreator")],e);return e}();t.DisplayedGroupCreator=d},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(0);var s=function(){function e(){this.templateCache={};this.waitingCallbacks={}}e.prototype.getTemplate=function(e,t){var i=this.templateCache[e];if(i){return i}var n=this.waitingCallbacks[e];var r=this;if(!n){n=[];this.waitingCallbacks[e]=n;var o=new XMLHttpRequest;o.onload=function(){r.handleHttpResult(this,e)};o.open("GET",e);o.send()}if(t){n.push(t)}return null};e.prototype.handleHttpResult=function(e,t){if(e.status!==200||e.response===null){console.warn("Unable to get template error "+e.status+" - "+t);return}this.templateCache[t]=e.response||e.responseText;var i=this.waitingCallbacks[t];for(var n=0;n<i.length;n++){var r=i[n];r()}if(this.$scope){var o=this;setTimeout(function(){o.$scope.$apply()},0)}};n([a.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);e=n([o.Bean("templateService")],e);return e}();t.TemplateService=s},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var d=i(1);var a=i(34);var s=i(14);var l=i(2);var u=i(10);var f=i(5);var c=i(0);var p=i(8);var h=i(11);var g=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.init=function(e){var t=d._.createIconNoSpan("groupLoading",this.gridOptionsWrapper,null);this.eLoadingIcon.appendChild(t);var i=this.gridOptionsWrapper.getLocaleTextFunc();this.eLoadingText.innerText=i("loadingOoo","Loading")};t.prototype.refresh=function(e){return false};t.TEMPLATE='<div class="ag-stub-cell">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>';r([c.Autowired("gridOptionsWrapper"),o("design:type",l.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([h.RefSelector("eLoadingIcon"),o("design:type",HTMLElement)],t.prototype,"eLoadingIcon",void 0);r([h.RefSelector("eLoadingText"),o("design:type",HTMLElement)],t.prototype,"eLoadingText",void 0);return t}(p.Component);t.LoadingCellRenderer=g;var v=function(c){n(r,c);function r(e,t,i,n,r,o,a,s,l){var u=c.call(this)||this;u.eAllRowContainers=[];u.active=true;u.columnRefreshPending=false;u.cellComps={};u.createSecondPassFuncs=[];u.removeFirstPassFuncs=[];u.removeSecondPassFuncs=[];u.initialised=false;u.parentScope=e;u.beans=a;u.bodyContainerComp=t;u.pinnedLeftContainerComp=i;u.pinnedRightContainerComp=n;u.fullWidthContainerComp=r;u.rowNode=o;u.rowIsEven=u.rowNode.rowIndex%2===0;u.paginationPage=u.beans.paginationProxy.getCurrentPage();u.useAnimationFrameForCreate=l;u.setAnimateFlags(s);return u}r.prototype.init=function(){var e=this;this.rowFocused=this.beans.focusedCellController.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);this.scope=this.createChildScopeOrNull(this.rowNode.data);this.setupRowContainers();this.addListeners();if(this.slideRowIn){this.createSecondPassFuncs.push(function(){e.onTopChanged()})}if(this.fadeRowIn){this.createSecondPassFuncs.push(function(){e.eAllRowContainers.forEach(function(e){return d._.removeCssClass(e,"ag-opacity-zero")})})}};r.prototype.createTemplate=function(e,t){if(t===void 0){t=null}var i=[];var n=this.rowNode.rowHeight;var r=this.getInitialRowClasses(t).join(" ");var o=d._.escape(this.rowNode.id);var a=this.preProcessStylesFromGridOptions();var s=this.getRowBusinessKey();var l=d._.escape(s);var u=this.getInitialRowTopStyle();i.push("<div");i.push(' role="row"');i.push(' row-index="'+this.rowNode.getRowIndexString()+'"');i.push(o?' row-id="'+o+'"':"");i.push(s?' row-business-key="'+l+'"':"");i.push(' comp-id="'+this.getCompId()+'"');i.push(' class="'+r+'"');i.push(' style="height: '+n+"px; "+u+" "+a+'">');i.push(e);i.push("</div>");return i.join("")};r.prototype.getCellForCol=function(e){var t=this.cellComps[e.getColId()];if(t){return t.getGui()}else{return null}};r.prototype.afterFlush=function(){if(!this.initialised){this.initialised=true;this.executeProcessRowPostCreateFunc()}};r.prototype.executeProcessRowPostCreateFunc=function(){var e=this.beans.gridOptionsWrapper.getProcessRowPostCreateFunc();if(e){var t={eRow:this.eBodyRow,ePinnedLeftRow:this.ePinnedLeftRow,ePinnedRightRow:this.ePinnedRightRow,node:this.rowNode,api:this.beans.gridOptionsWrapper.getApi(),rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()};e(t)}};r.prototype.getInitialRowTopStyle=function(){var e=this.slideRowIn?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop;var t=this.applyPaginationOffset(e);var i=this.beans.heightScaler.getRealPixelPosition(t);if(this.beans.gridOptionsWrapper.isSuppressRowTransform()){return"top: "+i+"px; "}else{return"transform: translateY("+i+"px); "}};r.prototype.getRowBusinessKey=function(){if(typeof this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc()==="function"){var e=this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc()(this.rowNode);return e}};r.prototype.lazyCreateCells=function(e,t){if(this.active){var i=this.createCells(e);t.innerHTML=i.template;this.callAfterRowAttachedOnCells(i.cellComps,t)}};r.prototype.createRowContainer=function(t,i,n){var r=this;var o;if(this.useAnimationFrameForCreate){o={cellComps:[],template:""}}else{o=this.createCells(i)}var e=this.createTemplate(o.template);t.appendRowTemplate(e,function(){var e=t.getRowElement(r.getCompId());r.afterRowAttached(t,e);n(e);if(r.useAnimationFrameForCreate){r.beans.taskQueue.addP1Task(r.lazyCreateCells.bind(r,i,e))}else{r.callAfterRowAttachedOnCells(o.cellComps,e)}})};r.prototype.createChildScopeOrNull=function(e){if(this.beans.gridOptionsWrapper.isAngularCompileRows()){var t=this.parentScope.$new();t.data=e;t.rowNode=this.rowNode;t.context=this.beans.gridOptionsWrapper.getContext();this.addDestroyFunc(function(){t.$destroy();t.data=null;t.rowNode=null;t.context=null});return t}else{return null}};r.prototype.setupRowContainers=function(){var e=this.beans.gridOptionsWrapper.getIsFullWidthCellFunc();var t=e?e(this.rowNode):false;var i=this.beans.doingMasterDetail&&this.rowNode.detail;var n=this.rowNode.group&&this.beans.gridOptionsWrapper.isGroupUseEntireRow();if(this.rowNode.stub){this.createFullWidthRows(r.LOADING_CELL_RENDERER,r.LOADING_CELL_RENDERER_COMP_NAME)}else if(i){this.createFullWidthRows(r.DETAIL_CELL_RENDERER,r.DETAIL_CELL_RENDERER_COMP_NAME)}else if(t){this.createFullWidthRows(r.FULL_WIDTH_CELL_RENDERER,null)}else if(n){this.createFullWidthRows(r.GROUP_ROW_RENDERER,r.GROUP_ROW_RENDERER_COMP_NAME)}else{this.setupNormalRowContainers()}};r.prototype.setupNormalRowContainers=function(){var t=this;var e=this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);this.createRowContainer(this.bodyContainerComp,e,function(e){return t.eBodyRow=e});var i=this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);var n=this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);this.createRowContainer(this.pinnedRightContainerComp,n,function(e){return t.ePinnedRightRow=e});this.createRowContainer(this.pinnedLeftContainerComp,i,function(e){return t.ePinnedLeftRow=e})};r.prototype.createFullWidthRows=function(e,t){var i=this;this.fullWidthRow=true;this.fullWidthRowEmbedded=this.beans.gridOptionsWrapper.isEmbedFullWidthRows();if(this.fullWidthRowEmbedded){this.createFullWidthRowContainer(this.bodyContainerComp,null,null,e,t,function(e){i.eFullWidthRowBody=e},function(e){i.fullWidthRowComponentBody=e});this.createFullWidthRowContainer(this.pinnedLeftContainerComp,u.Column.PINNED_LEFT,"ag-cell-last-left-pinned",e,t,function(e){i.eFullWidthRowLeft=e},function(e){i.fullWidthRowComponentLeft=e});this.createFullWidthRowContainer(this.pinnedRightContainerComp,u.Column.PINNED_RIGHT,"ag-cell-first-right-pinned",e,t,function(e){i.eFullWidthRowRight=e},function(e){i.fullWidthRowComponentRight=e})}else{this.createFullWidthRowContainer(this.fullWidthContainerComp,null,null,e,t,function(e){i.eFullWidthRow=e},function(e){i.fullWidthRowComponent=e})}};r.prototype.setAnimateFlags=function(e){if(e){var t=d._.exists(this.rowNode.oldRowTop);this.slideRowIn=t;this.fadeRowIn=!t}else{this.slideRowIn=false;this.fadeRowIn=false}};r.prototype.isEditing=function(){return this.editingRow};r.prototype.stopRowEditing=function(e){this.stopEditing(e)};r.prototype.isFullWidth=function(){return this.fullWidthRow};r.prototype.addListeners=function(){this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_ROW_SELECTED,this.onRowSelected.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_TOP_CHANGED,this.onTopChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_EXPANDED_CHANGED,this.onExpandedChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this));var e=this.beans.eventService;this.addDestroyableEventListener(e,f.Events.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this));this.addDestroyableEventListener(e,f.Events.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this))};r.prototype.onGridColumnsChanged=function(){var e=Object.keys(this.cellComps);this.removeRenderedCells(e)};r.prototype.onRowNodeDataChanged=function(t){this.forEachCellComp(function(e){return e.refreshCell({suppressFlash:!t.update,newData:!t.update})});this.onRowSelected();this.postProcessCss()};r.prototype.onRowNodeCellChanged=function(e){this.postProcessCss()};r.prototype.postProcessCss=function(){this.postProcessStylesFromGridOptions();this.postProcessClassesFromGridOptions();this.postProcessRowClassRules();this.postProcessRowDragging()};r.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()};r.prototype.postProcessRowDragging=function(){var t=this.rowNode.dragging;this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-dragging",t)})};r.prototype.onExpandedChanged=function(){if(this.rowNode.group&&!this.rowNode.footer){var t=this.rowNode.expanded;this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-group-expanded",t)});this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-group-contracted",!t)})}};r.prototype.onDisplayedColumnsChanged=function(){if(!this.fullWidthRow){this.refreshCells()}};r.prototype.destroyFullWidthComponents=function(){if(this.fullWidthRowComponent){if(this.fullWidthRowComponent.destroy){this.fullWidthRowComponent.destroy()}this.fullWidthRowComponent=null}if(this.fullWidthRowComponentBody){if(this.fullWidthRowComponentBody.destroy){this.fullWidthRowComponentBody.destroy()}this.fullWidthRowComponent=null}if(this.fullWidthRowComponentLeft){if(this.fullWidthRowComponentLeft.destroy){this.fullWidthRowComponentLeft.destroy()}this.fullWidthRowComponentLeft=null}if(this.fullWidthRowComponentRight){if(this.fullWidthRowComponentRight.destroy){this.fullWidthRowComponentRight.destroy()}this.fullWidthRowComponent=null}};r.prototype.getContainerForCell=function(e){switch(e){case u.Column.PINNED_LEFT:return this.ePinnedLeftRow;case u.Column.PINNED_RIGHT:return this.ePinnedRightRow;default:return this.eBodyRow}};r.prototype.onVirtualColumnsChanged=function(){if(!this.fullWidthRow){this.refreshCells()}};r.prototype.onColumnResized=function(){if(!this.fullWidthRow){this.refreshCells()}};r.prototype.refreshCells=function(){if(this.beans.gridOptionsWrapper.isSuppressAnimationFrame()){this.refreshCellsInAnimationFrame()}else{if(this.columnRefreshPending){return}this.beans.taskQueue.addP1Task(this.refreshCellsInAnimationFrame.bind(this))}};r.prototype.refreshCellsInAnimationFrame=function(){if(!this.active){return}this.columnRefreshPending=false;var e=this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);var t=this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);var i=this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);this.insertCellsIntoContainer(this.eBodyRow,e);this.insertCellsIntoContainer(this.ePinnedLeftRow,t);this.insertCellsIntoContainer(this.ePinnedRightRow,i);var n=Object.keys(this.cellComps);e.forEach(function(e){return d._.removeFromArray(n,e.getId())});t.forEach(function(e){return d._.removeFromArray(n,e.getId())});i.forEach(function(e){return d._.removeFromArray(n,e.getId())});n=d._.filter(n,this.isCellEligibleToBeRemoved.bind(this));this.removeRenderedCells(n)};r.prototype.removeRenderedCells=function(e){var i=this;e.forEach(function(e){var t=i.cellComps[e];if(d._.missing(t)){return}t.detach();t.destroy();i.cellComps[e]=null})};r.prototype.isCellEligibleToBeRemoved=function(e){var t=this.beans.columnController.getAllDisplayedColumns();var i=true;var n=false;var r=this.cellComps[e];if(!r){return i}if(this.isCellInWrongRow(r)){return i}var o=r.isEditing();var a=this.beans.focusedCellController.isCellFocused(r.getGridCell());var s=o||a;if(s){var l=r.getColumn();var u=t.indexOf(l)>=0;return u?n:i}else{return i}};r.prototype.ensureCellInCorrectContainer=function(e){var t=e.getGui();var i=e.getColumn();var n=i.getPinned();var r=this.getContainerForCell(n);var o=e.getParentRow();var a=o!==r;if(a){if(o){o.removeChild(t)}r.appendChild(t);e.setParentRow(r)}};r.prototype.isCellInWrongRow=function(e){var t=e.getColumn();var i=this.getContainerForCell(t.getPinned());var n=e.getParentRow();return n!==i};r.prototype.insertCellsIntoContainer=function(n,e){var r=this;if(!n){return}var o=[];var a=[];e.forEach(function(e){var t=e.getId();var i=r.cellComps[t];if(i){r.ensureCellInCorrectContainer(i)}else{r.createNewCell(e,n,o,a)}});if(o.length>0){d._.appendHtml(n,o.join(""));this.callAfterRowAttachedOnCells(a,n)}};r.prototype.addDomData=function(e){var t=this.beans.gridOptionsWrapper;t.setDomData(e,r.DOM_DATA_KEY_RENDERED_ROW,this);this.addDestroyFunc(function(){t.setDomData(e,r.DOM_DATA_KEY_RENDERED_ROW,null)})};r.prototype.createNewCell=function(e,t,i,n){var r=new a.CellComp(this.scope,this.beans,e,this.rowNode,this,false);var o=r.getCreateTemplate();i.push(o);n.push(r);this.cellComps[e.getId()]=r;r.setParentRow(t)};r.prototype.onMouseEvent=function(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break}};r.prototype.createRowEvent=function(e,t){return{type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),event:t}};r.prototype.createRowEventWithSource=function(e,t){var i=this.createRowEvent(e,t);i.source=this;return i};r.prototype.onRowDblClick=function(e){if(d._.isStopPropagationForAgGrid(e)){return}var t=this.createRowEventWithSource(f.Events.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)};r.prototype.onRowClick=function(e){var t=d._.isStopPropagationForAgGrid(e);if(t){return}var i=this.createRowEventWithSource(f.Events.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(i);var n=e.ctrlKey||e.metaKey;var r=e.shiftKey;if(this.rowNode.group){return}if(this.rowNode.rowPinned){return}if(!this.beans.gridOptionsWrapper.isRowSelection()){return}if(this.beans.gridOptionsWrapper.isSuppressRowClickSelection()){return}var o=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick();var a=this.beans.gridOptionsWrapper.isRowDeselection();if(this.rowNode.isSelected()){if(o){this.rowNode.setSelectedParams({newValue:false})}else if(n){if(a){this.rowNode.setSelectedParams({newValue:false})}}else{this.rowNode.setSelectedParams({newValue:true,clearSelection:true})}}else{var s=o?false:!n;this.rowNode.setSelectedParams({newValue:true,clearSelection:s,rangeSelect:r})}};r.prototype.createFullWidthRowContainer=function(n,r,e,o,a,s,l){var u=this;var t=this.createTemplate("",e);n.appendRowTemplate(t,function(){var i=n.getRowElement(u.getCompId());var e=u.createFullWidthParams(i,r);var t=function(e){if(u.isAlive()){var t=e.getGui();i.appendChild(t);l(e)}else{if(e.destroy){e.destroy()}}};u.beans.componentResolver.createAgGridComponent(null,e,o,e,a).then(t);u.afterRowAttached(n,i);s(i);u.angular1Compile(i)})};r.prototype.angular1Compile=function(e){if(this.scope){this.beans.$compile(e)(this.scope)}};r.prototype.createFullWidthParams=function(e,t){var i={fullWidth:true,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,$scope:this.scope,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this)};return i};r.prototype.getInitialRowClasses=function(e){var t=[];if(d._.exists(e)){t.push(e)}t.push("ag-row");t.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus");if(this.fadeRowIn){t.push("ag-opacity-zero")}if(this.rowIsEven){t.push("ag-row-even")}else{t.push("ag-row-odd")}if(this.rowNode.isSelected()){t.push("ag-row-selected")}if(this.rowNode.group){t.push("ag-row-group");t.push("ag-row-level-"+this.rowNode.level);if(this.rowNode.footer){t.push("ag-row-footer")}}else{if(this.rowNode.parent){t.push("ag-row-level-"+(this.rowNode.parent.level+1))}else{t.push("ag-row-level-0")}}if(this.rowNode.stub){t.push("ag-row-stub")}if(this.fullWidthRow){t.push("ag-full-width-row")}if(this.rowNode.group&&!this.rowNode.footer){t.push(this.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}if(this.rowNode.dragging){t.push("ag-row-dragging")}d._.pushAll(t,this.processClassesFromGridOptions());d._.pushAll(t,this.preProcessRowClassRules());return t};r.prototype.preProcessRowClassRules=function(){var t=[];this.processRowClassRules(function(e){t.push(e)},function(e){});return t};r.prototype.processRowClassRules=function(e,t){this.beans.stylingService.processClassRules(this.beans.gridOptionsWrapper.rowClassRules(),{value:undefined,colDef:undefined,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),$scope:this.scope,context:this.beans.gridOptionsWrapper.getContext()},e,t)};r.prototype.stopEditing=function(t){if(t===void 0){t=false}this.forEachCellComp(function(e){e.stopEditing(t)});if(this.editingRow){if(!t){var e=this.createRowEvent(f.Events.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}this.setEditingRow(false)}};r.prototype.setEditingRow=function(t){this.editingRow=t;this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-editing",t)});var e=t?this.createRowEvent(f.Events.EVENT_ROW_EDITING_STARTED):this.createRowEvent(f.Events.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(e)};r.prototype.startRowEditing=function(i,n,r){if(i===void 0){i=null}if(n===void 0){n=null}if(r===void 0){r=null}if(this.editingRow){return}this.forEachCellComp(function(e){var t=e===r;if(t){e.startEditingIfEnabled(i,n,t)}else{e.startEditingIfEnabled(null,null,t)}});this.setEditingRow(true)};r.prototype.forEachCellComp=function(i){d._.iterateObject(this.cellComps,function(e,t){if(t){i(t)}})};r.prototype.postProcessClassesFromGridOptions=function(){var e=this;var t=this.processClassesFromGridOptions();if(t){t.forEach(function(t){e.eAllRowContainers.forEach(function(e){return d._.addCssClass(e,t)})})}};r.prototype.postProcessRowClassRules=function(){var e=this;this.processRowClassRules(function(t){e.eAllRowContainers.forEach(function(e){return d._.addCssClass(e,t)})},function(t){e.eAllRowContainers.forEach(function(e){return d._.removeCssClass(e,t)})})};r.prototype.processClassesFromGridOptions=function(){var t=[];var e=function(e){if(typeof e==="string"){t.push(e)}else if(Array.isArray(e)){e.forEach(function(e){return t.push(e)})}};var i=this.beans.gridOptionsWrapper.getRowClass();if(i){if(typeof i==="function"){console.warn("ag-Grid: rowClass should not be a function, please use getRowClass instead");return}e(i)}var n=this.beans.gridOptionsWrapper.getRowClassFunc();if(n){var r={node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi()};var o=n(r);e(o)}return t};r.prototype.preProcessStylesFromGridOptions=function(){var e=this.processStylesFromGridOptions();return d._.cssStyleObjectToMarkup(e)};r.prototype.postProcessStylesFromGridOptions=function(){var t=this.processStylesFromGridOptions();this.eAllRowContainers.forEach(function(e){return d._.addStylesToElement(e,t)})};r.prototype.processStylesFromGridOptions=function(){var e=this.beans.gridOptionsWrapper.getRowStyle();if(e&&typeof e==="function"){console.log("ag-Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}var t=this.beans.gridOptionsWrapper.getRowStyleFunc();var i;if(t){var n={data:this.rowNode.data,node:this.rowNode,api:this.beans.gridOptionsWrapper.getApi(),context:this.beans.gridOptionsWrapper.getContext(),$scope:this.scope};i=t(n)}return d._.assign({},e,i)};r.prototype.createCells=function(e){var n=this;var r=[];var o=[];e.forEach(function(e){var t=new a.CellComp(n.scope,n.beans,e,n.rowNode,n,false);var i=t.getCreateTemplate();r.push(i);o.push(t);n.cellComps[e.getId()]=t});var t={template:r.join(""),cellComps:o};return t};r.prototype.onRowSelected=function(){var t=this.rowNode.isSelected();this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-selected",t)})};r.prototype.callAfterRowAttachedOnCells=function(e,t){var i=this;e.forEach(function(e){e.setParentRow(t);e.afterAttached();if(i.editingRow){e.startEditingIfEnabled()}})};r.prototype.afterRowAttached=function(e,t){var i=this;this.addDomData(t);this.removeSecondPassFuncs.push(function(){e.removeRowElement(t)});this.removeFirstPassFuncs.push(function(){if(d._.exists(i.rowNode.rowTop)){var e=i.roundRowTopToBounds(i.rowNode.rowTop);i.setRowTop(e)}else{d._.addCssClass(t,"ag-opacity-zero")}});this.eAllRowContainers.push(t);if(this.useAnimationFrameForCreate){this.beans.taskQueue.addP1Task(this.addHoverFunctionality.bind(this,t))}else{this.addHoverFunctionality(t)}};r.prototype.addHoverFunctionality=function(e){var t=this;if(!this.active){return}this.addDestroyableEventListener(e,"mouseenter",function(){return t.rowNode.onMouseEnter()});this.addDestroyableEventListener(e,"mouseleave",function(){return t.rowNode.onMouseLeave()});this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_MOUSE_ENTER,function(){if(!t.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()){d._.addCssClass(e,"ag-row-hover")}});this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_MOUSE_LEAVE,function(){d._.removeCssClass(e,"ag-row-hover")})};r.prototype.roundRowTopToBounds=function(e){var t=this.beans.gridPanel.getVScrollPosition();var i=this.applyPaginationOffset(t.top,true)-100;var n=this.applyPaginationOffset(t.bottom,true)+100;if(e<i){return i}else if(e>n){return n}else{return e}};r.prototype.onRowHeightChanged=function(){if(d._.exists(this.rowNode.rowHeight)){var t=this.rowNode.rowHeight+"px";this.eAllRowContainers.forEach(function(e){return e.style.height=t})}};r.prototype.addEventListener=function(e,t){if(e==="renderedRowRemoved"||e==="rowRemoved"){e=f.Events.EVENT_VIRTUAL_ROW_REMOVED;console.warn("ag-Grid: Since version 11, event renderedRowRemoved is now called "+f.Events.EVENT_VIRTUAL_ROW_REMOVED)}c.prototype.addEventListener.call(this,e,t)};r.prototype.removeEventListener=function(e,t){if(e==="renderedRowRemoved"||e==="rowRemoved"){e=f.Events.EVENT_VIRTUAL_ROW_REMOVED;console.warn("ag-Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+f.Events.EVENT_VIRTUAL_ROW_REMOVED)}c.prototype.removeEventListener.call(this,e,t)};r.prototype.destroy=function(e){if(e===void 0){e=false}c.prototype.destroy.call(this);this.active=false;this.destroyFullWidthComponents();if(e){this.removeFirstPassFuncs.forEach(function(e){return e()});this.removeSecondPassFuncs.push(this.destroyContainingCells.bind(this))}else{this.destroyContainingCells();var t=this.getAndClearDelayedDestroyFunctions();t.forEach(function(e){return e()})}var i=this.createRowEvent(f.Events.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(i);this.beans.eventService.dispatchEvent(i)};r.prototype.destroyContainingCells=function(){this.forEachCellComp(function(e){return e.destroy()});this.destroyFullWidthComponents()};r.prototype.getAndClearDelayedDestroyFunctions=function(){var e=this.removeSecondPassFuncs;this.removeSecondPassFuncs=[];return e};r.prototype.onCellFocusChanged=function(){var t=this.beans.focusedCellController.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);if(t!==this.rowFocused){this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-focus",t)});this.eAllRowContainers.forEach(function(e){return d._.addOrRemoveCssClass(e,"ag-row-no-focus",!t)});this.rowFocused=t}if(!t&&this.editingRow){this.stopEditing(false)}};r.prototype.onPaginationChanged=function(){var e=this.beans.paginationProxy.getCurrentPage();if(this.paginationPage!==e){this.paginationPage=e;this.onTopChanged()}};r.prototype.onTopChanged=function(){this.setRowTop(this.rowNode.rowTop)};r.prototype.applyPaginationOffset=function(e,t){if(t===void 0){t=false}if(this.rowNode.isRowPinned()){return e}else{var i=this.beans.paginationProxy.getPixelOffset();if(t){return e+i}else{return e-i}}};r.prototype.setRowTop=function(e){if(d._.exists(e)){var t=this.applyPaginationOffset(e);var i=this.beans.heightScaler.getRealPixelPosition(t);var n=i+"px";if(this.beans.gridOptionsWrapper.isSuppressRowTransform()){this.eAllRowContainers.forEach(function(e){return e.style.top=""+n})}else{this.eAllRowContainers.forEach(function(e){return e.style.transform="translateY("+n+")"})}}};r.prototype.getAndClearNextVMTurnFunctions=function(){var e=this.createSecondPassFuncs;this.createSecondPassFuncs=[];return e};r.prototype.getRowNode=function(){return this.rowNode};r.prototype.getRenderedCellForColumn=function(e){return this.cellComps[e.getColId()]};r.prototype.onRowIndexChanged=function(){this.onCellFocusChanged();this.updateRowIndexes()};r.prototype.updateRowIndexes=function(){var t=this.rowNode.getRowIndexString();var i=this.rowNode.rowIndex%2===0;var n=this.rowIsEven!==i;if(n){this.rowIsEven=i}this.eAllRowContainers.forEach(function(e){e.setAttribute("row-index",t);if(n){d._.addOrRemoveCssClass(e,"ag-row-even",i);d._.addOrRemoveCssClass(e,"ag-row-odd",!i)}})};r.prototype.ensureDomOrder=function(){var e=this.getBodyRowElement();if(e){this.bodyContainerComp.ensureDomOrder(e)}var t=this.getPinnedLeftRowElement();if(t){this.pinnedLeftContainerComp.ensureDomOrder(t)}var i=this.getPinnedRightRowElement();if(i){this.pinnedRightContainerComp.ensureDomOrder(i)}var n=this.getFullWidthRowElement();if(n){this.fullWidthContainerComp.ensureDomOrder(n)}};r.prototype.getPinnedLeftRowElement=function(){return this.ePinnedLeftRow?this.ePinnedLeftRow:this.eFullWidthRowLeft};r.prototype.getPinnedRightRowElement=function(){return this.ePinnedRightRow?this.ePinnedRightRow:this.eFullWidthRowRight};r.prototype.getBodyRowElement=function(){return this.eBodyRow?this.eBodyRow:this.eFullWidthRowBody};r.prototype.getFullWidthRowElement=function(){return this.eFullWidthRow};r.DOM_DATA_KEY_RENDERED_ROW="renderedRow";r.FULL_WIDTH_CELL_RENDERER="fullWidthCellRenderer";r.GROUP_ROW_RENDERER="groupRowRenderer";r.GROUP_ROW_RENDERER_COMP_NAME="agGroupRowRenderer";r.LOADING_CELL_RENDERER="loadingCellRenderer";r.LOADING_CELL_RENDERER_COMP_NAME="agLoadingCellRenderer";r.DETAIL_CELL_RENDERER="detailCellRenderer";r.DETAIL_CELL_RENDERER_COMP_NAME="agDetailCellRenderer";return r}(p.Component);t.RowComp=v},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(11);var l=i(0);var u=i(2);var c=i(1);var d;(function(e){e[e["MAIN"]=0]="MAIN";e[e["CONDITION"]=1]="CONDITION"})(d=t.FilterConditionType||(t.FilterConditionType={}));var f={loadingOoo:"Loading...",equals:"Equals",notEqual:"Not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"In range",lessThanOrEqual:"Less than or equals",greaterThanOrEqual:"Greater than or equals",filterOoo:"Filter...",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",searchOoo:"Search...",selectAll:"Select All",applyFilter:"Apply Filter",clearFilter:"Clear Filter"};var p=function(e){n(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.prototype.init=function(e){this.filterParams=e;this.defaultFilter=this.filterParams.defaultOption;if(this.filterParams.filterOptions&&!this.defaultFilter){if(this.filterParams.filterOptions.lastIndexOf(i.EQUALS)<0){this.defaultFilter=this.filterParams.filterOptions[0]}}this.customInit();this.filter=this.defaultFilter;this.filterCondition=this.defaultFilter;this.clearActive=e.clearButton===true;this.applyActive=e.applyButton===true||e.apply===true;this.newRowsActionKeep=e.newRowsAction==="keep";this.setTemplate(this.generateTemplate());c._.setVisible(this.eApplyButton,this.applyActive);if(this.applyActive){this.addDestroyableEventListener(this.eApplyButton,"click",this.filterParams.filterChangedCallback)}c._.setVisible(this.eClearButton,this.clearActive);if(this.clearActive){this.addDestroyableEventListener(this.eClearButton,"click",this.onClearButton.bind(this))}var t=this.applyActive||this.clearActive;c._.setVisible(this.eButtonsPanel,t);this.instantiate(this.context);this.initialiseFilterBodyUi(d.MAIN);this.refreshFilterBodyUi(d.MAIN)};i.prototype.onClearButton=function(){this.setModel(null);this.onFilterChanged()};i.prototype.floatingFilter=function(e){if(e!==""){var t=this.modelFromFloatingFilter(e);this.setModel(t)}else{this.resetState()}this.onFilterChanged()};i.prototype.onNewRowsLoaded=function(){if(!this.newRowsActionKeep){this.resetState()}};i.prototype.getModel=function(){if(this.isFilterActive()){if(!this.isFilterConditionActive(d.CONDITION)){return this.serialize(d.MAIN)}else{return{condition1:this.serialize(d.MAIN),condition2:this.serialize(d.CONDITION),operator:this.conditionValue}}}else{return null}};i.prototype.getNullableModel=function(){if(!this.isFilterConditionActive(d.CONDITION)){return this.serialize(d.MAIN)}else{return{condition1:this.serialize(d.MAIN),condition2:this.serialize(d.CONDITION),operator:this.conditionValue}}};i.prototype.setModel=function(e){if(e){if(!e.operator){this.resetState();this.parse(e,d.MAIN)}else{var t=e;this.parse(t.condition1,d.MAIN);this.parse(t.condition2,d.CONDITION);this.conditionValue=t.operator}}else{this.resetState()}this.redrawCondition();this.refreshFilterBodyUi(d.MAIN);this.refreshFilterBodyUi(d.CONDITION)};i.prototype.doOnFilterChanged=function(e){if(e===void 0){e=false}this.filterParams.filterModifiedCallback();var t=this.applyActive&&e;var i=!this.applyActive;var n=i||t;if(n){this.filterParams.filterChangedCallback()}this.refreshFilterBodyUi(d.MAIN);this.refreshFilterBodyUi(d.CONDITION);return n};i.prototype.onFilterChanged=function(e){if(e===void 0){e=false}this.doOnFilterChanged(e);this.redrawCondition();this.refreshFilterBodyUi(d.MAIN);this.refreshFilterBodyUi(d.CONDITION)};i.prototype.redrawCondition=function(){var e=this;var t=this.eFilterBodyWrapper.querySelector(".ag-filter-condition");if(!t&&this.isFilterActive()&&this.acceptsBooleanLogic()){this.eConditionWrapper=c._.loadTemplate(this.createConditionTemplate(d.CONDITION));this.eFilterBodyWrapper.appendChild(this.eConditionWrapper);this.wireQuerySelectors();var i=this.refreshOperatorUi(),n=i.andButton,r=i.orButton;this.addDestroyableEventListener(n,"change",function(){e.conditionValue="AND";e.onFilterChanged()});this.addDestroyableEventListener(r,"change",function(){e.conditionValue="OR";e.onFilterChanged()});this.initialiseFilterBodyUi(d.CONDITION)}else if(t&&!this.isFilterActive()){this.eFilterBodyWrapper.removeChild(this.eConditionWrapper);this.eConditionWrapper=null}else{this.refreshFilterBodyUi(d.CONDITION);if(this.eConditionWrapper){this.refreshOperatorUi()}}};i.prototype.refreshOperatorUi=function(){var e=this.eConditionWrapper.querySelector(".and");var t=this.eConditionWrapper.querySelector(".or");this.conditionValue=this.conditionValue==null?"AND":this.conditionValue;e.checked=this.conditionValue==="AND";t.checked=this.conditionValue==="OR";return{andButton:e,orButton:t}};i.prototype.onFloatingFilterChanged=function(e){var t=e;if(t==null){this.setModel(null)}else if(!this.isFilterConditionActive(d.CONDITION)){this.setModel(t?t.model:null)}else{var i={condition1:t.model,condition2:this.serialize(d.CONDITION),operator:this.conditionValue};this.setModel(i)}return this.doOnFilterChanged(t?t.apply:false)};i.prototype.generateFilterHeader=function(e){return""};i.prototype.generateTemplate=function(){var e=this.translate.bind(this);var t=this.createConditionBody(d.MAIN);var i=!this.acceptsBooleanLogic()?t:this.wrapCondition(t);return"<div>\n                    <div class='ag-filter-body-wrapper'>"+i+'</div>\n                    <div class="ag-filter-apply-panel" id="applyPanel">\n                        <button type="button" id="clearButton">'+e("clearFilter")+'</button>\n                        <button type="button" id="applyButton">'+e("applyFilter")+"</button>\n                    </div>\n                </div>"};i.prototype.acceptsBooleanLogic=function(){return false};i.prototype.wrapCondition=function(e){if(!this.isFilterActive())return e;return""+e+this.createConditionTemplate(d.CONDITION)};i.prototype.createConditionTemplate=function(e){return'<div class="ag-filter-condition">\n            <input id="andId" type="radio" class="and" name="booleanLogic" value="AND" checked="checked" /><label style="display: inline" for="andId">AND</label>\n            <input id="orId" type="radio" class="or" name="booleanLogic" value="OR" /><label style="display: inline" for="orId">OR</label>\n            <div>'+this.createConditionBody(e)+"</div>\n        </div>"};i.prototype.createConditionBody=function(e){var t=this.bodyTemplate(e);return this.generateFilterHeader(e)+t};i.prototype.translate=function(e){var t=this.gridOptionsWrapper.getLocaleTextFunc();return t(e,f[e])};i.prototype.getDebounceMs=function(e){if(e.applyButton&&e.debounceMs){console.warn("ag-Grid: debounceMs is ignored when applyButton = true");return 0}return e.debounceMs!=null?e.debounceMs:500};i.EQUALS="equals";i.NOT_EQUAL="notEqual";i.LESS_THAN="lessThan";i.LESS_THAN_OR_EQUAL="lessThanOrEqual";i.GREATER_THAN="greaterThan";i.GREATER_THAN_OR_EQUAL="greaterThanOrEqual";i.IN_RANGE="inRange";i.CONTAINS="contains";i.NOT_CONTAINS="notContains";i.STARTS_WITH="startsWith";i.ENDS_WITH="endsWith";r([s.QuerySelector("#applyPanel"),o("design:type",HTMLElement)],i.prototype,"eButtonsPanel",void 0);r([s.QuerySelector(".ag-filter-body-wrapper"),o("design:type",HTMLElement)],i.prototype,"eFilterBodyWrapper",void 0);r([s.QuerySelector("#applyButton"),o("design:type",HTMLElement)],i.prototype,"eApplyButton",void 0);r([s.QuerySelector("#clearButton"),o("design:type",HTMLElement)],i.prototype,"eClearButton",void 0);r([l.Autowired("context"),o("design:type",l.Context)],i.prototype,"context",void 0);r([l.Autowired("gridOptionsWrapper"),o("design:type",u.GridOptionsWrapper)],i.prototype,"gridOptionsWrapper",void 0);return i}(a.Component);t.BaseFilter=p;var h=function(t){n(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.doesFilterPass=function(e){var t=this.individualFilterPasses(e,d.MAIN);if(this.eTypeConditionSelector==null){return t}var i=this.individualFilterPasses(e,d.CONDITION);return this.conditionValue==="AND"?t&&i:t||i};e.prototype.init=function(e){t.prototype.init.call(this,e);this.suppressAndOrCondition=e.suppressAndOrCondition};e.prototype.customInit=function(){if(!this.defaultFilter){this.defaultFilter=this.getDefaultType()}};e.prototype.acceptsBooleanLogic=function(){return this.suppressAndOrCondition!==true};e.prototype.generateFilterHeader=function(e){var i=this;var t=this.getApplicableFilterTypes();var n=this.filterParams.filterOptions;var r=n?n:t;var o=r.map(function(e){var t=i.translate(e);return'<option value="'+e+'">'+t+"</option>"});var a=o.length==1?"disabled":"";var s=e==d.MAIN?"filterType":"filterConditionType";return o.length<=0?"":'<div>\n                <select class="ag-filter-select" id="'+s+'" '+a+">\n                    "+o.join("")+"\n                </select>\n            </div>"};e.prototype.initialiseFilterBodyUi=function(e){var t=this;if(e===d.MAIN){this.setFilterType(this.filter,e);this.addDestroyableEventListener(this.eTypeSelector,"change",function(){return t.onFilterTypeChanged(e)})}else{this.setFilterType(this.filterCondition,e);this.addDestroyableEventListener(this.eTypeConditionSelector,"change",function(){return t.onFilterTypeChanged(e)})}};e.prototype.onFilterTypeChanged=function(e){if(e===d.MAIN){this.filter=this.eTypeSelector.value}else{this.filterCondition=this.eTypeConditionSelector.value}this.refreshFilterBodyUi(e);if(this.isFilterActive()){this.onFilterChanged()}};e.prototype.isFilterActive=function(){var e=this.filterValues(d.MAIN);if(this.filter===p.IN_RANGE){var t=e;return t[0]!=null&&t[1]!=null}else{return e!=null}};e.prototype.setFilterType=function(e,t){if(t===d.MAIN){this.filter=e;if(!this.eTypeSelector)return;this.eTypeSelector.value=e}else{this.filterCondition=e;if(!this.eTypeConditionSelector)return;this.eTypeConditionSelector.value=e}};e.prototype.isFilterConditionActive=function(e){return this.filterValues(e)!=null};r([s.QuerySelector("#filterType"),o("design:type",HTMLSelectElement)],e.prototype,"eTypeSelector",void 0);r([s.QuerySelector("#filterConditionType"),o("design:type",HTMLSelectElement)],e.prototype,"eTypeConditionSelector",void 0);return e}(p);t.ComparableBaseFilter=h;var g=function(e){n(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.prototype.nullComparator=function(r){var o=this;return function(e,t){if(t==null){var i=o.translateNull(r);if(o.filter===p.EQUALS){return i?0:1}if(o.filter===p.GREATER_THAN){return i?1:-1}if(o.filter===p.GREATER_THAN_OR_EQUAL){return i?1:-1}if(o.filter===p.LESS_THAN_OR_EQUAL){return i?-1:1}if(o.filter===p.LESS_THAN){return i?-1:1}if(o.filter===p.NOT_EQUAL){return i?1:0}}var n=o.comparator();return n(e,t)}};i.prototype.getDefaultType=function(){return p.EQUALS};i.prototype.translateNull=function(e){var t=e.indexOf("greater")>-1?"greaterThan":e.indexOf("lessThan")>-1?"lessThan":"equals";if(this.filterParams.nullComparator&&this.filterParams.nullComparator[t]){return this.filterParams.nullComparator[t]}return i.DEFAULT_NULL_COMPARATOR[t]};i.prototype.individualFilterPasses=function(e,t){return this.doIndividualFilterPasses(e,t,t===d.MAIN?this.filter:this.filterCondition)};i.prototype.doIndividualFilterPasses=function(e,t,i){var n=this.filterParams.valueGetter(e.node);var r=this.nullComparator(i);var o=this.filterValues(t);var a=Array.isArray(o)?o[0]:o;if(a==null){return t===d.MAIN?true:this.conditionValue==="AND"}var s=r(a,n);if(i===p.EQUALS){return s===0}if(i===p.GREATER_THAN){return s>0}if(i===p.GREATER_THAN_OR_EQUAL){return s>=0}if(i===p.LESS_THAN_OR_EQUAL){return s<=0}if(i===p.LESS_THAN){return s<0}if(i===p.NOT_EQUAL){return s!=0}var l=r(o[1],n);if(i===p.IN_RANGE){if(!this.filterParams.inRangeInclusive){return s>0&&l<0}else{return s>=0&&l<=0}}throw new Error("Unexpected type of filter!: "+i)};i.DEFAULT_NULL_COMPARATOR={equals:false,lessThan:false,greaterThan:false};return i}(h);t.ScalarBaseFilter=g},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(1);var a=i(10);var o=i(13);var s=function(o){n(e,o);function e(e,t,i,n){var r=o.call(this)||this;r.columnOrGroup=e;r.eCell=t;r.colsSpanning=n;r.beans=i;return r}e.prototype.setColsSpanning=function(e){this.colsSpanning=e;this.onLeftChanged()};e.prototype.getColumnOrGroup=function(){if(this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning){return this.colsSpanning[this.colsSpanning.length-1]}else{return this.columnOrGroup}};e.prototype.init=function(){this.addDestroyableEventListener(this.columnOrGroup,a.Column.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this));this.setLeftFirstTime()};e.prototype.setLeftFirstTime=function(){var e=this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation();var t=r.Utils.exists(this.columnOrGroup.getOldLeft());var i=this.beans.columnAnimationService.isActive()&&t&&!e;if(i){this.animateInLeft()}else{this.onLeftChanged()}};e.prototype.animateInLeft=function(){var e=this;var t=this.getColumnOrGroup().getLeft();var i=this.getColumnOrGroup().getOldLeft();this.setLeft(i);this.actualLeft=t;this.beans.columnAnimationService.executeNextVMTurn(function(){if(e.actualLeft===t){e.setLeft(t)}})};e.prototype.onLeftChanged=function(){this.actualLeft=this.getColumnOrGroup().getLeft();this.setLeft(this.actualLeft)};e.prototype.setLeft=function(e){if(r.Utils.exists(e)){this.eCell.style.left=e+"px"}};return e}(o.BeanStub);t.SetLeftFeature=s},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var s=function(){function e(){this.executeNextFuncs=[];this.executeLaterFuncs=[];this.active=false;this.animationThreadCount=0}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.isActive=function(){return this.active};e.prototype.start=function(){if(this.active){return}if(this.gridOptionsWrapper.isSuppressColumnMoveAnimation()){return}if(this.gridOptionsWrapper.isEnableRtl()){return}this.ensureAnimationCssClassPresent();this.active=true};e.prototype.finish=function(){if(!this.active){return}this.flush();this.active=false};e.prototype.executeNextVMTurn=function(e){if(this.active){this.executeNextFuncs.push(e)}else{e()}};e.prototype.executeLaterVMTurn=function(e){if(this.active){this.executeLaterFuncs.push(e)}else{e()}};e.prototype.ensureAnimationCssClassPresent=function(){var e=this;this.animationThreadCount++;var t=this.animationThreadCount;this.gridPanel.setColumnMovingCss(true);this.executeLaterFuncs.push(function(){if(e.animationThreadCount===t){e.gridPanel.setColumnMovingCss(false)}})};e.prototype.flush=function(){var e=this.executeNextFuncs;this.executeNextFuncs=[];var t=this.executeLaterFuncs;this.executeLaterFuncs=[];if(e.length===0&&t.length===0){return}setTimeout(function(){return e.forEach(function(e){return e()})},0);setTimeout(function(){return t.forEach(function(e){return e()})},300)};n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("columnAnimationService")],e);return e}();t.ColumnAnimationService=s},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(69);var s=i(2);var l=i(27);var u=function(){function e(){}e.prototype.init=function(){};e.prototype.addCellEditor=function(e,t){console.warn("ag-grid: since v13.3.1 this method is not supported anymore. If you want to register your own editor check the docs: https://www.ag-grid.com/javascript-grid-cell-editor/")};e.prototype.createCellEditor=function(e,n){var r=this;var t=this.componentResolver.createAgGridComponent(e,n,"cellEditor",{api:n.api,columnApi:n.columnApi,node:n.node,data:n.node.data,rowIndex:n.rowIndex,column:n.column,colDef:n.column.getColDef()},"agCellEditor");return t.map(function(e){var t=e.isPopup&&e.isPopup();if(!t){return e}if(r.gridOptionsWrapper.isFullRowEdit()){console.warn("ag-Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both "+"- either turn off fullRowEdit, or stop using popup editors.")}var i=new a.PopupEditorWrapper(e);r.context.wireBean(i);i.init(n);return i})};n([o.Autowired("context"),r("design:type",o.Context)],e.prototype,"context",void 0);n([o.Autowired("componentResolver"),r("design:type",l.ComponentResolver)],e.prototype,"componentResolver",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("cellEditorFactory")],e);return e}();t.CellEditorFactory=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(1);var s=i(2);var l=i(3);var u=i(19);var c=i(70);var d=i(71);var f=i(72);var p=function(){function e(){this.cellRendererMap={}}t=e;e.prototype.init=function(){this.cellRendererMap[t.ANIMATE_SLIDE]=c.AnimateSlideCellRenderer;this.cellRendererMap[t.ANIMATE_SHOW_CHANGE]=d.AnimateShowChangeCellRenderer;this.cellRendererMap[t.GROUP]=f.GroupCellRenderer};e.prototype.addCellRenderer=function(e,t){this.cellRendererMap[e]=t};e.prototype.getCellRenderer=function(e){var t=this.cellRendererMap[e];if(a.Utils.missing(t)){console.warn("ag-Grid: unable to find cellRenderer for key "+e);return null}return t};e.ANIMATE_SLIDE="animateSlide";e.ANIMATE_SHOW_CHANGE="animateShowChange";e.GROUP="group";n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("expressionService"),r("design:type",u.ExpressionService)],e.prototype,"expressionService",void 0);n([o.Autowired("eventService"),r("design:type",l.EventService)],e.prototype,"eventService",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=t=n([o.Bean("cellRendererFactory")],e);return e;var t}();t.CellRendererFactory=p},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(21);var l=i(27);var u=i(1);var s=i(2);var c=function(){function e(){}e.prototype.useCellRenderer=function(e,t,i){var n=this;var r=this.componentRecipes.newCellRenderer(e,i);if(r!=null){r.then(function(e){if(e==null){t.innerText=i.valueFormatted!=null?i.valueFormatted:i.value}else{n.bindToHtml(r,t)}})}else{t.innerText=i.valueFormatted!=null?i.valueFormatted:i.value}return r};e.prototype.useFilterCellRenderer=function(e,t,i){var n=this.componentRecipes.newCellRenderer(e.filterParams,i);if(n!=null){this.bindToHtml(n,t)}else{if(i.valueFormatted==null&&i.value==null){var r=this.gridOptionsWrapper.getLocaleTextFunc();t.innerText="("+r("blanks","Blanks")+")"}else{t.innerText=i.valueFormatted!=null?i.valueFormatted:i.value}}return n};e.prototype.useRichSelectCellRenderer=function(e,t,i){var n=this.componentRecipes.newCellRenderer(e.cellEditorParams,i);if(n!=null){this.bindToHtml(n,t)}else{t.innerText=i.valueFormatted!=null?i.valueFormatted:i.value}return n};e.prototype.useInnerCellRenderer=function(e,t,i,n){var r=this;var o=null;var a=this.componentResolver.getComponentToUse(e,"innerRenderer",null);if(a&&a.component!=null&&a.source!=l.ComponentSource.DEFAULT){o=this.componentRecipes.newInnerCellRenderer(e,n)}else{var s=this.componentResolver.getComponentToUse(t,"cellRenderer",null);if(s&&s.source!=l.ComponentSource.DEFAULT){o=this.componentRecipes.newCellRenderer(t,n)}else if(s&&s.source==l.ComponentSource.DEFAULT&&u._.get(t,"cellRendererParams.innerRenderer",null)){o=this.componentRecipes.newInnerCellRenderer(t.cellRendererParams,n)}else{o=this.componentRecipes.newCellRenderer({},n)}}if(o!=null){o.then(function(e){if(e==null){i.innerText=n.valueFormatted!=null?n.valueFormatted:n.value;return}r.bindToHtml(o,i)})}else{i.innerText=n.valueFormatted!=null?n.valueFormatted:n.value}return o};e.prototype.useFullWidthGroupRowInnerCellRenderer=function(e,t){var i=this.componentRecipes.newFullWidthGroupRowInnerCellRenderer(t);if(i!=null){this.bindToHtml(i,e)}else{e.innerText=t.valueFormatted!=null?t.valueFormatted:t.value}return i};e.prototype.bindToHtml=function(e,i){e.then(function(e){var t=e.getGui();if(t!=null){if(typeof t=="object"){i.appendChild(t)}else{i.innerHTML=t}}});return e};n([o.Autowired("componentRecipes"),r("design:type",a.ComponentRecipes)],e.prototype,"componentRecipes",void 0);n([o.Autowired("componentResolver"),r("design:type",l.ComponentResolver)],e.prototype,"componentResolver",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("cellRendererService")],e);return e}();t.CellRendererService=c},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(13);var s=i(0);var l=i(3);var u=i(25);var c=i(1);var d=function(t){n(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.scrollY=0;e.uiBodyHeight=0;return e}e.prototype.postConstruct=function(){this.addDestroyableEventListener(this.eventService,u.Events.EVENT_BODY_HEIGHT_CHANGED,this.update.bind(this));this.scrollBarWidth=c._.getScrollbarWidth();this.maxDivHeight=c._.getMaxDivHeight()};e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.isScaling=function(){return this.scaling};e.prototype.getOffset=function(){return this.offset};e.prototype.update=function(){if(!this.scaling){return}var e=this.gridPanel.getVScrollPosition().top;var t=this.getUiBodyHeight();var i=e!==this.scrollY||t!==this.uiBodyHeight;if(i){this.scrollY=e;this.uiBodyHeight=t;this.calculateOffset()}};e.prototype.calculateOffset=function(){this.uiContainerHeight=this.maxDivHeight;this.pixelsToShave=this.modelHeight-this.uiContainerHeight;this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;var e=this.scrollY/this.maxScrollY;this.setOffset(e*this.pixelsToShave)};e.prototype.clearOffset=function(){this.uiContainerHeight=this.modelHeight;this.pixelsToShave=0;this.setOffset(0)};e.prototype.setOffset=function(e){var t=typeof e==="number"?Math.floor(e):null;if(this.offset!==t){this.offset=t;this.eventService.dispatchEvent({type:u.Events.EVENT_HEIGHT_SCALE_CHANGED})}};e.prototype.setModelHeight=function(e){this.modelHeight=e;this.scaling=this.maxDivHeight>0&&e>this.maxDivHeight;if(this.scaling){this.calculateOffset()}else{this.clearOffset()}};e.prototype.getUiContainerHeight=function(){return this.uiContainerHeight};e.prototype.getRealPixelPosition=function(e){var t=e-this.offset;return t};e.prototype.getUiBodyHeight=function(){var e=this.gridPanel.getVScrollPosition();var t=e.bottom-e.top;if(this.gridPanel.isHorizontalScrollShowing()){t-=this.scrollBarWidth}return t};e.prototype.getScrollPositionForPixel=function(e){if(this.pixelsToShave<=0){return e}else{var t=this.modelHeight-this.getUiBodyHeight();var i=e/t;var n=this.maxScrollY*i;return n}};r([s.Autowired("eventService"),o("design:type",l.EventService)],e.prototype,"eventService",void 0);r([s.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"postConstruct",null);e=r([s.Bean("heightScaler")],e);return e}(a.BeanStub);t.HeightScaler=d},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(2);var s=i(4);var l=i(3);var u=i(12);var c=i(5);var d=i(0);var f=i(0);var p=i(0);var h=i(0);var g=function(){function e(){this.consuming=false}e.prototype.setBeans=function(e){this.logger=e.create("AlignedGridsService")};e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.init=function(){this.eventService.addEventListener(c.Events.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this));this.eventService.addEventListener(c.Events.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this));this.eventService.addEventListener(c.Events.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this));this.eventService.addEventListener(c.Events.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this));this.eventService.addEventListener(c.Events.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this));this.eventService.addEventListener(c.Events.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))};e.prototype.fireEvent=function(i){if(this.consuming){return}var e=this.gridOptionsWrapper.getAlignedGrids();if(e){e.forEach(function(e){if(e.api){var t=e.api.__getAlignedGridService();i(t)}})}};e.prototype.onEvent=function(e){this.consuming=true;e();this.consuming=false};e.prototype.fireColumnEvent=function(t){this.fireEvent(function(e){e.onColumnEvent(t)})};e.prototype.fireScrollEvent=function(t){if(t.direction!=="horizontal"){return}this.fireEvent(function(e){e.onScrollEvent(t)})};e.prototype.onScrollEvent=function(e){var t=this;this.onEvent(function(){t.gridPanel.setHorizontalScrollPosition(e.left)})};e.prototype.getMasterColumns=function(e){var t=[];if(e.columns){e.columns.forEach(function(e){t.push(e)})}else if(e.column){t.push(e.column)}return t};e.prototype.getColumnIds=function(e){var t=[];if(e.columns){e.columns.forEach(function(e){t.push(e.getColId())})}else if(e.columns){t.push(e.column.getColId())}return t};e.prototype.onColumnEvent=function(i){var n=this;this.onEvent(function(){switch(i.type){case c.Events.EVENT_COLUMN_MOVED:case c.Events.EVENT_COLUMN_VISIBLE:case c.Events.EVENT_COLUMN_PINNED:case c.Events.EVENT_COLUMN_RESIZED:var e=i;n.processColumnEvent(e);break;case c.Events.EVENT_COLUMN_GROUP_OPENED:var t=i;n.processGroupOpenedEvent(t);break;case c.Events.EVENT_COLUMN_PIVOT_CHANGED:console.warn("ag-Grid: pivoting is not supported with aligned grids. "+"You can only use one of these features at a time in a grid.");break}})};e.prototype.processGroupOpenedEvent=function(e){var t=e.columnGroup;var i;if(t){var n=t.getGroupId();i=this.columnController.getOriginalColumnGroup(n)}if(t&&!i){return}this.logger.log("onColumnEvent-> processing "+event+" expanded = "+t.isExpanded());this.columnController.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged")};e.prototype.processColumnEvent=function(t){var i=this;var e=t.column;var n;if(e){n=this.columnController.getPrimaryColumn(e.getColId())}if(e&&!n){return}var r=this.getColumnIds(t);var o=this.getMasterColumns(t);switch(t.type){case c.Events.EVENT_COLUMN_MOVED:var a=t;this.logger.log("onColumnEvent-> processing "+t.type+" toIndex = "+a.toIndex);this.columnController.moveColumns(r,a.toIndex,"alignedGridChanged");break;case c.Events.EVENT_COLUMN_VISIBLE:var s=t;this.logger.log("onColumnEvent-> processing "+t.type+" visible = "+s.visible);this.columnController.setColumnsVisible(r,s.visible,"alignedGridChanged");break;case c.Events.EVENT_COLUMN_PINNED:var l=t;this.logger.log("onColumnEvent-> processing "+t.type+" pinned = "+l.pinned);this.columnController.setColumnsPinned(r,l.pinned,"alignedGridChanged");break;case c.Events.EVENT_COLUMN_RESIZED:var u=t;o.forEach(function(e){i.logger.log("onColumnEvent-> processing "+t.type+" actualWidth = "+e.getActualWidth());i.columnController.setColumnWidth(e.getColId(),e.getActualWidth(),false,u.finished,"alignedGridChanged")});break}};n([p.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([p.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);n([p.Autowired("eventService"),r("design:type",l.EventService)],e.prototype,"eventService",void 0);n([o(0,f.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[u.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);n([h.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([d.Bean("alignedGridsService")],e);return e}();t.AlignedGridsService=g},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(2);var a=i(0);var s=i(40);var l=function(){function e(){}e.prototype.addResizeBar=function(e){var t=this;var i={dragStartPixels:0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e)};this.dragService.addDragSource(i,true);var n=function(){return t.dragService.removeDragSource(i)};return n};e.prototype.onDragStart=function(e,t){this.draggingStarted=true;this.dragStartX=t.clientX;this.setResizeIcons();var i=t instanceof MouseEvent?t.shiftKey===true:false;e.onResizeStart(i)};e.prototype.setResizeIcons=function(){this.oldBodyCursor=this.eGridDiv.style.cursor;this.oldMsUserSelect=this.eGridDiv.style.msUserSelect;this.oldWebkitUserSelect=this.eGridDiv.style.webkitUserSelect;this.eGridDiv.style.cursor="col-resize";this.eGridDiv.style.msUserSelect="none";this.eGridDiv.style.webkitUserSelect="none"};e.prototype.onDragStop=function(e,t){e.onResizeEnd(this.resizeAmount);this.resetIcons()};e.prototype.resetIcons=function(){this.eGridDiv.style.cursor=this.oldBodyCursor;this.eGridDiv.style.msUserSelect=this.oldMsUserSelect;this.eGridDiv.style.webkitUserSelect=this.oldWebkitUserSelect};e.prototype.onDragging=function(e,t){this.resizeAmount=t.clientX-this.dragStartX;e.onResizing(this.resizeAmount)};n([a.Autowired("gridOptionsWrapper"),r("design:type",o.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([a.Autowired("dragService"),r("design:type",s.DragService)],e.prototype,"dragService",void 0);n([a.Autowired("eGridDiv"),r("design:type",HTMLElement)],e.prototype,"eGridDiv",void 0);e=n([a.Bean("horizontalResizeService")],e);return e}();t.HorizontalResizeService=l},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(11);var l=i(1);var u=i(0);var c=i(2);var d=function(t){n(i,t);function i(){var e=t.call(this)||this;e.selected=false;e.readOnly=false;e.passive=false;return e}i.prototype.preConstruct=function(){this.setTemplate(i.TEMPLATE)};i.prototype.postConstruct=function(){this.loadIcons();this.updateIcons();if(this.props.label){this.eLabel.innerText=this.props.label}};i.prototype.loadIcons=function(){l.Utils.removeAllChildren(this.eChecked);l.Utils.removeAllChildren(this.eUnchecked);l.Utils.removeAllChildren(this.eIndeterminate);if(this.readOnly){this.eChecked.appendChild(l.Utils.createIconNoSpan("checkboxCheckedReadOnly",this.gridOptionsWrapper,null));this.eUnchecked.appendChild(l.Utils.createIconNoSpan("checkboxUncheckedReadOnly",this.gridOptionsWrapper,null));this.eIndeterminate.appendChild(l.Utils.createIconNoSpan("checkboxIndeterminateReadOnly",this.gridOptionsWrapper,null))}else{this.eChecked.appendChild(l.Utils.createIconNoSpan("checkboxChecked",this.gridOptionsWrapper,null));this.eUnchecked.appendChild(l.Utils.createIconNoSpan("checkboxUnchecked",this.gridOptionsWrapper,null));this.eIndeterminate.appendChild(l.Utils.createIconNoSpan("checkboxIndeterminate",this.gridOptionsWrapper,null))}};i.prototype.onClick=function(e){l.Utils.addAgGridEventPath(e);if(!this.readOnly){this.toggle()}};i.prototype.getNextValue=function(){if(this.selected===undefined){return true}else{return!this.selected}};i.prototype.setPassive=function(e){this.passive=e};i.prototype.setReadOnly=function(e){this.readOnly=e;this.loadIcons()};i.prototype.isReadOnly=function(){return this.readOnly};i.prototype.isSelected=function(){return this.selected};i.prototype.toggle=function(){var e=this.getNextValue();if(this.passive){var t={type:i.EVENT_CHANGED,selected:e};this.dispatchEvent(t)}else{this.setSelected(e)}};i.prototype.setSelected=function(e){if(this.selected===e){return}if(e===true){this.selected=true}else if(e===false){this.selected=false}else{this.selected=undefined}this.updateIcons();var t={type:i.EVENT_CHANGED,selected:this.selected};this.dispatchEvent(t)};i.prototype.updateIcons=function(){l.Utils.setVisible(this.eChecked,this.selected===true);l.Utils.setVisible(this.eUnchecked,this.selected===false);l.Utils.setVisible(this.eIndeterminate,this.selected===undefined)};i.EVENT_CHANGED="change";i.TEMPLATE='<span class="ag-checkbox" role="presentation">'+'  <span class="ag-checkbox-checked" role="presentation"></span>'+'  <span class="ag-checkbox-unchecked" role="presentation"></span>'+'  <span class="ag-checkbox-indeterminate" role="presentation"></span>'+'  <span class="ag-checkbox-label" role="presentation"></span>'+"</span>";r([u.Autowired("gridOptionsWrapper"),o("design:type",c.GridOptionsWrapper)],i.prototype,"gridOptionsWrapper",void 0);r([s.QuerySelector(".ag-checkbox-checked"),o("design:type",HTMLElement)],i.prototype,"eChecked",void 0);r([s.QuerySelector(".ag-checkbox-unchecked"),o("design:type",HTMLElement)],i.prototype,"eUnchecked",void 0);r([s.QuerySelector(".ag-checkbox-indeterminate"),o("design:type",HTMLElement)],i.prototype,"eIndeterminate",void 0);r([s.QuerySelector(".ag-checkbox-label"),o("design:type",HTMLElement)],i.prototype,"eLabel",void 0);r([u.PreConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],i.prototype,"preConstruct",null);r([u.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],i.prototype,"postConstruct",null);r([s.Listener("click"),o("design:type",Function),o("design:paramtypes",[MouseEvent]),o("design:returntype",void 0)],i.prototype,"onClick",null);return i}(a.Component);t.AgCheckbox=d},function(e,t,i){"use strict";var o=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var s=i(14);var n=i(13);var r=function(n){o(r,n);function r(e,t){var i=n.call(this)||this;i.version=0;i.state=r.STATE_DIRTY;i.rowNodeCacheParams=t;i.blockNumber=e;i.startRow=e*t.blockSize;i.endRow=i.startRow+t.blockSize;return i}r.prototype.isAnyNodeOpen=function(e){var t=false;this.forEachNodeCallback(function(e){if(e.expanded){t=true}},e);return t};r.prototype.forEachNodeCallback=function(e,t){for(var i=this.startRow;i<this.endRow;i++){if(i<t){var n=this.getRowUsingLocalIndex(i);e(n,i)}}};r.prototype.forEachNode=function(t,i,e,n){this.forEachNodeCallback(function(e){t(e,i.next());if(n&&e.childrenCache){e.childrenCache.forEachNodeDeep(t,i)}},e)};r.prototype.forEachNodeDeep=function(e,t,i){this.forEachNode(e,t,i,true)};r.prototype.forEachNodeShallow=function(e,t,i){this.forEachNode(e,t,i,false)};r.prototype.getVersion=function(){return this.version};r.prototype.getLastAccessed=function(){return this.lastAccessed};r.prototype.getRowUsingLocalIndex=function(e,t){if(t===void 0){t=false}if(!t){this.lastAccessed=this.rowNodeCacheParams.lastAccessedSequence.next()}var i=e-this.startRow;return this.rowNodes[i]};r.prototype.init=function(e){this.beans=e;this.createRowNodes()};r.prototype.getStartRow=function(){return this.startRow};r.prototype.getEndRow=function(){return this.endRow};r.prototype.getBlockNumber=function(){return this.blockNumber};r.prototype.setDirty=function(){this.version++;this.state=r.STATE_DIRTY};r.prototype.setDirtyAndPurge=function(){this.setDirty();this.rowNodes.forEach(function(e){e.setData(null)})};r.prototype.getState=function(){return this.state};r.prototype.setRowNode=function(e,t){var i=e-this.startRow;this.rowNodes[i]=t};r.prototype.setBlankRowNode=function(e){var t=e-this.startRow;var i=this.createBlankRowNode(e);this.rowNodes[t]=i;return i};r.prototype.setNewData=function(e,t){var i=this.setBlankRowNode(e);this.setDataAndId(i,t,this.startRow+e);return i};r.prototype.createBlankRowNode=function(e){var t=new s.RowNode;this.beans.context.wireBean(t);t.setRowHeight(this.rowNodeCacheParams.rowHeight);return t};r.prototype.createRowNodes=function(){this.rowNodes=[];for(var e=0;e<this.rowNodeCacheParams.blockSize;e++){var t=this.startRow+e;var i=this.createBlankRowNode(t);this.rowNodes.push(i)}};r.prototype.load=function(){this.state=r.STATE_LOADING;this.loadFromDatasource()};r.prototype.pageLoadFailed=function(){this.state=r.STATE_FAILED;var e={type:r.EVENT_LOAD_COMPLETE,success:false,page:this,lastRow:null};this.dispatchEvent(e)};r.prototype.populateWithRowData=function(n){var r=this;var o=[];this.rowNodes.forEach(function(e,t){var i=n[t];if(e.stub){o.push(e)}r.setDataAndId(e,i,r.startRow+t)});if(o.length>0){this.beans.rowRenderer.redrawRows(o)}};r.prototype.destroy=function(){n.prototype.destroy.call(this);this.rowNodes.forEach(function(e){if(e.childrenCache){e.childrenCache.destroy();e.childrenCache=null}e.clearRowTop()})};r.prototype.pageLoaded=function(e,t,i){if(e===this.version){this.state=r.STATE_LOADED;this.populateWithRowData(t)}i=a.Utils.cleanNumber(i);var n={type:r.EVENT_LOAD_COMPLETE,success:true,page:this,lastRow:i};this.dispatchEvent(n)};r.EVENT_LOAD_COMPLETE="loadComplete";r.STATE_DIRTY="dirty";r.STATE_LOADING="loading";r.STATE_LOADED="loaded";r.STATE_FAILED="failed";return r}(n.BeanStub);t.RowNodeBlock=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var s=i(5);var n=i(90);var l=i(1);var r=i(2);var o=function(){function a(){}a.getEventCallbacks=function(){if(!a.EVENT_CALLBACKS){a.EVENT_CALLBACKS=[];a.EVENT_CALLBACKS_NO_PREFIX=[];a.EVENTS.forEach(function(e){a.EVENT_CALLBACKS.push(a.getCallbackForEvent(e));a.EVENT_CALLBACKS_NO_PREFIX.push(e)})}return a.EVENT_CALLBACKS};a.copyAttributesToGridOptions=function(e,i,t){if(t===void 0){t=false}u(i);if(typeof e!=="object"){e={}}var n=e;a.ARRAY_PROPERTIES.concat(a.STRING_PROPERTIES).concat(a.OBJECT_PROPERTIES).concat(a.FUNCTION_PROPERTIES).forEach(function(e){if(typeof i[e]!=="undefined"){n[e]=i[e]}});a.BOOLEAN_PROPERTIES.forEach(function(e){if(typeof i[e]!=="undefined"){n[e]=a.toBoolean(i[e])}});a.NUMBER_PROPERTIES.forEach(function(e){if(typeof i[e]!=="undefined"){n[e]=a.toNumber(i[e])}});a.getEventCallbacks().forEach(function(e){if(typeof i[e]!=="undefined"){n[e]=i[e]}});if(!t){a.EVENT_CALLBACKS_NO_PREFIX.forEach(function(e){var t=a.getCallbackForEvent(e);if(typeof i[e]!=="undefined"||typeof i[t]!=="undefined"){r.GridOptionsWrapper.checkEventDeprecation(e)}})}return e};a.getCallbackForEvent=function(e){if(!e||e.length<2){return e}else{return"on"+e[0].toUpperCase()+e.substr(1)}};a.processOnChange=function(t,e,i,n){if(!t){return}u(t);var r=e;a.ARRAY_PROPERTIES.concat(a.OBJECT_PROPERTIES).concat(a.STRING_PROPERTIES).forEach(function(e){if(t[e]){r[e]=t[e].currentValue}});a.BOOLEAN_PROPERTIES.forEach(function(e){if(t[e]){r[e]=a.toBoolean(t[e].currentValue)}});a.NUMBER_PROPERTIES.forEach(function(e){if(t[e]){r[e]=a.toNumber(t[e].currentValue)}});a.getEventCallbacks().forEach(function(e){if(t[e]){r[e]=t[e].currentValue}});if(t.showToolPanel){i.showToolPanel(a.toBoolean(t.showToolPanel.currentValue))}if(t.quickFilterText){i.setQuickFilter(t.quickFilterText.currentValue)}if(t.rowData){i.setRowData(t.rowData.currentValue)}if(t.pinnedTopRowData){i.setPinnedTopRowData(t.pinnedTopRowData.currentValue)}if(t.pinnedBottomRowData){i.setPinnedBottomRowData(t.pinnedBottomRowData.currentValue)}if(t.columnDefs){i.setColumnDefs(t.columnDefs.currentValue,"gridOptionsChanged")}if(t.datasource){i.setDatasource(t.datasource.currentValue)}if(t.headerHeight){i.setHeaderHeight(a.toNumber(t.headerHeight.currentValue))}if(t.paginationPageSize){i.paginationSetPageSize(a.toNumber(t.paginationPageSize.currentValue))}if(t.pivotMode){n.setPivotMode(a.toBoolean(t.pivotMode.currentValue))}if(t.groupRemoveSingleChildren){i.setGroupRemoveSingleChildren(a.toBoolean(t.groupRemoveSingleChildren.currentValue))}if(t.suppressRowDrag){i.setSuppressRowDrag(a.toBoolean(t.suppressRowDrag.currentValue))}if(t.gridAutoHeight){i.setGridAutoHeight(a.toBoolean(t.gridAutoHeight.currentValue))}if(t.suppressClipboardPaste){i.setSuppressClipboardPaste(a.toBoolean(t.suppressClipboardPaste.currentValue))}var o={type:s.Events.EVENT_COMPONENT_STATE_CHANGED,api:e.api,columnApi:e.columnApi};l.Utils.iterateObject(t,function(e,t){o[e]=t});i.dispatchEvent(o)};a.toBoolean=function(e){if(typeof e==="boolean"){return e}else if(typeof e==="string"){return e.toUpperCase()==="TRUE"||e==""}else{return false}};a.toNumber=function(e){if(typeof e==="number"){return e}else if(typeof e==="string"){return Number(e)}else{return undefined}};a.EVENTS=[];a.STRING_PROPERTIES=n.PropertyKeys.STRING_PROPERTIES;a.OBJECT_PROPERTIES=n.PropertyKeys.OBJECT_PROPERTIES;a.ARRAY_PROPERTIES=n.PropertyKeys.ARRAY_PROPERTIES;a.NUMBER_PROPERTIES=n.PropertyKeys.NUMBER_PROPERTIES;a.BOOLEAN_PROPERTIES=n.PropertyKeys.BOOLEAN_PROPERTIES;a.FUNCTION_PROPERTIES=n.PropertyKeys.FUNCTION_PROPERTIES;a.ALL_PROPERTIES=n.PropertyKeys.ALL_PROPERTIES;return a}();t.ComponentUtil=o;l.Utils.iterateObject(s.Events,function(e,t){o.EVENTS.push(t)});function u(e){if(e.rowDeselected||e.onRowDeselected){console.warn("ag-grid: as of v3.4 rowDeselected no longer exists. Please check the docs.")}}},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(4);var S=i(9);var D=i(1);var s=i(17);var l=i(2);var u=i(48);var c=i(38);var k=i(83);var d=i(26);var f=i(30);var p=function(){function e(e,t,i,n,r,o){this.columnController=e;this.valueService=t;this.gridOptionsWrapper=i;this.processCellCallback=n;this.processHeaderCallback=r;this.cellAndHeaderEscaper=o}e.prototype.extractHeaderValue=function(e){var t=this.getHeaderName(this.processHeaderCallback,e);if(t===null||t===undefined){t=""}return this.cellAndHeaderEscaper?this.cellAndHeaderEscaper(t):t};e.prototype.extractRowCellValue=function(e,t,i,n){var r=this.columnController.getRowGroupColumns().length>0;var o;if(n.group&&r&&t===0){o=this.createValueForGroupNode(n)}else{o=this.valueService.getValue(e,n)}o=this.processCell(n,e,o,this.processCellCallback,i);if(o===null||o===undefined){o=""}return this.cellAndHeaderEscaper?this.cellAndHeaderEscaper(o):o};e.prototype.getHeaderName=function(e,t){if(e){return e({column:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()})}else{return this.columnController.getDisplayNameForColumn(t,"csv",true)}};e.prototype.createValueForGroupNode=function(e){var t=[e.key];while(e.parent){e=e.parent;t.push(e.key)}return t.reverse().join(" -> ")};e.prototype.processCell=function(e,t,i,n,r){if(n){return n({column:t,node:e,value:i,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:r})}else{return i}};return e}();t.BaseGridSerializingSession=p;var h=function(){function e(){}e.prototype.serialize=function(r,e){var t=function(){return false};var o=e&&e.skipGroups;var i=e&&e.skipHeader;var n=e&&e.columnGroups;var a=e&&e.skipFooters;var s=e&&e.skipPinnedTop;var l=e&&e.skipPinnedBottom;var u=e&&e.customHeader;var c=e&&e.customFooter;var d=e&&e.allColumns;var f=e&&e.onlySelected;var p=e&&e.columnKeys;var h=e&&e.onlySelectedAllPages;var g=e&&e.shouldRowBeSkipped||t;var v=this.gridOptionsWrapper.getApi();var m=this.gridOptionsWrapper.getContext();var y=this.columnController.isPivotMode();var b=this.rowModel.getType()===S.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;var _=!b&&f;var w;if(D.Utils.existsAndNotEmpty(p)){w=this.columnController.getGridColumns(p)}else if(d&&!y){w=this.columnController.getAllPrimaryColumns()}else{w=this.columnController.getAllDisplayedColumns()}if(!w||w.length===0){return""}r.prepare(w);if(u){r.addCustomHeader(e.customHeader)}if(n){var C=new k.GroupInstanceIdCreator;var A=this.displayedGroupCreator.createDisplayedGroups(w,this.columnController.getGridBalancedTree(),C);this.recursivelyAddHeaderGroups(A,r)}if(!i){var E=r.onNewHeaderRow();w.forEach(function(e,t){E.onColumn(e,t,null)})}this.pinnedRowModel.forEachPinnedTopRow(T);if(y){if(this.rowModel.forEachPivotNode){this.rowModel.forEachPivotNode(T)}else{this.rowModel.forEachNode(T)}}else{if(h||_){var x=this.selectionController.getSelectedNodes();x.forEach(function(e){T(e)})}else{if(b){this.rowModel.forEachNodeAfterFilterAndSort(T)}else{this.rowModel.forEachNode(T)}}}this.pinnedRowModel.forEachPinnedBottomRow(T);if(c){r.addCustomFooter(e.customFooter)}function T(i){if(o&&i.group){return}if(a&&i.footer){return}if(f&&!i.isSelected()){return}if(s&&i.rowPinned==="top"){return}if(l&&i.rowPinned==="bottom"){return}var e=i.level===-1;if(e&&!i.leafGroup){return}var t=g({node:i,api:v,context:m});if(t)return;var n=r.onNewBodyRow();w.forEach(function(e,t){n.onColumn(e,t,i)})}return r.parse()};e.prototype.recursivelyAddHeaderGroups=function(e,t){var i=[];e.forEach(function(e){var t=e;if(!t.getChildren)return;t.getChildren().forEach(function(e){return i.push(e)})});if(e.length>0&&e[0]instanceof d.ColumnGroup){this.doAddHeaderHeader(t,e)}if(i&&i.length>0){this.recursivelyAddHeaderGroups(i,t)}};e.prototype.doAddHeaderHeader=function(e,t){var r=this;var o=e.onNewHeaderGroupingRow();var a=0;t.forEach(function(e){var t=e;var i=t.getDefinition();var n=r.columnController.getDisplayNameForColumnGroup(t,"header");o.onColumn(n,a++,t.getLeafColumns().length-1)})};n([o.Autowired("displayedGroupCreator"),r("design:type",u.DisplayedGroupCreator)],e.prototype,"displayedGroupCreator",void 0);n([o.Autowired("columnController"),r("design:type",a.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([o.Autowired("pinnedRowModel"),r("design:type",f.PinnedRowModel)],e.prototype,"pinnedRowModel",void 0);n([o.Autowired("selectionController"),r("design:type",s.SelectionController)],e.prototype,"selectionController",void 0);n([o.Autowired("balancedColumnTreeBuilder"),r("design:type",c.BalancedColumnTreeBuilder)],e.prototype,"balancedColumnTreeBuilder",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("gridSerializer")],e);return e}();t.GridSerializer=h;var g;(function(e){e[e["HEADER_GROUPING"]=0]="HEADER_GROUPING";e[e["HEADER"]=1]="HEADER";e[e["BODY"]=2]="BODY"})(g=t.RowType||(t.RowType={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(9);var r=i(1);var o=i(23);var a=function(){function e(e,t){this.rowIndex=e;this.floating=r.Utils.makeNull(t)}e.prototype.isFloatingTop=function(){return this.floating===n.Constants.PINNED_TOP};e.prototype.isFloatingBottom=function(){return this.floating===n.Constants.PINNED_BOTTOM};e.prototype.isNotFloating=function(){return!this.isFloatingBottom()&&!this.isFloatingTop()};e.prototype.equals=function(e){return this.rowIndex===e.rowIndex&&this.floating===e.floating};e.prototype.toString=function(){return"rowIndex = "+this.rowIndex+", floating = "+this.floating};e.prototype.getGridCell=function(e){var t={rowIndex:this.rowIndex,floating:this.floating,column:e};return new o.GridCell(t)};e.prototype.before=function(e){var t=e.floating;switch(this.floating){case n.Constants.PINNED_TOP:if(t!==n.Constants.PINNED_TOP){return true}break;case n.Constants.PINNED_BOTTOM:if(t!==n.Constants.PINNED_BOTTOM){return false}break;default:if(r.Utils.exists(t)){if(t===n.Constants.PINNED_TOP){return false}else{return true}}break}return this.rowIndex<e.rowIndex};return e}();t.GridRow=a},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(14);var l=i(1);var u=i(0);var c=i(2);var d=i(5);var f=i(3);var p=i(6);var h=i(7);var g=function(e){n(t,e);function t(){return e.call(this,'<span class="ag-selection-checkbox"/>')||this}t.prototype.createAndAddIcons=function(){this.eCheckedIcon=l.Utils.createIconNoSpan("checkboxChecked",this.gridOptionsWrapper,this.column);this.eUncheckedIcon=l.Utils.createIconNoSpan("checkboxUnchecked",this.gridOptionsWrapper,this.column);this.eIndeterminateIcon=l.Utils.createIconNoSpan("checkboxIndeterminate",this.gridOptionsWrapper,this.column);var e=this.getGui();e.appendChild(this.eCheckedIcon);e.appendChild(this.eUncheckedIcon);e.appendChild(this.eIndeterminateIcon)};t.prototype.onDataChanged=function(){this.onSelectionChanged()};t.prototype.onSelectableChanged=function(){this.showOrHideSelect()};t.prototype.onSelectionChanged=function(){var e=this.rowNode.isSelected();l.Utils.setVisible(this.eCheckedIcon,e===true);l.Utils.setVisible(this.eUncheckedIcon,e===false);l.Utils.setVisible(this.eIndeterminateIcon,typeof e!=="boolean")};t.prototype.onCheckedClicked=function(){var e=this.gridOptionsWrapper.isGroupSelectsFiltered();var t=this.rowNode.setSelectedParams({newValue:false,groupSelectsFiltered:e});return t};t.prototype.onUncheckedClicked=function(e){var t=this.gridOptionsWrapper.isGroupSelectsFiltered();var i=this.rowNode.setSelectedParams({newValue:true,rangeSelect:e.shiftKey,groupSelectsFiltered:t});return i};t.prototype.onIndeterminateClicked=function(e){var t=this.onUncheckedClicked(e);if(t===0){this.onCheckedClicked()}};t.prototype.init=function(e){this.rowNode=e.rowNode;this.column=e.column;this.createAndAddIcons();this.onSelectionChanged();this.addGuiEventListener("click",function(e){return l.Utils.stopPropagationForAgGrid(e)});this.addGuiEventListener("dblclick",function(e){return l.Utils.stopPropagationForAgGrid(e)});this.addDestroyableEventListener(this.eCheckedIcon,"click",this.onCheckedClicked.bind(this));this.addDestroyableEventListener(this.eUncheckedIcon,"click",this.onUncheckedClicked.bind(this));this.addDestroyableEventListener(this.eIndeterminateIcon,"click",this.onIndeterminateClicked.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_DATA_CHANGED,this.onDataChanged.bind(this));this.addDestroyableEventListener(this.rowNode,s.RowNode.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this));this.isRowSelectableFunc=this.gridOptionsWrapper.getIsRowSelectableFunc();var t=this.isRowSelectableFunc||this.checkboxCallbackExists();if(t){this.addDestroyableEventListener(this.eventService,d.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelect.bind(this));this.showOrHideSelect()}};t.prototype.showOrHideSelect=function(){var e=this.rowNode.selectable;if(e&&this.checkboxCallbackExists()){e=this.column.isCellCheckboxSelection(this.rowNode)}this.setVisible(e)};t.prototype.checkboxCallbackExists=function(){var e=this.column?this.column.getColDef():null;return e&&typeof e.checkboxSelection==="function"};r([u.Autowired("gridOptionsWrapper"),o("design:type",c.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([u.Autowired("eventService"),o("design:type",f.EventService)],t.prototype,"eventService",void 0);r([u.Autowired("gridApi"),o("design:type",p.GridApi)],t.prototype,"gridApi",void 0);r([u.Autowired("columnApi"),o("design:type",h.ColumnApi)],t.prototype,"columnApi",void 0);return t}(a.Component);t.CheckboxSelectionComponent=g},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(67);var a=i(0);var s=i(68);var l=i(125);var u=i(126);var c=i(91);var d=i(27);var f=i(72);var p=i(71);var h=i(70);var g=i(50);var v=i(75);var m=i(92);var y=i(93);var b=i(94);var _=i(95);var w=i(96);var C=i(127);var A=i(128);var E=i(1);var x;(function(e){e[e["DEFAULT"]=0]="DEFAULT";e[e["REGISTERED"]=1]="REGISTERED"})(x=t.RegisteredComponentSource||(t.RegisteredComponentSource={}));var T=function(){function e(){this.agGridDefaults={agDateInput:s.DefaultDateComponent,agColumnHeader:l.HeaderComp,agColumnGroupHeader:u.HeaderGroupComp,agSetColumnFloatingFilter:c.SetFloatingFilterComp,agTextColumnFloatingFilter:c.TextFloatingFilterComp,agNumberColumnFloatingFilter:c.NumberFloatingFilterComp,agDateColumnFloatingFilter:c.DateFloatingFilterComp,agAnimateShowChangeCellRenderer:p.AnimateShowChangeCellRenderer,agAnimateSlideCellRenderer:h.AnimateSlideCellRenderer,agGroupCellRenderer:f.GroupCellRenderer,agGroupRowRenderer:f.GroupCellRenderer,agLoadingCellRenderer:g.LoadingCellRenderer,agCellEditor:o.TextCellEditor,agTextCellEditor:o.TextCellEditor,agSelectCellEditor:v.SelectCellEditor,agPopupTextCellEditor:m.PopupTextCellEditor,agPopupSelectCellEditor:y.PopupSelectCellEditor,agLargeTextCellEditor:b.LargeTextCellEditor,agTextColumnFilter:_.TextFilter,agNumberColumnFilter:w.NumberFilter,agDateColumnFilter:s.DateFilter,agLoadingOverlay:C.LoadingOverlayComponent,agNoRowsOverlay:A.NoRowsOverlayComponent};this.agDeprecatedNames={set:{newComponentName:"agSetColumnFilter",propertyHolder:"filter"},text:{newComponentName:"agTextColumnFilter",propertyHolder:"filter"},number:{newComponentName:"agNumberColumnFilter",propertyHolder:"filter"},date:{newComponentName:"agDateColumnFilter",propertyHolder:"filter"},group:{newComponentName:"agGroupCellRenderer",propertyHolder:"cellRenderer"},animateShowChange:{newComponentName:"agAnimateShowChangeCellRenderer",propertyHolder:"cellRenderer"},animateSlide:{newComponentName:"agAnimateSlideCellRenderer",propertyHolder:"cellRenderer"},select:{newComponentName:"agSelectCellEditor",propertyHolder:"cellEditor"},largeText:{newComponentName:"agLargeTextCellEditor",propertyHolder:"cellEditor"},popupSelect:{newComponentName:"agPopupSelectCellEditor",propertyHolder:"cellEditor"},popupText:{newComponentName:"agPopupTextCellEditor",propertyHolder:"cellEditor"},richSelect:{newComponentName:"agRichSelectCellEditor",propertyHolder:"cellEditor"},headerComponent:{newComponentName:"agColumnHeader",propertyHolder:"headerComponent"}};this.jsComponents={};this.frameworkComponents={}}e.prototype.init=function(){var t=this;if(this.gridOptions.components!=null){Object.keys(this.gridOptions.components).forEach(function(e){t.registerComponent(e,t.gridOptions.components[e])})}if(this.gridOptions.frameworkComponents!=null){Object.keys(this.gridOptions.frameworkComponents).forEach(function(e){t.registerFwComponent(e,t.gridOptions.frameworkComponents[e])})}};e.prototype.registerDefaultComponent=function(e,t,i){if(i===void 0){i=true}var n=this.translateIfDeprecated(e);if(this.agGridDefaults[n]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[n]=t};e.prototype.registerComponent=function(e,t){var i=this.translateIfDeprecated(e);if(this.frameworkComponents[i]){console.error("Trying to register a component that you have already registered for frameworks: "+i);return}this.jsComponents[i]=t};e.prototype.registerFwComponent=function(e,t){var i=this.translateIfDeprecated(e);if(this.jsComponents[i]){console.error("Trying to register a component that you have already registered for plain javascript: "+i);return}this.frameworkComponents[i]=t};e.prototype.retrieve=function(e){var t=this.translateIfDeprecated(e);if(this.frameworkComponents[t]){return{type:d.ComponentType.FRAMEWORK,component:this.frameworkComponents[t],source:x.REGISTERED}}if(this.jsComponents[t]){return{type:d.ComponentType.AG_GRID,component:this.jsComponents[t],source:x.REGISTERED}}if(this.agGridDefaults[t]){return this.agGridDefaults[t]?{type:d.ComponentType.AG_GRID,component:this.agGridDefaults[t],source:x.DEFAULT}:null}if(Object.keys(this.agGridDefaults).indexOf(t)<0){console.warn("ag-grid: Looking for component ["+t+"] but it wasn't found.")}return null};e.prototype.translateIfDeprecated=function(e){var t=this.agDeprecatedNames[e];if(t!=null){E._.doOnce(function(){console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename "+t.propertyHolder+":"+e+" to "+t.propertyHolder+":"+t.newComponentName)},"DEPREACTE_COMPONENT_"+e);return t.newComponentName}return e};n([a.Autowired("gridOptions"),r("design:type",Object)],e.prototype,"gridOptions",void 0);n([a.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([a.Bean("componentProvider")],e);return e}();t.ComponentProvider=T},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(9);var o=i(8);var a=i(1);var s=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.init=function(e){this.params=e;var t=this.getGui();var i;if(e.cellStartedEdit){this.focusAfterAttached=true;var n=e.keyPress===r.Constants.KEY_BACKSPACE||e.keyPress===r.Constants.KEY_DELETE;if(n){i=""}else if(e.charPress){i=e.charPress}else{i=this.getStartValue(e);if(e.keyPress!==r.Constants.KEY_F2){this.highlightAllOnFocus=true}}}else{this.focusAfterAttached=false;i=this.getStartValue(e)}if(a.Utils.exists(i)){t.value=i}this.addDestroyableEventListener(t,"keydown",function(e){var t=e.keyCode===r.Constants.KEY_LEFT||e.keyCode===r.Constants.KEY_RIGHT||e.keyCode===r.Constants.KEY_UP||e.keyCode===r.Constants.KEY_DOWN||e.keyCode===r.Constants.KEY_PAGE_DOWN||e.keyCode===r.Constants.KEY_PAGE_UP||e.keyCode===r.Constants.KEY_PAGE_HOME||e.keyCode===r.Constants.KEY_PAGE_END;if(t){e.stopPropagation();var i=e.keyCode===r.Constants.KEY_PAGE_UP;var n=e.keyCode===r.Constants.KEY_PAGE_DOWN;if(i||n){e.preventDefault()}}})};t.prototype.afterGuiAttached=function(){if(!this.focusAfterAttached){return}var e=this.getGui();e.focus();if(this.highlightAllOnFocus){e.select()}else{var t=e.value?e.value.length:0;if(t>0){e.setSelectionRange(t,t)}}};t.prototype.focusIn=function(){var e=this.getGui();e.focus();e.select()};t.prototype.getValue=function(){var e=this.getGui();return this.params.parseValue(e.value)};t.prototype.getStartValue=function(e){var t=e.useFormatter||e.column.getColDef().refData;return t?e.formatValue(e.value):e.value};t.TEMPLATE='<input class="ag-cell-edit-input" type="text"/>';return t}(o.Component);t.TextCellEditor=s},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(11);var l=i(1);var u=i(51);var c=i(0);var d=i(21);var f=function(t){n(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.modelFromFloatingFilter=function(e){return{dateFrom:e,dateTo:this.getDateTo(),type:this.filter,filterType:"date"}};i.prototype.getApplicableFilterTypes=function(){return[u.BaseFilter.EQUALS,u.BaseFilter.GREATER_THAN,u.BaseFilter.LESS_THAN,u.BaseFilter.NOT_EQUAL,u.BaseFilter.IN_RANGE]};i.prototype.bodyTemplate=function(e){var t=e==u.FilterConditionType.MAIN?"filterDateFromPanel":"filterDateFromConditionPanel";var i=e==u.FilterConditionType.MAIN?"filterDateToPanel":"filterDateToConditionPanel";return'<div class="ag-filter-body">\n                    <div class="ag-filter-date-from" id="'+t+'">\n                    </div>\n                    <div class="ag-filter-date-to" id="'+i+'">\n                    </div>\n                </div>'};i.prototype.initialiseFilterBodyUi=function(e){t.prototype.initialiseFilterBodyUi.call(this,e);this.createComponents(e);if(e===u.FilterConditionType.MAIN){this.setDateFrom_date(this.dateFrom,u.FilterConditionType.MAIN);this.setDateTo_date(this.dateTo,u.FilterConditionType.MAIN);this.setFilterType(this.filterCondition,u.FilterConditionType.MAIN)}else{this.setDateFrom_date(this.dateFromCondition,u.FilterConditionType.CONDITION);this.setDateTo_date(this.dateToCondition,u.FilterConditionType.CONDITION);this.setFilterType(this.filterCondition,u.FilterConditionType.CONDITION)}};i.prototype.createComponents=function(i){var n=this;var e={onDateChanged:function(){n.onDateChanged(i)},filterParams:this.filterParams};this.componentRecipes.newDateComponent(e).then(function(e){if(i===u.FilterConditionType.MAIN){n.dateToComponent=e}else{n.dateToConditionComponent=e}var t=e.getGui();if(i===u.FilterConditionType.MAIN){n.eDateToPanel.appendChild(t);if(n.dateToComponent.afterGuiAttached){n.dateToComponent.afterGuiAttached()}}else{n.eDateToConditionPanel.appendChild(t);if(n.dateToConditionComponent.afterGuiAttached){n.dateToConditionComponent.afterGuiAttached()}}});this.componentRecipes.newDateComponent(e).then(function(e){if(i===u.FilterConditionType.MAIN){n.dateFromComponent=e}else{n.dateFromConditionComponent=e}var t=e.getGui();if(i===u.FilterConditionType.MAIN){n.eDateFromPanel.appendChild(t);if(n.dateFromComponent.afterGuiAttached){n.dateFromComponent.afterGuiAttached()}}else{n.eDateFromConditionPanel.appendChild(t);if(n.dateFromConditionComponent.afterGuiAttached){n.dateFromConditionComponent.afterGuiAttached()}}})};i.prototype.onDateChanged=function(e){if(e===u.FilterConditionType.MAIN){this.dateFrom=i.removeTimezone(this.dateFromComponent.getDate());this.dateTo=i.removeTimezone(this.dateToComponent.getDate())}else{this.dateFromCondition=i.removeTimezone(this.dateFromComponent.getDate());this.dateToCondition=i.removeTimezone(this.dateToComponent.getDate())}this.onFilterChanged()};i.prototype.refreshFilterBodyUi=function(e){var t;var i;if(e===u.FilterConditionType.MAIN){t=this.eDateToPanel;i=this.filter}else{t=this.eDateToConditionPanel;i=this.filterCondition}if(!t)return;var n=i===u.BaseFilter.IN_RANGE;l.Utils.setVisible(t,n)};i.prototype.comparator=function(){return this.filterParams.comparator?this.filterParams.comparator:this.defaultComparator.bind(this)};i.prototype.defaultComparator=function(e,t){var i=t;if(i<e){return-1}if(i>e){return 1}return t!=null?0:-1};i.prototype.serialize=function(e){var t=e===u.FilterConditionType.MAIN?this.dateToComponent:this.dateToConditionComponent;var i=e===u.FilterConditionType.MAIN?this.dateFromComponent:this.dateFromConditionComponent;var n=e===u.FilterConditionType.MAIN?this.filter:this.filterCondition;return{dateTo:l.Utils.serializeDateToYyyyMmDd(t.getDate(),"-"),dateFrom:l.Utils.serializeDateToYyyyMmDd(i.getDate(),"-"),type:n?n:this.defaultFilter,filterType:"date"}};i.prototype.filterValues=function(e){if(e===u.FilterConditionType.MAIN){if(!this.dateFromComponent)return null;return this.filter!==u.BaseFilter.IN_RANGE?this.dateFromComponent.getDate():[this.dateFromComponent.getDate(),this.dateToComponent.getDate()]}if(!this.dateFromConditionComponent)return null;return this.filterCondition!==u.BaseFilter.IN_RANGE?this.dateFromConditionComponent.getDate():[this.dateFromConditionComponent.getDate(),this.dateToConditionComponent.getDate()]};i.prototype.getDateFrom=function(){return l.Utils.serializeDateToYyyyMmDd(this.dateFromComponent.getDate(),"-")};i.prototype.getDateTo=function(){return l.Utils.serializeDateToYyyyMmDd(this.dateToComponent.getDate(),"-")};i.prototype.getFilterType=function(){return this.filter};i.prototype.setDateFrom=function(e,t){var i=l.Utils.parseYyyyMmDdToDate(e,"-");this.setDateFrom_date(i,t)};i.prototype.setDateFrom_date=function(e,t){if(t===u.FilterConditionType.MAIN){this.dateFrom=e;if(!this.dateFromComponent)return;this.dateFromComponent.setDate(this.dateFrom)}else{this.dateFromCondition=e;if(!this.dateFromConditionComponent)return;this.dateFromConditionComponent.setDate(this.dateFromCondition)}};i.prototype.setDateTo=function(e,t){var i=l.Utils.parseYyyyMmDdToDate(e,"-");this.setDateTo_date(i,t)};i.prototype.setDateTo_date=function(e,t){if(t===u.FilterConditionType.MAIN){this.dateTo=e;if(!this.dateToComponent)return;this.dateToComponent.setDate(this.dateTo)}else{this.dateToCondition=e;if(!this.dateToConditionComponent)return;this.dateToConditionComponent.setDate(this.dateToCondition)}};i.prototype.resetState=function(){this.setDateFrom(null,u.FilterConditionType.MAIN);this.setDateTo(null,u.FilterConditionType.MAIN);this.setFilterType(this.defaultFilter,u.FilterConditionType.MAIN);this.setDateFrom(null,u.FilterConditionType.CONDITION);this.setDateTo(null,u.FilterConditionType.CONDITION);this.setFilterType(this.defaultFilter,u.FilterConditionType.MAIN)};i.prototype.parse=function(e,t){this.setDateFrom(e.dateFrom,t);this.setDateTo(e.dateTo,t);this.setFilterType(e.type,t)};i.prototype.setType=function(e,t){this.setFilterType(e,t)};i.removeTimezone=function(e){if(!e){return null}return new Date(e.getFullYear(),e.getMonth(),e.getDate())};r([c.Autowired("componentRecipes"),o("design:type",d.ComponentRecipes)],i.prototype,"componentRecipes",void 0);r([s.QuerySelector("#filterDateFromPanel"),o("design:type",HTMLElement)],i.prototype,"eDateFromPanel",void 0);r([s.QuerySelector("#filterDateFromConditionPanel"),o("design:type",HTMLElement)],i.prototype,"eDateFromConditionPanel",void 0);r([s.QuerySelector("#filterDateToPanel"),o("design:type",HTMLElement)],i.prototype,"eDateToPanel",void 0);r([s.QuerySelector("#filterDateToConditionPanel"),o("design:type",HTMLElement)],i.prototype,"eDateToConditionPanel",void 0);return i}(u.ScalarBaseFilter);t.DateFilter=f;var p=function(e){n(t,e);function t(){return e.call(this,'<input class="ag-filter-filter" type="text" placeholder="yyyy-mm-dd">')||this}t.prototype.init=function(e){this.eDateInput=this.getGui();if(l.Utils.isBrowserChrome()||e.filterParams.browserDatePicker){if(l.Utils.isBrowserIE()){console.warn("ag-grid: browserDatePicker is specified to true, but it is not supported in IE 11, reverting to plain text date picker")}else{this.eDateInput.type="date"}}this.listener=e.onDateChanged;this.addGuiEventListener("input",this.listener)};t.prototype.getDate=function(){return l.Utils.parseYyyyMmDdToDate(this.eDateInput.value,"-")};t.prototype.setDate=function(e){this.eDateInput.value=l.Utils.serializeDateToYyyyMmDd(e,"-")};return t}(a.Component);t.DefaultDateComponent=p},function(e,t,i){"use strict";var r=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var n=i(8);var s=i(0);var l=i(2);var u=function(i){r(n,i);function n(e){var t=i.call(this,'<div class="ag-popup-editor" tabindex="-1"/>')||this;t.getGuiCalledOnChild=false;t.cellEditor=e;return t}n.prototype.onKeyDown=function(e){this.params.onKeyDown(e)};n.prototype.getGui=function(){if(!this.getGuiCalledOnChild){this.appendChild(this.cellEditor.getGui());this.getGuiCalledOnChild=true}return i.prototype.getGui.call(this)};n.prototype.init=function(e){var t=this;this.params=e;this.gridOptionsWrapper.setDomData(this.getGui(),n.DOM_KEY_POPUP_EDITOR_WRAPPER,true);this.addDestroyFunc(function(){if(t.cellEditor.destroy){t.cellEditor.destroy()}});this.addDestroyableEventListener(i.prototype.getGui.call(this),"keydown",this.onKeyDown.bind(this))};n.prototype.afterGuiAttached=function(){if(this.cellEditor.afterGuiAttached){this.cellEditor.afterGuiAttached()}};n.prototype.getValue=function(){return this.cellEditor.getValue()};n.prototype.isPopup=function(){return true};n.prototype.isCancelBeforeStart=function(){if(this.cellEditor.isCancelBeforeStart){return this.cellEditor.isCancelBeforeStart()}};n.prototype.isCancelAfterEnd=function(){if(this.cellEditor.isCancelAfterEnd){return this.cellEditor.isCancelAfterEnd()}};n.prototype.focusIn=function(){if(this.cellEditor.focusIn){this.cellEditor.focusIn()}};n.prototype.focusOut=function(){if(this.cellEditor.focusOut){this.cellEditor.focusOut()}};n.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper";o([s.Autowired("gridOptionsWrapper"),a("design:type",l.GridOptionsWrapper)],n.prototype,"gridOptionsWrapper",void 0);return n}(n.Component);t.PopupEditorWrapper=u},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(1);var o=i(8);var a=function(t){n(i,t);function i(){var e=t.call(this,i.TEMPLATE)||this;e.refreshCount=0;e.eCurrent=e.queryForHtmlElement(".ag-value-slide-current");return e}i.prototype.init=function(e){this.params=e;this.refresh(e)};i.prototype.addSlideAnimation=function(){var e=this;this.refreshCount++;var t=this.refreshCount;if(this.ePrevious){this.getGui().removeChild(this.ePrevious)}this.ePrevious=r.Utils.loadTemplate('<span class="ag-value-slide-previous ag-value-slide-out"></span>');this.ePrevious.innerHTML=this.eCurrent.innerHTML;this.getGui().insertBefore(this.ePrevious,this.eCurrent);setTimeout(function(){if(t!==e.refreshCount){return}r.Utils.addCssClass(e.ePrevious,"ag-value-slide-out-end")},50);setTimeout(function(){if(t!==e.refreshCount){return}e.getGui().removeChild(e.ePrevious);e.ePrevious=null},3e3)};i.prototype.refresh=function(e){var t=e.value;if(r.Utils.missing(t)){t=""}if(t===this.lastValue){return}this.addSlideAnimation();this.lastValue=t;if(r.Utils.exists(e.valueFormatted)){this.eCurrent.innerHTML=e.valueFormatted}else if(r.Utils.exists(e.value)){this.eCurrent.innerHTML=t}else{this.eCurrent.innerHTML=""}return true};i.TEMPLATE="<span>"+'<span class="ag-value-slide-current"></span>'+"</span>";return i}(o.Component);t.AnimateSlideCellRenderer=a},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var r=i(8);var s="&#65514;";var l="&#65516;";var o=function(t){n(i,t);function i(){var e=t.call(this,i.TEMPLATE)||this;e.refreshCount=0;return e}i.prototype.init=function(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value");this.eDelta=this.queryForHtmlElement(".ag-value-change-delta");this.refresh(e)};i.prototype.showDelta=function(e,t){var i=Math.abs(t);var n=e.formatValue(i);var r=a.Utils.exists(n)?n:i;var o=t>=0;if(o){this.eDelta.innerHTML=s+r}else{this.eDelta.innerHTML=l+r}a.Utils.addOrRemoveCssClass(this.eDelta,"ag-value-change-delta-up",o);a.Utils.addOrRemoveCssClass(this.eDelta,"ag-value-change-delta-down",!o)};i.prototype.setTimerToRemoveDelta=function(){var e=this;this.refreshCount++;var t=this.refreshCount;setTimeout(function(){if(t===e.refreshCount){e.hideDeltaValue()}},2e3)};i.prototype.hideDeltaValue=function(){a.Utils.removeCssClass(this.eValue,"ag-value-change-value-highlight");this.eDelta.innerHTML=""};i.prototype.refresh=function(e){var t=e.value;if(t===this.lastValue){return}if(a.Utils.exists(e.valueFormatted)){this.eValue.innerHTML=e.valueFormatted}else if(a.Utils.exists(e.value)){this.eValue.innerHTML=t}else{this.eValue.innerHTML=""}if(typeof t==="number"&&typeof this.lastValue==="number"){var i=t-this.lastValue;this.showDelta(e,i)}if(this.lastValue){a.Utils.addCssClass(this.eValue,"ag-value-change-value-highlight")}this.setTimerToRemoveDelta();this.lastValue=t;return true};i.TEMPLATE="<span>"+'<span class="ag-value-change-delta"></span>'+'<span class="ag-value-change-value"></span>'+"</span>";return i}(r.Component);t.AnimateShowChangeCellRenderer=o},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(2);var s=i(19);var l=i(3);var u=i(9);var c=i(1);var d=i(0);var f=i(8);var p=i(14);var h=i(56);var g=i(43);var v=i(65);var m=i(4);var y=i(10);var b=i(11);var _=i(44);var w=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.init=function(e){this.params=e;if(this.gridOptionsWrapper.isGroupIncludeTotalFooter()){this.assignBlankValueToGroupFooterCell(e)}var t=this.isEmbeddedRowMismatch();var i=e.value==null;this.cellIsBlank=t||i;if(this.cellIsBlank){return}this.setupDragOpenParents();this.addExpandAndContract();this.addCheckboxIfNeeded();this.addValueElement();this.setupIndent()};t.prototype.assignBlankValueToGroupFooterCell=function(e){if(!e.value&&e.node.level==-1){e.value=""}};t.prototype.isEmbeddedRowMismatch=function(){if(this.params.fullWidth&&this.gridOptionsWrapper.isEmbedFullWidthRows()){var e=this.params.pinned===y.Column.PINNED_LEFT;var t=this.params.pinned===y.Column.PINNED_RIGHT;var i=!e&&!t;if(this.gridOptionsWrapper.isEnableRtl()){if(this.columnController.isPinningLeft()){return!t}else{return!i}}else{if(this.columnController.isPinningLeft()){return!e}else{return!i}}}else{return false}};t.prototype.setIndent=function(){if(this.gridOptionsWrapper.isGroupHideOpenParents()){return}var e=this.params;var t=e.node;var i=t.uiLevel;var n=e.padding>=0;if(n){this.setPaddingDeprecatedWay(i,e.padding);return}if(this.indentClass){this.removeCssClass(this.indentClass)}this.indentClass="ag-row-group-indent-"+i;this.addCssClass(this.indentClass)};t.prototype.setPaddingDeprecatedWay=function(e,t){c.Utils.doOnce(function(){return console.warn("ag-Grid: since v14.2, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the ag-Grid documentation page for Themes, in particular the property $row-group-indent-size.")},"groupCellRenderer->doDeprecatedWay");var i=e*t;if(this.gridOptionsWrapper.isEnableRtl()){this.getGui().style.paddingRight=i+"px"}else{this.getGui().style.paddingLeft=i+"px"}};t.prototype.setupIndent=function(){var e=this.params.node;var t=this.params.suppressPadding;if(!t){this.addDestroyableEventListener(e,p.RowNode.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this));this.setIndent()}};t.prototype.addValueElement=function(){var e=this.params;var t=this.displayedGroup;if(t.footer){this.createFooterCell()}else if(t.hasChildren()||c.Utils.get(e.colDef,"cellRendererParams.innerRenderer",null)||c.Utils.get(e.colDef,"cellRendererParams.innerRendererFramework",null)){this.createGroupCell();if(t.hasChildren()){this.addChildCount()}}else{this.createLeafCell()}};t.prototype.createFooterCell=function(){var e;var t=this.params.footerValueGetter;if(t){var i=c.Utils.cloneObject(this.params);i.value=this.params.value;if(typeof t==="function"){e=t(i)}else if(typeof t==="string"){e=this.expressionService.evaluate(t,i)}else{console.warn("ag-Grid: footerValueGetter should be either a function or a string (expression)")}}else{e="Total "+this.params.value}this.eValue.innerHTML=e};t.prototype.createGroupCell=function(){var t=this;var e=this.params;var i=this.displayedGroup.rowGroupColumn;var n=i?i:e.column;var r=this.params.value;var o=n?this.valueFormatterService.formatValue(n,e.node,e.scope,r):null;e.valueFormatted=o;var a;if(e.fullWidth==true){a=this.cellRendererService.useFullWidthGroupRowInnerCellRenderer(this.eValue,e)}else{a=this.cellRendererService.useInnerCellRenderer(this.params.colDef.cellRendererParams,n.getColDef(),this.eValue,e)}if(a){a.then(function(e){t.innerCellRenderer=e})}};t.prototype.addChildCount=function(){if(this.params.suppressCount){return}this.addDestroyableEventListener(this.displayedGroup,p.RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this));this.updateChildCount()};t.prototype.updateChildCount=function(){var e=this.displayedGroup.allChildrenCount;this.eChildCount.innerHTML=e>=0?"("+e+")":""};t.prototype.createLeafCell=function(){if(c.Utils.exists(this.params.value)){this.eValue.innerHTML=this.params.valueFormatted?this.params.valueFormatted:this.params.value}};t.prototype.isUserWantsSelected=function(){var e=this.params.checkbox;if(typeof e==="function"){return e(this.params)}else{return e===true}};t.prototype.addCheckboxIfNeeded=function(){var e=this.displayedGroup;var t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){var i=new v.CheckboxSelectionComponent;this.context.wireBean(i);i.init({rowNode:e,column:this.params.column});this.eCheckbox.appendChild(i.getGui());this.addDestroyFunc(function(){return i.destroy()})}};t.prototype.addExpandAndContract=function(){var e=this.params;var t=e.eGridCell;var i=c.Utils.createIconNoSpan("groupExpanded",this.gridOptionsWrapper,null);var n=c.Utils.createIconNoSpan("groupContracted",this.gridOptionsWrapper,null);this.eExpanded.appendChild(i);this.eContracted.appendChild(n);this.addDestroyableEventListener(this.eExpanded,"click",this.onExpandClicked.bind(this));this.addDestroyableEventListener(this.eContracted,"click",this.onExpandClicked.bind(this));this.addDestroyableEventListener(t,"keydown",this.onKeyDown.bind(this));this.addDestroyableEventListener(e.node,p.RowNode.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this));this.showExpandAndContractIcons();this.addDestroyableEventListener(this.displayedGroup,p.RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.onAllChildrenCountChanged.bind(this));if(!this.gridOptionsWrapper.isEnableGroupEdit()&&this.isExpandable()&&!e.suppressDoubleClickExpand){this.addDestroyableEventListener(t,"dblclick",this.onCellDblClicked.bind(this))}};t.prototype.onAllChildrenCountChanged=function(){this.showExpandAndContractIcons();this.setIndent()};t.prototype.onKeyDown=function(e){if(c.Utils.isKeyPressed(e,u.Constants.KEY_ENTER)){var t=this.params.column.isCellEditable(this.params.node);if(t){return}e.preventDefault();this.onExpandOrContract()}};t.prototype.setupDragOpenParents=function(){var e=this.params.column;var t=this.params.node;if(!this.gridOptionsWrapper.isGroupHideOpenParents()){this.draggedFromHideOpenParents=false}else if(!t.hasChildren()){this.draggedFromHideOpenParents=true}else{var i=t.rowGroupColumn;this.draggedFromHideOpenParents=!e.isRowGroupDisplayed(i.getId())}if(this.draggedFromHideOpenParents){var n=t.parent;while(true){if(c.Utils.missing(n)){break}if(n.rowGroupColumn&&e.isRowGroupDisplayed(n.rowGroupColumn.getId())){this.displayedGroup=n;break}n=n.parent}}if(c.Utils.missing(this.displayedGroup)){this.displayedGroup=t}};t.prototype.onExpandClicked=function(e){if(c.Utils.isStopPropagationForAgGrid(e)){return}c.Utils.stopPropagationForAgGrid(e);this.onExpandOrContract()};t.prototype.onCellDblClicked=function(e){if(c.Utils.isStopPropagationForAgGrid(e)){return}var t=c.Utils.isElementInEventPath(this.eExpanded,e)||c.Utils.isElementInEventPath(this.eContracted,e);if(!t){this.onExpandOrContract()}};t.prototype.onExpandOrContract=function(){var e=this.displayedGroup;e.setExpanded(!e.expanded);if(this.gridOptionsWrapper.isGroupIncludeFooter()){this.params.api.redrawRows({rowNodes:[e]})}};t.prototype.isExpandable=function(){var e=this.params.node;var t=this.columnController.isPivotMode()&&e.leafGroup;return this.draggedFromHideOpenParents||e.isExpandable()&&!e.footer&&!t};t.prototype.showExpandAndContractIcons=function(){var e=this.params.node;if(this.isExpandable()){var t=this.draggedFromHideOpenParents?true:e.expanded;c.Utils.setVisible(this.eContracted,!t);c.Utils.setVisible(this.eExpanded,t)}else{c.Utils.setVisible(this.eExpanded,false);c.Utils.setVisible(this.eContracted,false)}var i=this.displayedGroup;var n=this.columnController.isPivotMode()&&i.leafGroup;var r=!i.isExpandable();var o=i.footer||r||n;this.addOrRemoveCssClass("ag-row-group-leaf-indent",o)};t.prototype.destroy=function(){e.prototype.destroy.call(this);if(this.innerCellRenderer&&this.innerCellRenderer.destroy){this.innerCellRenderer.destroy()}};t.prototype.refresh=function(){return false};t.TEMPLATE="<span>"+'<span class="ag-group-expanded" ref="eExpanded"></span>'+'<span class="ag-group-contracted" ref="eContracted"></span>'+'<span class="ag-group-checkbox" ref="eCheckbox"></span>'+'<span class="ag-group-value" ref="eValue"></span>'+'<span class="ag-group-child-count" ref="eChildCount"></span>'+"</span>";r([d.Autowired("gridOptionsWrapper"),o("design:type",a.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([d.Autowired("expressionService"),o("design:type",s.ExpressionService)],t.prototype,"expressionService",void 0);r([d.Autowired("eventService"),o("design:type",l.EventService)],t.prototype,"eventService",void 0);r([d.Autowired("cellRendererService"),o("design:type",h.CellRendererService)],t.prototype,"cellRendererService",void 0);r([d.Autowired("valueFormatterService"),o("design:type",g.ValueFormatterService)],t.prototype,"valueFormatterService",void 0);r([d.Autowired("context"),o("design:type",d.Context)],t.prototype,"context",void 0);r([d.Autowired("columnController"),o("design:type",m.ColumnController)],t.prototype,"columnController",void 0);r([d.Autowired("mouseEventService"),o("design:type",_.MouseEventService)],t.prototype,"mouseEventService",void 0);r([b.RefSelector("eExpanded"),o("design:type",HTMLElement)],t.prototype,"eExpanded",void 0);r([b.RefSelector("eContracted"),o("design:type",HTMLElement)],t.prototype,"eContracted",void 0);r([b.RefSelector("eCheckbox"),o("design:type",HTMLElement)],t.prototype,"eCheckbox",void 0);r([b.RefSelector("eValue"),o("design:type",HTMLElement)],t.prototype,"eValue",void 0);r([b.RefSelector("eChildCount"),o("design:type",HTMLElement)],t.prototype,"eChildCount",void 0);return t}(f.Component);t.GroupCellRenderer=w},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(19);var s=function(){function e(){}e.prototype.processAllCellClasses=function(e,t,i,n){this.processClassRules(e.cellClassRules,t,i,n);this.processStaticCellClasses(e,t,i)};e.prototype.processClassRules=function(e,t,i,n){if(typeof e==="object"&&e!==null){var r=Object.keys(e);for(var o=0;o<r.length;o++){var a=r[o];var s=e[a];var l=void 0;if(typeof s==="string"){l=this.expressionService.evaluate(s,t)}else if(typeof s==="function"){l=s(t)}if(l){i(a)}else if(n){n(a)}}}};e.prototype.processStaticCellClasses=function(e,t,i){var n=e.cellClass;if(n){var r=void 0;if(typeof e.cellClass==="function"){var o=e.cellClass;r=o(t)}else{r=e.cellClass}if(typeof r==="string"){i(r)}else if(Array.isArray(r)){r.forEach(function(e){i(e)})}}};n([o.Autowired("expressionService"),r("design:type",a.ExpressionService)],e.prototype,"expressionService",void 0);e=n([o.Bean("stylingService")],e);return e}();t.StylingService=s},function(e,t,i){"use strict";var r=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var n=i(13);var s=i(0);var l=i(45);var u=function(n){r(e,n);function e(e,t){var i=n.call(this)||this;i.columns=e;i.addMouseHoverListeners(t);return i}e.prototype.addMouseHoverListeners=function(e){this.addDestroyableEventListener(e,"mouseout",this.onMouseOut.bind(this));this.addDestroyableEventListener(e,"mouseover",this.onMouseOver.bind(this))};e.prototype.onMouseOut=function(){this.columnHoverService.clearMouseOver()};e.prototype.onMouseOver=function(){this.columnHoverService.setMouseOver(this.columns)};o([s.Autowired("columnHoverService"),a("design:type",l.ColumnHoverService)],e.prototype,"columnHoverService",void 0);return e}(n.BeanStub);t.HoverFeature=u},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(1);var l=i(9);var u=i(0);var c=i(2);var d=i(43);var f=function(t){n(e,t);function e(){var e=t.call(this,'<div class="ag-cell-edit-input"><select class="ag-cell-edit-input"/></div>')||this;e.eSelect=e.getGui().querySelector("select");return e}e.prototype.init=function(r){var o=this;this.focusAfterAttached=r.cellStartedEdit;if(s.Utils.missing(r.values)){console.log("ag-Grid: no values found for select cellEditor");return}r.values.forEach(function(e){var t=document.createElement("option");t.value=e;var i=o.valueFormatterService.formatValue(r.column,null,null,e);var n=i!==null&&i!==undefined;t.text=n?i:e;if(r.value===e){t.selected=true}o.eSelect.appendChild(t)});if(!this.gridOptionsWrapper.isFullRowEdit()){this.addDestroyableEventListener(this.eSelect,"change",function(){return r.stopEditing()})}this.addDestroyableEventListener(this.eSelect,"keydown",function(e){var t=e.keyCode===l.Constants.KEY_UP||e.keyCode===l.Constants.KEY_DOWN;if(t){e.stopPropagation()}});this.addDestroyableEventListener(this.eSelect,"mousedown",function(e){e.stopPropagation()})};e.prototype.afterGuiAttached=function(){if(this.focusAfterAttached){this.eSelect.focus()}};e.prototype.focusIn=function(){this.eSelect.focus()};e.prototype.getValue=function(){return this.eSelect.value};r([u.Autowired("gridOptionsWrapper"),o("design:type",c.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);r([u.Autowired("valueFormatterService"),o("design:type",d.ValueFormatterService)],e.prototype,"valueFormatterService",void 0);return e}(a.Component);t.SelectCellEditor=f},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(77);var s=i(1);var l=function(){function e(){}e.prototype.adaptFunction=function(e,t,i,n){if(t==null)return{component:null,type:i,source:n,dynamicParams:null};var r=this.componentMetadataProvider.retrieve(e);if(r&&r.functionAdapter){return{type:i,component:r.functionAdapter(t),source:n,dynamicParams:null}}return null};e.prototype.adaptCellRendererFunction=function(i){var e=function(){function e(){}e.prototype.refresh=function(e){return false};e.prototype.getGui=function(){var e=i(this.params);var t=typeof e;if(t==="string"||t==="number"||t==="boolean"){return s._.loadTemplate("<span>"+e+"</span>")}else{return e}};e.prototype.init=function(e){this.params=e};return e}();return e};e.prototype.doesImplementIComponent=function(e){if(!e)return false;return e.prototype&&"getGui"in e.prototype};n([o.Autowired("componentMetadataProvider"),r("design:type",a.ComponentMetadataProvider)],e.prototype,"componentMetadataProvider",void 0);e=n([o.Bean("agComponentUtils")],e);return e}();t.AgComponentUtils=l},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(76);var s=function(){function e(){}e.prototype.postConstruct=function(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},headerComponent:{mandatoryMethodList:[],optionalMethodList:[]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached"]},floatingFilterWrapperComponent:{mandatoryMethodList:[],optionalMethodList:[]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},pinnedRowCellRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowInnerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","afterGuiAttached"]},filterComponent:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","afterGuiAttached"]}}};e.prototype.retrieve=function(e){return this.componentMetaData[e]};n([o.Autowired("agComponentUtils"),r("design:type",a.AgComponentUtils)],e.prototype,"agComponentUtils",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);e=n([o.Bean("componentMetadataProvider")],e);return e}();t.ComponentMetadataProvider=s},function(L,e,t){"use strict";var i=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(e,"__esModule",{value:true});var s=t(1);var o=t(129);var a=t(2);var l=t(4);var u=t(7);var c=t(20);var d=t(0);var f=t(3);var p=t(5);var h=t(40);var g=t(9);var v=t(17);var m=t(47);var y=t(44);var b=t(22);var _=t(36);var w=t(130);var C=t(29);var A=t(69);var E=t(58);var x=t(30);var T=t(6);var S=t(37);var D=t(50);var k=t(97);var O=t(16);var R=t(46);var N=t(21);var I=t(15);var P=t(131);var F=t(57);var G=t(8);var $=t(79);var W=t(53);var H=t(39);var j=t(28);var M=t(11);var B=t(80);var V='<div class="ag-root ag-font-style" role="grid">\n        <ag-header-root ref="headerRoot"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <div class="ag-pinned-left-floating-top" ref="eLeftTop" role="presentation"></div>\n            <div class="ag-floating-top-viewport" ref="eTopViewport" role="presentation">\n                <div class="ag-floating-top-container" ref="eTopContainer" role="presentation"></div>\n            </div>\n            <div class="ag-pinned-right-floating-top" ref="eRightTop" role="presentation"></div>\n            <div class="ag-floating-top-full-width-container" ref="eTopFullWidthContainer" role="presentation"></div>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-pinned-left-cols-viewport-wrapper" ref="eLeftViewportWrapper" role="presentation">\n                <div class="ag-pinned-left-cols-viewport" ref="eLeftViewport" role="presentation">\n                    <div class="ag-pinned-left-cols-container" ref="eLeftContainer" role="presentation"></div>\n                </div>\n            </div>\n            <div class="ag-body-viewport-wrapper" role="presentation">\n                <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                    <div class="ag-body-container" ref="eBodyContainer" role="presentation"></div>\n                </div>\n            </div>\n            <div class="ag-pinned-right-cols-viewport-wrapper" ref="eRightViewportWrapper" role="presentation">\n                <div class="ag-pinned-right-cols-viewport" ref="eRightViewport" role="presentation">\n                    <div class="ag-pinned-right-cols-container" ref="eRightContainer" role="presentation"></div>\n                </div>\n            </div>\n            <div class="ag-full-width-viewport-wrapper" ref="eFullWidthViewportWrapper" role="presentation">\n                <div class="ag-full-width-viewport" ref="eFullWidthViewport" role="presentation">\n                    <div class="ag-full-width-container" ref="eFullWidthContainer" role="presentation"></div>\n                </div>\n            </div>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <div class="ag-pinned-left-floating-bottom" ref="eLeftBottom" role="presentation"></div>\n            <div class="ag-floating-bottom-viewport" ref="eBottomViewport" role="presentation">\n                <div class="ag-floating-bottom-container" ref="eBottomContainer" role="presentation"></div>\n            </div>\n            <div class="ag-pinned-right-floating-bottom" ref="eRightBottom" role="presentation"></div>\n            <div class="ag-floating-bottom-full-width-container" ref="eBottomFullWidthContainer" role="presentation"></div>\n        </div>\n        <div class="ag-overlay" ref="eOverlay"></div>\n    </div>';var z=function(t){i(e,t);function e(){var e=t.call(this,V)||this;e.scrollLeft=-1;e.nextScrollLeft=-1;e.scrollTop=-1;e.nextScrollTop=-1;e.verticalRedrawNeeded=false;return e}e.prototype.getVScrollPosition=function(){var e={top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight};return e};e.prototype.getHScrollPosition=function(){var e={left:this.eBodyViewport.scrollLeft,right:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetWidth};return e};e.prototype.destroy=function(){t.prototype.destroy.call(this)};e.prototype.onRowDataChanged=function(){this.showOrHideOverlay()};e.prototype.showOrHideOverlay=function(){if(this.paginationProxy.isEmpty()&&!this.gridOptionsWrapper.isSuppressNoRowsOverlay()){this.showNoRowsOverlay()}else{this.hideOverlay()}};e.prototype.onNewColumnsLoaded=function(){if(this.columnController.isReady()&&!this.paginationProxy.isEmpty()){this.hideOverlay()}};e.prototype.init=function(){this.instantiate(this.context);this.scrollWidth=this.gridOptionsWrapper.getScrollbarWidth();this.enableRtl=this.gridOptionsWrapper.isEnableRtl();this.useAnimationFrame=!this.gridOptionsWrapper.isSuppressAnimationFrame();this.scrollClipWidth=this.scrollWidth>0?this.scrollWidth:20;this.suppressScrollOnFloatingRow();this.setupRowAnimationCssClass();this.buildRowContainerComponents();this.addEventListeners();this.addDragListeners();this.addScrollListener();if(this.gridOptionsWrapper.isSuppressHorizontalScroll()){this.eBodyViewport.style.overflowX="hidden"}this.setupOverlay();if(this.gridOptionsWrapper.isRowModelDefault()&&!this.gridOptionsWrapper.getRowData()){this.showLoadingOverlay()}this.setPinnedContainersVisible();this.setBodyAndHeaderHeights();this.disableBrowserDragging();this.addShortcutKeyListeners();this.addMouseListeners();this.addKeyboardEvents();this.addBodyViewportListener();this.addStopEditingWhenGridLosesFocus();this.mockContextMenuForIPad();this.addRowDragListener();if(this.$scope){this.addAngularApplyCheck()}this.onDisplayedColumnsWidthChanged();this.gridApi.registerGridComp(this);this.alignedGridsService.registerGridComp(this);this.headerRootComp.registerGridComp(this);this.animationFrameService.registerGridComp(this);this.navigationService.registerGridComp(this);this.heightScaler.registerGridComp(this);this.autoHeightCalculator.registerGridComp(this);this.columnAnimationService.registerGridComp(this);this.autoWidthCalculator.registerGridComp(this);this.paginationAutoPageSizeService.registerGridComp(this);this.beans.registerGridComp(this);this.rowRenderer.registerGridComp(this);if(this.rangeController){this.rangeController.registerGridComp(this)}var e=o.observeResize(this.eBodyViewport,this.checkViewportAndScrolls.bind(this));this.addDestroyFunc(function(){return e()})};e.prototype.setColumnMovingCss=function(e){this.addOrRemoveCssClass("ag-column-moving",e)};e.prototype.setupOverlay=function(){this.overlayWrapper=this.componentRecipes.newOverlayWrapperComponent();this.eOverlay=this.queryForHtmlElement('[ref="eOverlay"]');this.overlayWrapper.hideOverlay(this.eOverlay)};e.prototype.addRowDragListener=function(){var e=new P.RowDragFeature(this.eBody,this);this.context.wireBean(e);this.dragAndDropService.addDropTarget(e)};e.prototype.addStopEditingWhenGridLosesFocus=function(){var a=this;if(this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()){this.addDestroyableEventListener(this.eBody,"focusout",function(e){var t=e.relatedTarget;var i=false;var n=t;while(s.Utils.exists(n)&&!i){var r=!!a.gridOptionsWrapper.getDomData(n,A.PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER);var o=a.eBody==n;i=r||o;n=n.parentNode}if(!i){a.rowRenderer.stopEditing()}})}};e.prototype.addAngularApplyCheck=function(){var e=this;var t=false;var i=function(){if(t){return}t=true;setTimeout(function(){t=false;e.$scope.$apply()},0)};this.addDestroyableEventListener(this.eventService,p.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,i);this.addDestroyableEventListener(this.eventService,p.Events.EVENT_VIRTUAL_COLUMNS_CHANGED,i)};e.prototype.disableBrowserDragging=function(){this.getGui().addEventListener("dragstart",function(e){if(e.target instanceof HTMLImageElement){e.preventDefault();return false}})};e.prototype.addEventListeners=function(){this.addDestroyableEventListener(this.eventService,p.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this));this.addDestroyableEventListener(this.eventService,p.Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this));this.addDestroyableEventListener(this.eventService,p.Events.EVENT_PINNED_ROW_DATA_CHANGED,this.setBodyAndHeaderHeights.bind(this));this.addDestroyableEventListener(this.eventService,p.Events.EVENT_ROW_DATA_CHANGED,this.onRowDataChanged.bind(this));this.addDestroyableEventListener(this.eventService,p.Events.EVENT_ROW_DATA_UPDATED,this.onRowDataChanged.bind(this));this.addDestroyableEventListener(this.eventService,p.Events.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,a.GridOptionsWrapper.PROP_HEADER_HEIGHT,this.setBodyAndHeaderHeights.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,a.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT,this.setBodyAndHeaderHeights.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,a.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT,this.setBodyAndHeaderHeights.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,a.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.setBodyAndHeaderHeights.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,a.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT,this.setBodyAndHeaderHeights.bind(this))};e.prototype.addDragListeners=function(){var i=this;if(!this.gridOptionsWrapper.isEnableRangeSelection()||s.Utils.missing(this.rangeController)){return}var e=[this.eLeftContainer,this.eRightContainer,this.eBodyContainer,this.eTop,this.eBottom];e.forEach(function(e){var t={eElement:e,onDragStart:i.rangeController.onDragStart.bind(i.rangeController),onDragStop:i.rangeController.onDragStop.bind(i.rangeController),onDragging:i.rangeController.onDragging.bind(i.rangeController),skipMouseEvent:function(e){return e.shiftKey}};i.dragService.addDragSource(t);i.addDestroyFunc(function(){return i.dragService.removeDragSource(t)})})};e.prototype.addMouseListeners=function(){var n=this;var e=["click","mousedown","dblclick","contextmenu","mouseover","mouseout"];e.forEach(function(t){var i=n.processMouseEvent.bind(n,t);n.eAllCellContainers.forEach(function(e){return n.addDestroyableEventListener(e,t,i)})})};e.prototype.addKeyboardEvents=function(){var n=this;var e=["keydown","keypress"];e.forEach(function(t){var i=n.processKeyboardEvent.bind(n,t);n.eAllCellContainers.forEach(function(e){n.addDestroyableEventListener(e,t,i)})})};e.prototype.addBodyViewportListener=function(){var i=this;var e=function(e){var t=s.Utils.getTarget(e);if(t===i.eBodyViewport||t===i.eLeftViewport||t===i.eRightViewport){i.onContextMenu(e,null,null,null,null);i.preventDefaultOnContextMenu(e)}};this.addDestroyableEventListener(this.eBodyViewport,"contextmenu",e);this.addDestroyableEventListener(this.eRightViewport,"contextmenu",e);this.addDestroyableEventListener(this.eLeftViewport,"contextmenu",e)};e.prototype.getBodyClientRect=function(){if(this.eBody){return this.eBody.getBoundingClientRect()}};e.prototype.getRowForEvent=function(e){var t=s.Utils.getTarget(e);while(t){var i=this.gridOptionsWrapper.getDomData(t,D.RowComp.DOM_DATA_KEY_RENDERED_ROW);if(i){return i}t=t.parentElement}return null};e.prototype.processKeyboardEvent=function(e,t){var i=this.mouseEventService.getRenderedCellForEvent(t);if(!i){return}switch(e){case"keydown":var n=this.navigationService.handlePageScrollingKey(t);if(!n){i.onKeyDown(t)}break;case"keypress":i.onKeyPress(t);break}};e.prototype.scrollToTop=function(){this.eBodyViewport.scrollTop=0};e.prototype.processMouseEvent=function(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)){return}if(s.Utils.isStopPropagationForAgGrid(t)){return}var i=this.getRowForEvent(t);var n=this.mouseEventService.getRenderedCellForEvent(t);if(e==="contextmenu"){this.handleContextMenuMouseEvent(t,null,i,n)}else{if(n){n.onMouseEvent(e,t)}if(i){i.onMouseEvent(e,t)}}this.preventDefaultOnContextMenu(t)};e.prototype.mockContextMenuForIPad=function(){var n=this;if(!s.Utils.isUserAgentIPad()){return}this.eAllCellContainers.forEach(function(e){var t=new R.TouchListener(e);var i=function(e){var t=n.getRowForEvent(e.touchEvent);var i=n.mouseEventService.getRenderedCellForEvent(e.touchEvent);n.handleContextMenuMouseEvent(null,e.touchEvent,t,i)};n.addDestroyableEventListener(t,R.TouchListener.EVENT_LONG_TAP,i);n.addDestroyFunc(function(){return t.destroy()})})};e.prototype.handleContextMenuMouseEvent=function(e,t,i,n){var r=i?i.getRowNode():null;var o=n?n.getColumn():null;var a=null;if(o){var s=e?e:t;n.dispatchCellContextMenuEvent(s);a=this.valueService.getValue(o,r)}this.onContextMenu(e,t,r,o,a)};e.prototype.onContextMenu=function(e,t,i,n,r){if(!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()){if(e&&(e.ctrlKey||e.metaKey)){return}}if(this.contextMenuFactory&&!this.gridOptionsWrapper.isSuppressContextMenu()){var o=e?e:t.touches[0];this.contextMenuFactory.showMenu(i,n,r,o);var a=e?e:t;a.preventDefault()}};e.prototype.preventDefaultOnContextMenu=function(e){if(this.gridOptionsWrapper.isSuppressMiddleClickScrolls()&&e.which===2){e.preventDefault()}};e.prototype.addShortcutKeyListeners=function(){var i=this;this.eAllCellContainers.forEach(function(e){e.addEventListener("keydown",function(e){var t=i.mouseEventService.getRenderedCellForEvent(e);if(t&&t.isEditing()){return}if(!i.mouseEventService.isEventFromThisGrid(e)){return}if(e.ctrlKey||e.metaKey){switch(e.which){case g.Constants.KEY_A:return i.onCtrlAndA(e);case g.Constants.KEY_C:return i.onCtrlAndC(e);case g.Constants.KEY_V:return i.onCtrlAndV(e);case g.Constants.KEY_D:return i.onCtrlAndD(e)}}})})};e.prototype.onCtrlAndA=function(e){if(this.rangeController&&this.paginationProxy.isRowsToRender()){var t=void 0;var i=void 0;var n=void 0;if(this.pinnedRowModel.isEmpty(g.Constants.PINNED_TOP)){i=null}else{i=g.Constants.PINNED_TOP}if(this.pinnedRowModel.isEmpty(g.Constants.PINNED_BOTTOM)){n=null;t=this.paginationProxy.getTotalRowCount()-1}else{n=g.Constants.PINNED_BOTTOM;t=this.pinnedRowModel.getPinnedBottomRowData().length-1}var r=this.columnController.getAllDisplayedColumns();if(s.Utils.missingOrEmpty(r)){return}this.rangeController.setRange({rowStart:0,floatingStart:i,rowEnd:t,floatingEnd:n,columnStart:r[0],columnEnd:r[r.length-1]})}e.preventDefault();return false};e.prototype.onCtrlAndC=function(e){if(!this.clipboardService){return}var t=this.focusedCellController.getFocusedCell();this.clipboardService.copyToClipboard();e.preventDefault();if(t){this.focusedCellController.setFocusedCell(t.rowIndex,t.column,t.floating,true)}return false};e.prototype.onCtrlAndV=function(e){if(!this.enterprise){return}if(this.gridOptionsWrapper.isSuppressClipboardPaste()){return}this.clipboardService.pasteFromClipboard();return false};e.prototype.onCtrlAndD=function(e){if(!this.enterprise){return}this.clipboardService.copyRangeDown();e.preventDefault();return false};e.prototype.ensureIndexVisible=function(e,t){if(this.gridOptionsWrapper.isGridAutoHeight()){return}var i=this.paginationProxy.getTotalRowCount();if(typeof e!=="number"||e<0||e>=i){console.warn("invalid row index for ensureIndexVisible: "+e);return}this.paginationProxy.goToPageWithIndex(e);var n=this.paginationProxy.getRow(e);var r=this.paginationProxy.getPixelOffset();var o=n.rowTop-r;var a=o+n.rowHeight;var s=this.getVScrollPosition();var l=this.heightScaler.getOffset();var u=s.top+l;var c=s.bottom+l;if(this.isHorizontalScrollShowing()){c-=this.scrollWidth}var d=c-u;var f=null;var p=this.heightScaler.getScrollPositionForPixel(o);var h=this.heightScaler.getScrollPositionForPixel(a-d);var g=(p+h)/2;if(g>o){g=o}var v=u>o;var m=c<a;if(t==="top"){f=p}else if(t==="bottom"){f=h}else if(t==="middle"){f=g}else if(v){f=p}else if(m){f=h}if(f!==null){this.eBodyViewport.scrollTop=f;this.rowRenderer.redrawAfterScroll()}};e.prototype.getCenterWidth=function(){return this.eBodyViewport.clientWidth};e.prototype.isHorizontalScrollShowing=function(){return s.Utils.isHorizontalScrollShowing(this.eBodyViewport)};e.prototype.isVerticalScrollShowing=function(){return s.Utils.isVerticalScrollShowing(this.eBodyViewport)};e.prototype.checkViewportAndScrolls=function(){this.updateScrollVisibleService();this.checkBodyHeight();this.onHorizontalViewportChanged();this.setPinnedLeftWidth();this.setPinnedRightWidth();this.setBottomPaddingOnPinned();this.hideVerticalScrollOnCenter();this.hideFullWidthViewportScrollbars()};e.prototype.updateScrollVisibleService=function(){var e={bodyHorizontalScrollShowing:false,leftVerticalScrollShowing:false,rightVerticalScrollShowing:false};if(this.enableRtl&&this.columnController.isPinningLeft()){e.leftVerticalScrollShowing=s.Utils.isVerticalScrollShowing(this.eLeftViewport)}if(!this.enableRtl&&this.columnController.isPinningRight()){e.rightVerticalScrollShowing=s.Utils.isVerticalScrollShowing(this.eRightViewport)}e.bodyHorizontalScrollShowing=this.isHorizontalScrollShowing();this.scrollVisibleService.setScrollsVisible(e)};e.prototype.setBottomPaddingOnPinned=function(){if(this.scrollWidth<=0){return}if(this.isHorizontalScrollShowing()){this.eRightContainer.style.marginBottom=this.scrollWidth+"px";this.eLeftContainer.style.marginBottom=this.scrollWidth+"px"}else{this.eRightContainer.style.marginBottom="";this.eLeftContainer.style.marginBottom=""}};e.prototype.hideFullWidthViewportScrollbars=function(){var e=this.scrollClipWidth>0?this.scrollWidth+"px":"";this.eFullWidthViewportWrapper.style.paddingBottom=this.isHorizontalScrollShowing()?e:"";var t=this.isVerticalScrollShowing();if(this.enableRtl){this.eFullWidthViewportWrapper.style.marginLeft=t?e:"";this.eFullWidthViewport.style.marginLeft=t?"-"+e:""}else{this.eFullWidthViewportWrapper.style.width=t?"calc(100% - "+e+")":"";this.eFullWidthViewport.style.width=t?"calc(100% + "+e+")":""}};e.prototype.ensureColumnVisible=function(e){var t=this.columnController.getGridColumn(e);if(!t){return}if(t.isPinned()){console.warn("calling ensureIndexVisible on a "+t.getPinned()+" pinned column doesn't make sense for column "+t.getColId());return}if(!this.columnController.isColumnDisplayed(t)){console.warn("column is not currently visible");return}var i=t.getLeft();var n=i+t.getActualWidth();var r=this.eBodyViewport.clientWidth;var o=this.getBodyViewportScrollLeft();var a=this.columnController.getBodyContainerWidth();var s;var l;if(this.enableRtl){s=a-o-r;l=a-o}else{s=o;l=r+o}var u=s>i;var c=l<n;var d=r<t.getActualWidth();var f=u||d;var p=c;if(f){if(this.enableRtl){var h=a-r-i;this.setBodyViewportScrollLeft(h)}else{this.setBodyViewportScrollLeft(i)}}else if(p){if(this.enableRtl){var h=a-n;this.setBodyViewportScrollLeft(h)}else{var h=n-r;this.setBodyViewportScrollLeft(h)}}else{}this.onHorizontalViewportChanged()};e.prototype.showLoadingOverlay=function(){this.overlayWrapper.showLoadingOverlay(this.eOverlay)};e.prototype.showNoRowsOverlay=function(){this.overlayWrapper.showNoRowsOverlay(this.eOverlay)};e.prototype.hideOverlay=function(){this.overlayWrapper.hideOverlay(this.eOverlay)};e.prototype.getWidthForSizeColsToFit=function(){var e=this.eBody.clientWidth;var t=this.isVerticalScrollShowing();if(t){e-=this.scrollWidth}return e};e.prototype.sizeColumnsToFit=function(e){var t=this;var i=this.getWidthForSizeColsToFit();if(i>0){this.columnController.sizeColumnsToFit(i,"sizeColumnsToFit")}else{if(e===undefined){setTimeout(function(){t.sizeColumnsToFit(100)},0)}else if(e===100){setTimeout(function(){t.sizeColumnsToFit(500)},100)}else if(e===500){setTimeout(function(){t.sizeColumnsToFit(-1)},500)}else{console.log("ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with "+"zero width, maybe the grid is not visible yet on the screen?")}}};e.prototype.getBodyContainer=function(){return this.eBodyContainer};e.prototype.getDropTargetBodyContainers=function(){return[this.eBodyViewport,this.eTopViewport,this.eBottomViewport]};e.prototype.getDropTargetLeftContainers=function(){return[this.eLeftViewport,this.eLeftBottom,this.eLeftTop]};e.prototype.getDropTargetRightContainers=function(){return[this.eRightViewport,this.eRightBottom,this.eRightTop]};e.prototype.buildRowContainerComponents=function(){var i=this;this.eAllCellContainers=[this.eLeftContainer,this.eRightContainer,this.eBodyContainer,this.eTop,this.eBottom,this.eFullWidthContainer];this.rowContainerComponents={body:new w.RowContainerComponent({eContainer:this.eBodyContainer,eViewport:this.eBodyViewport}),fullWidth:new w.RowContainerComponent({eContainer:this.eFullWidthContainer,hideWhenNoChildren:true,eViewport:this.eFullWidthViewport}),pinnedLeft:new w.RowContainerComponent({eContainer:this.eLeftContainer,eViewport:this.eLeftViewport}),pinnedRight:new w.RowContainerComponent({eContainer:this.eRightContainer,eViewport:this.eRightViewport}),floatingTop:new w.RowContainerComponent({eContainer:this.eTopContainer}),floatingTopPinnedLeft:new w.RowContainerComponent({eContainer:this.eLeftTop}),floatingTopPinnedRight:new w.RowContainerComponent({eContainer:this.eRightTop}),floatingTopFullWidth:new w.RowContainerComponent({eContainer:this.eTopFullWidthContainer,hideWhenNoChildren:true}),floatingBottom:new w.RowContainerComponent({eContainer:this.eBottomContainer}),floatingBottomPinnedLeft:new w.RowContainerComponent({eContainer:this.eLeftBottom}),floatingBottomPinnedRight:new w.RowContainerComponent({eContainer:this.eRightBottom}),floatingBottomFullWith:new w.RowContainerComponent({eContainer:this.eBottomFullWidthContainer,hideWhenNoChildren:true})};s.Utils.iterateObject(this.rowContainerComponents,function(e,t){if(t){i.context.wireBean(t)}})};e.prototype.setupRowAnimationCssClass=function(){var t=this;var e=function(){var e=t.gridOptionsWrapper.isAnimateRows()&&!t.heightScaler.isScaling();s.Utils.addOrRemoveCssClass(t.eBody,"ag-row-animation",e);s.Utils.addOrRemoveCssClass(t.eBody,"ag-row-no-animation",!e)};e();this.addDestroyableEventListener(this.eventService,p.Events.EVENT_HEIGHT_SCALE_CHANGED,e)};e.prototype.suppressScrollOnFloatingRow=function(){var e=this;var t=function(){return e.eTopViewport.scrollLeft=0};var i=function(){return e.eTopViewport.scrollLeft=0};this.addDestroyableEventListener(this.eTopViewport,"scroll",t);this.addDestroyableEventListener(this.eBottomViewport,"scroll",i)};e.prototype.getRowContainers=function(){return this.rowContainerComponents};e.prototype.onDisplayedColumnsChanged=function(){this.setPinnedContainersVisible();this.setBodyAndHeaderHeights();this.onHorizontalViewportChanged()};e.prototype.onDisplayedColumnsWidthChanged=function(){this.setWidthsOfContainers();this.onHorizontalViewportChanged();if(this.enableRtl){this.horizontallyScrollHeaderCenterAndFloatingCenter()}};e.prototype.setWidthsOfContainers=function(){this.setCenterWidth();this.setPinnedLeftWidth();this.setPinnedRightWidth()};e.prototype.setCenterWidth=function(){var e=this.columnController.getBodyContainerWidth()+"px";this.eBodyContainer.style.width=e;this.eBottomContainer.style.width=e;this.eTopContainer.style.width=e};e.prototype.setPinnedLeftWidth=function(){var e=this.columnController.getPinnedLeftContainerWidth();var t=e+this.scrollWidth;var i=e+this.scrollClipWidth;var n;var r;if(s.Utils.isVerticalScrollShowing(this.eLeftViewport)){if(this.enableRtl){n=t;r=t}else{n=i;r=e}}else{n=e;r=e}this.setElementWidth(this.eLeftViewportWrapper,r);this.setElementWidth(this.eLeftViewport,n);this.setElementWidth(this.eLeftContainer,e);this.setElementWidth(this.eLeftBottom,r);this.setElementWidth(this.eLeftTop,r)};e.prototype.setPinnedRightWidth=function(){var e=this.columnController.getPinnedRightContainerWidth();var t=e+this.scrollWidth;var i=e+this.scrollClipWidth;var n;var r;if(s.Utils.isVerticalScrollShowing(this.eRightViewport)){if(!this.enableRtl){n=t;r=t}else{n=i;r=e}}else{n=e;r=e}this.setElementWidth(this.eRightViewportWrapper,r);this.setElementWidth(this.eRightViewport,n);this.setElementWidth(this.eRightContainer,e);this.setElementWidth(this.eRightBottom,r);this.setElementWidth(this.eRightTop,r)};e.prototype.setElementWidth=function(e,t){e.style.width=t+"px";e.style.minWidth=t+"px"};e.prototype.setPinnedContainersVisible=function(){var e=false;var t=this.columnController.isPinningLeft();if(t!==this.pinningLeft){this.pinningLeft=t;this.headerRootComp.setLeftVisible(t);s.Utils.setVisible(this.eLeftViewportWrapper,t);e=true;if(t){this.eLeftViewport.scrollTop=this.eBodyViewport.scrollTop}}var i=this.columnController.isPinningRight();if(i!==this.pinningRight){this.pinningRight=i;this.headerRootComp.setRightVisible(i);s.Utils.setVisible(this.eRightViewportWrapper,i);if(i){this.eRightViewport.scrollTop=this.eBodyViewport.scrollTop}e=true}if(e){this.hideVerticalScrollOnCenter();this.setPinnedLeftWidth();this.setPinnedRightWidth()}};e.prototype.hideVerticalScrollOnCenter=function(){var e=this.enableRtl?this.columnController.isPinningLeft():this.columnController.isPinningRight();var t=s.Utils.isVerticalScrollShowing(this.eBodyViewport);var i=e&&t;var n=i?"-"+this.scrollClipWidth+"px":"";if(this.enableRtl){this.eBodyViewport.style.marginLeft=n}else{this.eBodyViewport.style.marginRight=n}};e.prototype.checkBodyHeight=function(){var e=this.eBody.clientHeight;if(this.bodyHeight!==e){this.bodyHeight=e;var t={type:p.Events.EVENT_BODY_HEIGHT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)}};e.prototype.setBodyAndHeaderHeights=function(){var e=this.columnController.getHeaderRowCount();var t;var i=0;var n;var r;if(!this.columnController.isPivotMode()){if(this.gridOptionsWrapper.isFloatingFilter()){e++}i=this.gridOptionsWrapper.isFloatingFilter()?1:0;n=this.gridOptionsWrapper.getGroupHeaderHeight();r=this.gridOptionsWrapper.getHeaderHeight()}else{i=0;n=this.gridOptionsWrapper.getPivotGroupHeaderHeight();r=this.gridOptionsWrapper.getPivotHeaderHeight()}var o=1+i;var a=e-o;t=i*this.gridOptionsWrapper.getFloatingFiltersHeight();t+=a*n;t+=r;this.headerRootComp.setHeight(t);var s=this.pinnedRowModel.getPinnedTopTotalHeight();var l=this.pinnedRowModel.getPinnedBottomTotalHeight();this.eTop.style.minHeight=s+"px";this.eTop.style.height=s+"px";this.eBottom.style.minHeight=l+"px";this.eBottom.style.height=l+"px";this.checkBodyHeight()};e.prototype.getBodyHeight=function(){return this.bodyHeight};e.prototype.setHorizontalScrollPosition=function(e){this.eBodyViewport.scrollLeft=e;if(this.nextScrollLeft!==e){this.nextScrollLeft=e;this.doHorizontalScroll()}};e.prototype.setVerticalScrollPosition=function(e){this.eBodyViewport.scrollTop=e};e.prototype.scrollHorizontally=function(e){var t=this.eBodyViewport.scrollLeft;this.setHorizontalScrollPosition(t+e);var i=this.eBodyViewport.scrollLeft;return i-t};e.prototype.scrollVertically=function(e){var t=this.eBodyViewport.scrollTop;this.setVerticalScrollPosition(t+e);var i=this.eBodyViewport.scrollTop;return i-t};e.prototype.addScrollListener=function(){var e=this;this.addDestroyableEventListener(this.eBodyViewport,"scroll",function(){e.onBodyHorizontalScroll();e.onAnyBodyScroll(e.eBodyViewport)});this.addDestroyableEventListener(this.eRightViewport,"scroll",this.onAnyBodyScroll.bind(this,this.eRightViewport));this.addDestroyableEventListener(this.eLeftViewport,"scroll",this.onAnyBodyScroll.bind(this,this.eLeftViewport));this.addDestroyableEventListener(this.eFullWidthViewport,"scroll",this.onAnyBodyScroll.bind(this,this.eFullWidthViewport))};e.prototype.onAnyBodyScroll=function(e){var t=(new Date).getTime();var i=t-this.lastVScrollTime;var n=e!==this.lastVScrollElement&&i<500;if(n){return}this.lastVScrollElement=e;this.lastVScrollTime=t;var r=e.scrollTop;if(this.useAnimationFrame){if(this.nextScrollTop!==r){this.nextScrollTop=r;this.animationFrameService.schedule()}}else{if(r!==this.scrollTop){this.scrollTop=r;this.synchroniseVerticalScrollPositions(r);this.redrawRowsAfterScroll()}}};e.prototype.onBodyHorizontalScroll=function(){var e=this.eBodyViewport.scrollLeft;if(this.nextScrollLeft!==e){this.nextScrollLeft=e;if(this.useAnimationFrame){this.animationFrameService.schedule()}else{this.doHorizontalScroll()}}};e.prototype.doHorizontalScroll=function(){this.scrollLeft=this.nextScrollLeft;var e={type:p.Events.EVENT_BODY_SCROLL,api:this.gridApi,columnApi:this.columnApi,direction:"horizontal",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(e);this.horizontallyScrollHeaderCenterAndFloatingCenter();this.onHorizontalViewportChanged()};e.prototype.executeFrame=function(){if(this.scrollLeft!==this.nextScrollLeft){this.doHorizontalScroll();return true}else if(this.scrollTop!==this.nextScrollTop){this.scrollTop=this.nextScrollTop;this.synchroniseVerticalScrollPositions(this.scrollTop);this.verticalRedrawNeeded=true;return true}else if(this.verticalRedrawNeeded){this.redrawRowsAfterScroll();this.verticalRedrawNeeded=false;return true}else{return false}};e.prototype.redrawRowsAfterScroll=function(){var e={type:p.Events.EVENT_BODY_SCROLL,direction:"vertical",api:this.gridApi,columnApi:this.columnApi,left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(e)};e.prototype.onHorizontalViewportChanged=function(){var e=this.eBodyViewport.clientWidth;var t=this.getBodyViewportScrollLeft();this.columnController.setVirtualViewportPosition(e,t)};e.prototype.getBodyViewportScrollLeft=function(){return s.Utils.getScrollLeft(this.eBodyViewport,this.enableRtl)};e.prototype.setBodyViewportScrollLeft=function(e){s.Utils.setScrollLeft(this.eBodyViewport,e,this.enableRtl)};e.prototype.horizontallyScrollHeaderCenterAndFloatingCenter=function(){var e=this.getBodyViewportScrollLeft();var t=this.enableRtl?e:-e;this.headerRootComp.setHorizontalScroll(t);this.eBottomContainer.style.left=t+"px";this.eTopContainer.style.left=t+"px"};e.prototype.synchroniseVerticalScrollPositions=function(e){if(this.lastVScrollElement!==this.eBodyViewport){this.eBodyViewport.scrollTop=e}if(this.lastVScrollElement!==this.eLeftViewport&&this.pinningLeft){this.eLeftViewport.scrollTop=e}if(this.lastVScrollElement!==this.eRightViewport&&this.pinningRight){this.eRightViewport.scrollTop=e}if(this.lastVScrollElement!==this.eFullWidthViewport){this.eFullWidthViewport.scrollTop=e}this.rowContainerComponents.body.setVerticalScrollPosition(e);this.rowContainerComponents.pinnedLeft.setVerticalScrollPosition(e);this.rowContainerComponents.pinnedRight.setVerticalScrollPosition(e);this.rowContainerComponents.fullWidth.setVerticalScrollPosition(e);this.redrawRowsAfterScroll()};e.prototype.addScrollEventListener=function(e){this.eBodyViewport.addEventListener("scroll",e)};e.prototype.removeScrollEventListener=function(e){this.eBodyViewport.removeEventListener("scroll",e)};n([d.Autowired("alignedGridsService"),r("design:type",E.AlignedGridsService)],e.prototype,"alignedGridsService",void 0);n([d.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([d.Autowired("columnController"),r("design:type",l.ColumnController)],e.prototype,"columnController",void 0);n([d.Autowired("rowRenderer"),r("design:type",c.RowRenderer)],e.prototype,"rowRenderer",void 0);n([d.Autowired("pinnedRowModel"),r("design:type",x.PinnedRowModel)],e.prototype,"pinnedRowModel",void 0);n([d.Autowired("eventService"),r("design:type",f.EventService)],e.prototype,"eventService",void 0);n([d.Autowired("context"),r("design:type",d.Context)],e.prototype,"context",void 0);n([d.Autowired("animationFrameService"),r("design:type",S.AnimationFrameService)],e.prototype,"animationFrameService",void 0);n([d.Autowired("navigationService"),r("design:type",k.NavigationService)],e.prototype,"navigationService",void 0);n([d.Autowired("autoHeightCalculator"),r("design:type",$.AutoHeightCalculator)],e.prototype,"autoHeightCalculator",void 0);n([d.Autowired("columnAnimationService"),r("design:type",W.ColumnAnimationService)],e.prototype,"columnAnimationService",void 0);n([d.Autowired("autoWidthCalculator"),r("design:type",H.AutoWidthCalculator)],e.prototype,"autoWidthCalculator",void 0);n([d.Autowired("paginationAutoPageSizeService"),r("design:type",C.PaginationAutoPageSizeService)],e.prototype,"paginationAutoPageSizeService",void 0);n([d.Autowired("beans"),r("design:type",j.Beans)],e.prototype,"beans",void 0);n([d.Autowired("paginationProxy"),r("design:type",C.PaginationProxy)],e.prototype,"paginationProxy",void 0);n([d.Autowired("columnApi"),r("design:type",u.ColumnApi)],e.prototype,"columnApi",void 0);n([d.Autowired("gridApi"),r("design:type",T.GridApi)],e.prototype,"gridApi",void 0);n([d.Autowired("dragService"),r("design:type",h.DragService)],e.prototype,"dragService",void 0);n([d.Autowired("selectionController"),r("design:type",v.SelectionController)],e.prototype,"selectionController",void 0);n([d.Autowired("csvCreator"),r("design:type",m.CsvCreator)],e.prototype,"csvCreator",void 0);n([d.Autowired("mouseEventService"),r("design:type",y.MouseEventService)],e.prototype,"mouseEventService",void 0);n([d.Autowired("focusedCellController"),r("design:type",b.FocusedCellController)],e.prototype,"focusedCellController",void 0);n([d.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);n([d.Autowired("scrollVisibleService"),r("design:type",_.ScrollVisibleService)],e.prototype,"scrollVisibleService",void 0);n([d.Autowired("frameworkFactory"),r("design:type",Object)],e.prototype,"frameworkFactory",void 0);n([d.Autowired("valueService"),r("design:type",O.ValueService)],e.prototype,"valueService",void 0);n([d.Autowired("componentRecipes"),r("design:type",N.ComponentRecipes)],e.prototype,"componentRecipes",void 0);n([d.Autowired("dragAndDropService"),r("design:type",I.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([d.Autowired("heightScaler"),r("design:type",F.HeightScaler)],e.prototype,"heightScaler",void 0);n([d.Autowired("enterprise"),r("design:type",Boolean)],e.prototype,"enterprise",void 0);n([d.Optional("rangeController"),r("design:type",Object)],e.prototype,"rangeController",void 0);n([d.Optional("contextMenuFactory"),r("design:type",Object)],e.prototype,"contextMenuFactory",void 0);n([d.Optional("clipboardService"),r("design:type",Object)],e.prototype,"clipboardService",void 0);n([M.RefSelector("eBody"),r("design:type",HTMLElement)],e.prototype,"eBody",void 0);n([M.RefSelector("eBodyViewport"),r("design:type",HTMLElement)],e.prototype,"eBodyViewport",void 0);n([M.RefSelector("eBodyContainer"),r("design:type",HTMLElement)],e.prototype,"eBodyContainer",void 0);n([M.RefSelector("eLeftContainer"),r("design:type",HTMLElement)],e.prototype,"eLeftContainer",void 0);n([M.RefSelector("eRightContainer"),r("design:type",HTMLElement)],e.prototype,"eRightContainer",void 0);n([M.RefSelector("eFullWidthViewportWrapper"),r("design:type",HTMLElement)],e.prototype,"eFullWidthViewportWrapper",void 0);n([M.RefSelector("eFullWidthViewport"),r("design:type",HTMLElement)],e.prototype,"eFullWidthViewport",void 0);n([M.RefSelector("eFullWidthContainer"),r("design:type",HTMLElement)],e.prototype,"eFullWidthContainer",void 0);n([M.RefSelector("eLeftViewport"),r("design:type",HTMLElement)],e.prototype,"eLeftViewport",void 0);n([M.RefSelector("eLeftViewportWrapper"),r("design:type",HTMLElement)],e.prototype,"eLeftViewportWrapper",void 0);n([M.RefSelector("eRightViewport"),r("design:type",HTMLElement)],e.prototype,"eRightViewport",void 0);n([M.RefSelector("eRightViewportWrapper"),r("design:type",HTMLElement)],e.prototype,"eRightViewportWrapper",void 0);n([M.RefSelector("eTop"),r("design:type",HTMLElement)],e.prototype,"eTop",void 0);n([M.RefSelector("eLeftTop"),r("design:type",HTMLElement)],e.prototype,"eLeftTop",void 0);n([M.RefSelector("eRightTop"),r("design:type",HTMLElement)],e.prototype,"eRightTop",void 0);n([M.RefSelector("eTopContainer"),r("design:type",HTMLElement)],e.prototype,"eTopContainer",void 0);n([M.RefSelector("eTopViewport"),r("design:type",HTMLElement)],e.prototype,"eTopViewport",void 0);n([M.RefSelector("eTopFullWidthContainer"),r("design:type",HTMLElement)],e.prototype,"eTopFullWidthContainer",void 0);n([M.RefSelector("eBottom"),r("design:type",HTMLElement)],e.prototype,"eBottom",void 0);n([M.RefSelector("eLeftBottom"),r("design:type",HTMLElement)],e.prototype,"eLeftBottom",void 0);n([M.RefSelector("eRightBottom"),r("design:type",HTMLElement)],e.prototype,"eRightBottom",void 0);n([M.RefSelector("eBottomContainer"),r("design:type",HTMLElement)],e.prototype,"eBottomContainer",void 0);n([M.RefSelector("eBottomViewport"),r("design:type",HTMLElement)],e.prototype,"eBottomViewport",void 0);n([M.RefSelector("eBottomFullWidthContainer"),r("design:type",HTMLElement)],e.prototype,"eBottomFullWidthContainer",void 0);n([M.RefSelector("headerRoot"),r("design:type",B.HeaderRootComp)],e.prototype,"headerRootComp",void 0);n([d.PreDestroy,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"destroy",null);n([d.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);return e}(G.Component);e.GridPanel=z},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(28);var u=i(34);var s=i(4);var c=i(1);var l=function(){function e(){}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.getPreferredHeightForRow=function(i){var n=this;if(!this.eDummyContainer){this.eDummyContainer=document.createElement("div");c._.addCssClass(this.eDummyContainer,"ag-row ag-row-no-focus")}var e=this.gridPanel.getBodyContainer();e.appendChild(this.eDummyContainer);var r=[];var t=this.columnController.getAllAutoRowHeightCols();console.log();t.forEach(function(e){var t=new u.CellComp(n.$scope,n.beans,e,i,null,true);t.setParentRow(n.eDummyContainer);r.push(t)});var o=r.map(function(e){return e.getCreateTemplate()}).join(" ");this.eDummyContainer.innerHTML=o;r.forEach(function(e){return e.afterAttached()});var a=0;for(var s=0;s<this.eDummyContainer.children.length;s++){var l=this.eDummyContainer.children[s];if(l.offsetHeight>a){a=l.offsetHeight}}e.removeChild(this.eDummyContainer);r.forEach(function(e){e.detach();e.destroy()});c._.removeAllChildren(this.eDummyContainer);return a};n([o.Autowired("beans"),r("design:type",a.Beans)],e.prototype,"beans",void 0);n([o.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);n([o.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);e=n([o.Bean("autoHeightCalculator")],e);return e}();t.AutoHeightCalculator=l},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(2);var s=i(4);var l=i(10);var u=i(0);var c=i(98);var d=i(3);var f=i(5);var p=i(36);var h=i(8);var g=i(11);var v=i(1);var m=i(6);var y=i(39);var b=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.registerGridComp=function(e){this.gridPanel=e;this.centerContainer.registerGridComp(e);this.pinnedLeftContainer.registerGridComp(e);this.pinnedRightContainer.registerGridComp(e)};t.prototype.postConstruct=function(){var t=this;this.gridApi.registerHeaderRootComp(this);this.autoWidthCalculator.registerHeaderRootComp(this);this.centerContainer=new c.HeaderContainer(this.eHeaderContainer,this.eHeaderViewport,null);this.childContainers=[this.centerContainer];this.pinnedLeftContainer=new c.HeaderContainer(this.ePinnedLeftHeader,null,l.Column.PINNED_LEFT);this.pinnedRightContainer=new c.HeaderContainer(this.ePinnedRightHeader,null,l.Column.PINNED_RIGHT);this.childContainers.push(this.pinnedLeftContainer);this.childContainers.push(this.pinnedRightContainer);this.childContainers.forEach(function(e){return t.context.wireBean(e)});this.eventService.addEventListener(f.Events.EVENT_COLUMN_VALUE_CHANGED,this.refreshHeader.bind(this));this.eventService.addEventListener(f.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this));this.addPreventHeaderScroll();if(this.columnController.isReady()){this.refreshHeader()}};t.prototype.setHorizontalScroll=function(e){this.eHeaderContainer.style.left=e+"px"};t.prototype.forEachHeaderElement=function(t){this.childContainers.forEach(function(e){return e.forEachHeaderElement(t)})};t.prototype.destroy=function(){this.childContainers.forEach(function(e){return e.destroy()})};t.prototype.refreshHeader=function(){this.childContainers.forEach(function(e){return e.refresh()})};t.prototype.onPivotModeChanged=function(){var e=this.columnController.isPivotMode();v.Utils.addOrRemoveCssClass(this.getGui(),"ag-pivot-on",e);v.Utils.addOrRemoveCssClass(this.getGui(),"ag-pivot-off",!e)};t.prototype.setHeight=function(e){this.getGui().style.height=e+"px";this.getGui().style.minHeight=e+"px"};t.prototype.addPreventHeaderScroll=function(){var t=this;this.addDestroyableEventListener(this.eHeaderViewport,"scroll",function(){var e=t.eHeaderViewport.scrollLeft;if(e!==0){t.gridPanel.scrollHorizontally(e);t.eHeaderViewport.scrollLeft=0}})};t.prototype.setLeftVisible=function(e){v.Utils.setVisible(this.ePinnedLeftHeader,e)};t.prototype.setRightVisible=function(e){v.Utils.setVisible(this.ePinnedRightHeader,e)};t.TEMPLATE='<div class="ag-header" role="row">\n            <div class="ag-pinned-left-header" ref="ePinnedLeftHeader" role="presentation"></div>\n            <div class="ag-header-viewport" ref="eHeaderViewport" role="presentation">\n                <div class="ag-header-container" ref="eHeaderContainer" role="presentation"></div>\n            </div>\n            <div class="ag-pinned-right-header" ref="ePinnedRightHeader" role="presentation"></div>\n        </div>';r([g.RefSelector("ePinnedLeftHeader"),o("design:type",HTMLElement)],t.prototype,"ePinnedLeftHeader",void 0);r([g.RefSelector("ePinnedRightHeader"),o("design:type",HTMLElement)],t.prototype,"ePinnedRightHeader",void 0);r([g.RefSelector("eHeaderContainer"),o("design:type",HTMLElement)],t.prototype,"eHeaderContainer",void 0);r([g.RefSelector("eHeaderViewport"),o("design:type",HTMLElement)],t.prototype,"eHeaderViewport",void 0);r([u.Autowired("gridOptionsWrapper"),o("design:type",a.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([u.Autowired("columnController"),o("design:type",s.ColumnController)],t.prototype,"columnController",void 0);r([u.Autowired("context"),o("design:type",u.Context)],t.prototype,"context",void 0);r([u.Autowired("eventService"),o("design:type",d.EventService)],t.prototype,"eventService",void 0);r([u.Autowired("scrollVisibleService"),o("design:type",p.ScrollVisibleService)],t.prototype,"scrollVisibleService",void 0);r([u.Autowired("gridApi"),o("design:type",m.GridApi)],t.prototype,"gridApi",void 0);r([u.Autowired("autoWidthCalculator"),o("design:type",y.AutoWidthCalculator)],t.prototype,"autoWidthCalculator",void 0);r([u.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"postConstruct",null);r([u.PreDestroy,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"destroy",null);return t}(h.Component);t.HeaderRootComp=b},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var u=i(1);var n=function(){function e(){}e.addHeaderClassesFromColDef=function(e,t,i,n,r){if(u.Utils.missing(e)){return}this.addColumnClassesFromCollDef(e.headerClass,e,t,i,n,r)};e.addToolPanelClassesFromColDef=function(e,t,i,n,r){if(u.Utils.missing(e)){return}this.addColumnClassesFromCollDef(e.toolPanelClass,e,t,i,n,r)};e.addColumnClassesFromCollDef=function(e,t,i,n,r,o){if(u.Utils.missing(e)){return}var a;if(typeof e==="function"){var s={colDef:t,column:r,columnGroup:o,context:n.getContext(),api:n.getApi()};var l=e;a=l(s)}else{a=e}if(typeof a==="string"){u.Utils.addCssClass(i,a)}else if(Array.isArray(a)){a.forEach(function(e){u.Utils.addCssClass(i,e)})}};return e}();t.CssClassApplier=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(9);var s=i(4);var l=i(1);var u=i(64);var c=i(23);var d=i(2);var f=i(30);var p=function(){function e(){}e.prototype.getNextCellToFocus=function(e,t){var i=t;var n=false;while(!n){switch(e){case a.Constants.KEY_UP:i=this.getCellAbove(i);break;case a.Constants.KEY_DOWN:i=this.getCellBelow(i);break;case a.Constants.KEY_RIGHT:if(this.gridOptionsWrapper.isEnableRtl()){i=this.getCellToLeft(i)}else{i=this.getCellToRight(i)}break;case a.Constants.KEY_LEFT:if(this.gridOptionsWrapper.isEnableRtl()){i=this.getCellToRight(i)}else{i=this.getCellToLeft(i)}break;default:console.log("ag-Grid: unknown key for navigation "+e);i=null;break}if(i){n=this.isCellGoodToFocusOn(i)}else{n=true}}return i};e.prototype.isCellGoodToFocusOn=function(e){var t=e.column;var i;switch(e.floating){case a.Constants.PINNED_TOP:i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case a.Constants.PINNED_BOTTOM:i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}var n=t.isSuppressNavigable(i);return!n};e.prototype.getCellToLeft=function(e){var t=this.columnController.getDisplayedColBefore(e.column);if(!t){return null}else{var i={rowIndex:e.rowIndex,column:t,floating:e.floating};return new c.GridCell(i)}};e.prototype.getCellToRight=function(e){var t=this.columnController.getDisplayedColAfter(e.column);if(!t){return null}else{var i={rowIndex:e.rowIndex,column:t,floating:e.floating};return new c.GridCell(i)}};e.prototype.getRowBelow=function(e){if(this.isLastRowInContainer(e)){if(e.isFloatingBottom()){return null}else if(e.isNotFloating()){if(this.pinnedRowModel.isRowsToRender(a.Constants.PINNED_BOTTOM)){return new u.GridRow(0,a.Constants.PINNED_BOTTOM)}else{return null}}else{if(this.rowModel.isRowsToRender()){return new u.GridRow(0,null)}else if(this.pinnedRowModel.isRowsToRender(a.Constants.PINNED_BOTTOM)){return new u.GridRow(0,a.Constants.PINNED_BOTTOM)}else{return null}}}else{return new u.GridRow(e.rowIndex+1,e.floating)}};e.prototype.getCellBelow=function(e){var t=this.getRowBelow(e.getGridRow());if(t){var i={rowIndex:t.rowIndex,column:e.column,floating:t.floating};return new c.GridCell(i)}else{return null}};e.prototype.isLastRowInContainer=function(e){if(e.isFloatingTop()){var t=this.pinnedRowModel.getPinnedTopRowData().length-1;return t<=e.rowIndex}else if(e.isFloatingBottom()){var i=this.pinnedRowModel.getPinnedBottomRowData().length-1;return i<=e.rowIndex}else{var n=this.rowModel.getPageLastRow();return n<=e.rowIndex}};e.prototype.getRowAbove=function(e){if(e.rowIndex===0){if(e.isFloatingTop()){return null}else if(e.isNotFloating()){if(this.pinnedRowModel.isRowsToRender(a.Constants.PINNED_TOP)){return this.getLastFloatingTopRow()}else{return null}}else{if(this.rowModel.isRowsToRender()){return this.getLastBodyCell()}else if(this.pinnedRowModel.isRowsToRender(a.Constants.PINNED_TOP)){return this.getLastFloatingTopRow()}else{return null}}}else{return new u.GridRow(e.rowIndex-1,e.floating)}};e.prototype.getCellAbove=function(e){var t=this.getRowAbove(e.getGridRow());if(t){var i={rowIndex:t.rowIndex,column:e.column,floating:t.floating};return new c.GridCell(i)}else{return null}};e.prototype.getLastBodyCell=function(){var e=this.rowModel.getPageLastRow();return new u.GridRow(e,null)};e.prototype.getLastFloatingTopRow=function(){var e=this.pinnedRowModel.getPinnedTopRowData().length-1;return new u.GridRow(e,a.Constants.PINNED_TOP)};e.prototype.getNextTabbedCell=function(e,t){if(t){return this.getNextTabbedCellBackwards(e)}else{return this.getNextTabbedCellForwards(e)}};e.prototype.getNextTabbedCellForwards=function(e){var t=this.columnController.getAllDisplayedColumns();var i=e.rowIndex;var n=e.floating;var r=this.columnController.getDisplayedColAfter(e.column);if(!r){r=t[0];var o=this.getRowBelow(e.getGridRow());if(l.Utils.missing(o)){return}i=o.rowIndex;n=o.floating}var a={rowIndex:i,column:r,floating:n};return new c.GridCell(a)};e.prototype.getNextTabbedCellBackwards=function(e){var t=this.columnController.getAllDisplayedColumns();var i=e.rowIndex;var n=e.floating;var r=this.columnController.getDisplayedColBefore(e.column);if(!r){r=t[t.length-1];var o=this.getRowAbove(e.getGridRow());if(l.Utils.missing(o)){return}i=o.rowIndex;n=o.floating}var a={rowIndex:i,column:r,floating:n};return new c.GridCell(a)};n([o.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([o.Autowired("pinnedRowModel"),r("design:type",f.PinnedRowModel)],e.prototype,"pinnedRowModel",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",d.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("cellNavigationService")],e);return e}();t.CellNavigationService=p},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){this.existingIds={}}e.prototype.getInstanceIdForKey=function(e){var t=this.existingIds[e];var i;if(typeof t!=="number"){i=0}else{i=t+1}this.existingIds[e]=i;return i};return e}();t.GroupInstanceIdCreator=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};Object.defineProperty(t,"__esModule",{value:true});var r=i(0);var o=function(){function e(){}e.prototype.download=function(e,t,i){var n=new Blob(["\ufeff",t],{type:i});if(window.navigator.msSaveOrOpenBlob){window.navigator.msSaveOrOpenBlob(n,e)}else{var r=document.createElement("a");r.href=window.URL.createObjectURL(n);r.download=e;document.body.appendChild(r);r.click();document.body.removeChild(r)}};e=n([r.Bean("downloader")],e);return e}();t.Downloader=o},function(i,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:true});var f=t(2);var p=t(17);var h=t(7);var g=t(4);var v=t(20);var m=t(80);var y=t(18);var b=t(16);var _=t(3);var w=t(78);var C=t(6);var A=t(38);var E=t(48);var x=t(19);var T=t(49);var S=t(35);var D=t(12);var k=t(31);var O=t(39);var R=t(59);var N=t(0);var I=t(47);var P=t(42);var M=t(108);var L=t(15);var F=t(40);var G=t(24);var $=t(22);var W=t(44);var V=t(82);var H=t(1);var z=t(109);var U=t(111);var Y=t(113);var q=t(54);var r=t(5);var o=t(114);var n=t(116);var X=t(55);var K=t(56);var Q=t(43);var Z=t(60);var J=t(117);var ee=t(36);var te=t(84);var ie=t(118);var ne=t(63);var re=t(73);var oe=t(45);var ae=t(53);var se=t(112);var le=t(110);var ue=t(138);var ce=t(104);var j=t(29);var de=t(105);var s=t(9);var fe=t(33);var pe=t(139);var he=t(58);var ge=t(30);var ve=t(27);var me=t(21);var B=t(66);var ye=t(76);var be=t(77);var _e=t(28);var we=t(41);var Ce=t(37);var Ae=t(97);var Ee=t(57);var xe=t(86);var Te=t(79);var Se=t(140);var a=function(){function d(e,t,i){if(!e){console.error("ag-Grid: no div element provided to the grid")}if(!t){console.error("ag-Grid: no gridOptions provided to the grid")}var n=this.getRowModelClass(t);var r=H.Utils.exists(d.enterpriseBeans);var o=i?i.frameworkFactory:null;if(H.Utils.missing(o)){o=new J.BaseFrameworkFactory}var a=[];if(d.enterpriseBeans){a=a.concat(d.enterpriseBeans)}if(d.frameworkBeans){a=a.concat(d.frameworkBeans)}var s={enterprise:r,gridOptions:t,eGridDiv:e,$scope:i?i.$scope:null,$compile:i?i.$compile:null,quickFilterOnScope:i?i.quickFilterOnScope:null,globalEventListener:i?i.globalEventListener:null,frameworkFactory:o};if(i&&i.seedBeanInstances){H.Utils.assign(s,i.seedBeanInstances)}var l=[{componentName:"AgCheckbox",theClass:Z.AgCheckbox},{componentName:"AgGridComp",theClass:w.GridPanel},{componentName:"AgHeaderRoot",theClass:m.HeaderRootComp},{componentName:"AgPagination",theClass:Se.PaginationComp}];if(d.enterpriseComponents){l=l.concat(d.enterpriseComponents)}var u={overrideBeans:a,seed:s,beans:[n,_e.Beans,j.PaginationAutoPageSizeService,C.GridApi,B.ComponentProvider,ye.AgComponentUtils,be.ComponentMetadataProvider,B.ComponentProvider,ve.ComponentResolver,me.ComponentRecipes,Ee.HeightScaler,Te.AutoHeightCalculator,X.CellRendererFactory,R.HorizontalResizeService,ge.PinnedRowModel,F.DragService,E.DisplayedGroupCreator,_.EventService,f.GridOptionsWrapper,p.SelectionController,y.FilterManager,g.ColumnController,j.PaginationProxy,v.RowRenderer,x.ExpressionService,A.BalancedColumnTreeBuilder,I.CsvCreator,te.Downloader,ie.XmlFactory,ne.GridSerializer,T.TemplateService,Ae.NavigationService,S.PopupService,fe.ValueCache,b.ValueService,he.AlignedGridsService,D.LoggerFactory,k.ColumnUtils,O.AutoWidthCalculator,S.PopupService,P.GridCore,M.StandardMenuFactory,L.DragAndDropService,h.ColumnApi,$.FocusedCellController,W.MouseEventService,V.CellNavigationService,z.FilterStage,U.SortStage,Y.FlattenStage,le.FilterService,ue.RowNodeFactory,q.CellEditorFactory,K.CellRendererService,Q.ValueFormatterService,re.StylingService,ee.ScrollVisibleService,oe.ColumnHoverService,ae.ColumnAnimationService,se.SortService,xe.SelectableService,ce.AutoGroupColService,de.ImmutableService,pe.ChangeDetectionService,we.Environment,Ce.AnimationFrameService,G.SortController],components:l,debug:!!t.debug};var c=function(){return u.debug};this.context=new N.Context(u,new D.Logger("Context",c));this.setColumnsAndData();this.dispatchGridReadyEvent(t);if(t.debug){console.log("ag-Grid -> initialised successfully, enterprise = "+r)}}d.setEnterpriseBeans=function(e,t){this.enterpriseBeans=e;H.Utils.iterateObject(t,function(e,t){return d.RowModelClasses[e]=t})};d.setEnterpriseComponents=function(e){this.enterpriseComponents=e};d.setFrameworkBeans=function(e){this.frameworkBeans=e};d.prototype.setColumnsAndData=function(){var e=this.context.getBean("gridOptionsWrapper");var t=this.context.getBean("columnController");var i=this.context.getBean("rowModel");var n=e.getColumnDefs();var r=e.getRowData();var o=H.Utils.missing(n)&&H.Utils.missing(r);if(o){return}if(H.Utils.exists(n)){t.setColumnDefs(n,"gridInitializing")}if(H.Utils.exists(r)&&i.getType()===s.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){var a=i;a.setRowData(r)}};d.prototype.dispatchGridReadyEvent=function(e){var t=this.context.getBean("eventService");var i={type:r.Events.EVENT_GRID_READY,api:e.api,columnApi:e.columnApi};t.dispatchEvent(i)};d.prototype.getRowModelClass=function(e){var t=e.rowModelType;t=t==="enterprise"?s.Constants.ROW_MODEL_TYPE_SERVER_SIDE:t;if(H.Utils.exists(t)){var i=d.RowModelClasses[t];if(H.Utils.exists(i)){return i}else{if(t==="normal"){console.warn("ag-Grid: normal rowModel deprecated. Should now be called client side row model instead.");return n.ClientSideRowModel}console.error("ag-Grid: could not find matching row model for rowModelType "+t);if(t===s.Constants.ROW_MODEL_TYPE_VIEWPORT){console.error("ag-Grid: rowModelType viewport is only available in ag-Grid Enterprise")}if(t===s.Constants.ROW_MODEL_TYPE_SERVER_SIDE){console.error("ag-Grid: rowModelType server side is only available in ag-Grid Enterprise")}}}return n.ClientSideRowModel};d.prototype.destroy=function(){this.context.destroy()};d.RowModelClasses={infinite:o.InfiniteRowModel,clientSide:n.ClientSideRowModel};return d}();e.Grid=a},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(1);var s=i(2);var l=function(){function e(){}e.prototype.init=function(){this.groupSelectsChildren=this.gridOptionsWrapper.isGroupSelectsChildren();this.isRowSelectableFunc=this.gridOptionsWrapper.getIsRowSelectableFunc()};e.prototype.updateSelectableAfterGrouping=function(e){if(this.isRowSelectableFunc){var t=function(e){return e.childrenAfterGroup};this.recurseDown(e.childrenAfterGroup,t)}};e.prototype.updateSelectableAfterFiltering=function(e){if(this.isRowSelectableFunc){var t=function(e){return e.childrenAfterFilter};this.recurseDown(e.childrenAfterGroup,t)}};e.prototype.recurseDown=function(e,n){var r=this;e.forEach(function(e){if(!e.group){return}if(e.hasChildren()){r.recurseDown(n(e),n)}var t;if(r.groupSelectsChildren){var i=a._.find(n(e),"selectable",true);t=a._.exists(i)}else{t=r.isRowSelectableFunc(e)}e.setRowSelectable(t)})};n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("selectableService")],e);return e}();t.SelectableService=l},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var c=i(1);var r=i(13);var o=i(61);var a=function(i){n(t,i);function t(e){var t=i.call(this)||this;t.maxRowFound=false;t.blocks={};t.blockCount=0;t.virtualRowCount=e.initialRowCount;t.cacheParams=e;return t}t.prototype.destroy=function(){var t=this;i.prototype.destroy.call(this);this.forEachBlockInOrder(function(e){return t.destroyBlock(e)})};t.prototype.init=function(){var e=this;this.active=true;this.addDestroyFunc(function(){return e.active=false})};t.prototype.isActive=function(){return this.active};t.prototype.getVirtualRowCount=function(){return this.virtualRowCount};t.prototype.hack_setVirtualRowCount=function(e){this.virtualRowCount=e};t.prototype.isMaxRowFound=function(){return this.maxRowFound};t.prototype.onPageLoaded=function(e){this.cacheParams.rowNodeBlockLoader.loadComplete();this.checkBlockToLoad();if(!this.isActive()){return}this.logger.log("onPageLoaded: page = "+e.page.getBlockNumber()+", lastRow = "+e.lastRow);if(e.success){this.checkVirtualRowCount(e.page,e.lastRow)}};t.prototype.purgeBlocksIfNeeded=function(t){var i=this;if(c.Utils.missing(this.cacheParams.maxBlocksInCache)){return}if(this.blockCount<=this.cacheParams.maxBlocksInCache){return}var n=[];this.forEachBlockInOrder(function(e){if(e===t){return}n.push(e)});n.sort(function(e,t){return t.getLastAccessed()-e.getLastAccessed()});var e=this.cacheParams.maxBlocksInCache-1;n.splice(0,e);n.forEach(function(e){if(e.isAnyNodeOpen(i.virtualRowCount)){return}i.removeBlockFromCache(e)})};t.prototype.postCreateBlock=function(e){e.addEventListener(o.RowNodeBlock.EVENT_LOAD_COMPLETE,this.onPageLoaded.bind(this));this.setBlock(e.getBlockNumber(),e);this.purgeBlocksIfNeeded(e);this.checkBlockToLoad()};t.prototype.removeBlockFromCache=function(e){if(!e){return}this.destroyBlock(e)};t.prototype.checkBlockToLoad=function(){this.cacheParams.rowNodeBlockLoader.checkBlockToLoad()};t.prototype.checkVirtualRowCount=function(e,t){if(typeof t==="number"&&t>=0){this.virtualRowCount=t;this.maxRowFound=true;this.onCacheUpdated()}else if(!this.maxRowFound){var i=(e.getBlockNumber()+1)*this.cacheParams.blockSize;var n=i+this.cacheParams.overflowSize;if(this.virtualRowCount<n){this.virtualRowCount=n;this.onCacheUpdated()}else if(this.cacheParams.dynamicRowHeight){this.onCacheUpdated()}}};t.prototype.setVirtualRowCount=function(e,t){this.virtualRowCount=e;if(c.Utils.exists(t)){this.maxRowFound=t}if(!this.maxRowFound){if(this.virtualRowCount%this.cacheParams.blockSize===0){this.virtualRowCount++}}this.onCacheUpdated()};t.prototype.forEachNodeDeep=function(t,i){var n=this;this.forEachBlockInOrder(function(e){e.forEachNodeDeep(t,i,n.virtualRowCount)})};t.prototype.forEachBlockInOrder=function(e){var t=this.getBlockIdsSorted();this.forEachBlockId(t,e)};t.prototype.forEachBlockInReverseOrder=function(e){var t=this.getBlockIdsSorted().reverse();this.forEachBlockId(t,e)};t.prototype.forEachBlockId=function(e,i){var n=this;e.forEach(function(e){var t=n.blocks[e];i(t,e)})};t.prototype.getBlockIdsSorted=function(){var e=function(e,t){return e-t};var t=Object.keys(this.blocks).map(function(e){return parseInt(e)}).sort(e);return t};t.prototype.getBlock=function(e){return this.blocks[e]};t.prototype.setBlock=function(e,t){this.blocks[e]=t;this.blockCount++;this.cacheParams.rowNodeBlockLoader.addBlock(t)};t.prototype.destroyBlock=function(e){delete this.blocks[e.getBlockNumber()];e.destroy();this.blockCount--;this.cacheParams.rowNodeBlockLoader.removeBlock(e)};t.prototype.onCacheUpdated=function(){if(this.isActive()){var e={type:t.EVENT_CACHE_UPDATED};this.dispatchEvent(e)}};t.prototype.purgeCache=function(){var t=this;this.forEachBlockInOrder(function(e){return t.removeBlockFromCache(e)});this.onCacheUpdated()};t.prototype.getRowNodesInRange=function(i,n){var r=this;var o=[];var a=-1;var s=false;var l=new c.NumberSequence;if(c.Utils.missing(i)){s=true}var u=false;this.forEachBlockInOrder(function(e,t){if(u)return;if(s&&a+1!==t){u=true;return}a=t;e.forEachNodeShallow(function(e){var t=e===i||e===n;if(s||t){o.push(e)}if(t){s=!s}},l,r.virtualRowCount)});var e=u||s;return e?[]:o};t.EVENT_CACHE_UPDATED="cacheUpdated";return t}(r.BeanStub);t.RowNodeCache=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var c=i(14);var d=i(1);var n=function(){function s(e,t,i,n,r){this.nextId=0;this.allNodesMap={};this.rootNode=e;this.gridOptionsWrapper=t;this.context=i;this.eventService=n;this.columnController=r;this.rootNode.group=true;this.rootNode.level=-1;this.rootNode.id=s.ROOT_NODE_ID;this.rootNode.allLeafChildren=[];this.rootNode.childrenAfterGroup=[];this.rootNode.childrenAfterSort=[];this.rootNode.childrenAfterFilter=[];this.postConstruct()}s.prototype.postConstruct=function(){this.getNodeChildDetails=this.gridOptionsWrapper.getNodeChildDetailsFunc();this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes();this.doesDataFlower=this.gridOptionsWrapper.getDoesDataFlowerFunc();this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc();this.doingLegacyTreeData=d.Utils.exists(this.getNodeChildDetails);this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()};s.prototype.getCopyOfNodesMap=function(){var e=d.Utils.cloneObject(this.allNodesMap);return e};s.prototype.getRowNode=function(e){return this.allNodesMap[e]};s.prototype.setRowData=function(e){this.rootNode.childrenAfterFilter=null;this.rootNode.childrenAfterGroup=null;this.rootNode.childrenAfterSort=null;this.rootNode.childrenMapped=null;this.nextId=0;this.allNodesMap={};if(!e){this.rootNode.allLeafChildren=[];this.rootNode.childrenAfterGroup=[];return}var t=this.recursiveFunction(e,null,s.TOP_LEVEL);if(this.doingLegacyTreeData){this.rootNode.childrenAfterGroup=t;this.setLeafChildren(this.rootNode)}else{this.rootNode.allLeafChildren=t}};s.prototype.updateRowData=function(e,t){var i=this;if(this.isLegacyTreeData()){return null}var n=e.add,r=e.addIndex,o=e.remove,a=e.update;var s={remove:[],update:[],add:[]};if(d.Utils.exists(n)){var l=typeof r==="number"&&r>=0;if(l){n.reverse().forEach(function(e){var t=i.addRowNode(e,r);s.add.push(t)})}else{n.forEach(function(e){var t=i.addRowNode(e);s.add.push(t)})}}if(d.Utils.exists(o)){o.forEach(function(e){var t=i.updatedRowNode(e,false);if(t){s.remove.push(t)}})}if(d.Utils.exists(a)){a.forEach(function(e){var t=i.updatedRowNode(e,true);if(t){s.update.push(t)}})}if(t){d.Utils.sortRowNodesByOrder(this.rootNode.allLeafChildren,t)}return s};s.prototype.addRowNode=function(e,t){var i=this.createNode(e,null,s.TOP_LEVEL);if(d.Utils.exists(t)){d.Utils.insertIntoArray(this.rootNode.allLeafChildren,i,t)}else{this.rootNode.allLeafChildren.push(i)}return i};s.prototype.updatedRowNode=function(t,e){var i=this.gridOptionsWrapper.getRowNodeIdFunc();var n;if(d.Utils.exists(i)){var r=i(t);n=this.allNodesMap[r];if(!n){console.error("ag-Grid: could not find row id="+r+", data item was not found for this id");return null}}else{n=d.Utils.find(this.rootNode.allLeafChildren,function(e){return e.data===t});if(!n){console.error("ag-Grid: could not find data item as object was not found",t);return null}}if(e){n.updateData(t)}else{n.setSelected(false);n.clearRowTop();d.Utils.removeFromArray(this.rootNode.allLeafChildren,n);this.allNodesMap[n.id]=undefined}return n};s.prototype.recursiveFunction=function(e,i,n){var r=this;if(typeof e==="string"){console.warn("ag-Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first");return}var o=[];e.forEach(function(e){var t=r.createNode(e,i,n);o.push(t)});return o};s.prototype.createNode=function(e,t,i){var n=new c.RowNode;this.context.wireBean(n);var r=this.gridOptionsWrapper.isTreeData();var o=!r&&d.Utils.exists(this.getNodeChildDetails);var a=o?this.getNodeChildDetails(e):null;if(a&&a.group){n.group=true;n.childrenAfterGroup=this.recursiveFunction(a.children,n,i+1);n.expanded=a.expanded===true;n.field=a.field;n.key=a.key;n.canFlower=n.master;this.setLeafChildren(n)}else{n.group=false;if(r){n.master=false;n.expanded=false}else{if(this.doesDataFlower){n.master=this.doesDataFlower(e)}else if(this.doingMasterDetail){if(this.isRowMasterFunc){n.master=this.isRowMasterFunc(e)}else{n.master=true}}else{n.master=false}var s=this.columnController.getRowGroupColumns();var l=s?s.length:0;var u=i+l;n.expanded=n.master?this.isExpanded(u):false}}n.canFlower=n.master;if(t&&!this.suppressParentsInRowNodes){n.parent=t}n.level=i;n.setDataAndId(e,this.nextId.toString());this.allNodesMap[n.id]=n;this.nextId++;return n};s.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();if(t===-1){return true}else{return e<t}};s.prototype.setLeafChildren=function(t){t.allLeafChildren=[];if(t.childrenAfterGroup){t.childrenAfterGroup.forEach(function(e){if(e.group){if(e.allLeafChildren){e.allLeafChildren.forEach(function(e){return t.allLeafChildren.push(e)})}}else{t.allLeafChildren.push(e)}})}};s.prototype.insertItemsAtIndex=function(e,t){if(this.isLegacyTreeData()){return null}var i=this.rootNode.allLeafChildren;if(e>i.length){console.warn("ag-Grid: invalid index "+e+", max index is "+i.length);return}var n=[];for(var r=t.length-1;r>=0;r--){var o=t[r];var a=this.createNode(o,null,s.TOP_LEVEL);d.Utils.insertIntoArray(i,a,e);n.push(a)}return n.length>0?n:null};s.prototype.addItems=function(e){var t=this.rootNode.allLeafChildren;return this.insertItemsAtIndex(t.length,e)};s.prototype.isLegacyTreeData=function(){var e=d.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());if(e){console.warn("ag-Grid: adding and removing rows is not supported when using nodeChildDetailsFunc, ie it is not "+"supported for legacy tree data. Please see the docs on the new preferred way of providing tree data that works with delta updates.");return true}else{return false}};s.TOP_LEVEL=0;s.ROOT_NODE_ID="ROOT_NODE_ID";return s}();t.ClientSideNodeManager=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(e){this.active=true;this.nodeIdsToBoolean={};this.nodeIdsToColumns={};this.keepingColumns=e}e.prototype.setInactive=function(){this.active=false};e.prototype.isActive=function(){return this.active};e.prototype.addParentNode=function(e,t){var i=this;this.validateActive();var n=e;while(n){this.nodeIdsToBoolean[n.id]=true;if(this.keepingColumns&&t){if(!this.nodeIdsToColumns[n.id]){this.nodeIdsToColumns[n.id]={}}t.forEach(function(e){return i.nodeIdsToColumns[n.id][e.getId()]=true})}n=n.parent}};e.prototype.isInPath=function(e){this.validateActive();return this.nodeIdsToBoolean[e.id]};e.prototype.getValueColumnsForNode=function(e,t){this.validateActive();if(!this.keepingColumns){return t}var i=this.nodeIdsToColumns[e.id];var n=t.filter(function(e){return i[e.getId()]});return n};e.prototype.getNotValueColumnsForNode=function(e,t){this.validateActive();if(!this.keepingColumns){return null}var i=this.nodeIdsToColumns[e.id];var n=t.filter(function(e){return!i[e.getId()]});return n};e.prototype.validateActive=function(){if(!this.active){throw"ag-Grid: tried to work on an invalid changed path"}};return e}();t.ChangedPath=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.STRING_PROPERTIES=["sortingOrder","rowClass","rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","quickFilterText","rowModelType","editType","domLayout","clipboardDeliminator","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals"];e.OBJECT_PROPERTIES=["components","frameworkComponents","rowStyle","context","autoGroupColumnDef","groupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultExportParams","columnTypes","rowClassRules","detailGridOptions","detailCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent"];e.ARRAY_PROPERTIES=["slaveGrids","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData"];e.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","colWidth","headerHeight","groupHeaderHeight","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","minColWidth","maxColWidth","viewportRowModelPageSize","viewportRowModelBufferSize","layoutInterval","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","scrollbarWidth","paginationStartPage","infiniteBlockSize","batchUpdateWaitMillis"];e.BOOLEAN_PROPERTIES=["toolPanelSuppressRowGroups","toolPanelSuppressValues","toolPanelSuppressPivots","toolPanelSuppressPivotMode","toolPanelSuppressSideButtons","toolPanelSuppressColumnFilter","toolPanelSuppressColumnSelectAll","toolPanelSuppressColumnExpandAll","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellSelection","suppressHorizontalScroll","debug","enableColResize","enableCellExpressions","enableSorting","enableServerSideSorting","enableFilter","enableServerSideFilter","angularCompileRows","angularCompileFilters","angularCompileHeaders","groupSuppressAutoColumn","groupSelectsChildren","groupIncludeFooter","groupIncludeTotalFooter","groupUseEntireRow","groupSuppressRow","groupSuppressBlankHeader","forPrint","suppressMenuHide","rowDeselection","unSortIcon","suppressMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","suppressParentsInRowNodes","showToolPanel","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","pivotPanelShow","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","suppressMenuFilterPanel","suppressMenuMainPanel","suppressMenuColumnPanel","enableStatusBar","alwaysShowStatusBar","rememberGroupStateWhenNewData","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressUseColIdForGroups","suppressCopyRowsToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragManaged","suppressRowDrag","enableGroupEdit","embedFullWidthRows","suppressTabbing","suppressPaginationPanel","floatingFilter","groupHideOpenParents","groupMultiAutoColumn","pagination","stopEditingWhenGridLosesFocus","paginationAutoPageSize","suppressScrollOnNewData","purgeClosedRowNodes","cacheQuickFilter","deltaRowDataMode","ensureDomOrder","accentedSort","pivotTotals","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","treeData","masterDetail","suppressMultiRangeSelection","enterMovesDownAfterEdit","enterMovesDown","suppressPropertyNamesCheck","rowMultiSelectWithClick","contractColumnSelection","suppressEnterpriseResetOnNewColumns","enableOldSetFilterModel","suppressRowHoverHighlight","gridAutoHeight","suppressRowTransform","suppressClipboardPaste"];e.FUNCTION_PROPERTIES=["localeTextFunc","groupRowInnerRenderer","groupRowInnerRendererFramework","dateComponent","dateComponentFramework","groupRowRenderer","groupRowRendererFramework","isExternalFilterPresent","getRowHeight","doesExternalFilterPass","getRowClass","getRowStyle","getRowClassRules","traverseNode","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getNodeChildDetails","groupRowAggNodes","getRowNodeId","isFullWidthCell","fullWidthCellRenderer","fullWidthCellRendererFramework","doesDataFlower","processSecondaryColDef","processSecondaryColGroupDef","getBusinessKeyForNode","sendToClipboard","navigateToNextCell","tabToNextCell","getDetailRowData","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","loadingOverlayComponent","loadingOverlayComponentFramework","noRowsOverlayComponent","noRowsOverlayComponentFramework","detailCellRenderer","detailCellRendererFramework","onGridReady","defaultGroupSortComparator","isRowMaster","isRowSelectable","postSort","processHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard"];e.ALL_PROPERTIES=e.ARRAY_PROPERTIES.concat(e.OBJECT_PROPERTIES).concat(e.STRING_PROPERTIES).concat(e.NUMBER_PROPERTIES).concat(e.FUNCTION_PROPERTIES).concat(e.BOOLEAN_PROPERTIES);return e}();t.PropertyKeys=n},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(0);var s=i(68);var l=i(11);var u=i(1);var c=i(21);var d=i(8);var f=i(9);var p=function(t){n(e,t);function e(){var e=t.call(this,'<div><input  ref="eColumnFloatingFilter" class="ag-floating-filter-input"></div>')||this;e.lastKnownModel=null;return e}e.prototype.init=function(e){this.onFloatingFilterChanged=e.onFloatingFilterChanged;this.currentParentModel=e.currentParentModel;var t=e.debounceMs!=null?e.debounceMs:500;var i=u._.debounce(this.syncUpWithParentFilter.bind(this),t);this.addDestroyableEventListener(this.eColumnFloatingFilter,"input",i);this.addDestroyableEventListener(this.eColumnFloatingFilter,"keypress",i);this.addDestroyableEventListener(this.eColumnFloatingFilter,"keydown",i);var n=e.column.getDefinition();if(n.filterParams&&n.filterParams.filterOptions&&n.filterParams.filterOptions.length===1&&n.filterParams.filterOptions[0]==="inRange"){this.eColumnFloatingFilter.readOnly=true}};e.prototype.onParentModelChanged=function(e,t){if(t!=null){this.eColumnFloatingFilter.value=this.parseAsText(t.condition1)+" "+t.operator+" "+this.parseAsText(t.condition2);this.eColumnFloatingFilter.readOnly=true;this.lastKnownModel=null;this.eColumnFloatingFilter.title=this.eColumnFloatingFilter.value;this.eColumnFloatingFilter.style.cursor="default";return}else{this.eColumnFloatingFilter.readOnly=false}if(this.equalModels(this.lastKnownModel,e)){if(!this.lastKnownModel&&!e){this.eColumnFloatingFilter.value=""}return}this.lastKnownModel=e;var i=this.asFloatingFilterText(e);if(i===this.eColumnFloatingFilter.value){return}this.eColumnFloatingFilter.value=i;this.eColumnFloatingFilter.title=""};e.prototype.syncUpWithParentFilter=function(e){var t=this.asParentModel();if(this.equalModels(this.lastKnownModel,t)){return}var i=null;if(u._.isKeyPressed(e,f.Constants.KEY_ENTER)){i=this.onFloatingFilterChanged({model:t,apply:true})}else{i=this.onFloatingFilterChanged({model:t,apply:false})}if(i){this.lastKnownModel=t}};e.prototype.equalModels=function(e,t){if(u._.referenceCompare(e,t)){return true}if(!e||!t){return false}if(Array.isArray(e)||Array.isArray(t)){return false}return u._.referenceCompare(e.type,t.type)&&u._.referenceCompare(e.filter,t.filter)&&u._.referenceCompare(e.filterTo,t.filterTo)&&u._.referenceCompare(e.filterType,t.filterType)};r([l.RefSelector("eColumnFloatingFilter"),o("design:type",HTMLInputElement)],e.prototype,"eColumnFloatingFilter",void 0);return e}(d.Component);t.InputTextFloatingFilterComp=p;var h=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.asFloatingFilterText=function(e){if(!e){return""}return e.filter};t.prototype.asParentModel=function(){var e=this.currentParentModel();return{type:e.type,filter:this.eColumnFloatingFilter.value,filterType:"text"}};t.prototype.parseAsText=function(e){return this.asFloatingFilterText(e)};return t}(p);t.TextFloatingFilterComp=h;var g=function(t){n(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.lastKnownModel=null;return e}e.prototype.init=function(e){this.onFloatingFilterChanged=e.onFloatingFilterChanged;this.currentParentModel=e.currentParentModel;var t=e.debounceMs!=null?e.debounceMs:500;var i=u._.debounce(this.onDateChanged.bind(this),t);var n={onDateChanged:i,filterParams:e.column.getColDef().filterParams};this.dateComponentPromise=this.componentRecipes.newDateComponent(n);var r=u._.loadTemplate("<div></div>");this.dateComponentPromise.then(function(e){r.appendChild(e.getGui())});this.setTemplateFromElement(r)};e.prototype.onDateChanged=function(){var e=this.currentParentModel();var t=this.asParentModel();if(this.equalModels(e,t)){return}this.onFloatingFilterChanged({model:t,apply:true});this.lastKnownModel=t};e.prototype.equalModels=function(e,t){if(u._.referenceCompare(e,t)){return true}if(!e||!t){return false}if(Array.isArray(e)||Array.isArray(t)){return false}return u._.referenceCompare(e.type,t.type)&&u._.referenceCompare(e.dateFrom,t.dateFrom)&&u._.referenceCompare(e.dateTo,t.dateTo)&&u._.referenceCompare(e.filterType,t.filterType)};e.prototype.asParentModel=function(){var e=this.currentParentModel();var t=this.dateComponentPromise.resolveNow(null,function(e){return e.getDate()});var i=u._.serializeDateToYyyyMmDd(s.DateFilter.removeTimezone(t),"-");return{type:e.type,dateFrom:i,dateTo:e?e.dateTo:null,filterType:"date"}};e.prototype.onParentModelChanged=function(t){this.lastKnownModel=t;this.dateComponentPromise.then(function(e){if(!t||!t.dateFrom){e.setDate(null);return}e.setDate(u._.parseYyyyMmDdToDate(t.dateFrom,"-"))})};r([a.Autowired("componentRecipes"),o("design:type",c.ComponentRecipes)],e.prototype,"componentRecipes",void 0);return e}(d.Component);t.DateFloatingFilterComp=g;var v=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.asFloatingFilterText=function(e){var t=this.currentParentModel();if(e==null&&t==null){return""}if(e==null&&t!=null&&t.type!=="inRange"){this.eColumnFloatingFilter.readOnly=false;return""}if(t!=null&&t.type==="inRange"){this.eColumnFloatingFilter.readOnly=true;return this.parseAsText(t)}this.eColumnFloatingFilter.readOnly=false;return this.parseAsText(e)};t.prototype.parseAsText=function(e){if(e.type&&e.type==="inRange"){var t=this.asNumber(e.filter);var i=this.asNumber(e.filterTo);return(t?t+"":"")+"-"+(i?i+"":"")}var n=this.asNumber(e.filter);return n!=null?n+"":""};t.prototype.asParentModel=function(){var e=this.currentParentModel();var t=this.asNumber(this.eColumnFloatingFilter.value);var i=this.eColumnFloatingFilter.value;var n=null;if(t==null&&i===""){n=null}else if(t==null){n=e.filter}else{n=t}return{type:e.type,filter:n,filterTo:!e?null:e.filterTo,filterType:"number"}};t.prototype.asNumber=function(e){if(e==null){return null}if(e===""){return null}var t=Number(e);var i=!u._.isNumeric(t);return i?null:t};return t}(p);t.NumberFloatingFilterComp=v;var m=function(t){n(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.init=function(e){t.prototype.init.call(this,e);this.eColumnFloatingFilter.readOnly=true};e.prototype.asFloatingFilterText=function(e){this.eColumnFloatingFilter.readOnly=true;if(!e)return"";var t=e instanceof Array?e:e.values;if(t.length===0){return""}var i=t.length>10?t.slice(0,10).concat("..."):t;return"("+t.length+") "+i.join(",")};e.prototype.parseAsText=function(e){return this.asFloatingFilterText(e)};e.prototype.asParentModel=function(){if(this.eColumnFloatingFilter.value==null||this.eColumnFloatingFilter.value===""){return{values:[],filterType:"set"}}return{values:this.eColumnFloatingFilter.value.split(","),filterType:"set"}};e.prototype.equalModels=function(e,t){return false};return e}(p);t.SetFloatingFilterComp=m;var y=function(t){n(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.init=function(e){t.prototype.init.call(this,e);this.eColumnFloatingFilter.readOnly=true};e.prototype.onParentModelChanged=function(e){this.eColumnFloatingFilter.value=this.asFloatingFilterText(this.currentParentModel())};e.prototype.asFloatingFilterText=function(e){return e};e.prototype.parseAsText=function(e){return e};e.prototype.asParentModel=function(){return null};return e}(p);t.ReadModelAsStringFloatingFilterComp=y},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(67);var o=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.isPopup=function(){return true};return t}(r.TextCellEditor);t.PopupTextCellEditor=o},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(75);var o=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.isPopup=function(){return true};return t}(r.SelectCellEditor);t.PopupSelectCellEditor=o},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:true});var r=i(8);var o=i(9);var a=i(1);var s=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.init=function(e){this.params=e;this.focusAfterAttached=e.cellStartedEdit;this.textarea=document.createElement("textarea");this.textarea.maxLength=e.maxLength?e.maxLength:"200";this.textarea.cols=e.cols?e.cols:"60";this.textarea.rows=e.rows?e.rows:"10";if(a.Utils.exists(e.value)){this.textarea.value=e.value.toString()}this.getGui().querySelector(".ag-large-textarea").appendChild(this.textarea);this.addGuiEventListener("keydown",this.onKeyDown.bind(this))};t.prototype.onKeyDown=function(e){var t=e.which||e.keyCode;if(t==o.Constants.KEY_LEFT||t==o.Constants.KEY_UP||t==o.Constants.KEY_RIGHT||t==o.Constants.KEY_DOWN||e.shiftKey&&t==o.Constants.KEY_ENTER){e.stopPropagation()}};t.prototype.afterGuiAttached=function(){if(this.focusAfterAttached){this.textarea.focus()}};t.prototype.getValue=function(){return this.textarea.value};t.prototype.isPopup=function(){return true};t.TEMPLATE='<div class="ag-large-text" tabindex="0">'+'<div class="ag-large-textarea"></div>'+"</div>";return t}(r.Component);t.LargeTextCellEditor=s},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(1);var l=i(51);var u=i(11);var r=function(t){n(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.prototype.getDefaultType=function(){return l.BaseFilter.CONTAINS};r.prototype.customInit=function(){this.comparator=this.filterParams.textCustomComparator?this.filterParams.textCustomComparator:r.DEFAULT_COMPARATOR;this.formatter=this.filterParams.textFormatter?this.filterParams.textFormatter:this.filterParams.caseSensitive==true?r.DEFAULT_FORMATTER:r.DEFAULT_LOWERCASE_FORMATTER;t.prototype.customInit.call(this)};r.prototype.modelFromFloatingFilter=function(e){return{type:this.filter,filter:e,filterType:"text"}};r.prototype.getApplicableFilterTypes=function(){return[l.BaseFilter.EQUALS,l.BaseFilter.NOT_EQUAL,l.BaseFilter.STARTS_WITH,l.BaseFilter.ENDS_WITH,l.BaseFilter.CONTAINS,l.BaseFilter.NOT_CONTAINS]};r.prototype.bodyTemplate=function(e){var t=this.translate.bind(this);var i=e==l.FilterConditionType.MAIN?"filterText":"filterConditionText";return'<div class="ag-filter-body">\n            <input class="ag-filter-filter" id='+i+' type="text" placeholder="'+t("filterOoo","Filter...")+'"/>\n        </div>'};r.prototype.initialiseFilterBodyUi=function(e){t.prototype.initialiseFilterBodyUi.call(this,e);this.addFilterChangedListener(e);this.setFilter(this.filterConditionText,l.FilterConditionType.CONDITION);this.setFilterType(this.filterCondition,l.FilterConditionType.CONDITION)};r.prototype.addFilterChangedListener=function(e){var t=this;var i=e===l.FilterConditionType.MAIN?this.eFilterTextField:this.eFilterConditionTextField;var n=this.getDebounceMs(this.filterParams);var r=s.Utils.debounce(function(){return t.onFilterTextFieldChanged(e)},n);this.addDestroyableEventListener(i,"input",r)};r.prototype.refreshFilterBodyUi=function(e){if(this.eFilterConditionTextField){this.addFilterChangedListener(l.FilterConditionType.CONDITION)}};r.prototype.afterGuiAttached=function(){this.eFilterTextField.focus()};r.prototype.filterValues=function(e){return e===l.FilterConditionType.MAIN?this.filterText:this.filterConditionText};r.prototype.individualFilterPasses=function(e,t){var i=t==l.FilterConditionType.MAIN?this.filterText:this.filterConditionText;var n=t==l.FilterConditionType.MAIN?this.filter:this.filterCondition;if(!i){return t===l.FilterConditionType.MAIN?true:this.conditionValue==="AND"}else{return this.checkIndividualFilter(e,n,i)}};r.prototype.checkIndividualFilter=function(e,t,i){var n=this.filterParams.valueGetter(e.node);if(!n){return t===l.BaseFilter.NOT_EQUAL||t===l.BaseFilter.NOT_CONTAINS}var r=this.formatter(n);return this.comparator(t,r,i)};r.prototype.onFilterTextFieldChanged=function(e){var t=e===l.FilterConditionType.MAIN?this.eFilterTextField.value:this.eFilterConditionTextField.value;var i=e===l.FilterConditionType.MAIN?this.filterText:this.filterConditionText;var n=s.Utils.makeNull(t);if(n&&n.trim()===""){n=null}if(i!==n){var r=n&&this.filterParams.caseSensitive!=true?n.toLowerCase():n;var o=i&&this.filterParams.caseSensitive!=true?i.toLowerCase():i;if(e===l.FilterConditionType.MAIN){this.filterText=this.formatter(n)}else{this.filterConditionText=this.formatter(n)}if(o!==r){this.onFilterChanged()}}};r.prototype.setFilter=function(e,t){e=s.Utils.makeNull(e);if(t===l.FilterConditionType.MAIN){if(e){this.filterText=this.formatter(e);if(!this.eFilterTextField)return;this.eFilterTextField.value=e}else{this.filterText=null;if(!this.eFilterTextField)return;this.eFilterTextField.value=null}}else{if(e){this.filterConditionText=this.formatter(e);if(!this.eFilterConditionTextField)return;this.eFilterConditionTextField.value=e}else{this.filterConditionText=null;if(!this.eFilterConditionTextField)return;this.eFilterConditionTextField.value=null}}};r.prototype.getFilter=function(){return this.filterText};r.prototype.resetState=function(){this.setFilter(null,l.FilterConditionType.MAIN);this.setFilterType(this.defaultFilter,l.FilterConditionType.MAIN);this.setFilter(null,l.FilterConditionType.CONDITION);this.setFilterType(this.defaultFilter,l.FilterConditionType.CONDITION)};r.prototype.serialize=function(e){var t=e===l.FilterConditionType.MAIN?this.filter:this.filterCondition;var i=e===l.FilterConditionType.MAIN?this.filterText:this.filterConditionText;return{type:t?t:this.defaultFilter,filter:i,filterType:"text"}};r.prototype.parse=function(e,t){this.setFilterType(e.type,t);this.setFilter(e.filter,t)};r.prototype.setType=function(e,t){this.setFilterType(e,t)};r.DEFAULT_FORMATTER=function(e){return e};r.DEFAULT_LOWERCASE_FORMATTER=function(e){if(e==null){return null}return e.toString().toLowerCase()};r.DEFAULT_COMPARATOR=function(e,t,i){switch(e){case r.CONTAINS:return t.indexOf(i)>=0;case r.NOT_CONTAINS:return t.indexOf(i)===-1;case r.EQUALS:return t===i;case r.NOT_EQUAL:return t!=i;case r.STARTS_WITH:return t.indexOf(i)===0;case r.ENDS_WITH:var n=t.lastIndexOf(i);return n>=0&&n===t.length-i.length;default:console.warn("invalid filter type "+e);return false}};o([u.QuerySelector("#filterText"),a("design:type",HTMLInputElement)],r.prototype,"eFilterTextField",void 0);o([u.QuerySelector("#filterConditionText"),a("design:type",HTMLInputElement)],r.prototype,"eFilterConditionTextField",void 0);return r}(l.ComparableBaseFilter);t.TextFilter=r},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(1);var l=i(11);var u=i(51);var r=function(t){n(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.prototype.modelFromFloatingFilter=function(e){return{type:this.filter,filter:Number(e),filterTo:this.filterNumberTo,filterType:"number"}};r.prototype.getApplicableFilterTypes=function(){return[u.BaseFilter.EQUALS,u.BaseFilter.NOT_EQUAL,u.BaseFilter.LESS_THAN,u.BaseFilter.LESS_THAN_OR_EQUAL,u.BaseFilter.GREATER_THAN,u.BaseFilter.GREATER_THAN_OR_EQUAL,u.BaseFilter.IN_RANGE]};r.prototype.bodyTemplate=function(e){var t=this.translate.bind(this);var i=e==u.FilterConditionType.MAIN?"filterText":"filterConditionText";var n=e==u.FilterConditionType.MAIN?"filterNumberToPanel":"filterNumberToPanelCondition";var r=e==u.FilterConditionType.MAIN?"filterToText":"filterToConditionText";return'<div class="ag-filter-body">\n            <div>\n                <input class="ag-filter-filter" id="'+i+'" type="text" placeholder="'+t("filterOoo")+'"/>\n            </div>\n             <div class="ag-filter-number-to" id="'+n+'">\n                <input class="ag-filter-filter" id="'+r+'" type="text" placeholder="'+t("filterOoo")+'"/>\n            </div>\n        </div>'};r.prototype.initialiseFilterBodyUi=function(e){t.prototype.initialiseFilterBodyUi.call(this,e);if(e===u.FilterConditionType.MAIN){this.eFilterTextField=this.queryForHtmlInputElement("#filterText");this.addFilterChangedEventListeners(e,this.eFilterTextField,this.eFilterToTextField)}else{this.eFilterTextConditionField=this.queryForHtmlInputElement("#filterConditionText");this.addFilterChangedEventListeners(e,this.eFilterTextConditionField,this.eFilterToConditionText);this.setFilter(this.filterNumberCondition,u.FilterConditionType.CONDITION);this.setFilterTo(this.filterNumberConditionTo,u.FilterConditionType.CONDITION);this.setFilterType(this.filterCondition,u.FilterConditionType.CONDITION)}};r.prototype.addFilterChangedEventListeners=function(e,t,i){var n=this;var r=this.getDebounceMs(this.filterParams);var o=s.Utils.debounce(function(){return n.onTextFieldsChanged(e,t,i)},r);this.addDestroyableEventListener(t,"input",o);this.addDestroyableEventListener(i,"input",o)};r.prototype.afterGuiAttached=function(){this.eFilterTextField.focus()};r.prototype.comparator=function(){return function(e,t){if(e===t){return 0}if(e<t){return 1}if(e>t){return-1}}};r.prototype.onTextFieldsChanged=function(e,t,i){var n=this.stringToFloat(t.value);var r=this.stringToFloat(i.value);if(e===u.FilterConditionType.MAIN){if(this.filterNumber!==n||this.filterNumberTo!==r){this.filterNumber=n;this.filterNumberTo=r;this.onFilterChanged()}}else{if(this.filterNumberCondition!==n||this.filterNumberConditionTo!==r){this.filterNumberCondition=n;this.filterNumberConditionTo=r;this.onFilterChanged()}}};r.prototype.filterValues=function(e){if(e===u.FilterConditionType.MAIN){return this.filter!==u.BaseFilter.IN_RANGE?this.asNumber(this.filterNumber):[this.asNumber(this.filterNumber),this.asNumber(this.filterNumberTo)]}return this.filterCondition!==u.BaseFilter.IN_RANGE?this.asNumber(this.filterNumberCondition):[this.asNumber(this.filterNumberCondition),this.asNumber(this.filterNumberConditionTo)]};r.prototype.asNumber=function(e){return s.Utils.isNumeric(e)?e:null};r.prototype.stringToFloat=function(e){var t=s.Utils.makeNull(e);if(t&&t.trim()===""){t=null}var i;if(t!==null&&t!==undefined){i=parseFloat(t)}else{i=null}return i};r.prototype.setFilter=function(e,t){e=s.Utils.makeNull(e);if(e!==null&&!(typeof e==="number")){e=parseFloat(e)}if(t===u.FilterConditionType.MAIN){this.filterNumber=e;if(!this.eFilterTextField)return;this.eFilterTextField.value=e}else{this.filterNumberCondition=e;if(!this.eFilterTextConditionField)return;this.eFilterTextConditionField.value=e}};r.prototype.setFilterTo=function(e,t){e=s.Utils.makeNull(e);if(e!==null&&!(typeof e==="number")){e=parseFloat(e)}if(t===u.FilterConditionType.MAIN){this.filterNumberTo=e;if(!this.eFilterToTextField)return;this.eFilterToTextField.value=e}else{this.filterNumberConditionTo=e;if(!this.eFilterToConditionText)return;this.eFilterToConditionText.value=e}};r.prototype.getFilter=function(e){return e===u.FilterConditionType.MAIN?this.filterNumber:this.filterNumberCondition};r.prototype.serialize=function(e){var t=e===u.FilterConditionType.MAIN?this.filter:this.filterCondition;var i=e===u.FilterConditionType.MAIN?this.filterNumber:this.filterNumberCondition;var n=e===u.FilterConditionType.MAIN?this.filterNumberTo:this.filterNumberConditionTo;return{type:t?t:this.defaultFilter,filter:i,filterTo:n,filterType:"number"}};r.prototype.parse=function(e,t){this.setFilterType(e.type,t);this.setFilter(e.filter,t);this.setFilterTo(e.filterTo,t)};r.prototype.refreshFilterBodyUi=function(e){var t=e===u.FilterConditionType.MAIN?this.filter:this.filterCondition;var i=e===u.FilterConditionType.MAIN?this.eNumberToPanel:this.eNumberToConditionPanel;if(!i)return;var n=t===r.IN_RANGE;s.Utils.setVisible(i,n)};r.prototype.resetState=function(){this.setFilterType(this.defaultFilter,u.FilterConditionType.MAIN);this.setFilter(null,u.FilterConditionType.MAIN);this.setFilterTo(null,u.FilterConditionType.MAIN);this.setFilterType(this.defaultFilter,u.FilterConditionType.CONDITION);this.setFilter(null,u.FilterConditionType.CONDITION);this.setFilterTo(null,u.FilterConditionType.CONDITION)};r.prototype.setType=function(e,t){this.setFilterType(e,t)};r.LESS_THAN="lessThan";o([l.QuerySelector("#filterNumberToPanel"),a("design:type",HTMLElement)],r.prototype,"eNumberToPanel",void 0);o([l.QuerySelector("#filterNumberToPanelCondition"),a("design:type",HTMLElement)],r.prototype,"eNumberToConditionPanel",void 0);o([l.QuerySelector("#filterToText"),a("design:type",HTMLInputElement)],r.prototype,"eFilterToTextField",void 0);o([l.QuerySelector("#filterToConditionText"),a("design:type",HTMLInputElement)],r.prototype,"eFilterToConditionText",void 0);return r}(u.ScalarBaseFilter);t.NumberFilter=r},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(23);var s=i(9);var l=i(44);var u=i(29);var c=i(22);var d=i(1);var f=i(37);var p=i(4);var h=i(2);var g=function(){function e(){}e.prototype.init=function(){this.scrollWidth=this.gridOptionsWrapper.getScrollbarWidth()};e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.handlePageScrollingKey=function(e){var t=e.which||e.keyCode;var i=e.altKey;var n=e.ctrlKey;var r=this.mouseEventService.getGridCellForEvent(e).getGridCellDef();if(!r){return false}var o=false;switch(t){case s.Constants.KEY_PAGE_HOME:case s.Constants.KEY_PAGE_END:if(!n&&!i){this.onHomeOrEndKey(t);o=true}break;case s.Constants.KEY_LEFT:case s.Constants.KEY_RIGHT:if(n&&!i){this.onCtrlLeftOrRight(t,r);o=true}break;case s.Constants.KEY_UP:case s.Constants.KEY_DOWN:if(n&&!i){this.onCtrlUpOrDown(t,r);o=true}break;case s.Constants.KEY_PAGE_DOWN:if(!n&&!i){this.onPageDown(r);o=true}break;case s.Constants.KEY_PAGE_UP:if(!n&&!i){this.onPageUp(r);o=true}break}if(o){e.preventDefault()}return o};e.prototype.onPageDown=function(e){var t=this.gridPanel.getVScrollPosition();var i=t.bottom-t.top;if(this.gridPanel.isHorizontalScrollShowing()){i-=this.scrollWidth}var n=this.paginationProxy.getPixelOffset();var r=t.top+i;var o=this.paginationProxy.getRowIndexAtPixel(r+n);var a=o;var s=this.paginationProxy.getRow(e.rowIndex).rowTop;var l=s+i-n;var u=this.paginationProxy.getRowIndexAtPixel(l+n);var c=this.paginationProxy.getPageLastRow();if(u>c){u=c}if(a>c){a=c}this.navigateTo(a,"top",null,u,e.column)};e.prototype.onPageUp=function(e){var t=this.gridPanel.getVScrollPosition();var i=t.bottom-t.top;if(this.gridPanel.isHorizontalScrollShowing()){i-=this.scrollWidth}var n=this.paginationProxy.getPixelOffset();var r=t.top;var o=this.paginationProxy.getRowIndexAtPixel(r+n);var a=o;var s=this.paginationProxy.getRow(e.rowIndex);var l=s.rowTop+s.rowHeight-i-n;var u=this.paginationProxy.getRowIndexAtPixel(l+n);var c=this.paginationProxy.getPageFirstRow();if(u<c){u=c}if(a<c){a=c}this.navigateTo(a,"bottom",null,u,e.column)};e.prototype.navigateTo=function(e,t,i,n,r){if(d._.exists(i)){this.gridPanel.ensureColumnVisible(i)}if(d._.exists(e)){this.gridPanel.ensureIndexVisible(e,t)}this.animationFrameService.flushAllFrames();this.focusedCellController.setFocusedCell(n,r,null,true);if(this.rangeController){var o=new a.GridCell({rowIndex:n,floating:null,column:r});this.rangeController.setRangeToCell(o)}};e.prototype.onCtrlUpOrDown=function(e,t){var i=e===s.Constants.KEY_UP;var n=i?0:this.paginationProxy.getPageLastRow();this.navigateTo(n,null,t.column,n,t.column)};e.prototype.onCtrlLeftOrRight=function(e,t){var i=e===s.Constants.KEY_LEFT;var n=this.columnController.getAllDisplayedColumns();var r=i?n[0]:n[n.length-1];this.navigateTo(t.rowIndex,null,r,t.rowIndex,r)};e.prototype.onHomeOrEndKey=function(e){var t=e===s.Constants.KEY_PAGE_HOME;var i=this.columnController.getAllDisplayedColumns();var n=t?i[0]:i[i.length-1];var r=t?0:this.paginationProxy.getPageLastRow();this.navigateTo(r,null,n,r,n)};n([o.Autowired("mouseEventService"),r("design:type",l.MouseEventService)],e.prototype,"mouseEventService",void 0);n([o.Autowired("paginationProxy"),r("design:type",u.PaginationProxy)],e.prototype,"paginationProxy",void 0);n([o.Autowired("focusedCellController"),r("design:type",c.FocusedCellController)],e.prototype,"focusedCellController",void 0);n([o.Autowired("animationFrameService"),r("design:type",f.AnimationFrameService)],e.prototype,"animationFrameService",void 0);n([o.Optional("rangeController"),r("design:type",Object)],e.prototype,"rangeController",void 0);n([o.Autowired("columnController"),r("design:type",p.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",h.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("navigationService")],e);return e}();t.NavigationService=g},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(1);var a=i(2);var s=i(0);var l=i(15);var u=i(4);var c=i(3);var d=i(5);var f=i(99);var p=i(101);var h=i(10);var g=i(36);var v=function(){function e(e,t,i){this.headerRowComps=[];this.eContainer=e;this.pinned=i;this.eViewport=t}e.prototype.registerGridComp=function(e){this.setupDragAndDrop(e)};e.prototype.forEachHeaderElement=function(t){this.headerRowComps.forEach(function(e){return e.forEachHeaderElement(t)})};e.prototype.init=function(){this.scrollWidth=this.gridOptionsWrapper.getScrollbarWidth();this.eventService.addEventListener(d.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this));this.eventService.addEventListener(d.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this));this.eventService.addEventListener(d.Events.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this));this.eventService.addEventListener(d.Events.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this));this.eventService.addEventListener(d.Events.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this));this.eventService.addEventListener(d.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this))};e.prototype.onColumnRowGroupChanged=function(){this.onGridColumnsChanged()};e.prototype.onColumnValueChanged=function(){this.onGridColumnsChanged()};e.prototype.onColumnResized=function(){this.setWidthOfPinnedContainer()};e.prototype.onDisplayedColumnsChanged=function(){this.setWidthOfPinnedContainer()};e.prototype.onScrollVisibilityChanged=function(){this.setWidthOfPinnedContainer()};e.prototype.setWidthOfPinnedContainer=function(){var e=this.pinned===h.Column.PINNED_LEFT;var t=this.pinned===h.Column.PINNED_RIGHT;if(e||t){var i=e?this.columnController.getPinnedLeftContainerWidth():this.columnController.getPinnedRightContainerWidth();var n=e?this.scrollVisibleService.isLeftVerticalScrollShowing():this.scrollVisibleService.isRightVerticalScrollShowing();if(n){i+=this.scrollWidth}this.eContainer.style.width=i+"px"}};e.prototype.destroy=function(){this.removeHeaderRowComps()};e.prototype.onGridColumnsChanged=function(){this.removeHeaderRowComps();this.createHeaderRowComps()};e.prototype.refresh=function(){this.onGridColumnsChanged()};e.prototype.setupDragAndDrop=function(e){var t=this.eViewport?this.eViewport:this.eContainer;var i=new p.BodyDropTarget(this.pinned,t);this.context.wireBean(i);i.registerGridComp(e)};e.prototype.removeHeaderRowComps=function(){this.headerRowComps.forEach(function(e){e.destroy()});this.headerRowComps.length=0;o.Utils.removeAllChildren(this.eContainer)};e.prototype.createHeaderRowComps=function(){var e=this.columnController.getHeaderRowCount();for(var t=0;t<e;t++){var i=t!==e-1;var n=i?f.HeaderRowType.COLUMN_GROUP:f.HeaderRowType.COLUMN;var r=new f.HeaderRowComp(t,n,this.pinned,this.dropTarget);this.context.wireBean(r);this.headerRowComps.push(r);this.eContainer.appendChild(r.getGui())}var o=this.gridOptionsWrapper.isFloatingFilter()&&!this.columnController.isPivotMode();if(o){var r=new f.HeaderRowComp(e,f.HeaderRowType.FLOATING_FILTER,this.pinned,this.dropTarget);this.context.wireBean(r);this.headerRowComps.push(r);this.eContainer.appendChild(r.getGui())}};n([s.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([s.Autowired("context"),r("design:type",s.Context)],e.prototype,"context",void 0);n([s.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);n([s.Autowired("dragAndDropService"),r("design:type",l.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([s.Autowired("columnController"),r("design:type",u.ColumnController)],e.prototype,"columnController",void 0);n([s.Autowired("eventService"),r("design:type",c.EventService)],e.prototype,"eventService",void 0);n([s.Autowired("scrollVisibleService"),r("design:type",g.ScrollVisibleService)],e.prototype,"scrollVisibleService",void 0);n([s.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);return e}();t.HeaderContainer=v},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(8);var s=i(0);var l=i(2);var u=i(4);var c=i(10);var d=i(3);var f=i(5);var p=i(1);var h=i(100);var g=i(133);var v=i(18);var m=i(21);var y=i(6);var b;(function(e){e[e["COLUMN_GROUP"]=0]="COLUMN_GROUP";e[e["COLUMN"]=1]="COLUMN";e[e["FLOATING_FILTER"]=2]="FLOATING_FILTER"})(b=t.HeaderRowType||(t.HeaderRowType={}));var _=function(o){n(e,o);function e(e,t,i,n){var r=o.call(this,'<div class="ag-header-row" role="presentation"/>')||this;r.headerComps={};r.dept=e;r.type=t;r.pinned=i;r.dropTarget=n;return r}e.prototype.forEachHeaderElement=function(t){var i=this;Object.keys(this.headerComps).forEach(function(e){t(i.headerComps[e])})};e.prototype.destroy=function(){var e=Object.keys(this.headerComps);this.removeAndDestroyChildComponents(e);o.prototype.destroy.call(this)};e.prototype.removeAndDestroyChildComponents=function(e){var i=this;e.forEach(function(e){var t=i.headerComps[e];i.getGui().removeChild(t.getGui());if(t.destroy){t.destroy()}delete i.headerComps[e]})};e.prototype.onRowHeightChanged=function(){var e=this.columnController.getHeaderRowCount();var t=[];var i=0;var n;var r;if(!this.columnController.isPivotMode()){if(this.gridOptionsWrapper.isFloatingFilter()){e++}i=this.gridOptionsWrapper.isFloatingFilter()?1:0;n=this.gridOptionsWrapper.getGroupHeaderHeight();r=this.gridOptionsWrapper.getHeaderHeight()}else{i=0;n=this.gridOptionsWrapper.getPivotGroupHeaderHeight();r=this.gridOptionsWrapper.getPivotHeaderHeight()}var o=1+i;var a=e-o;for(var s=0;s<a;s++){t.push(n)}t.push(r);for(var s=0;s<i;s++){t.push(this.gridOptionsWrapper.getFloatingFiltersHeight())}var l=0;for(var s=0;s<this.dept;s++){l+=t[s]}this.getGui().style.top=l+"px";this.getGui().style.height=t[this.dept]+"px"};e.prototype.init=function(){this.onRowHeightChanged();this.onVirtualColumnsChanged();this.setWidth();this.addDestroyableEventListener(this.gridOptionsWrapper,l.GridOptionsWrapper.PROP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,l.GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,l.GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,l.GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.gridOptionsWrapper,l.GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT,this.onRowHeightChanged.bind(this));this.addDestroyableEventListener(this.eventService,f.Events.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this));this.addDestroyableEventListener(this.eventService,f.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this));this.addDestroyableEventListener(this.eventService,f.Events.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this));this.addDestroyableEventListener(this.eventService,f.Events.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this))};e.prototype.onColumnResized=function(){this.setWidth()};e.prototype.setWidth=function(){var e=this.columnController.getContainerWidth(this.pinned)+"px";this.getGui().style.width=e};e.prototype.onGridColumnsChanged=function(){this.removeAndDestroyAllChildComponents()};e.prototype.removeAndDestroyAllChildComponents=function(){var e=Object.keys(this.headerComps);this.removeAndDestroyChildComponents(e)};e.prototype.onDisplayedColumnsChanged=function(){this.onVirtualColumnsChanged();this.setWidth()};e.prototype.onVirtualColumnsChanged=function(){var a=this;var s=Object.keys(this.headerComps);var e=this.columnController.getVirtualHeaderGroupRow(this.pinned,this.type==b.FLOATING_FILTER?this.dept-1:this.dept);var l=this.gridOptionsWrapper.isEnsureDomOrder();var u;e.forEach(function(e){if(e.isEmptyGroup()){return}var t=e.getUniqueId();var i=a.getGui();var n=s.indexOf(t)>=0;var r;var o;if(n){p.Utils.removeFromArray(s,t);r=a.headerComps[t];o=r.getGui();if(l){p.Utils.ensureDomOrder(i,o,u)}u=o}else{r=a.createHeaderComp(e);a.headerComps[t]=r;o=r.getGui();if(l){p.Utils.insertWithDomOrder(i,o,u)}else{i.appendChild(o)}u=o}});this.removeAndDestroyChildComponents(s)};e.prototype.createHeaderComp=function(e){var t;switch(this.type){case b.COLUMN:t=new h.HeaderWrapperComp(e,this.dropTarget,this.pinned);break;case b.COLUMN_GROUP:t=new g.HeaderGroupWrapperComp(e,this.dropTarget,this.pinned);break;case b.FLOATING_FILTER:var i=e;t=this.createFloatingFilterWrapper(i);break}this.context.wireBean(t);return t};e.prototype.createFloatingFilterWrapper=function(t){var i=this;var e=this.createFloatingFilterParams(t);var n=this.componentRecipes.newFloatingFilterWrapperComponent(t,e);this.addDestroyableEventListener(t,c.Column.EVENT_FILTER_CHANGED,function(){var e=i.filterManager.getFilterComponent(t);n.onParentModelChanged(e.resolveNow(null,function(e){return e.getModel()}))});var r=this.filterManager.cachedFilter(t);if(r){var o=this.filterManager.getFilterComponent(t);n.onParentModelChanged(o.resolveNow(null,function(e){return e.getModel()}))}return n};e.prototype.createFloatingFilterParams=function(r){var o=this;var e={api:this.gridApi,column:r,currentParentModel:function(){var e=o.filterManager.getFilterComponent(r);var t=e.resolveNow(null,function(e){return e.getNullableModel?e.getNullableModel():e.getModel()});return t.operator!=null?t.condition1:t},onFloatingFilterChanged:function(i){var n;var e=new p.Promise(function(e){n=e});var t=o.filterManager.getFilterComponent(r);t.then(function(e){if(e.onFloatingFilterChanged){var t=e.onFloatingFilterChanged(i);n(t)}else{e.setModel(i);o.filterManager.onFilterChanged();n(true)}});return e.resolveNow(true,function(e){return e})},suppressFilterButton:false};return e};r([s.Autowired("gridOptionsWrapper"),a("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);r([s.Autowired("gridApi"),a("design:type",y.GridApi)],e.prototype,"gridApi",void 0);r([s.Autowired("columnController"),a("design:type",u.ColumnController)],e.prototype,"columnController",void 0);r([s.Autowired("context"),a("design:type",s.Context)],e.prototype,"context",void 0);r([s.Autowired("eventService"),a("design:type",d.EventService)],e.prototype,"eventService",void 0);r([s.Autowired("filterManager"),a("design:type",v.FilterManager)],e.prototype,"filterManager",void 0);r([s.Autowired("componentRecipes"),a("design:type",m.ComponentRecipes)],e.prototype,"componentRecipes",void 0);r([s.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"init",null);return e}(o.Component);t.HeaderRowComp=_},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var a=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var s=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var r=i(8);var l=i(0);var u=i(10);var c=i(1);var d=i(15);var f=i(7);var p=i(4);var h=i(59);var g=i(2);var v=i(81);var m=i(52);var y=i(6);var b=i(24);var _=i(3);var w=i(21);var C=i(60);var A=i(11);var E=i(132);var x=i(5);var T=i(45);var S=i(28);var D=i(74);var k=i(46);var o=function(r){n(o,r);function o(e,t,i){var n=r.call(this,o.TEMPLATE)||this;n.column=e;n.dragSourceDropTarget=t;n.pinned=i;return n}o.prototype.getColumn=function(){return this.column};o.prototype.init=function(){this.instantiate(this.context);var e=this.columnController.getDisplayNameForColumn(this.column,"header",true);var t=this.gridOptionsWrapper.isEnableSorting()&&!this.column.getColDef().suppressSorting;var i=this.menuFactory.isMenuEnabled(this.column)&&!this.column.getColDef().suppressMenu;this.appendHeaderComp(e,t,i);this.setupWidth();this.setupMovingCss();this.setupTooltip();this.setupResize();this.setupMenuClass();this.setupSortableClass(t);this.addColumnHoverListener();this.addFeature(this.context,new D.HoverFeature([this.column],this.getGui()));this.addDestroyableEventListener(this.column,u.Column.EVENT_FILTER_ACTIVE_CHANGED,this.onFilterChanged.bind(this));this.onFilterChanged();this.addFeature(this.context,new E.SelectAllFeature(this.cbSelectAll,this.column));var n=new m.SetLeftFeature(this.column,this.getGui(),this.beans);n.init();this.addDestroyFunc(n.destroy.bind(n));this.addAttributes();v.CssClassApplier.addHeaderClassesFromColDef(this.column.getColDef(),this.getGui(),this.gridOptionsWrapper,this.column,null)};o.prototype.addColumnHoverListener=function(){this.addDestroyableEventListener(this.eventService,x.Events.EVENT_COLUMN_HOVER_CHANGED,this.onColumnHover.bind(this));this.onColumnHover()};o.prototype.onColumnHover=function(){var e=this.columnHoverService.isHovered(this.column);c.Utils.addOrRemoveCssClass(this.getGui(),"ag-column-hover",e)};o.prototype.setupSortableClass=function(e){if(e){var t=this.getGui();c.Utils.addCssClass(t,"ag-header-cell-sortable")}};o.prototype.onFilterChanged=function(){var e=this.column.isFilterActive();c.Utils.addOrRemoveCssClass(this.getGui(),"ag-header-cell-filtered",e)};o.prototype.appendHeaderComp=function(e,t,i){var n=this;var r={column:this.column,displayName:e,enableSorting:t,enableMenu:i,showColumnMenu:function(e){n.gridApi.showColumnMenuAfterButtonClick(n.column,e)},progressSort:function(e){n.sortController.progressSort(n.column,!!e,"uiColumnSorted")},setSort:function(e,t){n.sortController.setSortForColumn(n.column,e,!!t,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};var o=this.afterHeaderCompCreated.bind(this,e);this.componentRecipes.newHeaderComponent(r).then(o)};o.prototype.afterHeaderCompCreated=function(e,t){this.appendChild(t);this.setupMove(t.getGui(),e);if(t.destroy){this.addDestroyFunc(t.destroy.bind(t))}};o.prototype.onColumnMovingChanged=function(){if(this.column.isMoving()){c.Utils.addCssClass(this.getGui(),"ag-header-cell-moving")}else{c.Utils.removeCssClass(this.getGui(),"ag-header-cell-moving")}};o.prototype.setupMove=function(e,t){var i=this;var n=this.gridOptionsWrapper.isSuppressMovableColumns()||this.column.getColDef().suppressMovable||this.column.isLockPosition();if(n){return}if(e){var r={type:d.DragSourceType.HeaderCell,eElement:e,dragItemCallback:function(){return i.createDragItem()},dragItemName:t,dragSourceDropTarget:this.dragSourceDropTarget,dragStarted:function(){return i.column.setMoving(true,"uiColumnMoved")},dragStopped:function(){return i.column.setMoving(false,"uiColumnMoved")}};this.dragAndDropService.addDragSource(r,true);this.addDestroyFunc(function(){return i.dragAndDropService.removeDragSource(r)})}};o.prototype.createDragItem=function(){var e={};e[this.column.getId()]=this.column.isVisible();return{columns:[this.column],visibleState:e}};o.prototype.setupResize=function(){var e=this;var t=this.column.getColDef();if(!this.eResize){return}if(!this.column.isResizable()){c.Utils.removeFromParent(this.eResize);return}var i=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,false),onResizeEnd:this.onResizing.bind(this,true)});this.addDestroyFunc(i);var n=!this.gridOptionsWrapper.isSuppressAutoSize()&&!t.suppressAutoSize;if(n){this.addDestroyableEventListener(this.eResize,"dblclick",function(){e.columnController.autoSizeColumn(e.column,"uiColumnResized")});var r=new k.TouchListener(this.eResize);this.addDestroyableEventListener(r,k.TouchListener.EVENT_DOUBLE_TAP,function(){e.columnController.autoSizeColumn(e.column,"uiColumnResized")});this.addDestroyFunc(r.destroy.bind(r))}};o.prototype.onResizing=function(e,t){var i=this.normaliseResizeAmount(t);var n=this.resizeStartWidth+i;this.columnController.setColumnWidth(this.column,n,this.resizeWithShiftKey,e,"uiColumnDragged")};o.prototype.onResizeStart=function(e){this.resizeStartWidth=this.column.getActualWidth();this.resizeWithShiftKey=e};o.prototype.setupTooltip=function(){var e=this.column.getColDef();if(e.headerTooltip){this.getGui().title=e.headerTooltip}};o.prototype.setupMovingCss=function(){this.addDestroyableEventListener(this.column,u.Column.EVENT_MOVING_CHANGED,this.onColumnMovingChanged.bind(this));this.onColumnMovingChanged()};o.prototype.addAttributes=function(){this.getGui().setAttribute("col-id",this.column.getColId())};o.prototype.setupWidth=function(){this.addDestroyableEventListener(this.column,u.Column.EVENT_WIDTH_CHANGED,this.onColumnWidthChanged.bind(this));this.onColumnWidthChanged()};o.prototype.setupMenuClass=function(){this.addDestroyableEventListener(this.column,u.Column.EVENT_MENU_VISIBLE_CHANGED,this.onMenuVisible.bind(this));this.onColumnWidthChanged()};o.prototype.onMenuVisible=function(){this.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};o.prototype.onColumnWidthChanged=function(){this.getGui().style.width=this.column.getActualWidth()+"px"};o.prototype.normaliseResizeAmount=function(e){var t=e;if(this.gridOptionsWrapper.isEnableRtl()){if(this.pinned!==u.Column.PINNED_LEFT){t*=-1}}else{if(this.pinned===u.Column.PINNED_RIGHT){t*=-1}}return t};o.TEMPLATE='<div class="ag-header-cell" role="presentation" >'+'<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>'+'<ag-checkbox ref="cbSelectAll" class="ag-header-select-all" role="presentation"></ag-checkbox>'+"</div>";a([l.Autowired("gridOptionsWrapper"),s("design:type",g.GridOptionsWrapper)],o.prototype,"gridOptionsWrapper",void 0);a([l.Autowired("dragAndDropService"),s("design:type",d.DragAndDropService)],o.prototype,"dragAndDropService",void 0);a([l.Autowired("columnController"),s("design:type",p.ColumnController)],o.prototype,"columnController",void 0);a([l.Autowired("horizontalResizeService"),s("design:type",h.HorizontalResizeService)],o.prototype,"horizontalResizeService",void 0);a([l.Autowired("context"),s("design:type",l.Context)],o.prototype,"context",void 0);a([l.Autowired("menuFactory"),s("design:type",Object)],o.prototype,"menuFactory",void 0);a([l.Autowired("gridApi"),s("design:type",y.GridApi)],o.prototype,"gridApi",void 0);a([l.Autowired("columnApi"),s("design:type",f.ColumnApi)],o.prototype,"columnApi",void 0);a([l.Autowired("sortController"),s("design:type",b.SortController)],o.prototype,"sortController",void 0);a([l.Autowired("eventService"),s("design:type",_.EventService)],o.prototype,"eventService",void 0);a([l.Autowired("componentRecipes"),s("design:type",w.ComponentRecipes)],o.prototype,"componentRecipes",void 0);a([l.Autowired("columnHoverService"),s("design:type",T.ColumnHoverService)],o.prototype,"columnHoverService",void 0);a([l.Autowired("beans"),s("design:type",S.Beans)],o.prototype,"beans",void 0);a([A.RefSelector("eResize"),s("design:type",HTMLElement)],o.prototype,"eResize",void 0);a([A.RefSelector("cbSelectAll"),s("design:type",C.AgCheckbox)],o.prototype,"cbSelectAll",void 0);a([l.PostConstruct,s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],o.prototype,"init",null);return o}(r.Component);t.HeaderWrapperComp=o},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(15);var a=i(0);var s=i(102);var l=i(10);var u=i(103);var c=i(4);var d;(function(e){e[e["ColumnMove"]=0]="ColumnMove";e[e["Pivot"]=1]="Pivot"})(d||(d={}));var f=function(){function e(e,t){this.dropListeners={};this.pinned=e;this.eContainer=t}e.prototype.registerGridComp=function(e){this.gridPanel=e;this.moveColumnController.registerGridComp(e);switch(this.pinned){case l.Column.PINNED_LEFT:this.eSecondaryContainers=this.gridPanel.getDropTargetLeftContainers();break;case l.Column.PINNED_RIGHT:this.eSecondaryContainers=this.gridPanel.getDropTargetRightContainers();break;default:this.eSecondaryContainers=this.gridPanel.getDropTargetBodyContainers();break}};e.prototype.isInterestedIn=function(e){return e===o.DragSourceType.HeaderCell||e===o.DragSourceType.ToolPanel};e.prototype.getSecondaryContainers=function(){return this.eSecondaryContainers};e.prototype.getContainer=function(){return this.eContainer};e.prototype.init=function(){this.moveColumnController=new s.MoveColumnController(this.pinned,this.eContainer);this.context.wireBean(this.moveColumnController);var e=new u.BodyDropPivotTarget(this.pinned);this.context.wireBean(e);this.dropListeners[d.ColumnMove]=this.moveColumnController;this.dropListeners[d.Pivot]=e;this.dragAndDropService.addDropTarget(this)};e.prototype.getIconName=function(){return this.currentDropListener.getIconName()};e.prototype.getDropType=function(e){if(this.columnController.isPivotMode()){if(e.dragSource.type===o.DragSourceType.ToolPanel){return d.Pivot}else{return d.ColumnMove}}else{return d.ColumnMove}};e.prototype.onDragEnter=function(e){var t=this.getDropType(e);this.currentDropListener=this.dropListeners[t];this.currentDropListener.onDragEnter(e)};e.prototype.onDragLeave=function(e){this.currentDropListener.onDragLeave(e)};e.prototype.onDragging=function(e){this.currentDropListener.onDragging(e)};e.prototype.onDragStop=function(e){this.currentDropListener.onDragStop(e)};n([a.Autowired("context"),r("design:type",a.Context)],e.prototype,"context",void 0);n([a.Autowired("dragAndDropService"),r("design:type",o.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([a.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);n([a.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);return e}();t.BodyDropTarget=f},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(12);var s=i(4);var l=i(10);var b=i(1);var f=i(15);var u=i(2);var c=function(){function e(e,t){this.needToMoveLeft=false;this.needToMoveRight=false;this.pinned=e;this.eContainer=t;this.centerContainer=!b.Utils.exists(e)}e.prototype.registerGridComp=function(e){this.gridPanel=e};e.prototype.init=function(){this.logger=this.loggerFactory.create("MoveColumnController")};e.prototype.getIconName=function(){return this.pinned?f.DragAndDropService.ICON_PINNED:f.DragAndDropService.ICON_MOVE};e.prototype.onDragEnter=function(e){var t=e.dragItem.columns;var i=e.dragSource.type===f.DragSourceType.ToolPanel;if(i){this.setColumnsVisible(t,true,"uiColumnDragged")}else{var n=e.dragItem.visibleState;var r=t.filter(function(e){return n[e.getId()]});this.setColumnsVisible(r,true,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged");this.onDragging(e,true)};e.prototype.onDragLeave=function(e){var t=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()&&!e.fromNudge;if(t){var i=e.dragSource.dragItemCallback();var n=i.columns;this.setColumnsVisible(n,false,"uiColumnDragged")}this.ensureIntervalCleared()};e.prototype.setColumnsVisible=function(e,t,i){if(i===void 0){i="api"}if(e){var n=e.filter(function(e){return!e.isLockVisible()});this.columnController.setColumnsVisible(n,t,i)}};e.prototype.setColumnsPinned=function(e,t,i){if(i===void 0){i="api"}if(e){var n=e.filter(function(e){return!e.isLockPinned()});this.columnController.setColumnsPinned(n,t,i)}};e.prototype.onDragStop=function(){this.ensureIntervalCleared()};e.prototype.normaliseX=function(e){var t=this.gridOptionsWrapper.isEnableRtl();if(t){var i=this.eContainer.clientWidth;e=i-e}var n=this.centerContainer;if(n){e+=this.gridPanel.getBodyViewportScrollLeft()}return e};e.prototype.checkCenterForScrolling=function(e){if(this.centerContainer){var t=this.gridPanel.getBodyViewportScrollLeft();var i=t+this.gridPanel.getCenterWidth();if(this.gridOptionsWrapper.isEnableRtl()){this.needToMoveRight=e<t+50;this.needToMoveLeft=e>i-50}else{this.needToMoveLeft=e<t+50;this.needToMoveRight=e>i-50}if(this.needToMoveLeft||this.needToMoveRight){this.ensureIntervalStarted()}else{this.ensureIntervalCleared()}}};e.prototype.onDragging=function(e,t){var i=this;if(t===void 0){t=false}this.lastDraggingEvent=e;if(b.Utils.missing(e.hDirection)){return}var n=this.normaliseX(e.x);if(!t){this.checkCenterForScrolling(n)}var r=this.normaliseDirection(e.hDirection);var o=e.dragSource.type;var a=e.dragSource.dragItemCallback().columns;a=a.filter(function(e){if(e.isLockPinned()){return e.getPinned()==i.pinned}else{return true}});this.attemptMoveColumns(o,a,r,n,t)};e.prototype.normaliseDirection=function(e){if(this.gridOptionsWrapper.isEnableRtl()){switch(e){case f.HDirection.Left:return f.HDirection.Right;case f.HDirection.Right:return f.HDirection.Left;default:console.error("ag-Grid: Unknown direction "+e)}}else{return e}};e.prototype.calculateOldIndex=function(e){var t=this.columnController.getAllGridColumns();var i=[];e.forEach(function(e){return i.push(t.indexOf(e))});b.Utils.sortNumberArray(i);var n=i[0];var r=i[i.length-1];var o=r-n;var a=o!==i.length-1;return a?null:n};e.prototype.attemptMoveColumns=function(e,t,i,n,r){var o=i===f.HDirection.Left;var a=i===f.HDirection.Right;var s=this.calculateValidMoves(t,a,n);var l=this.calculateOldIndex(t);for(var u=0;u<s.length;u++){var c=s[u];var d=l!==null&&!r;if(e==f.DragSourceType.HeaderCell){d=l!==null}if(d){if(o&&c>=l){continue}if(a&&c<=l){continue}}if(!this.columnController.doesMovePassRules(t,c)){continue}this.columnController.moveColumns(t,c,"uiColumnDragged");return}};e.prototype.calculateValidMoves=function(t,e,i){var n=this.columnController.getDisplayedColumns(this.pinned);var r=this.columnController.getAllGridColumns();var o=function(e){return t.indexOf(e)>=0};var a=function(e){return t.indexOf(e)<0};var s=n.filter(o);var l=n.filter(a);var u=r.filter(a);var c=0;var d=i;if(e){var f=0;s.forEach(function(e){return f+=e.getActualWidth()});d-=f}for(var p=0;p<l.length;p++){var h=l[p];d-=h.getActualWidth();if(d<0){break}c++}if(e){c++}var g;if(c>0){var v=l[c-1];g=u.indexOf(v)+1}else{g=0}var m=[g];var y=r[g];while(b.Utils.exists(y)&&this.isColumnHidden(n,y)){g++;m.push(g);y=r[g]}return m};e.prototype.isColumnHidden=function(e,t){return e.indexOf(t)<0};e.prototype.ensureIntervalStarted=function(){if(!this.movingIntervalId){this.intervalCount=0;this.failedMoveAttempts=0;this.movingIntervalId=setInterval(this.moveInterval.bind(this),100);if(this.needToMoveLeft){this.dragAndDropService.setGhostIcon(f.DragAndDropService.ICON_LEFT,true)}else{this.dragAndDropService.setGhostIcon(f.DragAndDropService.ICON_RIGHT,true)}}};e.prototype.ensureIntervalCleared=function(){if(this.moveInterval){clearInterval(this.movingIntervalId);this.movingIntervalId=null;this.dragAndDropService.setGhostIcon(f.DragAndDropService.ICON_MOVE)}};e.prototype.moveInterval=function(){var e;this.intervalCount++;e=10+this.intervalCount*5;if(e>100){e=100}var t;if(this.needToMoveLeft){t=this.gridPanel.scrollHorizontally(-e)}else if(this.needToMoveRight){t=this.gridPanel.scrollHorizontally(e)}if(t!==0){this.onDragging(this.lastDraggingEvent);this.failedMoveAttempts=0}else{this.failedMoveAttempts++;var i=this.lastDraggingEvent.dragItem.columns;var n=i.filter(function(e){return!e.isLockPinned()});if(n.length>0){this.dragAndDropService.setGhostIcon(f.DragAndDropService.ICON_PINNED);if(this.failedMoveAttempts>7){var r=this.needToMoveLeft?l.Column.PINNED_LEFT:l.Column.PINNED_RIGHT;this.setColumnsPinned(n,r,"uiColumnDragged");this.dragAndDropService.nudge()}}}};n([o.Autowired("loggerFactory"),r("design:type",a.LoggerFactory)],e.prototype,"loggerFactory",void 0);n([o.Autowired("columnController"),r("design:type",s.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("dragAndDropService"),r("design:type",f.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",u.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);return e}();t.MoveColumnController=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(15);var a=i(4);var s=i(0);var l=i(2);var u=function(){function e(e){this.columnsToAggregate=[];this.columnsToGroup=[];this.columnsToPivot=[];this.pinned=e}e.prototype.onDragEnter=function(e){var t=this;this.clearColumnsList();if(this.gridOptionsWrapper.isFunctionsReadOnly()){return}var i=e.dragItem.columns;i.forEach(function(e){if(!e.isPrimary()){return}if(e.isAnyFunctionActive()){return}if(e.isAllowValue()){t.columnsToAggregate.push(e)}else if(e.isAllowRowGroup()){t.columnsToGroup.push(e)}else if(e.isAllowRowGroup()){t.columnsToPivot.push(e)}})};e.prototype.getIconName=function(){var e=this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length;if(e>0){return this.pinned?o.DragAndDropService.ICON_PINNED:o.DragAndDropService.ICON_MOVE}else{return null}};e.prototype.onDragLeave=function(e){this.clearColumnsList()};e.prototype.clearColumnsList=function(){this.columnsToAggregate.length=0;this.columnsToGroup.length=0;this.columnsToPivot.length=0};e.prototype.onDragging=function(e){};e.prototype.onDragStop=function(e){if(this.columnsToAggregate.length>0){this.columnController.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop")}if(this.columnsToGroup.length>0){this.columnController.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop")}if(this.columnsToPivot.length>0){this.columnController.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};n([s.Autowired("columnController"),r("design:type",a.ColumnController)],e.prototype,"columnController",void 0);n([s.Autowired("gridOptionsWrapper"),r("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);return e}();t.BodyDropPivotTarget=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var l=i(10);var a=i(2);var u=i(1);var c=i(4);var d=i(38);var s=function(){function e(){}s=e;e.prototype.createAutoGroupColumns=function(e){var i=this;var n=[];var t=this.gridOptionsWrapper.isTreeData();var r=this.gridOptionsWrapper.isGroupMultiAutoColumn();if(t&&r){console.log("ag-Grid: you cannot mix groupMultiAutoColumn with treeData, only one column can be used to display groups when doing tree data");r=false}if(r){e.forEach(function(e,t){n.push(i.createOneAutoGroupColumn(e,t))})}else{n.push(this.createOneAutoGroupColumn(null))}return n};e.prototype.createOneAutoGroupColumn=function(e,t){var i=this.generateDefaultColDef(e);var n;if(e){n=s.GROUP_AUTO_COLUMN_ID+"-"+e.getId()}else{n=s.GROUP_AUTO_COLUMN_BUNDLE_ID}var r=this.gridOptionsWrapper.getAutoGroupColumnDef();u._.mergeDeep(i,r);i=this.balancedColumnTreeBuilder.mergeColDefs(i);i.colId=n;if(!this.gridOptionsWrapper.isTreeData()){var o=u._.missing(i.field)&&u._.missing(i.valueGetter)&&u._.missing(i.filterValueGetter);if(o){i.suppressFilter=true}}if(t>0){i.headerCheckboxSelection=false}var a=new l.Column(i,n,true);this.context.wireBean(a);return a};e.prototype.generateDefaultColDef=function(e){var t=this.gridOptionsWrapper.getLocaleTextFunc();var i={headerName:t("group","Group"),cellRenderer:"agGroupCellRenderer"};if(e){var n=e.getColDef();u._.assign(i,{headerName:this.columnController.getDisplayNameForColumn(e,"header"),headerValueGetter:n.headerValueGetter});if(n.cellRenderer){u._.assign(i,{cellRendererParams:{innerRenderer:n.cellRenderer,innerRendererParams:n.cellRendererParams}})}i.showRowGroup=e.getColId()}else{i.showRowGroup=true}return i};e.GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn";e.GROUP_AUTO_COLUMN_BUNDLE_ID=s.GROUP_AUTO_COLUMN_ID;n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("context"),r("design:type",o.Context)],e.prototype,"context",void 0);n([o.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("balancedColumnTreeBuilder"),r("design:type",d.BalancedColumnTreeBuilder)],e.prototype,"balancedColumnTreeBuilder",void 0);e=s=n([o.Bean("autoGroupColService")],e);return e;var s}();t.AutoGroupColService=s},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(9);var u=i(1);var s=i(2);var l=function(){function e(){}e.prototype.postConstruct=function(){if(this.rowModel.getType()===a.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){this.clientSideRowModel=this.rowModel}};e.prototype.createTransactionForRowData=function(e){if(u._.missing(this.clientSideRowModel)){console.error("ag-Grid: ImmutableService only works with ClientSideRowModel");return}var o=this.gridOptionsWrapper.getRowNodeIdFunc();if(u._.missing(o)){console.error("ag-Grid: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs!");return}var a={remove:[],update:[],add:[]};var s=this.clientSideRowModel.getCopyOfNodesMap();var l={};if(u._.exists(e)){e.forEach(function(e,t){var i=o(e);var n=s[i];l[i]=t;if(n){var r=n.data!==e;if(r){a.update.push(e)}s[i]=undefined}else{a.add.push(e)}})}u._.iterateObject(s,function(e,t){if(t){a.remove.push(t.data)}});return[a,l]};n([o.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);e=n([o.Bean("immutableService")],e);return e}();t.ImmutableService=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.STRING_PROPERTIES=["headerName","columnGroupShow","headerClass","toolPanelClass","headerValueGetter","pivotKeys","groupId","colId","sort","field","type","tooltipField","headerTooltip","cellClass","showRowGroup","template","templateUrl","filter","aggFunc","cellRenderer","cellEditor","pinned"];e.OBJECT_PROPERTIES=["headerGroupComponent","headerGroupComponentFramework","headerGroupComponentParams","cellStyle","cellRendererParams","cellEditorFramework","cellEditorParams","pinnedRowCellRendererFramework","pinnedRowCellRendererParams","filterFramework","filterParams","pivotValueColumn","headerComponent","headerComponentFramework","headerComponentParams","floatingFilterComponent","floatingFilterComponentParams","floatingFilterComponentFramework","refData"];e.ARRAY_PROPERTIES=["children","sortingOrder","allowedAggFuncs","menuTabs","pivotTotalColumnIds","cellClassRules","icons"];e.NUMBER_PROPERTIES=["sortedAt","width","minWidth","maxWidth","rowGroupIndex","pivotIndex"];e.BOOLEAN_PROPERTIES=["suppressCellFlash","suppressToolPanel","openByDefault","marryChildren","hide","rowGroup","pivot","checkboxSelection","headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","suppressMenu","suppressSorting","suppressMovable","suppressFilter","lockPosition","lockVisible","lockPinned","unSortIcon","suppressSizeToFit","suppressResize","suppressAutoSize","enableRowGroup","enablePivot","enableValue","editable","suppressPaste","suppressNavigable","enableCellChangeFlash","rowDrag","autoHeight"];e.FUNCTION_PROPERTIES=["valueGetter","valueSetter","filterValueGetter","keyCreator","cellRenderer","cellRendererFramework","pinnedRowCellRenderer","valueFormatter","pinnedRowValueFormatter","valueParser","comparator","equals","pivotComparator","suppressKeyboardEvent","colSpan","rowSpan","getQuickFilterText","newValueHandler","onCellValueChanged","onCellClicked","onCellDoubleClicked","onCellContextMenu","tooltip","cellRendererSelector","cellEditorSelector"];e.ALL_PROPERTIES=e.ARRAY_PROPERTIES.concat(e.OBJECT_PROPERTIES).concat(e.STRING_PROPERTIES).concat(e.NUMBER_PROPERTIES).concat(e.FUNCTION_PROPERTIES).concat(e.BOOLEAN_PROPERTIES);return e}();t.ColDefUtil=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=i(1);var n=function(){function e(){this.existingKeys=[]}e.prototype.getUniqueKey=function(e,t){e=r.Utils.toStringOrNull(e);var i=0;while(true){var n=void 0;if(e){n=e;if(i!==0){n+="_"+i}}else if(t){n=t;if(i!==0){n+="_"+i}}else{n=""+i}if(this.existingKeys.indexOf(n)<0){this.existingKeys.push(n);return n}i++}};return e}();t.ColumnKeyCreator=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(18);var l=i(1);var s=i(35);var u=i(2);var c=i(3);var d=function(){function e(){}e.prototype.hideActiveMenu=function(){if(this.hidePopup){this.hidePopup()}};e.prototype.showMenuAfterMouseEvent=function(t,i){var n=this;this.showPopup(t,function(e){n.popupService.positionPopupUnderMouseEvent({column:t,type:"columnMenu",mouseEvent:i,ePopup:e})})};e.prototype.showMenuAfterButtonClick=function(t,i){var n=this;this.showPopup(t,function(e){n.popupService.positionPopupUnderComponent({type:"columnMenu",eventSource:i,ePopup:e,keepWithinBounds:true,column:t})})};e.prototype.showPopup=function(e,t){var i=this;var n=this.filterManager.getOrCreateFilterWrapper(e);var r=document.createElement("div");l.Utils.addCssClass(r,"ag-menu");n.guiPromise.promise.then(function(e){r.appendChild(e)});var o;var a=function(e){if(e.direction==="horizontal"){o()}};this.eventService.addEventListener("bodyScroll",a);var s=function(){i.eventService.removeEventListener("bodyScroll",a);e.setMenuVisible(false,"contextMenu")};o=this.popupService.addAsModalPopup(r,true,s);t(r);n.filterPromise.then(function(e){if(e.afterGuiAttached){var t={hidePopup:o};e.afterGuiAttached(t)}});this.hidePopup=o;e.setMenuVisible(true,"contextMenu")};e.prototype.isMenuEnabled=function(e){return this.gridOptionsWrapper.isEnableFilter()&&e.isFilterAllowed()};n([o.Autowired("eventService"),r("design:type",c.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("filterManager"),r("design:type",a.FilterManager)],e.prototype,"filterManager",void 0);n([o.Autowired("popupService"),r("design:type",s.PopupService)],e.prototype,"popupService",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",u.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);e=n([o.Bean("menuFactory")],e);return e}();t.StandardMenuFactory=d},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var s=i(110);var l=i(86);var u=function(){function e(){}e.prototype.execute=function(e){var t=e.rowNode;if(this.gridOptionsWrapper.isEnableServerSideFilter()){this.filterService.filter(t,false)}else{this.filterService.filterAccordingToColumnState(t)}this.selectableService.updateSelectableAfterFiltering(t)};n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("selectableService"),r("design:type",l.SelectableService)],e.prototype,"selectableService",void 0);n([o.Autowired("filterService"),r("design:type",s.FilterService)],e.prototype,"filterService",void 0);e=n([o.Bean("filterStage")],e);return e}();t.FilterStage=u},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(18);var s=i(2);var l=function(){function e(){}e.prototype.postConstruct=function(){this.doingTreeData=this.gridOptionsWrapper.isTreeData()};e.prototype.filterAccordingToColumnState=function(e){var t=this.filterManager.isAnyFilterPresent();this.filter(e,t)};e.prototype.filter=function(e,t){var n=this;if(e.hasChildren()){e.childrenAfterGroup.forEach(function(e){return n.filter(e,t)});if(t){e.childrenAfterFilter=e.childrenAfterGroup.filter(function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0;var i=e.data&&n.filterManager.doesRowPassFilter(e);return t||i})}else{e.childrenAfterFilter=e.childrenAfterGroup}this.setAllChildrenCount(e)}else{e.childrenAfterFilter=e.childrenAfterGroup;e.setAllChildrenCount(null)}};e.prototype.setAllChildrenCountTreeData=function(e){var t=0;e.childrenAfterFilter.forEach(function(e){t++;t+=e.allChildrenCount});e.setAllChildrenCount(t)};e.prototype.setAllChildrenCountGridGrouping=function(e){var t=0;e.childrenAfterFilter.forEach(function(e){if(e.group){t+=e.allChildrenCount}else{t++}});e.setAllChildrenCount(t)};e.prototype.setAllChildrenCount=function(e){if(this.doingTreeData){this.setAllChildrenCountTreeData(e)}else{this.setAllChildrenCountGridGrouping(e)}};n([o.Autowired("filterManager"),r("design:type",a.FilterManager)],e.prototype,"filterManager",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);e=n([o.Bean("filterService")],e);return e}();t.FilterService=l},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(2);var s=i(112);var l=function(){function e(){}e.prototype.execute=function(e){if(this.gridOptionsWrapper.isEnableServerSideSorting()){this.sortService.sort(e.rowNode,null)}else{this.sortService.sortAccordingToColumnsState(e.rowNode)}};n([o.Autowired("gridOptionsWrapper"),r("design:type",a.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("sortService"),r("design:type",s.SortService)],e.prototype,"sortService",void 0);e=n([o.Bean("sortStage")],e);return e}();t.SortStage=l},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(24);var f=i(1);var s=i(16);var l=i(2);var u=i(4);var c=function(){function e(){}e.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()};e.prototype.sortAccordingToColumnsState=function(e){var t=this.sortController.getSortForRowController();this.sort(e,t)};e.prototype.sort=function(e,t){var i=this;e.childrenAfterSort=e.childrenAfterFilter.slice(0);this.pullDownDataForHideOpenParents(e,true);var n=f._.exists(t)&&t.length>0;if(n){var r=e.childrenAfterSort.map(function(e,t){return{currentPos:t,rowNode:e}});r.sort(this.compareRowNodes.bind(this,t));e.childrenAfterSort=r.map(function(e){return e.rowNode})}this.updateChildIndexes(e);this.pullDownDataForHideOpenParents(e,false);e.childrenAfterFilter.forEach(function(e){if(e.hasChildren()){i.sort(e,t)}});if(this.postSortFunc){this.postSortFunc(e.childrenAfterSort)}};e.prototype.compareRowNodes=function(e,t,i){var n=t.rowNode;var r=i.rowNode;for(var o=0,a=e.length;o<a;o++){var s=e[o];var l=s.inverter===-1;var u=this.getValue(n,s.column);var c=this.getValue(r,s.column);var d=void 0;if(s.column.getColDef().comparator){d=s.column.getColDef().comparator(u,c,n,r,l)}else{d=f._.defaultComparator(u,c,this.gridOptionsWrapper.isAccentedSort())}if(d!==0){return d*s.inverter}}return t.currentPos-i.currentPos};e.prototype.getValue=function(e,t){return this.valueService.getValue(t,e)};e.prototype.updateChildIndexes=function(r){if(f._.missing(r.childrenAfterSort)){return}r.childrenAfterSort.forEach(function(e,t){var i=t===0;var n=t===r.childrenAfterSort.length-1;e.setFirstChild(i);e.setLastChild(n);e.setChildIndex(t)})};e.prototype.pullDownDataForHideOpenParents=function(e,s){var l=this;if(f._.missing(e.childrenAfterSort)){return}if(!this.gridOptionsWrapper.isGroupHideOpenParents()){return}e.childrenAfterSort.forEach(function(a){var e=l.columnController.getGroupDisplayColumns();e.forEach(function(e){var t=e.getColDef().showRowGroup;if(typeof t!=="string"){console.error("ag-Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}var i=t;var n=l.columnController.getPrimaryColumn(i);var r=n===a.rowGroupColumn;if(r){return}if(s){a.setGroupValue(e.getId(),null)}else{var o=a.getFirstChildOfFirstChild(n);if(o){a.setGroupValue(e.getId(),o.key)}}})})};n([o.Autowired("sortController"),r("design:type",a.SortController)],e.prototype,"sortController",void 0);n([o.Autowired("columnController"),r("design:type",u.ColumnController)],e.prototype,"columnController",void 0);n([o.Autowired("valueService"),r("design:type",s.ValueService)],e.prototype,"valueService",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([o.Bean("sortService")],e);return e}();t.SortService=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(0);var a=i(14);var C=i(1);var s=i(2);var l=i(17);var u=i(3);var c=i(4);var d=function(){function e(){}e.prototype.execute=function(e){var t=e.rowNode;var i=[];var n={value:0};var r=this.columnController.isPivotMode();var o=r&&t.leafGroup;var a=o?[t]:t.childrenAfterSort;this.resetRowTops(t);this.recursivelyAddToRowsToDisplay(a,i,n,r,0);var s=!o&&this.gridOptionsWrapper.isGroupIncludeTotalFooter();if(s){this.ensureFooterNodeExists(t);this.addRowNodeToRowsToDisplay(t.sibling,i,n,0)}return i};e.prototype.resetRowTops=function(e){e.clearRowTop();if(e.hasChildren()){if(e.childrenAfterGroup){for(var t=0;t<e.childrenAfterGroup.length;t++){this.resetRowTops(e.childrenAfterGroup[t])}}if(e.sibling){e.sibling.clearRowTop()}}};e.prototype.recursivelyAddToRowsToDisplay=function(e,t,i,n,r){if(C.Utils.missingOrEmpty(e)){return}var o=this.gridOptionsWrapper.isGroupSuppressRow();var a=this.gridOptionsWrapper.isGroupHideOpenParents();var s=this.gridOptionsWrapper.isGroupRemoveSingleChildren();var l=!s&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren();for(var u=0;u<e.length;u++){var c=e[u];var d=c.hasChildren();var f=o&&d;var p=n&&!d;var h=s&&d&&c.childrenAfterGroup.length===1;var g=l&&d&&c.leafGroup&&c.childrenAfterGroup.length===1;var v=n&&c.leafGroup;var m=a&&c.expanded&&!v;var y=!p&&!f&&!m&&!h&&!g;if(y){this.addRowNodeToRowsToDisplay(c,t,i,r)}if(n&&c.leafGroup){continue}if(d){var b=h||g;if(c.expanded||b){var _=b?r:r+1;this.recursivelyAddToRowsToDisplay(c.childrenAfterSort,t,i,n,_);if(this.gridOptionsWrapper.isGroupIncludeFooter()){this.ensureFooterNodeExists(c);this.addRowNodeToRowsToDisplay(c.sibling,t,i,r)}}else{}}else if(c.master&&c.expanded){var w=this.createDetailNode(c);this.addRowNodeToRowsToDisplay(w,t,i,r)}}};e.prototype.addRowNodeToRowsToDisplay=function(e,t,i,n){t.push(e);if(C.Utils.missing(e.rowHeight)){var r=this.gridOptionsWrapper.getRowHeightForNode(e);e.setRowHeight(r)}e.setUiLevel(n);e.setRowTop(i.value);e.setRowIndex(t.length-1);i.value+=e.rowHeight};e.prototype.ensureFooterNodeExists=function(t){if(C.Utils.exists(t.sibling)){return}var i=new a.RowNode;this.context.wireBean(i);Object.keys(t).forEach(function(e){i[e]=t[e]});i.footer=true;i.rowTop=null;i.oldRowTop=null;if(C.Utils.exists(i.id)){i.id="rowGroupFooter_"+i.id}i.sibling=t;t.sibling=i};e.prototype.createDetailNode=function(e){if(C.Utils.exists(e.detailNode)){return e.detailNode}else{var t=new a.RowNode;this.context.wireBean(t);t.detail=true;t.flower=t.detail;t.parent=e;if(C.Utils.exists(e.id)){t.id="detail_"+e.id}t.data=e.data;t.level=e.level+1;e.detailNode=t;e.childFlower=e.detailNode;return t}};n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Autowired("selectionController"),r("design:type",l.SelectionController)],e.prototype,"selectionController",void 0);n([o.Autowired("eventService"),r("design:type",u.EventService)],e.prototype,"eventService",void 0);n([o.Autowired("context"),r("design:type",o.Context)],e.prototype,"context",void 0);n([o.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);e=n([o.Bean("flattenStage")],e);return e}();t.FlattenStage=d},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var s=i(2);var l=i(0);var u=i(3);var c=i(17);var d=i(5);var f=i(24);var p=i(18);var h=i(9);var g=i(136);var v=i(13);var m=i(87);var y=i(115);var b=i(6);var _=i(7);var w=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.getRowBounds=function(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}};t.prototype.init=function(){var e=this;if(!this.gridOptionsWrapper.isRowModelInfinite()){return}this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber();this.addEventListeners();this.setDatasource(this.gridOptionsWrapper.getDatasource());this.addDestroyFunc(function(){return e.destroyCache()})};t.prototype.destroyDatasource=function(){if(this.datasource&&this.datasource.destroy){this.datasource.destroy()}this.datasource=null};t.prototype.isLastRowFound=function(){return this.infiniteCache?this.infiniteCache.isMaxRowFound():false};t.prototype.addEventListeners=function(){this.addDestroyableEventListener(this.eventService,d.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this));this.addDestroyableEventListener(this.eventService,d.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this));this.addDestroyableEventListener(this.eventService,d.Events.EVENT_COLUMN_EVERYTHING_CHANGED,this.onColumnEverything.bind(this))};t.prototype.onFilterChanged=function(){if(this.gridOptionsWrapper.isEnableServerSideFilter()){this.reset()}};t.prototype.onSortChanged=function(){if(this.gridOptionsWrapper.isEnableServerSideSorting()){this.reset()}};t.prototype.onColumnEverything=function(){if(this.gridOptionsWrapper.isEnableServerSideSorting()){this.reset()}};t.prototype.destroy=function(){e.prototype.destroy.call(this)};t.prototype.getType=function(){return h.Constants.ROW_MODEL_TYPE_INFINITE};t.prototype.setDatasource=function(e){this.destroyDatasource();this.datasource=e;if(e){this.checkForDeprecated();this.reset()}};t.prototype.checkForDeprecated=function(){var e=this.datasource;if(a.Utils.exists(e.maxConcurrentRequests)){console.error("ag-Grid: since version 5.1.x, maxConcurrentRequests is replaced with grid property maxConcurrentDatasourceRequests")}if(a.Utils.exists(e.maxPagesInCache)){console.error("ag-Grid: since version 5.1.x, maxPagesInCache is replaced with grid property maxPagesInPaginationCache")}if(a.Utils.exists(e.overflowSize)){console.error("ag-Grid: since version 5.1.x, overflowSize is replaced with grid property paginationOverflowSize")}if(a.Utils.exists(e.blockSize)){console.error("ag-Grid: since version 5.1.x, pageSize/blockSize is replaced with grid property infinitePageSize")}};t.prototype.isEmpty=function(){return a.Utils.missing(this.infiniteCache)};t.prototype.isRowsToRender=function(){return a.Utils.exists(this.infiniteCache)};t.prototype.getNodesInRangeForSelection=function(e,t){return this.infiniteCache.getRowNodesInRange(e,t)};t.prototype.reset=function(){if(a.Utils.missing(this.datasource)){return}var e=a.Utils.exists(this.gridOptionsWrapper.getRowNodeIdFunc());if(!e){this.selectionController.reset()}this.resetCache();var t=this.createModelUpdatedEvent();this.eventService.dispatchEvent(t)};t.prototype.createModelUpdatedEvent=function(){return{type:d.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,newPage:false,newData:false,keepRenderedRows:false,animate:false}};t.prototype.resetCache=function(){this.destroyCache();var e=this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests();this.rowNodeBlockLoader=new y.RowNodeBlockLoader(e);this.context.wireBean(this.rowNodeBlockLoader);var t={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,maxConcurrentRequests:e,overflowSize:this.gridOptionsWrapper.getCacheOverflowSize(),initialRowCount:this.gridOptionsWrapper.getInfiniteInitialRowCount(),maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache(),blockSize:this.gridOptionsWrapper.getCacheBlockSize(),rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber(),lastAccessedSequence:new a.NumberSequence};if(!(t.maxConcurrentRequests>=1)){t.maxConcurrentRequests=2}if(!(t.blockSize>=1)){t.blockSize=100}if(!(t.initialRowCount>=1)){t.initialRowCount=0}if(!(t.overflowSize>=1)){t.overflowSize=1}this.infiniteCache=new g.InfiniteCache(t);this.context.wireBean(this.infiniteCache);this.infiniteCache.addEventListener(m.RowNodeCache.EVENT_CACHE_UPDATED,this.onCacheUpdated.bind(this))};t.prototype.destroyCache=function(){if(this.infiniteCache){this.infiniteCache.destroy();this.infiniteCache=null}if(this.rowNodeBlockLoader){this.rowNodeBlockLoader.destroy();this.rowNodeBlockLoader=null}};t.prototype.onCacheUpdated=function(){var e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)};t.prototype.getRow=function(e){return this.infiniteCache?this.infiniteCache.getRow(e):null};t.prototype.getRowNode=function(t){var i=null;this.forEachNode(function(e){if(e.id===t){i=e}});return i};t.prototype.forEachNode=function(e){if(this.infiniteCache){this.infiniteCache.forEachNodeDeep(e,new a.NumberSequence)}};t.prototype.getCurrentPageHeight=function(){return this.getRowCount()*this.rowHeight};t.prototype.getRowIndexAtPixel=function(e){if(this.rowHeight!==0){var t=Math.floor(e/this.rowHeight);if(t>this.getPageLastRow()){return this.getPageLastRow()}else{return t}}else{return 0}};t.prototype.getPageFirstRow=function(){return 0};t.prototype.getPageLastRow=function(){return this.infiniteCache?this.infiniteCache.getVirtualRowCount()-1:0};t.prototype.getRowCount=function(){return this.infiniteCache?this.infiniteCache.getVirtualRowCount():0};t.prototype.updateRowData=function(e){if(a.Utils.exists(e.remove)||a.Utils.exists(e.update)){console.warn("ag-Grid: updateRowData for InfiniteRowModel does not support remove or update, only add");return}if(a.Utils.missing(e.addIndex)){console.warn("ag-Grid: updateRowData for InfiniteRowModel requires add and addIndex to be set");return}if(this.infiniteCache){this.infiniteCache.insertItemsAtIndex(e.addIndex,e.add)}};t.prototype.isRowPresent=function(e){return false};t.prototype.refreshCache=function(){if(this.infiniteCache){this.infiniteCache.refreshCache()}};t.prototype.purgeCache=function(){if(this.infiniteCache){this.infiniteCache.purgeCache()}};t.prototype.getVirtualRowCount=function(){if(this.infiniteCache){return this.infiniteCache.getVirtualRowCount()}else{return null}};t.prototype.isMaxRowFound=function(){if(this.infiniteCache){return this.infiniteCache.isMaxRowFound()}};t.prototype.setVirtualRowCount=function(e,t){if(this.infiniteCache){this.infiniteCache.setVirtualRowCount(e,t)}};t.prototype.getBlockState=function(){if(this.rowNodeBlockLoader){return this.rowNodeBlockLoader.getBlockState()}else{return null}};r([l.Autowired("gridOptionsWrapper"),o("design:type",s.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([l.Autowired("filterManager"),o("design:type",p.FilterManager)],t.prototype,"filterManager",void 0);r([l.Autowired("sortController"),o("design:type",f.SortController)],t.prototype,"sortController",void 0);r([l.Autowired("selectionController"),o("design:type",c.SelectionController)],t.prototype,"selectionController",void 0);r([l.Autowired("eventService"),o("design:type",u.EventService)],t.prototype,"eventService",void 0);r([l.Autowired("context"),o("design:type",l.Context)],t.prototype,"context",void 0);r([l.Autowired("gridApi"),o("design:type",b.GridApi)],t.prototype,"gridApi",void 0);r([l.Autowired("columnApi"),o("design:type",_.ColumnApi)],t.prototype,"columnApi",void 0);r([l.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"init",null);r([l.PreDestroy,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"destroyDatasource",null);r([l.PreDestroy,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"destroy",null);t=r([l.Bean("rowModel")],t);return t}(v.BeanStub);t.InfiniteRowModel=w},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var o=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var a=i(61);var s=i(12);var l=i(0);var u=i(1);var c=function(){function e(e){this.activeBlockLoadsCount=0;this.blocks=[];this.active=true;this.maxConcurrentRequests=e}e.prototype.setBeans=function(e){this.logger=e.create("RowNodeBlockLoader")};e.prototype.addBlock=function(e){this.blocks.push(e)};e.prototype.removeBlock=function(e){u._.removeFromArray(this.blocks,e)};e.prototype.destroy=function(){this.active=false};e.prototype.loadComplete=function(){this.activeBlockLoadsCount--};e.prototype.checkBlockToLoad=function(){if(!this.active){return}this.printCacheStatus();if(this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.logger.log("checkBlockToLoad: max loads exceeded");return}var t=null;this.blocks.forEach(function(e){if(e.getState()===a.RowNodeBlock.STATE_DIRTY){t=e}});if(t){t.load();this.activeBlockLoadsCount++;this.logger.log("checkBlockToLoad: loading page "+t.getBlockNumber());this.printCacheStatus()}else{this.logger.log("checkBlockToLoad: no pages to load")}};e.prototype.getBlockState=function(){var n={};this.blocks.forEach(function(e){var t=e.getNodeIdPrefix();var i={blockNumber:e.getBlockNumber(),startRow:e.getStartRow(),endRow:e.getEndRow(),pageStatus:e.getState()};if(u._.exists(t)){n[t+e.getBlockNumber()]=i}else{n[e.getBlockNumber()]=i}});return n};e.prototype.printCacheStatus=function(){if(this.logger.isLogging()){this.logger.log("printCacheStatus: activePageLoadsCount = "+this.activeBlockLoadsCount+","+(" blocks = "+JSON.stringify(this.getBlockState())))}};n([o(0,l.Qualifier("loggerFactory")),r("design:type",Function),r("design:paramtypes",[s.LoggerFactory]),r("design:returntype",void 0)],e.prototype,"setBeans",null);return e}();t.RowNodeBlockLoader=c},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var o=i(9);var s=i(2);var l=i(7);var u=i(4);var c=i(18);var d=i(14);var f=i(3);var p=i(5);var h=i(0);var g=i(17);var v=i(88);var m=i(89);var y=i(16);var b=i(33);var _=i(6);var w;(function(e){e[e["Normal"]=0]="Normal";e[e["AfterFilter"]=1]="AfterFilter";e[e["AfterFilterAndSort"]=2]="AfterFilterAndSort";e[e["PivotNodes"]=3]="PivotNodes"})(w||(w={}));var C=function(){function e(){}e.prototype.init=function(){var e=this.refreshModel.bind(this,{step:o.Constants.STEP_EVERYTHING});this.eventService.addModalPriorityEventListener(p.Events.EVENT_COLUMN_EVERYTHING_CHANGED,e);this.eventService.addModalPriorityEventListener(p.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e);this.eventService.addModalPriorityEventListener(p.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this));this.eventService.addModalPriorityEventListener(p.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:o.Constants.STEP_PIVOT}));this.eventService.addModalPriorityEventListener(p.Events.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this));this.eventService.addModalPriorityEventListener(p.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this));this.eventService.addModalPriorityEventListener(p.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this));this.eventService.addModalPriorityEventListener(p.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var t=this.refreshModel.bind(this,{step:o.Constants.STEP_MAP,keepRenderedRows:true,animate:true});this.gridOptionsWrapper.addEventListener(s.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,t);this.gridOptionsWrapper.addEventListener(s.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,t);this.rootNode=new d.RowNode;this.nodeManager=new v.ClientSideNodeManager(this.rootNode,this.gridOptionsWrapper,this.context,this.eventService,this.columnController);this.context.wireBean(this.rootNode)};e.prototype.ensureRowAtPixel=function(e,t){var i=this.getRowIndexAtPixel(t);var n=this.getRow(i);if(n===e){return false}a.Utils.removeFromArray(this.rootNode.allLeafChildren,e);a.Utils.insertIntoArray(this.rootNode.allLeafChildren,e,i);this.refreshModel({step:o.Constants.STEP_EVERYTHING,keepRenderedRows:true,animate:true,keepEditingRows:true});return true};e.prototype.isLastRowFound=function(){return true};e.prototype.getRowCount=function(){if(this.rowsToDisplay){return this.rowsToDisplay.length}else{return 0}};e.prototype.getRowBounds=function(e){if(a.Utils.missing(this.rowsToDisplay)){return null}var t=this.rowsToDisplay[e];if(t){return{rowTop:t.rowTop,rowHeight:t.rowHeight}}else{return null}};e.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.Constants.STEP_MAP,keepRenderedRows:true,animate:e})};e.prototype.onFilterChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.Constants.STEP_FILTER,keepRenderedRows:true,animate:e})};e.prototype.onSortChanged=function(){if(this.gridOptionsWrapper.isEnableServerSideSorting()){return}var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.Constants.STEP_SORT,keepRenderedRows:true,animate:e,keepEditingRows:true})};e.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE};e.prototype.onValueChanged=function(){if(this.columnController.isPivotActive()){this.refreshModel({step:o.Constants.STEP_PIVOT})}else{this.refreshModel({step:o.Constants.STEP_AGGREGATE})}};e.prototype.createChangePath=function(e){var t=this.columnController.getValueColumns();var i=a.Utils.missingOrEmpty(t);var n=a.Utils.missingOrEmpty(e);var r=new m.ChangedPath(false);if(i||n){r.setInactive()}return r};e.prototype.refreshModel=function(e){var t=this;var i=this.createChangePath(e.rowNodeTransactions);switch(e.step){case o.Constants.STEP_EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,i);case o.Constants.STEP_FILTER:this.doFilter();case o.Constants.STEP_PIVOT:this.doPivot(i);case o.Constants.STEP_AGGREGATE:this.doAggregate(i);case o.Constants.STEP_SORT:this.doSort();case o.Constants.STEP_MAP:this.doRowsToDisplay()}var n={type:p.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:false};this.eventService.dispatchEvent(n);if(this.$scope){setTimeout(function(){t.$scope.$apply()},0)}};e.prototype.isEmpty=function(){var e;var t=a.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());if(t){e=a.Utils.missing(this.rootNode.childrenAfterGroup)||this.rootNode.childrenAfterGroup.length===0}else{e=a.Utils.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0}var i=a.Utils.missing(this.rootNode)||e||!this.columnController.isReady();return i};e.prototype.isRowsToRender=function(){return a.Utils.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0};e.prototype.getNodesInRangeForSelection=function(o,a){var s=!a;var l=false;var u;var c=[];var d=this.gridOptionsWrapper.isGroupSelectsChildren();this.forEachNodeAfterFilterAndSort(function(e){var t=s&&!l;if(!s){if(e===a||e===o){s=true}}var i=e.group&&d;if(!i){var n=s&&!l;var r=e.isParentOfNode(u);if(n||r){c.push(e)}}if(t){if(e===a||e===o){l=true;if(e===a){u=a}else{u=o}}}});return c};e.prototype.setDatasource=function(e){console.error("ag-Grid: should never call setDatasource on clientSideRowController")};e.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null};e.prototype.getRootNode=function(){return this.rootNode};e.prototype.getRow=function(e){return this.rowsToDisplay[e]};e.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0};e.prototype.getVirtualRowCount=function(){console.warn("ag-Grid: rowModel.getVirtualRowCount() is not longer a function, use rowModel.getRowCount() instead");return this.getPageLastRow()};e.prototype.getPageFirstRow=function(){return 0};e.prototype.getPageLastRow=function(){if(this.rowsToDisplay){return this.rowsToDisplay.length-1}else{return 0}};e.prototype.getRowIndexAtPixel=function(e){if(this.isEmpty()){return-1}var t=0;var i=this.rowsToDisplay.length-1;if(e<=0){return 0}var n=this.rowsToDisplay[this.rowsToDisplay.length-1];if(n.rowTop<=e){return this.rowsToDisplay.length-1}while(true){var r=Math.floor((t+i)/2);var o=this.rowsToDisplay[r];if(this.isRowInPixel(o,e)){return r}else if(o.rowTop<e){t=r+1}else if(o.rowTop>e){i=r-1}}};e.prototype.isRowInPixel=function(e,t){var i=e.rowTop;var n=e.rowTop+e.rowHeight;var r=i<=t&&n>t;return r};e.prototype.getCurrentPageHeight=function(){if(this.rowsToDisplay&&this.rowsToDisplay.length>0){var e=this.rowsToDisplay[this.rowsToDisplay.length-1];var t=e.rowTop+e.rowHeight;return t}else{return 0}};e.prototype.forEachLeafNode=function(i){if(this.rootNode.allLeafChildren){this.rootNode.allLeafChildren.forEach(function(e,t){return i(e,t)})}};e.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,w.Normal,0)};e.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter,e,w.AfterFilter,0)};e.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,w.AfterFilterAndSort,0)};e.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,w.PivotNodes,0)};e.prototype.recursivelyWalkNodesAndCallback=function(e,t,i,n){if(e){for(var r=0;r<e.length;r++){var o=e[r];t(o,n++);if(o.hasChildren()){var a=void 0;switch(i){case w.Normal:a=o.childrenAfterGroup;break;case w.AfterFilter:a=o.childrenAfterFilter;break;case w.AfterFilterAndSort:a=o.childrenAfterSort;break;case w.PivotNodes:a=!o.leafGroup?o.childrenAfterSort:null;break}if(a){n=this.recursivelyWalkNodesAndCallback(a,t,i,n)}}}}return n};e.prototype.doAggregate=function(e){if(this.aggregationStage){this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})}};e.prototype.expandOrCollapseAll=function(i){var n=this.gridOptionsWrapper.isTreeData();if(this.rootNode){r(this.rootNode.childrenAfterGroup)}function r(e){if(!e){return}e.forEach(function(e){var t=n?a.Utils.exists(e.childrenAfterGroup):e.group;if(t){e.expanded=i;r(e.childrenAfterGroup)}})}this.refreshModel({step:o.Constants.STEP_MAP})};e.prototype.doSort=function(){this.sortStage.execute({rowNode:this.rootNode})};e.prototype.doRowGrouping=function(e,t,i,n){var r=this;var o=a.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());if(o){return}if(this.groupStage){if(a.Utils.exists(t)){t.forEach(function(e){r.groupStage.execute({rowNode:r.rootNode,rowNodeTransaction:e,rowNodeOrder:i,changedPath:n})})}else{this.selectionController.removeGroupsFromSelection();this.groupStage.execute({rowNode:this.rootNode,changedPath:n});this.restoreGroupState(e)}if(this.gridOptionsWrapper.isGroupSelectsChildren()){this.selectionController.updateGroupsFromChildrenSelections()}}else{this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren}};e.prototype.restoreGroupState=function(i){if(!i){return}a.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup,function(e,t){if(typeof i[t]==="boolean"){e.expanded=i[t]}})};e.prototype.doFilter=function(){this.filterStage.execute({rowNode:this.rootNode})};e.prototype.doPivot=function(e){if(this.pivotStage){this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})}};e.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData()){return null}var i={};a.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup,function(e,t){return i[t]=e.expanded});return i};e.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()};e.prototype.getRowNode=function(e){return this.nodeManager.getRowNode(e)};e.prototype.setRowData=function(e){var t=this.getGroupState();this.nodeManager.setRowData(e);var i={type:p.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i);this.refreshModel({step:o.Constants.STEP_EVERYTHING,groupState:t,newData:true})};e.prototype.batchUpdateRowData=function(e,t){var i=this;if(!this.rowDataTransactionBatch){this.rowDataTransactionBatch=[];var n=this.gridOptionsWrapper.getBatchUpdateWaitMillis();setTimeout(function(){i.executeBatchUpdateRowData();i.rowDataTransactionBatch=null},n)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})};e.prototype.executeBatchUpdateRowData=function(){var i=this;this.valueCache.onDataChanged();var n=[];var r=[];this.rowDataTransactionBatch.forEach(function(e){var t=i.nodeManager.updateRowData(e.rowDataTransaction,null);r.push(t);if(e.callback){n.push(e.callback.bind(t))}});this.commonUpdateRowData(r);if(n.length>0){setTimeout(function(){n.forEach(function(e){return e()})},0)}};e.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var i=this.nodeManager.updateRowData(e,t);this.commonUpdateRowData([i],t);return i};e.prototype.commonUpdateRowData=function(e,t){this.refreshModel({step:o.Constants.STEP_EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:true,animate:true,keepEditingRows:true});var i={type:p.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i)};e.prototype.doRowsToDisplay=function(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})};e.prototype.onRowHeightChanged=function(){this.refreshModel({step:o.Constants.STEP_MAP,keepRenderedRows:true,keepEditingRows:true})};e.prototype.resetRowHeights=function(){this.forEachNode(function(e){return e.setRowHeight(null)});this.onRowHeightChanged()};n([h.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([h.Autowired("columnController"),r("design:type",u.ColumnController)],e.prototype,"columnController",void 0);n([h.Autowired("filterManager"),r("design:type",c.FilterManager)],e.prototype,"filterManager",void 0);n([h.Autowired("$scope"),r("design:type",Object)],e.prototype,"$scope",void 0);n([h.Autowired("selectionController"),r("design:type",g.SelectionController)],e.prototype,"selectionController",void 0);n([h.Autowired("eventService"),r("design:type",f.EventService)],e.prototype,"eventService",void 0);n([h.Autowired("context"),r("design:type",h.Context)],e.prototype,"context",void 0);n([h.Autowired("valueService"),r("design:type",y.ValueService)],e.prototype,"valueService",void 0);n([h.Autowired("valueCache"),r("design:type",b.ValueCache)],e.prototype,"valueCache",void 0);n([h.Autowired("columnApi"),r("design:type",l.ColumnApi)],e.prototype,"columnApi",void 0);n([h.Autowired("gridApi"),r("design:type",_.GridApi)],e.prototype,"gridApi",void 0);n([h.Autowired("filterStage"),r("design:type",Object)],e.prototype,"filterStage",void 0);n([h.Autowired("sortStage"),r("design:type",Object)],e.prototype,"sortStage",void 0);n([h.Autowired("flattenStage"),r("design:type",Object)],e.prototype,"flattenStage",void 0);n([h.Optional("groupStage"),r("design:type",Object)],e.prototype,"groupStage",void 0);n([h.Optional("aggregationStage"),r("design:type",Object)],e.prototype,"aggregationStage",void 0);n([h.Optional("pivotStage"),r("design:type",Object)],e.prototype,"pivotStage",void 0);n([h.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"init",null);e=n([h.Bean("rowModel")],e);return e}();t.ClientSideRowModel=C},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.prototype.dateComponent=function(e){return e.dateComponent};e.prototype.colDefFloatingCellRenderer=function(e){return e.pinnedRowCellRenderer};e.prototype.colDefCellRenderer=function(e){return e.cellRenderer};e.prototype.colDefCellEditor=function(e){return e.cellEditor};e.prototype.colDefFilter=function(e){return e.filter};e.prototype.gridOptionsFullWidthCellRenderer=function(e){return e.fullWidthCellRenderer};e.prototype.gridOptionsGroupRowRenderer=function(e){return e.groupRowRenderer};e.prototype.gridOptionsGroupRowInnerRenderer=function(e){return e.groupRowInnerRenderer};e.prototype.setTimeout=function(e,t){setTimeout(e,t)};return e}();t.BaseFrameworkFactory=n},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};Object.defineProperty(t,"__esModule",{value:true});var r=i(0);var a="\r\n";var o=function(){function e(){}e.prototype.createXml=function(t,i){var n=this;var r="";if(t.properties){if(t.properties.prefixedAttributes){t.properties.prefixedAttributes.forEach(function(t){Object.keys(t.map).forEach(function(e){r+=n.returnAttributeIfPopulated(t.prefix+e,t.map[e],i)})})}if(t.properties.rawMap){Object.keys(t.properties.rawMap).forEach(function(e){r+=n.returnAttributeIfPopulated(e,t.properties.rawMap[e],i)})}}var o="<"+t.name+r;if(!t.children&&t.textNode==null){return o+"/>"+a}if(t.textNode!=null){return o+">"+t.textNode+"</"+t.name+">"+a}o+=">"+a;t.children.forEach(function(e){o+=n.createXml(e,i)});return o+"</"+t.name+">"+a};e.prototype.returnAttributeIfPopulated=function(e,t,i){if(!t){return""}var n=t;if(typeof t==="boolean"){if(i){n=i(t)}}n='"'+n+'"';return" "+e+"="+n};e=n([r.Bean("xmlFactory")],e);return e}();t.XmlFactory=o},function(e,Je,et){"use strict";(function(e){Object.defineProperty(Je,"__esModule",{value:true});var t=typeof e==="undefined"?{}:e;t.HTMLElement=typeof HTMLElement==="undefined"?{}:HTMLElement;t.HTMLButtonElement=typeof HTMLButtonElement==="undefined"?{}:HTMLButtonElement;t.HTMLSelectElement=typeof HTMLSelectElement==="undefined"?{}:HTMLSelectElement;t.HTMLInputElement=typeof HTMLInputElement==="undefined"?{}:HTMLInputElement;t.Node=typeof Node==="undefined"?{}:Node;t.MouseEvent=typeof MouseEvent==="undefined"?{}:MouseEvent;var i=et(38);Je.BalancedColumnTreeBuilder=i.BalancedColumnTreeBuilder;var n=et(4);Je.ColumnController=n.ColumnController;var r=et(107);Je.ColumnKeyCreator=r.ColumnKeyCreator;var o=et(31);Je.ColumnUtils=o.ColumnUtils;var a=et(48);Je.DisplayedGroupCreator=a.DisplayedGroupCreator;var s=et(83);Je.GroupInstanceIdCreator=s.GroupInstanceIdCreator;var l=et(62);Je.ComponentUtil=l.ComponentUtil;var u=et(106);Je.ColDefUtil=u.ColDefUtil;var c=et(66);Je.ComponentProvider=c.ComponentProvider;var d=et(135);Je.initialiseAgGridWithAngular1=d.initialiseAgGridWithAngular1;var f=et(141);Je.initialiseAgGridWithWebComponents=f.initialiseAgGridWithWebComponents;var p=et(13);Je.BeanStub=p.BeanStub;var h=et(0);Je.Context=h.Context;Je.Autowired=h.Autowired;Je.PostConstruct=h.PostConstruct;Je.PreConstruct=h.PreConstruct;Je.Optional=h.Optional;Je.Bean=h.Bean;Je.Qualifier=h.Qualifier;Je.PreDestroy=h.PreDestroy;var g=et(11);Je.QuerySelector=g.QuerySelector;Je.Listener=g.Listener;Je.RefSelector=g.RefSelector;var v=et(15);Je.DragAndDropService=v.DragAndDropService;Je.DragSourceType=v.DragSourceType;Je.HDirection=v.HDirection;Je.VDirection=v.VDirection;var m=et(40);Je.DragService=m.DragService;var y=et(10);Je.Column=y.Column;var b=et(26);Je.ColumnGroup=b.ColumnGroup;var _=et(23);Je.GridCell=_.GridCell;var w=et(64);Je.GridRow=w.GridRow;var C=et(32);Je.OriginalColumnGroup=C.OriginalColumnGroup;var A=et(14);Je.RowNode=A.RowNode;var E=et(51);Je.BaseFilter=E.BaseFilter;var x=et(68);Je.DateFilter=x.DateFilter;var T=et(18);Je.FilterManager=T.FilterManager;var S=et(96);Je.NumberFilter=S.NumberFilter;var D=et(95);Je.TextFilter=D.TextFilter;var k=et(78);Je.GridPanel=k.GridPanel;var O=et(36);Je.ScrollVisibleService=O.ScrollVisibleService;var R=et(44);Je.MouseEventService=R.MouseEventService;var N=et(103);Je.BodyDropPivotTarget=N.BodyDropPivotTarget;var L=et(101);Je.BodyDropTarget=L.BodyDropTarget;var F=et(81);Je.CssClassApplier=F.CssClassApplier;var G=et(98);Je.HeaderContainer=G.HeaderContainer;var $=et(80);Je.HeaderRootComp=$.HeaderRootComp;var W=et(99);Je.HeaderRowComp=W.HeaderRowComp;var H=et(59);Je.HorizontalResizeService=H.HorizontalResizeService;var j=et(102);Je.MoveColumnController=j.MoveColumnController;var B=et(108);Je.StandardMenuFactory=B.StandardMenuFactory;var V=et(142);Je.TabbedLayout=V.TabbedLayout;var z=et(143);Je.VerticalStack=z.VerticalStack;var U=et(144);Je.simpleHttpRequest=U.simpleHttpRequest;var Y=et(94);Je.LargeTextCellEditor=Y.LargeTextCellEditor;var q=et(69);Je.PopupEditorWrapper=q.PopupEditorWrapper;var X=et(93);Je.PopupSelectCellEditor=X.PopupSelectCellEditor;var K=et(92);Je.PopupTextCellEditor=K.PopupTextCellEditor;var Q=et(75);Je.SelectCellEditor=Q.SelectCellEditor;var Z=et(67);Je.TextCellEditor=Z.TextCellEditor;var J=et(71);Je.AnimateShowChangeCellRenderer=J.AnimateShowChangeCellRenderer;var ee=et(70);Je.AnimateSlideCellRenderer=ee.AnimateSlideCellRenderer;var te=et(72);Je.GroupCellRenderer=te.GroupCellRenderer;var ie=et(52);Je.SetLeftFeature=ie.SetLeftFeature;var ne=et(39);Je.AutoWidthCalculator=ne.AutoWidthCalculator;var re=et(54);Je.CellEditorFactory=re.CellEditorFactory;var oe=et(55);Je.CellRendererFactory=oe.CellRendererFactory;var ae=et(56);Je.CellRendererService=ae.CellRendererService;var se=et(65);Je.CheckboxSelectionComponent=se.CheckboxSelectionComponent;var le=et(34);Je.CellComp=le.CellComp;var ue=et(50);Je.RowComp=ue.RowComp;var ce=et(20);Je.RowRenderer=ce.RowRenderer;var de=et(43);Je.ValueFormatterService=de.ValueFormatterService;var fe=et(109);Je.FilterStage=fe.FilterStage;var pe=et(113);Je.FlattenStage=pe.FlattenStage;var he=et(111);Je.SortStage=he.SortStage;var ge=et(30);Je.PinnedRowModel=ge.PinnedRowModel;var ve=et(116);Je.ClientSideRowModel=ve.ClientSideRowModel;var me=et(89);Je.ChangedPath=me.ChangedPath;var ye=et(88);Je.ClientSideNodeManager=ye.ClientSideNodeManager;var be=et(114);Je.InfiniteRowModel=be.InfiniteRowModel;var _e=et(61);Je.RowNodeBlock=_e.RowNodeBlock;var we=et(115);Je.RowNodeBlockLoader=we.RowNodeBlockLoader;var Ce=et(87);Je.RowNodeCache=Ce.RowNodeCache;var Ae=et(73);Je.StylingService=Ae.StylingService;var Ee=et(60);Je.AgCheckbox=Ee.AgCheckbox;var xe=et(8);Je.Component=xe.Component;var Te=et(35);Je.PopupService=Te.PopupService;var Se=et(46);Je.TouchListener=Se.TouchListener;var De=et(117);Je.BaseFrameworkFactory=De.BaseFrameworkFactory;var ke=et(82);Je.CellNavigationService=ke.CellNavigationService;var Oe=et(58);Je.AlignedGridsService=Oe.AlignedGridsService;var Re=et(9);Je.Constants=Re.Constants;var I=et(47);Je.CsvCreator=I.CsvCreator;Je.BaseCreator=I.BaseCreator;var Ne=et(84);Je.Downloader=Ne.Downloader;var Ie=et(85);Je.Grid=Ie.Grid;var Pe=et(6);Je.GridApi=Pe.GridApi;var Me=et(25);Je.Events=Me.Events;var Le=et(22);Je.FocusedCellController=Le.FocusedCellController;var Fe=et(145);Je.defaultGroupComparator=Fe.defaultGroupComparator;var Ge=et(2);Je.GridOptionsWrapper=Ge.GridOptionsWrapper;var $e=et(3);Je.EventService=$e.EventService;var We=et(86);Je.SelectableService=We.SelectableService;var He=et(42);Je.GridCore=He.GridCore;var je=et(12);Je.Logger=je.Logger;var Be=et(17);Je.SelectionController=Be.SelectionController;var Ve=et(24);Je.SortController=Ve.SortController;var ze=et(49);Je.TemplateService=ze.TemplateService;var P=et(1);Je.Utils=P.Utils;Je.NumberSequence=P.NumberSequence;Je._=P._;Je.Promise=P.Promise;var Ue=et(16);Je.ValueService=Ue.ValueService;var Ye=et(19);Je.ExpressionService=Ye.ExpressionService;var qe=et(118);Je.XmlFactory=qe.XmlFactory;var M=et(63);Je.GridSerializer=M.GridSerializer;Je.BaseGridSerializingSession=M.BaseGridSerializingSession;Je.RowType=M.RowType;var Xe=et(12);Je.LoggerFactory=Xe.LoggerFactory;var Ke=et(7);Je.ColumnApi=Ke.ColumnApi;var Qe=et(146);Je.BaseComponentWrapper=Qe.BaseComponentWrapper;var Ze=et(41);Je.Environment=Ze.Environment}).call(Je,et(120))},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(1,eval)("this")}catch(e){if(typeof window==="object")i=window}e.exports=i},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(8);var s=i(0);var l=i(14);var u=i(15);var c=i(25);var d=i(1);var f=i(13);var p=function(o){n(e,o);function e(e,t,i,n){var r=o.call(this,'<span class="ag-row-drag"></span>')||this;r.rowNode=e;r.column=t;r.cellValue=i;r.beans=n;return r}e.prototype.postConstruct=function(){this.addDragSource();this.checkCompatibility();if(this.beans.gridOptionsWrapper.isRowDragManaged()){this.addFeature(this.beans.context,new g(this,this.beans,this.rowNode,this.column))}else{this.addFeature(this.beans.context,new h(this,this.beans,this.rowNode,this.column))}};e.prototype.checkCompatibility=function(){var e=this.beans.gridOptionsWrapper.isRowDragManaged();var t=this.beans.gridOptionsWrapper.isTreeData();if(t&&e){d._.doOnce(function(){return console.warn("ag-Grid: If using row drag with tree data, you cannot have rowDragManaged=true")},"RowDragComp.managedAndTreeData")}};e.prototype.addDragSource=function(){var e=this;var t={rowNode:this.rowNode};var i={type:u.DragSourceType.RowDrag,eElement:this.getGui(),dragItemName:this.cellValue,dragItemCallback:function(){return t},dragStartPixels:0};this.beans.dragAndDropService.addDragSource(i,true);this.addDestroyFunc(function(){return e.beans.dragAndDropService.removeDragSource(i)})};r([s.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}(o.Component);t.RowDragComp=p;var h=function(o){n(e,o);function e(e,t,i,n){var r=o.call(this)||this;r.parent=e;r.beans=t;r.column=n;r.rowNode=i;return r}e.prototype.postConstruct=function(){this.addDestroyableEventListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this));this.addDestroyableEventListener(this.rowNode,l.RowNode.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this));this.addDestroyableEventListener(this.rowNode,l.RowNode.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this));this.workOutVisibility()};e.prototype.onSuppressRowDrag=function(){this.workOutVisibility()};e.prototype.workOutVisibility=function(){var e=this.beans.gridOptionsWrapper.isSuppressRowDrag();if(e){this.parent.setVisible(false)}else{var t=this.column.isRowDrag(this.rowNode);this.parent.setVisible(t)}};r([s.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}(f.BeanStub);var g=function(o){n(e,o);function e(e,t,i,n){var r=o.call(this)||this;r.parent=e;r.beans=t;r.column=n;r.rowNode=i;return r}e.prototype.postConstruct=function(){this.addDestroyableEventListener(this.beans.eventService,c.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this));this.addDestroyableEventListener(this.beans.eventService,c.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this));this.addDestroyableEventListener(this.beans.eventService,c.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this));this.addDestroyableEventListener(this.rowNode,l.RowNode.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this));this.addDestroyableEventListener(this.rowNode,l.RowNode.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this));this.addDestroyableEventListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this));this.updateSortActive();this.updateFilterActive();this.updateRowGroupActive();this.workOutVisibility()};e.prototype.updateRowGroupActive=function(){var e=this.beans.columnController.getRowGroupColumns();this.rowGroupActive=!d._.missingOrEmpty(e)};e.prototype.onRowGroupChanged=function(){this.updateRowGroupActive();this.workOutVisibility()};e.prototype.updateSortActive=function(){var e=this.beans.sortController.getSortModel();this.sortActive=!d._.missingOrEmpty(e)};e.prototype.onSortChanged=function(){this.updateSortActive();this.workOutVisibility()};e.prototype.updateFilterActive=function(){this.filterActive=this.beans.filterManager.isAnyFilterPresent()};e.prototype.onFilterChanged=function(){this.updateFilterActive();this.workOutVisibility()};e.prototype.onSuppressRowDrag=function(){this.workOutVisibility()};e.prototype.workOutVisibility=function(){var e=this.sortActive||this.filterActive||this.rowGroupActive;var t=this.beans.gridOptionsWrapper.isSuppressRowDrag();var i=e||t;if(i){this.parent.setVisible(false)}else{var n=this.column.isRowDrag(this.rowNode);this.parent.setVisible(n)}};r([s.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}(f.BeanStub)},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(0);var s=i(10);var l=i(1);var u=i(52);var c=i(8);var d=i(11);var f=i(2);var p=i(28);var h=i(74);var g=i(5);var v=i(3);var m=i(45);var y=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.init=function(e){this.column=e.column;var t=l._.loadTemplate('<div class="ag-header-cell" aria-hidden="true"><div class="ag-floating-filter-body" aria-hidden="true"></div></div>');this.enrichBody(t);this.setTemplateFromElement(t);this.setupWidth();this.addColumnHoverListener();this.addFeature(this.context,new h.HoverFeature([this.column],this.getGui()));var i=new u.SetLeftFeature(this.column,this.getGui(),this.beans);i.init();this.addDestroyFunc(i.destroy.bind(i))};t.prototype.addColumnHoverListener=function(){this.addDestroyableEventListener(this.eventService,g.Events.EVENT_COLUMN_HOVER_CHANGED,this.onColumnHover.bind(this));this.onColumnHover()};t.prototype.onColumnHover=function(){var e=this.columnHoverService.isHovered(this.column);l._.addOrRemoveCssClass(this.getGui(),"ag-column-hover",e)};t.prototype.setupWidth=function(){this.addDestroyableEventListener(this.column,s.Column.EVENT_WIDTH_CHANGED,this.onColumnWidthChanged.bind(this));this.onColumnWidthChanged()};t.prototype.onColumnWidthChanged=function(){this.getGui().style.width=this.column.getActualWidth()+"px"};r([a.Autowired("context"),o("design:type",a.Context)],t.prototype,"context",void 0);r([a.Autowired("columnHoverService"),o("design:type",m.ColumnHoverService)],t.prototype,"columnHoverService",void 0);r([a.Autowired("eventService"),o("design:type",v.EventService)],t.prototype,"eventService",void 0);r([a.Autowired("beans"),o("design:type",p.Beans)],t.prototype,"beans",void 0);return t}(c.Component);t.BaseFilterWrapperComp=y;var b=function(t){n(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.init=function(e){this.floatingFilterCompPromise=e.floatingFilterComp;this.suppressFilterButton=e.suppressFilterButton;t.prototype.init.call(this,e);this.addEventListeners()};e.prototype.addEventListeners=function(){if(!this.suppressFilterButton&&this.eButtonShowMainFilter){this.addDestroyableEventListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this))}};e.prototype.enrichBody=function(r){var o=this;this.floatingFilterCompPromise.then(function(e){var t=r.querySelector(".ag-floating-filter-body");var i=e.getGui();if(o.suppressFilterButton){t.appendChild(i);l._.removeCssClass(t,"ag-floating-filter-body");l._.addCssClass(t,"ag-floating-filter-full-body")}else{t.appendChild(i);r.appendChild(l._.loadTemplate('<div class="ag-floating-filter-button" aria-hidden="true">\n                        <button type="button" ref="eButtonShowMainFilter"></button>\n                </div>'));var n=l._.createIconNoSpan("filter",o.gridOptionsWrapper,o.column);r.querySelector("button").appendChild(n)}if(e.afterGuiAttached){e.afterGuiAttached()}o.wireQuerySelectors();o.addEventListeners()})};e.prototype.onParentModelChanged=function(e){var t=undefined;var i=null;if(e&&e.operator){t=e;i=t.condition1}else{i=e}this.floatingFilterCompPromise.then(function(e){e.onParentModelChanged(i,t)})};e.prototype.showParentFilter=function(){this.menuFactory.showMenuAfterButtonClick(this.column,this.eButtonShowMainFilter,"filterMenuTab",["filterMenuTab"])};r([d.RefSelector("eButtonShowMainFilter"),o("design:type",HTMLInputElement)],e.prototype,"eButtonShowMainFilter",void 0);r([a.Autowired("menuFactory"),o("design:type",Object)],e.prototype,"menuFactory",void 0);r([a.Autowired("gridOptionsWrapper"),o("design:type",f.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);return e}(y);t.FloatingFilterWrapperComp=b;var _=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.enrichBody=function(e){};t.prototype.onParentModelChanged=function(e){};return t}(y);t.EmptyFloatingFilterWrapperComp=_},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){this.first=null;this.last=null}e.prototype.add=function(e){var t={item:e,next:null};if(this.last){this.last.next=t}else{this.first=t}this.last=t};e.prototype.remove=function(){var e=this.first;if(e){this.first=e.next;if(!this.first){this.last=null}}return e.item};e.prototype.isEmpty=function(){return!this.first};return e}();t.LinkedList=n;var r=function(){function e(){}return e}()},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(1);var s=i(2);var l=i(0);var u=i(8);var c=i(21);var d=function(e){n(t,e);function t(){return e.call(this)||this}t.prototype.init=function(){};t.prototype.showLoadingOverlay=function(e){var i=this;this.setTemplate(t.LOADING_WRAPPER_OVERLAY_TEMPLATE);this.componentRecipes.newLoadingOverlayComponent().then(function(e){var t=i.getRefElement("loadingOverlayWrapper");a.Utils.removeAllChildren(t);t.appendChild(e.getGui())});this.showOverlay(e,this.getGui())};t.prototype.showNoRowsOverlay=function(e){var i=this;this.setTemplate(t.NO_ROWS_WRAPPER_OVERLAY_TEMPLATE);this.componentRecipes.newNoRowsOverlayComponent().then(function(e){var t=i.getRefElement("noRowsOverlayWrapper");a.Utils.removeAllChildren(t);t.appendChild(e.getGui())});this.showOverlay(e,this.getGui())};t.prototype.hideOverlay=function(e){a.Utils.removeAllChildren(e);a.Utils.setVisible(e,false)};t.prototype.showOverlay=function(e,t){if(t){a.Utils.removeAllChildren(e);a.Utils.setVisible(e,true);e.appendChild(t)}else{console.warn("ag-Grid: unknown overlay");this.hideOverlay(e)}};t.LOADING_WRAPPER_OVERLAY_TEMPLATE='<div class="ag-overlay-panel" role="presentation">'+'<div class="ag-overlay-wrapper ag-overlay-loading-wrapper" ref="loadingOverlayWrapper">[OVERLAY_TEMPLATE]</div>'+"</div>";t.NO_ROWS_WRAPPER_OVERLAY_TEMPLATE='<div class="ag-overlay-panel" role="presentation">'+'<div class="ag-overlay-wrapper ag-overlay-no-rows-wrapper" ref="noRowsOverlayWrapper">[OVERLAY_TEMPLATE]</div>'+"</div>";r([l.Autowired("gridOptionsWrapper"),o("design:type",s.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([l.Autowired("componentRecipes"),o("design:type",c.ComponentRecipes)],t.prototype,"componentRecipes",void 0);return t}(u.Component);t.OverlayWrapperComponent=d},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var l=i(10);var s=i(1);var u=i(0);var c=i(2);var d=i(24);var f=i(46);var p=i(3);var h=i(11);var g=i(5);var v=function(t){n(i,t);function i(){var e=t!==null&&t.apply(this,arguments)||this;e.lastMovingChanged=0;return e}i.prototype.init=function(e){var t=s.Utils.firstExistingValue(e.template,i.TEMPLATE);this.setTemplate(t);this.params=e;this.setupTap();this.setupIcons(e.column);this.setupMenu();this.setupSort();this.setupFilterIcon();this.setupText(e.displayName)};i.prototype.setupText=function(e){if(this.eText){this.eText.innerHTML=e}};i.prototype.setupIcons=function(e){this.addInIcon("sortAscending",this.eSortAsc,e);this.addInIcon("sortDescending",this.eSortDesc,e);this.addInIcon("sortUnSort",this.eSortNone,e);this.addInIcon("menu",this.eMenu,e);this.addInIcon("filter",this.eFilter,e)};i.prototype.addInIcon=function(e,t,i){if(t==null)return;var n=s.Utils.createIconNoSpan(e,this.gridOptionsWrapper,i);t.appendChild(n)};i.prototype.setupTap=function(){var t=this;if(this.gridOptionsWrapper.isSuppressTouch()){return}var e=new f.TouchListener(this.getGui());if(this.params.enableMenu){var i=function(e){t.gridOptionsWrapper.getApi().showColumnMenuAfterMouseClick(t.params.column,e.touchStart)};this.addDestroyableEventListener(e,f.TouchListener.EVENT_LONG_TAP,i)}if(this.params.enableSorting){var n=function(){t.sortController.progressSort(t.params.column,false,"uiColumnSorted")};this.addDestroyableEventListener(e,f.TouchListener.EVENT_TAP,n)}this.addDestroyFunc(function(){return e.destroy()})};i.prototype.setupMenu=function(){var e=this;if(!this.eMenu){return}var t=!this.params.enableMenu||s.Utils.isUserAgentIPad();if(t){s.Utils.removeFromParent(this.eMenu);return}this.eMenu.addEventListener("click",function(){return e.showMenu(e.eMenu)});if(!this.gridOptionsWrapper.isSuppressMenuHide()){this.eMenu.style.opacity="0";this.addGuiEventListener("mouseover",function(){e.eMenu.style.opacity="1"});this.addGuiEventListener("mouseout",function(){e.eMenu.style.opacity="0"})}var i=this.eMenu.style;i["transition"]="opacity 0.2s, border 0.2s";i["-webkit-transition"]="opacity 0.2s, border 0.2s"};i.prototype.showMenu=function(e){this.menuFactory.showMenuAfterButtonClick(this.params.column,e)};i.prototype.removeSortIcons=function(){s.Utils.removeFromParent(this.eSortAsc);s.Utils.removeFromParent(this.eSortDesc);s.Utils.removeFromParent(this.eSortNone);s.Utils.removeFromParent(this.eSortOrder)};i.prototype.setupSort=function(){var a=this;var e=this.params.enableSorting;if(!e){this.removeSortIcons();return}var s=this.gridOptionsWrapper.isMultiSortKeyCtrl();this.addDestroyableEventListener(this.params.column,l.Column.EVENT_MOVING_CHANGED,function(){a.lastMovingChanged=(new Date).getTime()});if(this.eLabel){this.addDestroyableEventListener(this.eLabel,"click",function(e){var t=a.params.column.isMoving();var i=(new Date).getTime();var n=i-a.lastMovingChanged<50;var r=t||n;if(!r){var o=s?e.ctrlKey||e.metaKey:e.shiftKey;a.params.progressSort(o)}else{console.log("kipping sort cos of moving "+a.lastMovingChanged)}})}this.addDestroyableEventListener(this.params.column,l.Column.EVENT_SORT_CHANGED,this.onSortChanged.bind(this));this.onSortChanged();this.addDestroyableEventListener(this.eventService,g.Events.EVENT_SORT_CHANGED,this.setMultiSortOrder.bind(this));this.setMultiSortOrder()};i.prototype.onSortChanged=function(){s.Utils.addOrRemoveCssClass(this.getGui(),"ag-header-cell-sorted-asc",this.params.column.isSortAscending());s.Utils.addOrRemoveCssClass(this.getGui(),"ag-header-cell-sorted-desc",this.params.column.isSortDescending());s.Utils.addOrRemoveCssClass(this.getGui(),"ag-header-cell-sorted-none",this.params.column.isSortNone());if(this.eSortAsc){s.Utils.addOrRemoveCssClass(this.eSortAsc,"ag-hidden",!this.params.column.isSortAscending())}if(this.eSortDesc){s.Utils.addOrRemoveCssClass(this.eSortDesc,"ag-hidden",!this.params.column.isSortDescending())}if(this.eSortNone){var e=!this.params.column.getColDef().unSortIcon&&!this.gridOptionsWrapper.isUnSortIcon();s.Utils.addOrRemoveCssClass(this.eSortNone,"ag-hidden",e||!this.params.column.isSortNone())}};i.prototype.setMultiSortOrder=function(){if(!this.eSortOrder){return}var e=this.params.column;var t=this.sortController.getColumnsWithSortingOrdered();var i=t.indexOf(e);var n=t.length>1;var r=e.isSorting()&&n;s.Utils.setVisible(this.eSortOrder,r);if(i>=0){this.eSortOrder.innerHTML=(i+1).toString()}else{this.eSortOrder.innerHTML=""}};i.prototype.setupFilterIcon=function(){if(!this.eFilter){return}this.addDestroyableEventListener(this.params.column,l.Column.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this));this.onFilterChanged()};i.prototype.onFilterChanged=function(){var e=this.params.column.isFilterActive();s.Utils.addOrRemoveCssClass(this.eFilter,"ag-hidden",!e)};i.TEMPLATE='<div class="ag-cell-label-container" role="presentation">'+'  <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>'+'  <div ref="eLabel" class="ag-header-cell-label" role="presentation">'+'    <span ref="eText" class="ag-header-cell-text" role="columnheader"></span>'+'    <span ref="eFilter" class="ag-header-icon ag-filter-icon" aria-hidden="true"></span>'+'    <span ref="eSortOrder" class="ag-header-icon ag-sort-order" aria-hidden="true"></span>'+'    <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon" aria-hidden="true"></span>'+'    <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon" aria-hidden="true"></span>'+'    <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon" aria-hidden="true"></span>'+"  </div>"+"</div>";r([u.Autowired("gridOptionsWrapper"),o("design:type",c.GridOptionsWrapper)],i.prototype,"gridOptionsWrapper",void 0);r([u.Autowired("sortController"),o("design:type",d.SortController)],i.prototype,"sortController",void 0);r([u.Autowired("menuFactory"),o("design:type",Object)],i.prototype,"menuFactory",void 0);r([u.Autowired("eventService"),o("design:type",p.EventService)],i.prototype,"eventService",void 0);r([h.RefSelector("eFilter"),o("design:type",HTMLElement)],i.prototype,"eFilter",void 0);r([h.RefSelector("eSortAsc"),o("design:type",HTMLElement)],i.prototype,"eSortAsc",void 0);r([h.RefSelector("eSortDesc"),o("design:type",HTMLElement)],i.prototype,"eSortDesc",void 0);r([h.RefSelector("eSortNone"),o("design:type",HTMLElement)],i.prototype,"eSortNone",void 0);r([h.RefSelector("eSortOrder"),o("design:type",HTMLElement)],i.prototype,"eSortOrder",void 0);r([h.RefSelector("eMenu"),o("design:type",HTMLElement)],i.prototype,"eMenu",void 0);r([h.RefSelector("eLabel"),o("design:type",HTMLElement)],i.prototype,"eLabel",void 0);r([h.RefSelector("eText"),o("design:type",HTMLElement)],i.prototype,"eText",void 0);return i}(a.Component);t.HeaderComp=v},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(1);var l=i(4);var u=i(2);var c=i(0);var d=i(46);var f=i(11);var p=i(32);var h=function(e){n(t,e);function t(){return e.call(this,t.TEMPLATE)||this}t.prototype.init=function(e){this.params=e;this.setupLabel();this.addGroupExpandIcon();this.setupExpandIcons()};t.prototype.setupExpandIcons=function(){var i=this;this.addInIcon("columnGroupOpened","agOpened");this.addInIcon("columnGroupClosed","agClosed");var e=function(e){if(s.Utils.isStopPropagationForAgGrid(e)){return}var t=!i.params.columnGroup.isExpanded();i.columnController.setColumnGroupOpened(i.params.columnGroup.getOriginalColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e);this.addTouchAndClickListeners(this.eOpenIcon,e);var t=function(e){s.Utils.stopPropagationForAgGrid(e)};this.addDestroyableEventListener(this.eCloseIcon,"dblclick",t);this.addDestroyableEventListener(this.eOpenIcon,"dblclick",t);this.addDestroyableEventListener(this.getGui(),"dblclick",e);this.updateIconVisibility();var n=this.params.columnGroup.getOriginalColumnGroup();this.addDestroyableEventListener(n,p.OriginalColumnGroup.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this));this.addDestroyableEventListener(n,p.OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))};t.prototype.addTouchAndClickListeners=function(e,t){var i=new d.TouchListener(this.eCloseIcon);this.addDestroyableEventListener(i,d.TouchListener.EVENT_TAP,t);this.addDestroyFunc(function(){return i.destroy()});this.addDestroyableEventListener(e,"click",t)};t.prototype.updateIconVisibility=function(){var e=this.params.columnGroup;if(e.isExpandable()){var t=this.params.columnGroup.isExpanded();s.Utils.setVisible(this.eOpenIcon,!t);s.Utils.setVisible(this.eCloseIcon,t)}else{s.Utils.setVisible(this.eOpenIcon,false);s.Utils.setVisible(this.eCloseIcon,false)}};t.prototype.addInIcon=function(e,t){var i=s.Utils.createIconNoSpan(e,this.gridOptionsWrapper,null);this.getRefElement(t).appendChild(i)};t.prototype.addGroupExpandIcon=function(){if(!this.params.columnGroup.isExpandable()){s.Utils.setVisible(this.eOpenIcon,false);s.Utils.setVisible(this.eCloseIcon,false);return}};t.prototype.setupLabel=function(){if(this.params.displayName&&this.params.displayName!==""){var e=this.getRefElement("agLabel");e.innerHTML=this.params.displayName}};t.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer">'+'<span ref="agLabel" class="ag-header-group-text"></span>'+'<span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>'+'<span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>'+"</div>";r([c.Autowired("columnController"),o("design:type",l.ColumnController)],t.prototype,"columnController",void 0);r([c.Autowired("gridOptionsWrapper"),o("design:type",u.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([f.RefSelector("agOpened"),o("design:type",HTMLElement)],t.prototype,"eOpenIcon",void 0);r([f.RefSelector("agClosed"),o("design:type",HTMLElement)],t.prototype,"eCloseIcon",void 0);return t}(a.Component);t.HeaderGroupComp=h},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(2);var l=i(0);var r=i(8);var u=function(e){n(r,e);function r(){return e.call(this)||this}r.prototype.init=function(e){var t=this.gridOptionsWrapper.getOverlayLoadingTemplate()?this.gridOptionsWrapper.getOverlayLoadingTemplate():r.DEFAULT_LOADING_OVERLAY_TEMPLATE;var i=this.gridOptionsWrapper.getLocaleTextFunc();var n=t.replace("[LOADING...]",i("loadingOoo","Loading..."));this.setTemplate(n)};r.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span class="ag-overlay-loading-center">[LOADING...]</span>';o([l.Autowired("gridOptionsWrapper"),a("design:type",s.GridOptionsWrapper)],r.prototype,"gridOptionsWrapper",void 0);return r}(r.Component);t.LoadingOverlayComponent=u},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(2);var l=i(0);var r=i(8);var u=function(e){n(r,e);function r(){return e.call(this)||this}r.prototype.init=function(e){var t=this.gridOptionsWrapper.getOverlayNoRowsTemplate()?this.gridOptionsWrapper.getOverlayNoRowsTemplate():r.DEFAULT_NO_ROWS_TEMPLATE;var i=this.gridOptionsWrapper.getLocaleTextFunc();var n=t.replace("[NO_ROWS_TO_SHOW]",i("noRowsToShow","No Rows To Show"));this.setTemplate(n)};r.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';o([l.Autowired("gridOptionsWrapper"),a("design:type",s.GridOptionsWrapper)],r.prototype,"gridOptionsWrapper",void 0);return r}(r.Component);t.NoRowsOverlayComponent=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var l=function(){if(typeof requestAnimationFrame==="function"){return requestAnimationFrame.bind(window)}return function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}();var u=2;var n=function(e,t){var i=false;var n=false;var r=0;function o(){if(i){i=false;e()}if(n){s()}}function a(){l(o)}function s(){var e=Date.now();if(i){if(e-r<u){return}n=true}else{i=true;n=false;setTimeout(a,t)}r=e}return s};var r=20;var o=typeof MutationObserver!=="undefined";var d=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||window};var f=v(0,0,0,0);function p(e){return parseFloat(e)||0}function h(n,e,t){var i=[e,t];return i.reduce(function(e,t){var i=n.getPropertyValue("border-"+t+"-width");return e+p(i)},0)}function g(e){var t=["top","right","bottom","left"];var i={top:null,left:null,right:null,bottom:null};for(var n=0,r=t;n<r.length;n+=1){var o=r[n];var a=e.getPropertyValue("padding-"+o);i[o]=p(a)}return i}function a(e){var t=e.clientWidth;var i=e.clientHeight;if(!t&&!i){return f}var n=d(e).getComputedStyle(e);var r=g(n);var o=r.left+r.right;var a=r.top+r.bottom;var s=p(n.width);var l=p(n.height);if(n.boxSizing==="border-box"){if(Math.round(s+o)!==t){s-=h(n,"left","right")+o}if(Math.round(l+a)!==i){l-=h(n,"top","bottom")+a}}var u=Math.round(s+o)-t;var c=Math.round(l+a)-i;if(Math.abs(u)!==1){s-=u}if(Math.abs(c)!==1){l-=c}return v(r.left,r.top,s,l)}function s(e){return a(e)}function c(e){var t=e.x;var i=e.y;var n=e.width;var r=e.height;var o=window.DOMRectReadOnly?window.DOMRectReadOnly:Object;var a=Object.create(o.prototype);y(a,{x:t,y:i,width:n,height:r,top:i,right:t+n,bottom:r+i,left:t});return a}function v(e,t,i,n){return{x:e,y:t,width:i,height:n}}var m=function(){function e(){this.connected_=false;this.mutationEventsAdded_=false;this.mutationsObserver_=null;this.observers_=[];this.callback_=null;this.refresh=n(this.refresh.bind(this),r)}e.prototype.addObserver=function(e){if(this.observers_.indexOf(e)==-1){this.observers_.push(e)}if(!this.connected_){this.connect_()}};e.prototype.removeObserver=function(e){var t=this.observers_;var i=t.indexOf(e);if(i>-1){t.splice(i,1)}if(!t.length&&this.connected_){this.disconnect_()}};e.prototype.refresh=function(){var e=this.updateObservers_();if(e){this.refresh()}};e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.hasActive()});e.forEach(function(e){return e.broadcastActive()});return e.length>0};e.prototype.connect_=function(){if(this.connected_){return}window.addEventListener("resize",this.refresh);if(o){this.mutationsObserver_=new MutationObserver(this.refresh);this.mutationsObserver_.observe(document,{attributes:true,childList:true,characterData:true,subtree:true})}else{document.addEventListener("DOMSubtreeModified",this.refresh);this.mutationEventsAdded_=true}this.connected_=true};e.prototype.disconnect_=function(){if(!this.connected_){return}window.removeEventListener("resize",this.refresh);if(this.mutationsObserver_){this.mutationsObserver_.disconnect()}if(this.mutationEventsAdded_){document.removeEventListener("DOMSubtreeModified",this.refresh)}this.mutationsObserver_=null;this.mutationEventsAdded_=false;this.connected_=false};e.getInstance=function(){if(!this.instance_){this.instance_=new e}return this.instance_};e.instance_=null;return e}();var y=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i+=1){var r=n[i];Object.defineProperty(e,r,{value:t[r],enumerable:false,writable:false,configurable:true})}return e};var b=function(){function e(e){this.target=e;this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=null;this.contentRect_=v(0,0,0,0)}e.prototype.isActive=function(){var e=s(this.target);this.contentRect_=e;return e.width!==this.broadcastWidth||e.height!==this.broadcastHeight};e.prototype.broadcastRect=function(){var e=this.contentRect_;this.broadcastWidth=e.width;this.broadcastHeight=e.height;return e};return e}();var _=function(){function e(e,t,i){this.observation=null;this.callback_=null;this.controller_=null;this.callbackCtx_=null;this.observation=null;if(typeof e!=="function"){throw new TypeError("The callback provided as parameter 1 is not a function.")}this.callback_=e;this.controller_=t;this.callbackCtx_=i}e.prototype.observe=function(e){this.observation=new b(e);this.controller_.addObserver(this);this.controller_.refresh()};e.prototype.disconnect=function(){this.observation=null;this.controller_.removeObserver(this)};e.prototype.broadcastActive=function(){if(!this.hasActive()){return}var e=this.callbackCtx_;this.callback_.call(e,{target:this.observation.target,contentRect:c(this.observation.broadcastRect())},e)};e.prototype.hasActive=function(){return this.observation.isActive()};return e}();var w=function(){function e(e){var t=m.getInstance();var i=new _(e,t,this);this.observer_=i}e.prototype.observe=function(e){this.observer_.observe(e)};e.prototype.disconnect=function(){this.observer_.disconnect()};return e}();function C(e,o){if(window.ResizeObserver){var t=new window.ResizeObserver(function(e,t){for(var i=0,n=e;i<n.length;i++){var r=n[i];o(r)}});t.observe(e);return function e(){t.disconnect()}}else{var i=new w(function(e){o(e)});i.observe(e);return function e(){i.disconnect()}}}t.observeResize=C},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(1);var a=i(0);var s=i(2);var l=function(){function e(e){this.childCount=0;this.rowTemplatesToAdd=[];this.afterGuiAttachedCallbacks=[];this.eContainer=e.eContainer;this.eViewport=e.eViewport;this.hideWhenNoChildren=e.hideWhenNoChildren}e.prototype.setVerticalScrollPosition=function(e){this.scrollTop=e};e.prototype.postConstruct=function(){this.domOrder=this.gridOptionsWrapper.isEnsureDomOrder();this.checkVisibility()};e.prototype.getRowElement=function(e){return this.eContainer.querySelector('[comp-id="'+e+'"]')};e.prototype.setHeight=function(e){this.eContainer.style.height=e+"px"};e.prototype.flushRowTemplates=function(){if(this.rowTemplatesToAdd.length!==0){var e=this.rowTemplatesToAdd.join("");o.Utils.appendHtml(this.eContainer,e);this.rowTemplatesToAdd.length=0}this.afterGuiAttachedCallbacks.forEach(function(e){return e()});this.afterGuiAttachedCallbacks.length=0;this.lastPlacedElement=null};e.prototype.appendRowTemplate=function(e,t){if(this.domOrder){this.lastPlacedElement=o.Utils.insertTemplateWithDomOrder(this.eContainer,e,this.lastPlacedElement)}else{this.rowTemplatesToAdd.push(e)}this.afterGuiAttachedCallbacks.push(t);this.childCount++;this.checkVisibility()};e.prototype.ensureDomOrder=function(e){if(this.domOrder){o.Utils.ensureDomOrder(this.eContainer,e,this.lastPlacedElement);this.lastPlacedElement=e}};e.prototype.removeRowElement=function(e){this.eContainer.removeChild(e);this.childCount--;this.checkVisibility()};e.prototype.checkVisibility=function(){if(!this.hideWhenNoChildren){return}var e=this.eViewport?this.eViewport:this.eContainer;var t=this.childCount>0;if(this.visible!==t){this.visible=t;o.Utils.setVisible(e,t);if(t&&this.eViewport){this.eViewport.scrollTop=this.scrollTop}}};n([a.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([a.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}();t.RowContainerComponent=l},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var l=i(15);var o=i(0);var a=i(22);var s=i(2);var u=i(3);var c=i(25);var d=function(){function e(e,t){this.eContainer=e;this.gridPanel=t}e.prototype.postConstruct=function(){if(this.gridOptionsWrapper.isRowModelDefault()){this.clientSideRowModel=this.rowModel}};e.prototype.getContainer=function(){return this.eContainer};e.prototype.isInterestedIn=function(e){return e===l.DragSourceType.RowDrag};e.prototype.getIconName=function(){return l.DragAndDropService.ICON_MOVE};e.prototype.onDragEnter=function(e){this.dispatchEvent(c.Events.EVENT_ROW_DRAG_ENTER,e);this.dragAndDropService.setGhostIcon(l.DragAndDropService.ICON_MOVE);e.dragItem.rowNode.setDragging(true);this.onEnterOrDragging(e)};e.prototype.onDragging=function(e){this.onEnterOrDragging(e)};e.prototype.onEnterOrDragging=function(e){this.dispatchEvent(c.Events.EVENT_ROW_DRAG_MOVE,e);this.lastDraggingEvent=e;var t=this.normaliseForScroll(e.y);var i=this.gridOptionsWrapper.isRowDragManaged();if(i){this.doManagedDrag(e,t)}this.checkCenterForScrolling(t)};e.prototype.doManagedDrag=function(e,t){var i=e.dragItem.rowNode;var n=this.clientSideRowModel.ensureRowAtPixel(i,t);if(n){this.focusedCellController.clearFocusedCell();if(this.rangeController){this.rangeController.clearSelection()}}};e.prototype.normaliseForScroll=function(e){var t=!this.gridOptionsWrapper.isGridAutoHeight();if(t){var i=this.gridPanel.getVScrollPosition();return e+i.top}else{return e}};e.prototype.checkCenterForScrolling=function(e){var t=this.gridPanel.getVScrollPosition();this.needToMoveUp=e<t.top+50;this.needToMoveDown=e>t.bottom-50;if(this.needToMoveUp||this.needToMoveDown){this.ensureIntervalStarted()}else{this.ensureIntervalCleared()}};e.prototype.ensureIntervalStarted=function(){if(!this.movingIntervalId){this.intervalCount=0;this.movingIntervalId=setInterval(this.moveInterval.bind(this),100)}};e.prototype.ensureIntervalCleared=function(){if(this.moveInterval){clearInterval(this.movingIntervalId);this.movingIntervalId=null}};e.prototype.moveInterval=function(){var e;this.intervalCount++;e=10+this.intervalCount*5;if(e>100){e=100}var t;if(this.needToMoveDown){t=this.gridPanel.scrollVertically(e)}else if(this.needToMoveUp){t=this.gridPanel.scrollVertically(-e)}if(t!==0){this.onDragging(this.lastDraggingEvent)}};e.prototype.dispatchEvent=function(e,t){var i=this.normaliseForScroll(t.y);var n=-1;var r=null;var o=i>this.rowModel.getCurrentPageHeight();if(!o){n=this.rowModel.getRowIndexAtPixel(i);r=this.rowModel.getRow(n)}var a;switch(t.vDirection){case l.VDirection.Down:a="down";break;case l.VDirection.Up:a="up";break;default:a=null;break}var s={type:e,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),event:t.event,node:t.dragItem.rowNode,overIndex:n,overNode:r,y:i,vDirection:a};this.eventService.dispatchEvent(s)};e.prototype.onDragLeave=function(e){this.dispatchEvent(c.Events.EVENT_ROW_DRAG_LEAVE,e);this.stopDragging(e)};e.prototype.onDragStop=function(e){this.dispatchEvent(c.Events.EVENT_ROW_DRAG_END,e);this.stopDragging(e)};e.prototype.stopDragging=function(e){this.ensureIntervalCleared();e.dragItem.rowNode.setDragging(false)};n([o.Autowired("dragAndDropService"),r("design:type",l.DragAndDropService)],e.prototype,"dragAndDropService",void 0);n([o.Autowired("rowModel"),r("design:type",Object)],e.prototype,"rowModel",void 0);n([o.Autowired("focusedCellController"),r("design:type",a.FocusedCellController)],e.prototype,"focusedCellController",void 0);n([o.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([o.Optional("rangeController"),r("design:type",Object)],e.prototype,"rangeController",void 0);n([o.Autowired("eventService"),r("design:type",u.EventService)],e.prototype,"eventService",void 0);n([o.PostConstruct,r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}();t.RowDragFeature=d},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(60);var r=i(13);var l=i(0);var u=i(7);var c=i(6);var d=i(5);var f=i(3);var p=i(9);var h=i(17);var g=i(2);var v=function(r){n(e,r);function e(e,t){var i=r.call(this)||this;i.cbSelectAllVisible=false;i.processingEventFromCheckbox=false;i.cbSelectAll=e;i.column=t;var n=t.getColDef();i.filteredOnly=n?!!n.headerCheckboxSelectionFilteredOnly:false;return i}e.prototype.postConstruct=function(){this.showOrHideSelectAll();this.addDestroyableEventListener(this.eventService,d.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this));this.addDestroyableEventListener(this.eventService,d.Events.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this));this.addDestroyableEventListener(this.eventService,d.Events.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this));this.addDestroyableEventListener(this.cbSelectAll,s.AgCheckbox.EVENT_CHANGED,this.onCbSelectAll.bind(this))};e.prototype.showOrHideSelectAll=function(){this.cbSelectAllVisible=this.isCheckboxSelection();this.cbSelectAll.setVisible(this.cbSelectAllVisible);if(this.cbSelectAllVisible){this.checkRightRowModelType();this.updateStateOfCheckbox()}};e.prototype.onModelChanged=function(){if(!this.cbSelectAllVisible){return}this.updateStateOfCheckbox()};e.prototype.onSelectionChanged=function(){if(!this.cbSelectAllVisible){return}this.updateStateOfCheckbox()};e.prototype.getNextCheckboxState=function(e){if(e.selected===0&&e.notSelected===0){return false}else if(e.selected>0&&e.notSelected>0){return null}else if(e.selected>0){return true}else{return false}};e.prototype.updateStateOfCheckbox=function(){if(this.processingEventFromCheckbox){return}this.processingEventFromCheckbox=true;var e=this.getSelectionCount();var t=this.getNextCheckboxState(e);this.cbSelectAll.setSelected(t);this.processingEventFromCheckbox=false};e.prototype.getSelectionCount=function(){var t=0;var i=0;var e=function(e){if(e.isSelected()){t++}else if(!e.selectable){}else{i++}};if(this.filteredOnly){this.gridApi.forEachNodeAfterFilter(e)}else{this.gridApi.forEachNode(e)}return{notSelected:i,selected:t}};e.prototype.checkRightRowModelType=function(){var e=this.rowModel.getType();var t=e===p.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;if(!t){console.log("ag-Grid: selectAllCheckbox is only available if using normal row model, you are using "+e)}};e.prototype.onCbSelectAll=function(){if(this.processingEventFromCheckbox){return}if(!this.cbSelectAllVisible){return}var e=this.cbSelectAll.isSelected();if(e){this.selectionController.selectAllRowNodes(this.filteredOnly)}else{this.selectionController.deselectAllRowNodes(this.filteredOnly)}};e.prototype.isCheckboxSelection=function(){var e=this.column.getColDef().headerCheckboxSelection;if(typeof e==="function"){var t=e;e=t({column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi})}if(e){if(this.gridOptionsWrapper.isRowModelServerSide()){console.warn("headerCheckboxSelection is not supported for Server Side Row Model");return false}if(this.gridOptionsWrapper.isRowModelInfinite()){console.warn("headerCheckboxSelection is not supported for Infinite Row Model");return false}if(this.gridOptionsWrapper.isRowModelViewport()){console.warn("headerCheckboxSelection is not supported for Viewport Row Model");return false}return true}else{return false}};o([l.Autowired("gridApi"),a("design:type",c.GridApi)],e.prototype,"gridApi",void 0);o([l.Autowired("columnApi"),a("design:type",u.ColumnApi)],e.prototype,"columnApi",void 0);o([l.Autowired("eventService"),a("design:type",f.EventService)],e.prototype,"eventService",void 0);o([l.Autowired("rowModel"),a("design:type",Object)],e.prototype,"rowModel",void 0);o([l.Autowired("selectionController"),a("design:type",h.SelectionController)],e.prototype,"selectionController",void 0);o([l.Autowired("gridOptionsWrapper"),a("design:type",g.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);o([l.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"postConstruct",null);return e}(r.BeanStub);t.SelectAllFeature=v},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var a=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var s=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var r=i(8);var l=i(10);var u=i(1);var c=i(26);var d=i(7);var f=i(4);var p=i(2);var h=i(59);var g=i(0);var v=i(81);var m=i(15);var y=i(52);var b=i(6);var _=i(21);var w=i(28);var C=i(74);var o=function(r){n(o,r);function o(e,t,i){var n=r.call(this,o.TEMPLATE)||this;n.childColumnsDestroyFuncs=[];n.columnGroup=e;n.dragSourceDropTarget=t;n.pinned=i;return n}o.prototype.postConstruct=function(){v.CssClassApplier.addHeaderClassesFromColDef(this.columnGroup.getColGroupDef(),this.getGui(),this.gridOptionsWrapper,null,this.columnGroup);var e=this.columnController.getDisplayNameForColumnGroup(this.columnGroup,"header");this.appendHeaderGroupComp(e);this.setupResize();this.addClasses();this.setupWidth();this.addAttributes();this.setupMovingCss();this.setupTooltip();this.addFeature(this.context,new C.HoverFeature(this.columnGroup.getOriginalColumnGroup().getLeafColumns(),this.getGui()));var t=new y.SetLeftFeature(this.columnGroup,this.getGui(),this.beans);t.init();this.addDestroyFunc(t.destroy.bind(t))};o.prototype.setupMovingCss=function(){var t=this;var e=this.columnGroup.getOriginalColumnGroup();var i=e.getLeafColumns();i.forEach(function(e){t.addDestroyableEventListener(e,l.Column.EVENT_MOVING_CHANGED,t.onColumnMovingChanged.bind(t))});this.onColumnMovingChanged()};o.prototype.setupTooltip=function(){var e=this.columnGroup.getColGroupDef();if(e&&e.headerTooltip){this.getGui().title=e.headerTooltip}};o.prototype.onColumnMovingChanged=function(){if(this.columnGroup.isMoving()){u.Utils.addCssClass(this.getGui(),"ag-header-cell-moving")}else{u.Utils.removeCssClass(this.getGui(),"ag-header-cell-moving")}};o.prototype.addAttributes=function(){this.getGui().setAttribute("col-id",this.columnGroup.getUniqueId())};o.prototype.appendHeaderGroupComp=function(e){var t=this;var i={displayName:e,columnGroup:this.columnGroup,setExpanded:function(e){t.columnController.setColumnGroupOpened(t.columnGroup.getOriginalColumnGroup(),e,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};if(!e){var n=this.columnGroup.getLeafColumns();e=n?n[0].getColDef().headerName:""}var r=this.afterHeaderCompCreated.bind(this,e);this.componentRecipes.newHeaderGroupComponent(i).then(r)};o.prototype.afterHeaderCompCreated=function(e,t){this.appendChild(t);this.setupMove(t.getGui(),e);if(t.destroy){this.addDestroyFunc(t.destroy.bind(t))}};o.prototype.addClasses=function(){if(this.columnGroup.isPadding()){this.addCssClass("ag-header-group-cell-no-group")}else{this.addCssClass("ag-header-group-cell-with-group")}};o.prototype.setupMove=function(e,t){var i=this;if(!e){return}if(this.isSuppressMoving()){return}var n=this.columnGroup.getOriginalColumnGroup().getLeafColumns();if(e){var r={type:m.DragSourceType.HeaderCell,eElement:e,dragItemName:t,dragItemCallback:this.getDragItemForGroup.bind(this),dragSourceDropTarget:this.dragSourceDropTarget,dragStarted:function(){return n.forEach(function(e){return e.setMoving(true,"uiColumnDragged")})},dragStopped:function(){return n.forEach(function(e){return e.setMoving(false,"uiColumnDragged")})}};this.dragAndDropService.addDragSource(r,true);this.addDestroyFunc(function(){return i.dragAndDropService.removeDragSource(r)})}};o.prototype.getDragItemForGroup=function(){var t=this.columnGroup.getOriginalColumnGroup().getLeafColumns();var i={};t.forEach(function(e){return i[e.getId()]=e.isVisible()});var n=[];this.columnController.getAllDisplayedColumns().forEach(function(e){if(t.indexOf(e)>=0){n.push(e);u.Utils.removeFromArray(t,e)}});t.forEach(function(e){return n.push(e)});return{columns:n,visibleState:i}};o.prototype.isSuppressMoving=function(){var t=false;this.columnGroup.getLeafColumns().forEach(function(e){if(e.getColDef().suppressMovable||e.isLockPosition()){t=true}});var e=t||this.gridOptionsWrapper.isSuppressMovableColumns();return e};o.prototype.setupWidth=function(){this.addListenersToChildrenColumns();this.addDestroyableEventListener(this.columnGroup,c.ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this));this.onWidthChanged();this.addDestroyFunc(this.destroyListenersOnChildrenColumns.bind(this))};o.prototype.onDisplayedChildrenChanged=function(){this.addListenersToChildrenColumns();this.onWidthChanged()};o.prototype.addListenersToChildrenColumns=function(){var t=this;this.destroyListenersOnChildrenColumns();var i=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(function(e){e.addEventListener(l.Column.EVENT_WIDTH_CHANGED,i);e.addEventListener(l.Column.EVENT_VISIBLE_CHANGED,i);t.childColumnsDestroyFuncs.push(function(){e.removeEventListener(l.Column.EVENT_WIDTH_CHANGED,i);e.removeEventListener(l.Column.EVENT_VISIBLE_CHANGED,i)})})};o.prototype.destroyListenersOnChildrenColumns=function(){this.childColumnsDestroyFuncs.forEach(function(e){return e()});this.childColumnsDestroyFuncs=[]};o.prototype.onWidthChanged=function(){this.getGui().style.width=this.columnGroup.getActualWidth()+"px"};o.prototype.setupResize=function(){var i=this;this.eHeaderCellResize=this.getRefElement("agResize");if(!this.columnGroup.isResizable()){u.Utils.removeFromParent(this.eHeaderCellResize);return}var e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eHeaderCellResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,false),onResizeEnd:this.onResizing.bind(this,true)});this.addDestroyFunc(e);if(!this.gridOptionsWrapper.isSuppressAutoSize()){this.eHeaderCellResize.addEventListener("dblclick",function(e){var t=[];i.columnGroup.getDisplayedLeafColumns().forEach(function(e){if(!e.getColDef().suppressAutoSize){t.push(e.getColId())}});if(t.length>0){i.columnController.autoSizeColumns(t,"uiColumnResized")}})}};o.prototype.onResizeStart=function(e){var t=this;var i=this.columnGroup.getDisplayedLeafColumns();this.resizeCols=u.Utils.filter(i,function(e){return e.isResizable()});this.resizeStartWidth=0;this.resizeCols.forEach(function(e){return t.resizeStartWidth+=e.getActualWidth()});this.resizeRatios=[];this.resizeCols.forEach(function(e){return t.resizeRatios.push(e.getActualWidth()/t.resizeStartWidth)});var n=null;if(e){n=this.columnController.getDisplayedGroupAfter(this.columnGroup)}if(n){var r=n.getDisplayedLeafColumns();this.resizeTakeFromCols=u.Utils.filter(r,function(e){return e.isResizable()});this.resizeTakeFromStartWidth=0;this.resizeTakeFromCols.forEach(function(e){return t.resizeTakeFromStartWidth+=e.getActualWidth()});this.resizeTakeFromRatios=[];this.resizeTakeFromCols.forEach(function(e){return t.resizeTakeFromRatios.push(e.getActualWidth()/t.resizeTakeFromStartWidth)})}else{this.resizeTakeFromCols=null;this.resizeTakeFromStartWidth=null;this.resizeTakeFromRatios=null}};o.prototype.onResizing=function(e,t){var i=[];var n=this.normaliseDragChange(t);i.push({columns:this.resizeCols,ratios:this.resizeRatios,width:this.resizeStartWidth+n});if(this.resizeTakeFromCols){i.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-n})}this.columnController.resizeColumnSets(i,e,"uiColumnDragged")};o.prototype.normaliseDragChange=function(e){var t=e;if(this.gridOptionsWrapper.isEnableRtl()){if(this.pinned!==l.Column.PINNED_LEFT){t*=-1}}else{if(this.pinned===l.Column.PINNED_RIGHT){t*=-1}}return t};o.TEMPLATE='<div class="ag-header-group-cell">'+'<div ref="agResize" class="ag-header-cell-resize"></div>'+"</div>";a([g.Autowired("gridOptionsWrapper"),s("design:type",p.GridOptionsWrapper)],o.prototype,"gridOptionsWrapper",void 0);a([g.Autowired("columnController"),s("design:type",f.ColumnController)],o.prototype,"columnController",void 0);a([g.Autowired("horizontalResizeService"),s("design:type",h.HorizontalResizeService)],o.prototype,"horizontalResizeService",void 0);a([g.Autowired("dragAndDropService"),s("design:type",m.DragAndDropService)],o.prototype,"dragAndDropService",void 0);a([g.Autowired("context"),s("design:type",g.Context)],o.prototype,"context",void 0);a([g.Autowired("componentRecipes"),s("design:type",_.ComponentRecipes)],o.prototype,"componentRecipes",void 0);a([g.Autowired("gridApi"),s("design:type",b.GridApi)],o.prototype,"gridApi",void 0);a([g.Autowired("columnApi"),s("design:type",d.ColumnApi)],o.prototype,"columnApi",void 0);a([g.Autowired("beans"),s("design:type",w.Beans)],o.prototype,"beans",void 0);a([g.PostConstruct,s("design:type",Function),s("design:paramtypes",[]),s("design:returntype",void 0)],o.prototype,"postConstruct",null);return o}(r.Component);t.HeaderGroupWrapperComp=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DefaultColumnTypes={numericColumn:{headerClass:"ag-numeric-header",cellClass:"ag-numeric-cell"}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var c=i(85);function n(e){var t=e.module("agGrid",[]);t.directive("agGrid",function(){return{restrict:"A",controller:["$element","$scope","$compile","$attrs",r],scope:true}})}t.initialiseAgGridWithAngular1=n;function r(e,t,i,n){var r;var o;var a=n.agGrid;o=a+".quickFilterText";r=t.$eval(a);if(!r){console.warn("WARNING - grid options for ag-Grid not found. Please ensure the attribute ag-grid points to a valid object on the scope");return}var s=e[0];var l={$scope:t,$compile:i,quickFilterOnScope:o};var u=new c.Grid(s,r,l);t.$on("$destroy",function(){u.destroy();u=null})}},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var a=this&&this.__param||function(i,n){return function(e,t){n(e,t,i)}};Object.defineProperty(t,"__esModule",{value:true});var s=i(0);var l=i(3);var u=i(5);var c=i(12);var d=i(137);var f=i(87);var p=i(6);var h=i(7);var g=function(t){n(e,t);function e(e){return t.call(this,e)||this}e.prototype.setBeans=function(e){this.logger=e.create("InfiniteCache")};e.prototype.init=function(){t.prototype.init.call(this);this.getRow(0)};e.prototype.moveItemsDown=function(e,t,i){var n=e.getStartRow();var r=e.getEndRow();var o=t+i;for(var a=r-1;a>=n;a--){if(a<o){continue}var s=a-i;var l=this.getRow(s,true);if(l){e.setRowNode(a,l)}else{e.setBlankRowNode(a);e.setDirty()}}};e.prototype.insertItems=function(e,t,i){var n=e.getStartRow();var r=e.getEndRow();var o=[];for(var a=0;a<i.length;a++){var s=t+a;var l=s>=n&&s<r;if(l){var u=i[a];var c=e.setNewData(s,u);o.push(c)}}return o};e.prototype.insertItemsAtIndex=function(n,r){var o=this;var a=[];this.forEachBlockInReverseOrder(function(e){var t=e.getEndRow();if(t<=n){return}o.moveItemsDown(e,n,r.length);var i=o.insertItems(e,n,r);i.forEach(function(e){return a.push(e)})});if(this.isMaxRowFound()){this.hack_setVirtualRowCount(this.getVirtualRowCount()+r.length)}this.onCacheUpdated();var e={type:u.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)};e.prototype.getRow=function(e,t){if(t===void 0){t=false}var i=Math.floor(e/this.cacheParams.blockSize);var n=this.getBlock(i);if(!n){if(t){return null}else{n=this.createBlock(i)}}return n.getRow(e)};e.prototype.createBlock=function(e){var t=new d.InfiniteBlock(e,this.cacheParams);this.context.wireBean(t);this.postCreateBlock(t);return t};e.prototype.refreshCache=function(){this.forEachBlockInOrder(function(e){return e.setDirty()});this.checkBlockToLoad()};r([s.Autowired("eventService"),o("design:type",l.EventService)],e.prototype,"eventService",void 0);r([s.Autowired("context"),o("design:type",s.Context)],e.prototype,"context",void 0);r([s.Autowired("columnApi"),o("design:type",h.ColumnApi)],e.prototype,"columnApi",void 0);r([s.Autowired("gridApi"),o("design:type",p.GridApi)],e.prototype,"gridApi",void 0);r([a(0,s.Qualifier("loggerFactory")),o("design:type",Function),o("design:paramtypes",[c.LoggerFactory]),o("design:returntype",void 0)],e.prototype,"setBeans",null);r([s.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"init",null);return e}(f.RowNodeCache);t.InfiniteCache=g},function(e,t,i){"use strict";var r=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var o=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var a=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var s=i(1);var l=i(2);var u=i(0);var n=i(61);var c=i(20);var d=function(n){r(e,n);function e(e,t){var i=n.call(this,e,t)||this;i.cacheParams=t;return i}e.prototype.createBlankRowNode=function(e){var t=n.prototype.createBlankRowNode.call(this,e);t.uiLevel=0;this.setIndexAndTopOnRowNode(t,e);return t};e.prototype.setDataAndId=function(e,t,i){if(s.Utils.exists(t)){e.setDataAndId(t,i.toString())}else{e.setDataAndId(undefined,undefined)}};e.prototype.setRowNode=function(e,t){n.prototype.setRowNode.call(this,e,t);this.setIndexAndTopOnRowNode(t,e)};e.prototype.init=function(){n.prototype.init.call(this,{context:this.context,rowRenderer:this.rowRenderer})};e.prototype.getNodeIdPrefix=function(){return null};e.prototype.getRow=function(e){return this.getRowUsingLocalIndex(e)};e.prototype.setIndexAndTopOnRowNode=function(e,t){e.setRowIndex(t);e.rowTop=this.cacheParams.rowHeight*t};e.prototype.loadFromDatasource=function(){var e=this;var t={startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this),sortModel:this.cacheParams.sortModel,filterModel:this.cacheParams.filterModel,context:this.gridOptionsWrapper.getContext()};if(s.Utils.missing(this.cacheParams.datasource.getRows)){console.warn("ag-Grid: datasource is missing getRows method");return}var i=s.Utils.getFunctionParameters(this.cacheParams.datasource.getRows);if(i.length>1){console.warn("ag-grid: It looks like your paging datasource is of the old type, taking more than one parameter.");console.warn("ag-grid: From ag-grid 1.9.0, now the getRows takes one parameter. See the documentation for details.")}setTimeout(function(){e.cacheParams.datasource.getRows(t)},0)};o([u.Autowired("gridOptionsWrapper"),a("design:type",l.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);o([u.Autowired("context"),a("design:type",u.Context)],e.prototype,"context",void 0);o([u.Autowired("rowRenderer"),a("design:type",c.RowRenderer)],e.prototype,"rowRenderer",void 0);o([u.PostConstruct,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"init",null);return e}(n.RowNodeBlock);t.InfiniteBlock=d},function(e,t,i){"use strict";var n=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var r=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var o=i(14);var a=i(88);var s=i(2);var l=i(3);var u=i(0);var c=i(4);var d=function(){function e(){}e.prototype.create=function(e){var t=new o.RowNode;var i=new a.ClientSideNodeManager(t,this.gridOptionsWrapper,this.context,this.eventService,this.columnController);this.context.wireBean(t);i.setRowData(e);return t};n([u.Autowired("gridOptionsWrapper"),r("design:type",s.GridOptionsWrapper)],e.prototype,"gridOptionsWrapper",void 0);n([u.Autowired("eventService"),r("design:type",l.EventService)],e.prototype,"eventService",void 0);n([u.Autowired("context"),r("design:type",u.Context)],e.prototype,"context",void 0);n([u.Autowired("columnController"),r("design:type",c.ColumnController)],e.prototype,"columnController",void 0);e=n([u.Bean("rowNodeFactory")],e);return e}();t.RowNodeFactory=d},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(0);var s=i(2);var l=i(89);var u=i(20);var c=i(3);var d=i(9);var f=i(13);var p=i(5);var h=function(e){n(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.init=function(){if(this.rowModel.getType()===d.Constants.ROW_MODEL_TYPE_CLIENT_SIDE){this.clientSideRowModel=this.rowModel}this.addDestroyableEventListener(this.eventService,p.Events.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))};t.prototype.onCellValueChanged=function(e){this.doChangeDetection(e.node,e.column)};t.prototype.doChangeDetection=function(e,t){if(this.gridOptionsWrapper.isSuppressChangeDetection()){return}if(this.clientSideRowModel&&!e.isRowPinned()){var i=this.gridOptionsWrapper.isAggregateOnlyChangedColumns();var n=new l.ChangedPath(i);n.addParentNode(e.parent,[t]);this.clientSideRowModel.doAggregate(n)}this.rowRenderer.refreshCells()};r([a.Autowired("gridOptionsWrapper"),o("design:type",s.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([a.Autowired("rowModel"),o("design:type",Object)],t.prototype,"rowModel",void 0);r([a.Autowired("rowRenderer"),o("design:type",u.RowRenderer)],t.prototype,"rowRenderer",void 0);r([a.Autowired("eventService"),o("design:type",c.EventService)],t.prototype,"eventService",void 0);r([a.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"init",null);t=r([a.Bean("changeDetectionService")],t);return t}(f.BeanStub);t.ChangeDetectionService=h},function(e,t,i){"use strict";var n=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i]};return function(e,t){n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();var r=this&&this.__decorate||function(e,t,i,n){var r=arguments.length,o=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o;return r>3&&o&&Object.defineProperty(t,i,o),o};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});var a=i(8);var s=i(0);var l=i(2);var u=i(11);var c=i(1);var d=i(3);var f=i(5);var p=i(20);var h=i(29);var g=function(e){n(t,e);function t(){return e.call(this)||this}t.prototype.postConstruct=function(){this.setTemplate(this.getTemplate());var e=this.gridOptionsWrapper.isPagination();var t=e&&!this.gridOptionsWrapper.isSuppressPaginationPanel();if(!t){this.setVisible(false);return}this.addDestroyableEventListener(this.eventService,f.Events.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this));this.addDestroyableEventListener(this.btFirst,"click",this.onBtFirst.bind(this));this.addDestroyableEventListener(this.btLast,"click",this.onBtLast.bind(this));this.addDestroyableEventListener(this.btNext,"click",this.onBtNext.bind(this));this.addDestroyableEventListener(this.btPrevious,"click",this.onBtPrevious.bind(this));this.onPaginationChanged()};t.prototype.onPaginationChanged=function(){this.enableOrDisableButtons();this.updateRowLabels();this.setCurrentPageLabel();this.setTotalLabels()};t.prototype.setCurrentPageLabel=function(){var e=this.paginationProxy.getTotalPages()>0;var t=this.paginationProxy.getCurrentPage();var i=e?t+1:0;this.lbCurrent.innerHTML=this.formatNumber(i)};t.prototype.formatNumber=function(e){var t=this.gridOptionsWrapper.getPaginationNumberFormatterFunc();if(t){return t({value:e})}else{return c._.formatNumberCommas(e)}};t.prototype.getTemplate=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc();var t=e("page","Page");var i=e("to","to");var n=e("of","of");var r=e("first","First");var o=e("previous","Previous");var a=e("next","Next");var s=e("last","Last");return'<div class="ag-paging-panel ag-font-style">\n                <span ref="eSummaryPanel" class="ag-paging-row-summary-panel">\n                    <span ref="lbFirstRowOnPage"></span> '+i+' <span ref="lbLastRowOnPage"></span> '+n+' <span ref="lbRecordCount"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel">\n                    <button type="button" class="ag-paging-button" ref="btFirst">'+r+'</button>\n                    <button type="button" class="ag-paging-button" ref="btPrevious">'+o+"</button>\n                    "+t+' <span ref="lbCurrent"></span> '+n+' <span ref="lbTotal"></span>\n                    <button type="button" class="ag-paging-button" ref="btNext">'+a+'</button>\n                    <button type="button" class="ag-paging-button" ref="btLast">'+s+"</button>\n                </span>\n            </div>"};t.prototype.onBtNext=function(){this.paginationProxy.goToNextPage()};t.prototype.onBtPrevious=function(){this.paginationProxy.goToPreviousPage()};t.prototype.onBtFirst=function(){this.paginationProxy.goToFirstPage()};t.prototype.onBtLast=function(){this.paginationProxy.goToLastPage()};t.prototype.enableOrDisableButtons=function(){var e=this.paginationProxy.getCurrentPage();var t=this.paginationProxy.isLastPageFound();var i=this.paginationProxy.getTotalPages();var n=e===0;this.btPrevious.disabled=n;this.btFirst.disabled=n;var r=this.isZeroPagesToDisplay();var o=t&&e===i-1;var a=o||r;this.btNext.disabled=a;var s=!t||r||e===i-1;this.btLast.disabled=s};t.prototype.updateRowLabels=function(){var e=this.paginationProxy.getCurrentPage();var t=this.paginationProxy.getPageSize();var i=this.paginationProxy.isLastPageFound();var n=this.paginationProxy.isLastPageFound()?this.paginationProxy.getTotalRowCount():null;var r;var o;if(this.isZeroPagesToDisplay()){r=0;o=0}else{r=t*e+1;o=r+t-1;if(i&&o>n){o=n}}this.lbFirstRowOnPage.innerHTML=this.formatNumber(r);this.lbLastRowOnPage.innerHTML=this.formatNumber(o)};t.prototype.isZeroPagesToDisplay=function(){var e=this.paginationProxy.isLastPageFound();var t=this.paginationProxy.getTotalPages();return e&&t===0};t.prototype.setTotalLabels=function(){var e=this.paginationProxy.isLastPageFound();var t=this.paginationProxy.getTotalPages();var i=this.paginationProxy.isLastPageFound()?this.paginationProxy.getTotalRowCount():null;if(e){this.lbTotal.innerHTML=this.formatNumber(t);this.lbRecordCount.innerHTML=this.formatNumber(i)}else{var n=this.gridOptionsWrapper.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=n;this.lbRecordCount.innerHTML=n}};r([s.Autowired("gridOptionsWrapper"),o("design:type",l.GridOptionsWrapper)],t.prototype,"gridOptionsWrapper",void 0);r([s.Autowired("eventService"),o("design:type",d.EventService)],t.prototype,"eventService",void 0);r([s.Autowired("paginationProxy"),o("design:type",h.PaginationProxy)],t.prototype,"paginationProxy",void 0);r([s.Autowired("rowRenderer"),o("design:type",p.RowRenderer)],t.prototype,"rowRenderer",void 0);r([u.RefSelector("btFirst"),o("design:type",HTMLButtonElement)],t.prototype,"btFirst",void 0);r([u.RefSelector("btPrevious"),o("design:type",HTMLButtonElement)],t.prototype,"btPrevious",void 0);r([u.RefSelector("btNext"),o("design:type",HTMLButtonElement)],t.prototype,"btNext",void 0);r([u.RefSelector("btLast"),o("design:type",HTMLButtonElement)],t.prototype,"btLast",void 0);r([u.RefSelector("lbRecordCount"),o("design:type",Object)],t.prototype,"lbRecordCount",void 0);r([u.RefSelector("lbFirstRowOnPage"),o("design:type",Object)],t.prototype,"lbFirstRowOnPage",void 0);r([u.RefSelector("lbLastRowOnPage"),o("design:type",Object)],t.prototype,"lbLastRowOnPage",void 0);r([u.RefSelector("eSummaryPanel"),o("design:type",Object)],t.prototype,"eSummaryPanel",void 0);r([u.RefSelector("lbCurrent"),o("design:type",Object)],t.prototype,"lbCurrent",void 0);r([u.RefSelector("lbTotal"),o("design:type",Object)],t.prototype,"lbTotal",void 0);r([s.PostConstruct,o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],t.prototype,"postConstruct",null);return t}(a.Component);t.PaginationComp=g},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(62);var r=i(85);var o=false;function a(){console.warn("ag-grid: initialiseAgGridWithWebComponents is deprecated. Please use the ag-grid-webcomponent dependency instead. ");if(o){return}o=true;if(typeof document==="undefined"||!document.registerElement){console.error("ag-Grid: unable to find document.registerElement() function, unable to initialise ag-Grid as a Web Component")}var e=Object.create(HTMLElement.prototype);n.ComponentUtil.ALL_PROPERTIES.forEach(function(t){Object.defineProperty(e,t,{set:function(e){this.__agGridSetProperty(t,e)},get:function(){return this.__agGridGetProperty(t)},enumerable:true,configurable:true})});var t=e;t.__agGridSetProperty=function(e,t){if(!this.__attributes){this.__attributes={}}this.__attributes[e]=t;var i={};i[e]={currentValue:t};this.onChange(i)};t.onChange=function(e){if(this._initialised){n.ComponentUtil.processOnChange(e,this._gridOptions,this.api,this.columnApi)}};t.__agGridGetProperty=function(e){if(!this.__attributes){this.__attributes={}}return this.__attributes[e]};t.setGridOptions=function(e){var t=this.globalEventListener.bind(this);this._gridOptions=n.ComponentUtil.copyAttributesToGridOptions(e,this);var i={globalEventListener:t};this._agGrid=new r.Grid(this,this._gridOptions,i);this.api=e.api;this.columnApi=e.columnApi;this._initialised=true};t.createdCallback=function(){for(var e=0;e<this.attributes.length;e++){var t=this.attributes[e];this.setPropertyFromAttribute(t)}};t.setPropertyFromAttribute=function(e){var t=s(e.nodeName);var i=e.nodeValue;if(n.ComponentUtil.ALL_PROPERTIES.indexOf(t)>=0){this[t]=i}};t.attachedCallback=function(e){};t.detachedCallback=function(e){};t.attributeChangedCallback=function(e){var t=this.attributes[e];this.setPropertyFromAttribute(t)};t.globalEventListener=function(e,t){var i=e.toLowerCase();var n=new Event(i);var r=n;r.agGridDetails=t;this.dispatchEvent(n);var o="on"+i;if(typeof this[o]==="function"){this[o](n)}};document.registerElement("ag-grid",{prototype:e})}t.initialiseAgGridWithWebComponents=a;function s(e){if(typeof e==="string"){var t=e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()});return t}else{return e}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=i(1);var n=function(){function i(e){var t=this;this.items=[];this.params=e;this.eGui=document.createElement("div");this.eGui.innerHTML=i.TEMPLATE;this.eHeader=this.eGui.querySelector('[ref="tabHeader"]');this.eBody=this.eGui.querySelector('[ref="tabBody"]');r.Utils.addCssClass(this.eGui,e.cssClass);if(e.items){e.items.forEach(function(e){return t.addItem(e)})}}i.prototype.setAfterAttachedParams=function(e){this.afterAttachedParams=e};i.prototype.getMinWidth=function(){var i=document.createElement("span");i.style.position="fixed";this.eGui.appendChild(i);var n=0;this.items.forEach(function(e){r.Utils.removeAllChildren(i);var t=e.tabbedItem.bodyPromise.resolveNow(null,function(e){return e.cloneNode(true)});if(t==null){return}i.appendChild(t);if(n<i.offsetWidth){n=i.offsetWidth}});this.eGui.removeChild(i);return n};i.prototype.showFirstItem=function(){if(this.items.length>0){this.showItemWrapper(this.items[0])}};i.prototype.addItem=function(e){var t=document.createElement("span");t.appendChild(e.title);r.Utils.addCssClass(t,"ag-tab");this.eHeader.appendChild(t);var i={tabbedItem:e,eHeaderButton:t};this.items.push(i);t.addEventListener("click",this.showItemWrapper.bind(this,i))};i.prototype.showItem=function(t){var e=r.Utils.find(this.items,function(e){return e.tabbedItem===t});if(e){this.showItemWrapper(e)}};i.prototype.showItemWrapper=function(e){var t=this;if(this.params.onItemClicked){this.params.onItemClicked({item:e.tabbedItem})}if(this.activeItem===e){r.Utils.callIfPresent(this.params.onActiveItemClicked);return}r.Utils.removeAllChildren(this.eBody);e.tabbedItem.bodyPromise.then(function(e){t.eBody.appendChild(e)});if(this.activeItem){r.Utils.removeCssClass(this.activeItem.eHeaderButton,"ag-tab-selected")}r.Utils.addCssClass(e.eHeaderButton,"ag-tab-selected");this.activeItem=e;if(e.tabbedItem.afterAttachedCallback){e.tabbedItem.afterAttachedCallback(this.afterAttachedParams)}};i.prototype.getGui=function(){return this.eGui};i.TEMPLATE="<div>"+'<div ref="tabHeader" class="ag-tab-header"></div>'+'<div ref="tabBody" class="ag-tab-body"></div>'+"</div>";return i}();t.TabbedLayout=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){this.isLayoutPanel=true;this.childPanels=[];this.eGui=document.createElement("div");this.eGui.style.height="100%"}e.prototype.addPanel=function(e,t){var i;if(e.isLayoutPanel){this.childPanels.push(e);i=e.getGui()}else{i=e}if(t){i.style.height=t}this.eGui.appendChild(i)};e.prototype.getGui=function(){return this.eGui};e.prototype.doLayout=function(){for(var e=0;e<this.childPanels.length;e++){this.childPanels[e].doLayout()}};return e}();t.VerticalStack=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=i(1);function r(e){return new n.Promise(function(t){var i=new XMLHttpRequest;i.open("GET",e.url);i.send();i.onreadystatechange=function(){if(i.readyState==4&&i.status==200){var e=JSON.parse(i.responseText);t(e)}}})}t.simpleHttpRequest=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var u=i(1);function n(e,t,i,n,r){if(r===void 0){r=false}console.warn("ag-Grid: Since ag-grid 11.0.0 defaultGroupComparator is not necessary. You can remove this from your colDef");var o=u.Utils.exists(i)&&i.group;var a=u.Utils.exists(n)&&n.group;var s=o&&a;var l=!o&&!a;if(s){return u.Utils.defaultComparator(i.key,n.key,r)}else if(l){return u.Utils.defaultComparator(e,t,r)}else if(o){return 1}else{return-1}}t.defaultGroupComparator=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=function(){function e(){}e.prototype.wrap=function(e,t,i,n){var r=this;var o=this.createWrapper(e,n);t.forEach(function(e){r.createMethod(o,e,true)});if(i){i.forEach(function(e){r.createMethod(o,e,false)})}return o};e.prototype.createMethod=function(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))};e.prototype.createMethodProxy=function(e,t,i){return function(){if(e.hasMethod(t)){return e.callMethod(t,arguments)}if(i){console.warn("ag-Grid: Framework component is missing the method "+t+"()")}return null}};return e}();t.BaseComponentWrapper=n}])});(function(){var t=function(e){var n={};_.each(e,function(e,i){if(_.isPlainObject(e)){_.each(t(e),function(e,t){n[i+"."+t]=e})}else{n[i]=e}});return n};$.i18n.load(t(window.I18n));window.t=function(){return $.i18n._.apply($.i18n,Array.prototype.slice.call(arguments))}})();AGN=window.AGN||(window.AGN={});AGN.Lib=window.AGN.Lib||(window.AGN.Lib={});AGN.Lib.WM=window.AGN.Lib.WM||(window.AGN.Lib.WM={});AGN.Opt=window.AGN.Opt||(window.AGN.Opt={});AGN.Opt.Fields=window.AGN.Opt.Fields||(window.AGN.Opt.Fields={});AGN.Opt.Forms=window.AGN.Opt.Forms||(window.AGN.Opt.Forms={});AGN.Opt.Controllers=window.AGN.Opt.Controllers||(window.AGN.Opt.Controllers={});AGN.Opt.Templates=window.AGN.Opt.Templates||(window.AGN.Opt.Templates={});AGN.Opt.TableCellRenderers=window.AGN.Opt.TableCellRenderers||(window.AGN.Opt.TableCellRenderers={});AGN.Opt.Table=window.AGN.Opt.Table||(window.AGN.Opt.Table={comparators:{}});AGN.Opt.TableHeaderComponents=window.AGN.Opt.TableHeaderComponents||(window.AGN.Opt.TableHeaderComponents={});AGN.Opt.Charts=window.AGN.Opt.Charts||(window.AGN.Opt.Charts={});AGN.Opt.Validators=window.AGN.Opt.Validators||(window.AGN.Opt.Validators={});AGN.Opt.Components=window.AGN.Opt.Components||(window.AGN.Opt.Components={});AGN.url=function(e,t){if(window.agnResolveRelativeUrl){if(e&&e.charAt(0)==="/"){e=e.substring(1)}return window.agnResolveRelativeUrl(e,t)}else{console.error("window.agnResolveRelativeUrl is not defined");return e}};AGN.isIE=/MSIE|Trident/.test(window.navigator.userAgent);AGN.runAll=function(e){AGN.Lib.CoreInitializer.autorun(e);AGN.Lib.DomInitializer.autorun(e)};(function(){if(!Array.prototype.find){Object.defineProperty(Array.prototype,"find",{value:function(e){"use strict";if(this==null){throw new TypeError("Array.prototype.find called on null or undefined")}if(typeof e!=="function"){throw new TypeError("predicate must be a function")}var t=Object(this);var i=t.length>>>0;var n=arguments[1];var r;for(var o=0;o<i;o++){r=t[o];if(e.call(n,r,o,t)){return r}}return undefined}})}if(!Array.prototype.findIndex){Object.defineProperty(Array.prototype,"findIndex",{value:function(e){"use strict";if(this==null){throw new TypeError("Array.prototype.findIndex called on null or undefined")}if(typeof e!=="function"){throw new TypeError("predicate must be a function")}var t=Object(this);var i=t.length>>>0;var n=arguments[1];var r;for(var o=0;o<i;o++){r=t[o];if(e.call(n,r,o,t)){return o}}return-1},enumerable:false,configurable:false,writable:false})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(this==null){throw new TypeError('"this" is null or not defined')}var i=Object(this);var n=i.length>>>0;if(n===0){return false}var r=t|0;var o=Math.max(r>=0?r:n-Math.abs(r),0);function a(e,t){return e===t||typeof e==="number"&&typeof t==="number"&&isNaN(e)&&isNaN(t)}while(o<n){if(a(i[o],e)){return true}o++}return false}})}})();(function(){var i=$.ui.dialog.prototype._allowInteraction;$.ui.dialog.prototype._allowInteraction=function(e){var t=$(e.target);if(t.closest(".cke_dialog").length||t.closest(".cke_panel_frame").length){return true}return i.apply(this,arguments)}})();if(Function.prototype.bind&&window.console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call)}(function(e,t){if(typeof exports=="object"){module.exports=t(e)}else if(typeof define=="function"&&define.amd){define([],t.bind(e,e))}else{t(e)}})(typeof global!="undefined"?global:this,function(e){if(e.CSS&&e.CSS.escape){return e.CSS.escape}var t=function(e){if(arguments.length==0){throw new TypeError("`CSS.escape` requires an argument.")}var t=String(e);var i=t.length;var n=-1;var r;var o="";var a=t.charCodeAt(0);while(++n<i){r=t.charCodeAt(n);if(r==0){o+="";continue}if(r>=1&&r<=31||r==127||n==0&&r>=48&&r<=57||n==1&&r>=48&&r<=57&&a==45){o+="\\"+r.toString(16)+" ";continue}if(n==0&&i==1&&r==45){o+="\\"+t.charAt(n);continue}if(r>=128||r==45||r==95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){o+=t.charAt(n);continue}o+="\\"+t.charAt(n)}return o};if(!e.CSS){e.CSS={}}e.CSS.escape=t;return t});(function(t){t.fn.modal.Constructor.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(e){setTimeout(t.proxy(function(){e.which==27&&this.hide()},this),100)},this))}else if(!this.isShown){this.$element.off("keydown.dismiss.bs.modal")}}})(jQuery);(function(){jQuery.browser=e().browser;function e(){var e=navigator.userAgent.toLowerCase();var t=/(msie) ([\w.]+)/;var i=/(webkit)[ \/]([\w.]+)/;var n=/(opera)(?:.*version)?[ \/]([\w.]+)/;var r=/(mozilla)(?:.*? rv:([\w.]+))?/;var o=i.exec(e)||n.exec(e)||t.exec(e)||e.indexOf("compatible")<0&&r.exec(e)||[];return{browser:o[1]||"",version:o[2]||"0"}}})(jQuery);(function(u){u.extend(true,u.fn.dirty.prototype,{checkValues:function(e){var a=this;var s=false;this.form.find("select").each(function(e,t){var i=u(t);var n=a.isSelectFieldDirty(i);i.data(a.statuses.dataIsDirty,n);s|=n});this.form.find("input, textarea").each(function(e,t){var i=a.isRadioOrCheckbox(t);var n=a.isFileInput(t);var r=u(t);var o;if(i){o=a.isCheckboxDirty(r)}else if(n){o=a.isFileInputDirty(r)}else{if(!r.is(".select2-input[placeholder]")){o=a.isFieldDirty(r)}}r.data(a.statuses.dataIsDirty,o);s|=o});if(s){a.setDirty()}else{a.setClean()}},saveInitialValues:function(){var a=this;this.form.find("input, select, textarea").each(function(e,t){var i=u(t);if(i.attr("id")||i.attr("name")){i.attr("id",i.prop("tagName"+"__"+e))}var n=a.isRadioOrCheckbox(t);var r=a.isFileInput(t);if(n){var o=u(t).is(":checked")?"checked":"unchecked";i.data(a.statuses.dataInitialValue,o)}else if(r){i.data(a.statuses.dataInitialValue,JSON.stringify(t.files))}else{i.data(a.statuses.dataInitialValue,i.val()||"")}})},backupData:function(){var o=this;var a={};o.form.find("input, select, textarea").each(function(e,t){var i=u(t);var n=i.attr("id")||i.attr("name");var r={};r[o.statuses.dataInitialValue]=i.data(o.statuses.dataInitialValue);r[o.statuses.dataIsDirty]=i.data(o.statuses.dataIsDirty);a[n]=r});return a},restoreData:function(o){var a=this;if(o){a.form.find("input, select, textarea").each(function(e,t){var i=u(t);var n=i.attr("id")||i.attr("name");var r=o[n];if(r){i.data(a.statuses.dataInitialValue,r[a.statuses.dataInitialValue]);i.data(a.statuses.dataIsDirty,r[a.statuses.dataIsDirty])}})}a.checkValues()},isSelectFieldDirty:function(e){var t=this;var i=e.data(t.statuses.dataInitialValue)||"";var n=e.val()||"";return!_.isEqual(n,i)},resetForm:function(){var l=this;this.form.find("select").each(function(e,t){var i=u(t);var n=i.data(l.statuses.dataInitialValue);if(i.data("select2")){i.select2("val",n)}else{i.val(n)}});this.form.find("input, textarea").each(function(e,t){var i=u(t);var n=l.isRadioOrCheckbox(t);var r=l.isFileInput(t);if(n){var o=i.data(l.statuses.dataInitialValue);var a=o==="checked";i.prop("checked",a)}if(r){t.value="";u(t).data(l.statuses.dataInitialValue,JSON.stringify(t.files))}else{var s=i.data(l.statuses.dataInitialValue);i.val(s)}});this.checkValues()}})})(jQuery);(function(e){if(e.fn.all){console.error("$.fn.all is already defined")}else{e.fn.extend({all:function(e){return this.filter(e).add(this.find(e))}})}if(e.fn.exists){console.error("$.fn.exists is already defined")}else{e.fn.extend({exists:function(){return this.length>0}})}if(e.fn.json){console.error("$.fn.json is already defined")}else{e.fn.extend({json:function(){return JSON.parse(this.html())}})}e.expr[":"].truncated=function(e){return e.clientWidth<e.scrollWidth}})(jQuery);(function(t){t.fn.extend({ensureLoad:function(e){return this.each(function(){if(this.complete){e.call(this)}else{t(this).on("load",e)}})}})})(jQuery);$.extend(true,$.inputmask.defaults.aliases,{datetime:{regex:{quartspre:new RegExp("0|1|3|4"),quartspost:new RegExp("00|15|30|45"),halfspre:new RegExp("0|3"),halfspost:new RegExp("00|30")},definitions:{q:{validator:function(e,t,i,n,r){var o=r.regex.quartspost.test(e);if(!n&&!o){if(r.regex.quartspost.test(e[0]+"5")){return{c:"5"}}else{return{c:"0"}}}return true},cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){var o=r.regex.quartspre.test(e);o=false;if(!n&&!o){var a=parseInt(e+"0"),s=["00","15","30","45"],l=100,u,c;for(var d=0;d<s.length;d++){var f=s[d];parsedNum=parseInt(f);if(Math.abs(parsedNum-a)<l){l=Math.abs(parsedNum-a);u=f}}c={caret:i+2,insert:[{pos:i,c:u[0]},{pos:i+1,c:u[1]}]};return c}return true},cardinality:1}]},u:{validator:function(e,t,i,n,r){var o=r.regex.halfspost.test(e);if(!n&&!o){return{c:"0"}}return true},cardinality:2,prevalidator:[{validator:function(e,t,i,n,r){var o=r.regex.halfspre.test(e);o=false;if(!n&&!o){var a=parseInt(e+"0"),s=["00","30"],l=100,u,c;for(var d=0;d<s.length;d++){var f=s[d];parsedNum=parseInt(f);if(Math.abs(parsedNum-a)<l){l=Math.abs(parsedNum-a);u=f}}c={caret:i+2,insert:[{pos:i,c:u[0]},{pos:i+1,c:u[1]}]};return c}return true},cardinality:1}]}}},"h:quarts t":{mask:"h:q t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:quarts":{mask:"h:q",placeholder:"hh:mm",alias:"datetime",hourFormat:"24"},"h:halfs t":{mask:"h:u t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:halfs":{mask:"h:u",placeholder:"hh:mm",alias:"datetime",hourFormat:"24"},"h:00 t":{mask:"h:00 t\\m",placeholder:"hh:00 xm",alias:"datetime",hourFormat:"12"},"h:00":{mask:"h:00",placeholder:"hh:00",alias:"datetime",hourFormat:"24"}});$.fn.serializeObject=function(){var e={};$.each(this.serializeArray(),function(){if(e[this.name]){if(!e[this.name].push){e[this.name]=[e[this.name]]}e[this.name].push(this.value||"")}else{e[this.name]=this.value||""}});return e};$.fn.serializeFormDataObject=function(){var i=this.serializeObject();this.find("input[type=file]").each(function(){if(!$(this).is(":disabled")&&this.name){var e=this.files;if(e.length==0){e=[new File([],"",{type:"application/octet-stream"})]}if(i[this.name]){var t=i[this.name];if($.isArray(t)){i[this.name]=t.concat(e)}else{i[this.name]=[t].concat(e)}}else{if(e.length>1){i[this.name]=e}else{i[this.name]=e[0]}}}});return i};(function(e){if(e.fn.style){console.error("$.fn.style is already defined")}else{e.fn.extend({style:function(t,i,n){if(i===undefined){return this.css(t)}if(e.isFunction(i)){this.each(function(){if(this.style){var e=i.call(this,this.style.getPropertyValue(t));this.style.setProperty(t,e,n)}})}else{this.each(function(){if(this.style){this.style.setProperty(t,i,n)}})}}})}})(jQuery);(function(e){if(String.prototype.trim){e.trim=function(e){return e==null?"":(e+"").trim()}}})(jQuery);$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_title:function(e){if(!this.options.title){e.html("&#160;")}e.html(this.options.title)}}));AGN.Opt.Components.JsPlumbFixedBezierConnector=function(e){var i=jsPlumb.Connectors.AbstractConnector.apply(this,arguments);this.type="FixedBezierConnector";this._compute=function(e){var t=e.anchorOrientation==="opposite"?2:1.5;i.addSegment(this,"Bezier",{x1:e.tx,y1:e.ty,x2:e.sx,y2:e.sy,cp1x:e.tx+e.to[0]*e.w/t,cp1y:e.ty+e.to[1]*e.h/t,cp2x:e.sx+e.so[0]*e.w/t,cp2y:e.sy+e.so[1]*e.h/t})}};_.templateSettings={evaluate:/\{\{(.+?)\}\}/g,interpolate:/\{\{=(.+?)\}\}/g,escape:/\{\{-(.+?)\}\}/g};jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:t("date.monthsFull"),monthsShort:t("date.monthsShort"),weekdaysFull:t("date.weekdaysFull"),weekdaysShort:t("date.weekdaysShort"),labelMonthNext:t("date.nextMonth"),labelMonthPrev:t("date.prevMonth"),labelMonthSelect:t("date.selectMonth"),labelYearSelect:t("date.selectYear"),today:t("defaults.today"),clear:t("defaults.delete"),close:t("defaults.close"),firstDay:t("date.firstDayOfWeek"),format:t("date.format"),hiddenName:true});jQuery.extend(jQuery.fn.pickatime.defaults,{clear:t("defaults.delete"),format:t("time.format"),hiddenName:true});window.onpopstate=function(){window.location.reload()};jQuery.extend($.fn.select2.defaults,{formatNoMatches:function(e){return t("selects.noMatches",e)},formatInputTooShort:function(e,i){return t("selects.errors.inputTooShort",i)},formatInputTooLong:function(e,i){return t("selects.errors.inputTooLong",i)},formatSelectionTooBig:function(e){return t("selects.errors.selectionTooBig",e)},formatLoadMore:function(e){return t("selects.loadMore")},formatSearching:function(){return t("selects.loadMore")},formatAjaxError:function(){return t("selects.errors.ajax")},formatMatches:function(e){if(e>1){return t("selects.matches",e)}else{return t("selects.matchesSing",e)}}});(function(){if(!String.prototype.startsWith){String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e}}if(!String.prototype.endsWith){String.prototype.endsWith=function(e,t){if(t===undefined||t>this.length){t=this.length}return this.substring(t-e.length,t)===e}}if(!String.prototype.includes){String.prototype.includes=function(e,t){"use strict";if(typeof t!=="number"){t=0}if(t+e.length>this.length){return false}else{return this.indexOf(e,t)!==-1}}}})();!function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.svg4everybody=t()}):"object"==typeof exports?module.exports=t():e.svg4everybody=t()}(this,function(){function p(e,t){if(t){var i=!e.getAttribute("viewBox")&&t.getAttribute("viewBox"),n=document.createDocumentFragment(),r=t.cloneNode(!0);for(i&&e.setAttribute("viewBox",i);r.childNodes.length;){n.appendChild(r.firstChild)}e.appendChild(n)}}function h(e){e.onreadystatechange=function(){if(4===e.readyState){var t=document.createElement("x");t.innerHTML=e.responseText,e.s.splice(0).map(function(e){p(e[0],t.querySelector("#"+e[1].replace(/(\W)/g,"\\$1")))})}},e.onreadystatechange()}function e(e){function s(){for(var e;e=l[0];){var t=e.parentNode;if(t&&/svg/i.test(t.nodeName)){var i=e.getAttribute("xlink:href");if(u&&(!c||c(i,t,e))){var n=i.split("#"),r=n[0],o=n[1];if(t.removeChild(e),r.length){var a=f[r]=f[r]||new XMLHttpRequest;a.s||(a.s=[],a.open("GET",r),a.send()),a.s.push([t,o]),h(a)}else{p(t,document.getElementById(o))}}}}d(s,17)}e=e||{};var l=document.getElementsByTagName("use"),u="polyfill"in e?e.polyfill:/\bEdge\/12\b|\bTrident\/[567]\b|\bVersion\/7.0 Safari\b/.test(navigator.userAgent)||(navigator.userAgent.match(/AppleWebKit\/(\d+)/)||[])[1]<537,c=e.validate,d=window.requestAnimationFrame||setTimeout,f={};u&&s()}return e});AGN.Opt.Templates["modal"]='<div class="modal">   <div class="modal-dialog {{= modalClass }}">     <div class="modal-content">       <div class="modal-header">         <button type="button" class="close-icon close" data-dismiss="modal">           <i aria-hidden="true" class="icon icon-times-circle"></i>         </button>         <h4 class="modal-title">{{= title }}</h4>       </div>       <div class="modal-body">         {{= content }}       </div>     </div>   </div> </div>';AGN.Opt.Templates["csrf-error"]='    <div class="backdrop backdrop-error js-close-error" style="position: fixed; top: 0; left: 0; bottom: 0; right:0; z-index: 1100; background-color: rgba(0,0,0,0.5)">        <div class="notification notification-alert" style="position: fixed; top: 50%; left: 50%; width: 420px; margin: -80px 0 0 -210px; z-index: 1101;">            <div class="notification-header">                <p class="headline">                    <i class="icon icon-state-alert"></i>                    <span class="text">{{= headline }}</span>                    <i class="icon icon-times-circle close-icon js-close-error"></i>                </p>            </div>            <div class="notification-content">                <p>{{= content }}</p>                <a href="#" class="btn btn-regular btn-primary vspace-top-10" onclick="location.reload();">                    <i class="icon icon-repeat"></i>                    <span class="text">{{= reload }}</span>                </a>            </div>        </div>    </div>';AGN.Opt.Templates["modal-yes-no-cancel"]='<div class="modal">   <div class="modal-dialog">     <div class="modal-content">       <form action="{{= action }}" method="{{= method }}">         <div class="modal-header">           <button type="button" class="close-icon close" data-dismiss="modal">             <i aria-hidden="true" class="icon icon-times-circle"></i>           </button>           <h4 class="modal-title">{{= title }}</h4>         </div>         <div class="modal-body">           {{= content }}         </div>         <div class="modal-footer">           <div class="btn-group">             <button type="button" class="btn btn-default btn-large js-confirm-negative" data-dismiss="modal">               <i class="icon icon-times"></i>               <span class="text">{{= t(\'defaults.no\') }}</span>             </button>             <button type="button" class="btn btn-primary btn-large js-confirm-positive" data-dismiss="modal">               <i class="icon icon-check"></i>               <span class="text">{{= t(\'defaults.yes\') }}</span>             </button>           </div>         </div>       </form>     </div>   </div> </div>';AGN.Opt.Templates["modal-yes-no-cancel-save-choice"]='<div class="modal">   <div class="modal-dialog {{= modalClass }}">     <div class="modal-content">       <div class="modal-header">         <button type="button" class="close-icon close" data-dismiss="modal">           <i aria-hidden="true" class="icon icon-times-circle"></i>         </button>         <h4 class="modal-title">{{= title }}</h4>       </div>       <div class="modal-body">         <div class="form-group">           <div class="col-sm-12">           {{= content }}           </div>         </div>         <div class="form-group">           <div class="col-sm-8">             <label class="control-label-left">               {{ if(!choiceContent) { }}                 {{= t(\'defaults.remember.choice\') }}               {{ } else { }}                 {{= choiceContent }}               {{ } }}             </label>           </div>           <div class="col-sm-4">             <label class="toggle">               <input type="checkbox" name="confirm-save-choice">               <div class="toggle-control"></div>             </label>           </div>         </div>       </div>       <div class="modal-footer">         <div class="btn-group">           <button type="button" class="btn btn-default btn-large pull-left" data-confirm-negative="cancel" data-dismiss="modal">             <i class="icon icon-times"></i>             <span class="text">{{= t(\'defaults.cancel\') }}</span>           </button>           <button type="button" class="btn btn-default btn-large" data-confirm-negative="no" data-dismiss="modal">             <i class="icon icon-times"></i>             <span class="text">{{= t(\'defaults.no\') }}</span>           </button>           <button type="button" class="btn btn-primary btn-large" data-confirm-positive="yes" data-dismiss="modal">             <i class="icon icon-check"></i>             <span class="text">{{= t(\'defaults.yes\') }}</span>           </button>         </div>       </div>     </div>   </div> </div>';AGN.Opt.Templates["error"]='<div class="backdrop backdrop-error js-close-error overlay-box">     <div class="notification notification-alert overlay-content">         <div class="notification-header">             <p class="headline">                 <i class="icon icon-state-alert"></i>                 <span class="text">{{= headline }}</span>                 <i class="icon icon-times-circle close-icon js-close-error"></i>             </p>         </div>         <div class="notification-content">             <p>{{= text }}</p>             <button type="button" class="btn btn-regular btn-primary vspace-top-10" onclick="location.reload();">                 <i class="icon icon-repeat"></i>                 <span class="text">{{= reload }}</span>             </button>         </div>     </div> </div>';AGN.Opt.Templates["permission-denied"]='<div class="backdrop backdrop-error js-close-error overlay-box">     <div class="notification notification-alert overlay-content">         <div class="notification-header">             <p class="headline">                 <i class="icon icon-state-alert"></i>                 <span class="text">{{= title }}</span>                 <i class="icon icon-times-circle close-icon js-close-error"></i>             </p>         </div>         <div class="notification-content">             <p>{{= text }}</p>             <button type="button" class="btn btn-regular btn-primary vspace-top-10 vspace-bottom-10 js-close-error" style="float: right">                 <i class="icon icon-check"></i>                 <span class="text">{{= btn }}</span>             </button>         </div>     </div> </div>';AGN.Opt.Templates["autosave-restore"]='<div class="modal">   <div class="modal-dialog {{= modalClass }}">     <div class="modal-content">       <div class="modal-header">         <button type="button" class="close-icon close" data-dismiss="modal">           <i aria-hidden="true" class="icon icon-times-circle"></i>         </button>         <h4 class="modal-title">{{= title }}</h4>       </div>       <div class="modal-body">         {{= content }}       </div>       <div class="modal-footer">         <div class="btn-group">           <button type="button" class="btn btn-default btn-large js-confirm-negative" data-dismiss="modal">             <i class="icon icon-times"></i>             <span class="text">{{= negative }}</span>           </button>           <button type="button" class="btn btn-primary btn-large js-confirm-positive" data-dismiss="modal">             <i class="icon icon-check"></i>             <span class="text">{{= positive }}</span>           </button>         </div>       </div>     </div>   </div> </div>';AGN.Opt.Templates["tooltip-template"]='<div class="tooltip {{= tooltipStyle }}" role="tooltip">   <div class="tooltip-arrow {{= arrowStyle }}"></div>   <div class="tooltip-inner {{= innerStyle }}"></div> </div>';AGN.Opt.Templates["tooltip-message-with-title"]='<div class="helper-popup-header">{{= title }}</div> <div class="helper-popup-content">{{= content }}</div>';AGN.Opt.Templates["tooltip-message-just-content"]='<div class="helper-popup-content">{{= content }}</div>';AGN.Opt.Templates["table-controls-top"]='{{ if (showRecordsCount || pagination) { }} <div class="table-controls clearfix">   {{ if (showRecordsCount) { }}   <div class="table-control pull-left">     <div class="well">{{= t(\'tables.range\', itemStart, itemEnd, itemTotal) }}</div>   </div>   {{ } }}  <div class="table-control pull-left" id="filtersDescription"></div>   {{ if (pagination) { }}   <div class="table-control pull-right">     <ul class="pagination">       <li class="js-data-table-first-page {{= currentPage == 1 ? \'disabled\' : \'\' }}">         <span><i class="icon icon-angle-double-left"></i> {{= t(\'tables.first\') }}</span>       </li>       <li class="js-data-table-prev-page {{= currentPage == 1 ? \'disabled\' : \'\' }}">         <span><i class="icon icon-angle-left"></i> {{= t(\'tables.previous\') }}</span>       </li>       {{ _.each(pageSelects, function(page) { }}       <li class="{{= page == currentPage ? \'active\' : \'js-data-table-page\' }}" data-page="{{= page - 1 }}">         <span>{{= page }}</span>       </li>       {{ }) }}       <li class="js-data-table-next-page {{= currentPage == totalPages ? \'disabled\' : \'\' }}">         <span>{{= t(\'tables.next\') }} <i class="icon icon-angle-right"></i></span>       </li>       <li class="js-data-table-last-page {{= currentPage == totalPages ? \'disabled\' : \'\' }}">         <span>{{= t(\'tables.last\') }} <i class="icon icon-angle-double-right"></i></span>       </li>     </ul>   </div>   {{ } }}  </div>{{ } }}';AGN.Opt.Templates["table-controls-bottom"]="<div class=\"table-controls clearfix\">   {{ if (showRecordsCount) { }}   <div class=\"table-control pull-left\">     <div class=\"well\">{{= t('tables.range', itemStart, itemEnd, itemTotal) }}</div>   </div>   {{ } }}   {{ if (pagination) { }}   <div class=\"table-control pull-right\">     <ul class=\"pagination\">       <li class=\"js-data-table-first-page {{= currentPage == 1 ? 'disabled' : '' }}\">         <span><i class=\"icon icon-angle-double-left\"></i> {{= t('tables.first') }}</span>       </li>       <li class=\"js-data-table-prev-page {{= currentPage == 1 ? 'disabled' : '' }}\">         <span><i class=\"icon icon-angle-left\"></i> {{= t('tables.previous') }}</span>       </li>       {{ _.each(pageSelects, function(page) { }}        <li class=\"{{= page == currentPage ? 'active' : 'js-data-table-page' }}\" data-page=\"{{= page - 1 }}\">         <span>{{= page }}</span>       </li>       {{ }) }}       <li class=\"js-data-table-next-page {{= currentPage == totalPages ? 'disabled' : '' }}\">         <span>{{= t('tables.next') }} <i class=\"icon icon-angle-right\"></i></span>       </li>       <li class=\"js-data-table-last-page {{= currentPage == totalPages ? 'disabled' : '' }}\">         <span>{{= t('tables.last') }} <i class=\"icon icon-angle-double-right\"></i></span>       </li>     </ul>   </div>   {{ } }} </div>";AGN.Opt.Templates["session-expired"]='<div class="backdrop backdrop-warning overlay-box" id="session-expired-overlay">     <div class="notification notification-warning overlay-content">         <div class="notification-header">             <p class="headline">                 <i class="icon icon-state-alert"></i>                 <span class="text">{{= t(\'logon.session.expired\') }}</span>             </p>         </div>         <div class="notification-content">             <div class="form-group">               {{= t(\'logon.session.notification\') }}             </div>            <div class="form-group">               <a href="{{= AGN.url("/logon.action", true) }}">                 {{= t(\'defaults.relogin\') }}               </a>             </div>        </div>     </div> </div>';AGN.Opt.Templates["datetime-picker"]='<div class="row">  <div class="col-sm-8">     <div class="input-group">       <div class="input-group-controls">         <input type="text" id="{{- property }}_date" class="form-control datepicker-input js-datepicker"           data-value="{{- date}}" data-datepicker-options="format: {{- dateFormat}}"/>       </div>       <div class="input-group-btn">         <button type="button" class="btn btn-regular btn-toggle js-open-datepicker" tabindex="-1">           <i class="icon icon-calendar-o"></i>         </button>       </div>     </div>   </div>   <div class="col-sm-4">     <div class="input-group">       <div class="input-group-controls">         <input type="text" id="{{- property }}_time" class="form-control js-timepicker" value="{{- time}}"              data-timepicker-options="mask: \'h:s\'"/>       </div>       <div class="input-group-addon">         <span class="addon"><i class="icon icon-clock-o"></i></span>       </div>     </div>   </div> </div>';AGN.Opt.Templates["trackablelink-extension-table-row"]='<tr data-extension-row="{{- index}}">     <td>         <input type="text" class="form-control" data-extension-name value="{{- name}}"/>     </td>     <td>         <input type="text" class="form-control" data-extension-value value="{{- value}}"/>     </td>     <td class="table-actions">         {{ if (name == "" && value == "") { }}             <a href="#" class="btn btn-regular btn-primary" data-extension-add id="newExtensionBtn">                 <i class="icon icon-plus"></i>             </a>         {{ } else { }}             <a href="#" class="btn btn-regular btn-alert" data-extension-delete>                 <i class="icon icon-trash-o"></i>             </a>         {{ } }}     </td> </tr>';AGN.Opt.Templates["mailing-param-row"]='  <tr data-param-row="{{- index}}">       <td>           <input type="text" value="{{- name}}" data-param-name class="form-control" data-action="param-enterdown" {{ isChangeable ? print("") : print("readonly") }} />       </td>       <td>           <input type="text" value="{{- value}}" data-param-value class="form-control" data-action="param-enterdown" {{ isChangeable ? print("") : print("readonly") }} />       </td>       <td>           <input type="text" value="{{- description}}" data-param-description class="form-control" data-action="param-enterdown" {{ isChangeable ? print("") : print("readonly") }} />       </td>       {{ if (isChangeable) { }}       <td class="table-actions">         {{ if (name == "" && value == "") { }}             <a href="#" class="btn btn-regular btn-primary" data-action="add-param-row" id="newParamBtn">                 <i class="icon icon-plus"></i>             </a>         {{ } else { }}             <a href="#" class="btn btn-regular btn-alert" data-action="delete-param-row">                 <i class="icon icon-trash-o"></i>             </a>         {{ } }}       </td>       {{ } }}   </tr>';AGN.Opt.Templates["mailing-reference-content-item"]='   <div class="form-group">       <div class="col-sm-4">           <label class="control-label" for="input-{{- name }}">{{- name }}</label>       </div>       <div class="col-sm-8">           <div class="input-group-controls">               <input type="text" class="form-control" name="referenceContentSettings.items" value="{{- value }}" {{ disable ? print("disabled") : print("")}} id="input-{{- name }}"/>           </div>           <div class="input-group-btn">               <button type="button" class="btn btn-regular btn-alert" {{ disable ? print("disabled") : print("")}}                       data-action="delete-reference-content-item">                   <i class="icon icon-trash-o"></i>               </button>           </div>       </div>   </div>';(function(){if(window.agnTimeZoneId){moment.tz.setDefault(window.agnTimeZoneId)}})();(function(e,t){if(typeof define=="function"&&define.amd){define(["jquery","dot/doT","jquery-extendext"],t)}else if(typeof module==="object"&&module.exports){module.exports=t(require("jquery"),require("dot/doT"),require("jquery-extendext"))}else{t(e.jQuery,e.doT)}})(this,function(v,i){"use strict";var f=function(e,t){e[0].queryBuilder=this;this.$el=e;this.settings=v.extendext(true,"replace",{},f.DEFAULTS,t);this.model=new n;this.status={id:null,generated_id:false,group_id:0,rule_id:0,has_optgroup:false,has_operator_optgroup:false};this.filters=this.settings.filters;this.icons=this.settings.icons;this.operators=this.settings.operators;this.templates=this.settings.templates;this.plugins=this.settings.plugins;this.lang=null;if(f.regional["en"]===undefined){m.error("Config",'"i18n/en.js" not loaded.')}this.lang=v.extendext(true,"replace",{},f.regional["en"],f.regional[this.settings.lang_code],this.settings.lang);if(this.settings.allow_groups===false){this.settings.allow_groups=0}else if(this.settings.allow_groups===true){this.settings.allow_groups=-1}Object.keys(this.templates).forEach(function(e){if(!this.templates[e]){this.templates[e]=f.templates[e]}if(typeof this.templates[e]=="string"){this.templates[e]=i.template(this.templates[e])}},this);if(!this.$el.attr("id")){this.$el.attr("id","qb_"+Math.floor(Math.random()*99999));this.status.generated_id=true}this.status.id=this.$el.attr("id");this.$el.addClass("query-builder form-inline");this.filters=this.checkFilters(this.filters);this.operators=this.checkOperators(this.operators);this.bindEvents();this.initPlugins()};v.extend(f.prototype,{trigger:function(e){var t=new v.Event(this._tojQueryEvent(e),{builder:this});this.$el.triggerHandler(t,Array.prototype.slice.call(arguments,1));return t},change:function(e,t){var i=new v.Event(this._tojQueryEvent(e,true),{builder:this,value:t});this.$el.triggerHandler(i,Array.prototype.slice.call(arguments,2));return i.value},on:function(e,t){this.$el.on(this._tojQueryEvent(e),t);return this},off:function(e,t){this.$el.off(this._tojQueryEvent(e),t);return this},once:function(e,t){this.$el.one(this._tojQueryEvent(e),t);return this},_tojQueryEvent:function(e,t){return e.split(" ").map(function(e){return e+".queryBuilder"+(t?".filter":"")}).join(" ")}});f.types={string:"string",integer:"number",double:"number",date:"datetime",time:"datetime",datetime:"datetime",boolean:"boolean"};f.inputs=["text","number","textarea","radio","checkbox","select"];f.modifiable_options=["display_errors","allow_groups","allow_empty","default_condition","default_filter"];f.selectors={group_container:".rules-group-container",rule_container:".rule-container",filter_container:".rule-filter-container",operator_container:".rule-operator-container",value_container:".rule-value-container",error_container:".error-container",condition_container:".rules-group-header .group-conditions",rule_header:".rule-header",group_header:".rules-group-header",group_actions:".group-actions",rule_actions:".rule-actions",rules_list:".rules-group-body>.rules-list",group_btns:".btn",group_condition:".rules-group-header [name$=_cond]",rule_filter:".rule-filter-container [name$=_filter]",rule_operator:".rule-operator-container [name$=_operator]",rule_value:".rule-value-container :input:not(.icon-help)",add_rule:"[data-add=rule]",delete_rule:"[data-delete=rule]",add_group:"[data-add=group]",delete_group:"[data-delete=group]"};f.templates={};f.regional={};f.OPERATORS={equal:{type:"equal",nb_inputs:1,multiple:false,apply_to:["string","number","datetime","boolean"]},not_equal:{type:"not_equal",nb_inputs:1,multiple:false,apply_to:["string","number","datetime","boolean"]},in:{type:"in",nb_inputs:1,multiple:true,apply_to:["string","number","datetime"]},not_in:{type:"not_in",nb_inputs:1,multiple:true,apply_to:["string","number","datetime"]},less:{type:"less",nb_inputs:1,multiple:false,apply_to:["number","datetime"]},less_or_equal:{type:"less_or_equal",nb_inputs:1,multiple:false,apply_to:["number","datetime"]},greater:{type:"greater",nb_inputs:1,multiple:false,apply_to:["number","datetime"]},greater_or_equal:{type:"greater_or_equal",nb_inputs:1,multiple:false,apply_to:["number","datetime"]},between:{type:"between",nb_inputs:2,multiple:false,apply_to:["number","datetime"]},not_between:{type:"not_between",nb_inputs:2,multiple:false,apply_to:["number","datetime"]},begins_with:{type:"begins_with",nb_inputs:1,multiple:false,apply_to:["string"]},not_begins_with:{type:"not_begins_with",nb_inputs:1,multiple:false,apply_to:["string"]},contains:{type:"contains",nb_inputs:1,multiple:false,apply_to:["string"]},not_contains:{type:"not_contains",nb_inputs:1,multiple:false,apply_to:["string"]},ends_with:{type:"ends_with",nb_inputs:1,multiple:false,apply_to:["string"]},not_ends_with:{type:"not_ends_with",nb_inputs:1,multiple:false,apply_to:["string"]},is_empty:{type:"is_empty",nb_inputs:0,multiple:false,apply_to:["string"]},is_not_empty:{type:"is_not_empty",nb_inputs:0,multiple:false,apply_to:["string"]},is_null:{type:"is_null",nb_inputs:0,multiple:false,apply_to:["string","number","datetime","boolean"]},is_not_null:{type:"is_not_null",nb_inputs:0,multiple:false,apply_to:["string","number","datetime","boolean"]}};f.DEFAULTS={filters:[],plugins:[],sort_filters:false,display_errors:true,allow_groups:-1,allow_empty:false,conditions:["AND","OR"],default_condition:"AND",inputs_separator:" , ",select_placeholder:"------",display_empty_filter:true,default_filter:null,optgroups:{},default_rule_flags:{filter_readonly:false,operator_readonly:false,value_readonly:false,no_delete:false},default_group_flags:{condition_readonly:false,no_add_rule:false,no_add_group:false,no_delete:false},templates:{group:null,rule:null,filterSelect:null,operatorSelect:null,ruleValueSelect:null},lang_code:"en",lang:{},operators:["equal","not_equal","in","not_in","less","less_or_equal","greater","greater_or_equal","between","not_between","begins_with","not_begins_with","contains","not_contains","ends_with","not_ends_with","is_empty","is_not_empty","is_null","is_not_null"],icons:{add_group:"glyphicon glyphicon-plus-sign",add_rule:"glyphicon glyphicon-plus",remove_group:"glyphicon glyphicon-remove",remove_rule:"glyphicon glyphicon-remove",error:"glyphicon glyphicon-warning-sign"}};f.plugins={};f.defaults=function(e){if(typeof e=="object"){v.extendext(true,"replace",f.DEFAULTS,e)}else if(typeof e=="string"){if(typeof f.DEFAULTS[e]=="object"){return v.extend(true,{},f.DEFAULTS[e])}else{return f.DEFAULTS[e]}}else{return v.extend(true,{},f.DEFAULTS)}};f.define=function(e,t,i){f.plugins[e]={fct:t,def:i||{}}};f.extend=function(e){v.extend(f.prototype,e)};f.prototype.initPlugins=function(){if(!this.plugins){return}if(v.isArray(this.plugins)){var t={};this.plugins.forEach(function(e){t[e]=null});this.plugins=t}Object.keys(this.plugins).forEach(function(e){if(e in f.plugins){this.plugins[e]=v.extend(true,{},f.plugins[e].def,this.plugins[e]||{});f.plugins[e].fct.call(this,this.plugins[e])}else{m.error("Config",'Unable to find plugin "{0}"',e)}},this)};f.prototype.getPluginOptions=function(e,t){var i;if(this.plugins&&this.plugins[e]){i=this.plugins[e]}else if(f.plugins[e]){i=f.plugins[e].def}if(i){if(t){return i[t]}else{return i}}else{m.error("Config",'Unable to find plugin "{0}"',e)}};f.prototype.init=function(e){this.trigger("afterInit");if(e){this.setRules(e);delete this.settings.rules}else{this.setRoot(true)}};f.prototype.checkFilters=function(e){var t=[];if(!e||e.length===0){m.error("Config","Missing filters list")}e.forEach(function(n,e){if(!n.id){m.error("Config","Missing filter {0} id",e)}if(t.indexOf(n.id)!=-1){m.error("Config",'Filter "{0}" already defined',n.id)}t.push(n.id);if(!n.type){n.type="string"}else if(!f.types[n.type]){m.error("Config",'Invalid type "{0}"',n.type)}if(!n.input){n.input=f.types[n.type]==="number"?"number":"text"}else if(typeof n.input!="function"&&f.inputs.indexOf(n.input)==-1){m.error("Config",'Invalid input "{0}"',n.input)}if(n.operators){n.operators.forEach(function(e){if(typeof e!="string"){m.error("Config","Filter operators must be global operators types (string)")}})}if(!n.field){n.field=n.id}if(!n.label){n.label=n.field}if(!n.optgroup){n.optgroup=null}else{this.status.has_optgroup=true;if(!this.settings.optgroups[n.optgroup]){this.settings.optgroups[n.optgroup]=n.optgroup}}switch(n.input){case"radio":case"checkbox":if(!n.values||n.values.length<1){m.error("Config",'Missing filter "{0}" values',n.id)}break;case"select":var r=[];n.has_optgroup=false;m.iterateOptions(n.values,function(e,t,i){r.push({value:e,label:t,optgroup:i||null});if(i){n.has_optgroup=true;if(!this.settings.optgroups[i]){this.settings.optgroups[i]=i}}}.bind(this));if(n.has_optgroup){n.values=m.groupSort(r,"optgroup")}else{n.values=r}if(n.placeholder){if(n.placeholder_value===undefined){n.placeholder_value=-1}n.values.forEach(function(e){if(e.value==n.placeholder_value){m.error("Config",'Placeholder of filter "{0}" overlaps with one of its values',n.id)}})}break}},this);if(this.settings.sort_filters){if(typeof this.settings.sort_filters=="function"){e.sort(this.settings.sort_filters)}else{var i=this;e.sort(function(e,t){return i.translate(e.label).localeCompare(i.translate(t.label))})}}if(this.status.has_optgroup){e=m.groupSort(e,"optgroup")}return e};f.prototype.checkOperators=function(i){var n=[];i.forEach(function(e,t){if(typeof e=="string"){if(!f.OPERATORS[e]){m.error("Config",'Unknown operator "{0}"',e)}i[t]=e=v.extendext(true,"replace",{},f.OPERATORS[e])}else{if(!e.type){m.error("Config",'Missing "type" for operator {0}',t)}if(f.OPERATORS[e.type]){i[t]=e=v.extendext(true,"replace",{},f.OPERATORS[e.type],e)}if(e.nb_inputs===undefined||e.apply_to===undefined){m.error("Config",'Missing "nb_inputs" and/or "apply_to" for operator "{0}"',e.type)}}if(n.indexOf(e.type)!=-1){m.error("Config",'Operator "{0}" already defined',e.type)}n.push(e.type);if(!e.optgroup){e.optgroup=null}else{this.status.has_operator_optgroup=true;if(!this.settings.optgroups[e.optgroup]){this.settings.optgroups[e.optgroup]=e.optgroup}}},this);if(this.status.has_operator_optgroup){i=m.groupSort(i,"optgroup")}return i};f.prototype.bindEvents=function(){var o=this;var t=f.selectors;this.$el.on("change.queryBuilder",t.group_condition,function(){if(v(this).is(":checked")){var e=v(this).closest(t.group_container);o.getModel(e).condition=v(this).val()}});this.$el.on("change.queryBuilder",t.rule_filter,function(){var e=v(this).closest(t.rule_container);o.getModel(e).filter=o.getFilterById(v(this).val())});this.$el.on("change.queryBuilder",t.rule_operator,function(){var e=v(this).closest(t.rule_container);o.getModel(e).operator=o.getOperatorByType(v(this).val())});this.$el.on("click.queryBuilder",t.add_rule,function(){var e=v(this).closest(t.group_container);o.addRule(o.getModel(e))});this.$el.on("click.queryBuilder",t.delete_rule,function(){var e=v(this).closest(t.rule_container);o.deleteRule(o.getModel(e))});if(this.settings.allow_groups!==0){this.$el.on("click.queryBuilder",t.add_group,function(){var e=v(this).closest(t.group_container);o.addGroup(o.getModel(e))});this.$el.on("click.queryBuilder",t.delete_group,function(){var e=v(this).closest(t.group_container);o.deleteGroup(o.getModel(e))})}this.model.on({drop:function(e,t){t.$el.remove();o.refreshGroupsConditions()},add:function(e,t,i,n){if(n===0){i.$el.prependTo(t.$el.find(">"+f.selectors.rules_list))}else{i.$el.insertAfter(t.rules[n-1].$el)}o.refreshGroupsConditions()},move:function(e,t,i,n){t.$el.detach();if(n===0){t.$el.prependTo(i.$el.find(">"+f.selectors.rules_list))}else{t.$el.insertAfter(i.rules[n-1].$el)}o.refreshGroupsConditions()},update:function(e,t,i,n,r){if(t instanceof a){switch(i){case"error":o.updateError(t);break;case"flags":o.applyRuleFlags(t);break;case"filter":o.updateRuleFilter(t,r);break;case"operator":o.updateRuleOperator(t,r);break;case"value":o.updateRuleValue(t,r);break}}else{switch(i){case"error":o.updateError(t);break;case"flags":o.applyGroupFlags(t);break;case"condition":o.updateGroupCondition(t,r);break}}}})};f.prototype.setRoot=function(e,t,i){e=e===undefined||e===true;var n=this.nextGroupId();var r=v(this.getGroupTemplate(n,1));r.find(f.selectors.group_btns).addClass(this.settings.readonly?"disabled":"");this.$el.append(r);this.model.root=new u(null,r);this.model.root.model=this.model;this.model.root.data=t;this.model.root.flags=v.extend({},this.settings.default_group_flags,i);this.model.root.condition=this.settings.default_condition;this.trigger("afterAddGroup",this.model.root);if(e){this.addRule(this.model.root)}return this.model.root};f.prototype.addGroup=function(e,t,i,n){t=t===undefined||t===true;var r=e.level+1;var o=this.trigger("beforeAddGroup",e,t,r);if(o.isDefaultPrevented()){return null}var a=this.nextGroupId();var s=v(this.getGroupTemplate(a,r));var l=e.addGroup(s);l.data=i;l.flags=v.extend({},this.settings.default_group_flags,n);l.condition=this.settings.default_condition;this.trigger("afterAddGroup",l);this.trigger("rulesChanged");if(t){this.addRule(l)}return l};f.prototype.deleteGroup=function(e){if(e.isRoot()){return false}var t=this.trigger("beforeDeleteGroup",e);if(t.isDefaultPrevented()){return false}var i=true;e.each("reverse",function(e){i&=this.deleteRule(e)},function(e){i&=this.deleteGroup(e)},this);if(i){e.drop();this.trigger("afterDeleteGroup");this.trigger("rulesChanged")}return i};f.prototype.updateGroupCondition=function(t,e){t.$el.find(">"+f.selectors.group_condition).each(function(){var e=v(this);e.prop("checked",e.val()===t.condition);e.parent().toggleClass("active",e.val()===t.condition)});this.trigger("afterUpdateGroupCondition",t,e);this.trigger("rulesChanged")};f.prototype.refreshGroupsConditions=function(){(function t(e){if(!e.flags||e.flags&&!e.flags.condition_readonly){e.$el.find(">"+f.selectors.group_condition).prop("disabled",e.rules.length<=1).parent().toggleClass("disabled",e.rules.length<=1)}e.each(null,function(e){t(e)},this)})(this.model.root)};f.prototype.addRule=function(e,t,i){var n=this.trigger("beforeAddRule",e);if(n.isDefaultPrevented()){return null}var r=this.nextRuleId();var o=v(this.getRuleTemplate(r));var a=e.addRule(o);a.data=t;a.flags=v.extend({},this.settings.default_rule_flags,i);this.trigger("afterAddRule",a);this.trigger("rulesChanged");this.createRuleFilters(a);if(this.settings.default_filter||!this.settings.display_empty_filter){a.filter=this.change("getDefaultFilter",this.getFilterById(this.settings.default_filter||this.filters[0].id),a)}return a};f.prototype.deleteRule=function(e){if(e.flags.no_delete){return false}var t=this.trigger("beforeDeleteRule",e);if(t.isDefaultPrevented()){return false}e.drop();this.trigger("afterDeleteRule");this.trigger("rulesChanged");return true};f.prototype.createRuleFilters=function(e){var t=this.change("getRuleFilters",this.filters,e);var i=v(this.getRuleFilterSelect(e,t));e.$el.find(f.selectors.filter_container).html(i);this.trigger("afterCreateRuleFilters",e);this.applyRuleFlags(e)};f.prototype.createRuleOperators=function(e){var t=e.$el.find(f.selectors.operator_container).empty();if(!e.filter){return}var i=this.getOperators(e.filter);var n=v(this.getRuleOperatorSelect(e,i));t.html(n);if(e.filter.default_operator){e.__.operator=this.getOperatorByType(e.filter.default_operator)}else{e.__.operator=i[0]}e.$el.find(f.selectors.rule_operator).val(e.operator.type);this.trigger("afterCreateRuleOperators",e,i);this.applyRuleFlags(e)};f.prototype.createRuleInput=function(e){var t=e.$el.find(f.selectors.value_container).empty();e.__.value=undefined;if(!e.filter||!e.operator||e.operator.nb_inputs===0){return}var i=this;var n=v();var r=e.filter;for(var o=0;o<e.operator.nb_inputs;o++){var a=v(this.getRuleInput(e,o));if(o>0)t.append(this.settings.inputs_separator);t.append(a);n=n.add(a)}t.css("display","");n.on("change "+(r.input_event||""),function(){if(!e._updating_input){e._updating_value=true;e.value=i.getRuleInputValue(e);e._updating_value=false}});if(r.plugin){n[r.plugin](r.plugin_config||{})}this.trigger("afterCreateRuleInput",e);if(r.default_value!==undefined){e.value=r.default_value}else{e._updating_value=true;e.value=i.getRuleInputValue(e);e._updating_value=false}this.applyRuleFlags(e)};f.prototype.updateRuleFilter=function(e,t){this.createRuleOperators(e);this.createRuleInput(e);e.$el.find(f.selectors.rule_filter).val(e.filter?e.filter.id:"-1");if(t&&e.filter&&t.id!==e.filter.id){e.data=undefined}this.trigger("afterUpdateRuleFilter",e,t);this.trigger("rulesChanged")};f.prototype.updateRuleOperator=function(e,t){var i=e.$el.find(f.selectors.value_container);if(!e.operator||e.operator.nb_inputs===0){i.hide();e.__.value=undefined}else{i.css("display","");if(i.is(":empty")||!t||e.operator.nb_inputs!==t.nb_inputs||e.operator.optgroup!==t.optgroup){this.createRuleInput(e)}}if(e.operator){e.$el.find(f.selectors.rule_operator).val(e.operator.type);e.__.value=this.getRuleInputValue(e)}this.trigger("afterUpdateRuleOperator",e,t);this.trigger("rulesChanged")};f.prototype.updateRuleValue=function(e,t){if(!e._updating_value){this.setRuleInputValue(e,e.value)}this.trigger("afterUpdateRuleValue",e,t);this.trigger("rulesChanged")};f.prototype.applyRuleFlags=function(e){var t=e.flags;var i=f.selectors;e.$el.find(i.rule_filter).prop("disabled",t.filter_readonly);e.$el.find(i.rule_operator).prop("disabled",t.operator_readonly);e.$el.find(i.rule_value).prop("disabled",t.value_readonly);if(t.no_delete){e.$el.find(i.delete_rule).remove()}this.trigger("afterApplyRuleFlags",e)};f.prototype.applyGroupFlags=function(e){var t=e.flags;var i=f.selectors;e.$el.find(">"+i.group_condition).prop("disabled",t.condition_readonly).parent().toggleClass("readonly",t.condition_readonly);if(t.no_add_rule){e.$el.find(i.add_rule).remove()}if(t.no_add_group){e.$el.find(i.add_group).remove()}if(t.no_delete){e.$el.find(i.delete_group).remove()}this.trigger("afterApplyGroupFlags",e)};f.prototype.clearErrors=function(e){e=e||this.model.root;if(!e){return}e.error=null;if(e instanceof u){e.each(function(e){e.error=null},function(e){this.clearErrors(e)},this)}};f.prototype.updateError=function(e){if(this.settings.display_errors){if(e.error===null){e.$el.removeClass("has-error")}else{var t=this.translate("errors",e.error[0]);t=m.fmt(t,e.error.slice(1));t=this.change("displayError",t,e.error,e);e.$el.addClass("has-error").find(f.selectors.error_container).eq(0).attr("title",t)}}};f.prototype.triggerValidationError=function(e,t,i){if(!v.isArray(t)){t=[t]}var n=this.trigger("validationError",e,t,i);if(!n.isDefaultPrevented()){e.error=t}};f.prototype.destroy=function(){this.trigger("beforeDestroy");if(this.status.generated_id){this.$el.removeAttr("id")}this.clear();this.model=null;this.$el.off(".queryBuilder").removeClass("query-builder").removeData("queryBuilder");delete this.$el[0].queryBuilder};f.prototype.reset=function(){var e=this.trigger("beforeReset");if(e.isDefaultPrevented()){return}this.status.group_id=1;this.status.rule_id=0;this.model.root.empty();this.model.root.data=undefined;this.model.root.flags=v.extend({},this.settings.default_group_flags);this.model.root.condition=this.settings.default_condition;this.addRule(this.model.root);this.trigger("afterReset");this.trigger("rulesChanged")};f.prototype.clear=function(){var e=this.trigger("beforeClear");if(e.isDefaultPrevented()){return}this.status.group_id=0;this.status.rule_id=0;if(this.model.root){this.model.root.drop();this.model.root=null}this.trigger("afterClear");this.trigger("rulesChanged")};f.prototype.setOptions=function(e){v.each(e,function(e,t){if(f.modifiable_options.indexOf(e)!==-1){this.settings[e]=t}}.bind(this))};f.prototype.getModel=function(e){if(!e){return this.model.root}else if(e instanceof r){return e}else{return v(e).data("queryBuilderModel")}};f.prototype.validate=function(o){o=v.extend({skip_empty:false},o);this.clearErrors();var a=this;var e=function i(e){var n=0;var r=0;e.each(function(e){if(!e.filter&&o.skip_empty){return}if(!e.filter){a.triggerValidationError(e,"no_filter",null);r++;return}if(!e.operator){a.triggerValidationError(e,"no_operator",null);r++;return}if(e.operator.nb_inputs!==0){var t=a.validateValue(e,e.value);if(t!==true){a.triggerValidationError(e,t,e.value);r++;return}}n++},function(e){var t=i(e);if(t===true){n++}else if(t===false){r++}});if(r>0){return false}else if(n===0&&!e.isRoot()&&o.skip_empty){return null}else if(n===0&&(!a.settings.allow_empty||!e.isRoot())){a.triggerValidationError(e,"empty_group",null);return false}return true}(this.model.root);return this.change("validate",e)};f.prototype.getRules=function(o){o=v.extend({get_flags:false,allow_invalid:false,skip_empty:false},o);var e=this.validate(o);if(!e&&!o.allow_invalid){return null}var a=this;var t=function i(e){var r={condition:e.condition,rules:[]};if(e.data){r.data=v.extendext(true,"replace",{},e.data)}if(o.get_flags){var t=a.getGroupFlags(e.flags,o.get_flags==="all");if(!v.isEmptyObject(t)){r.flags=t}}e.each(function(e){if(!e.filter&&o.skip_empty){return}var t=null;if(!e.operator||e.operator.nb_inputs!==0){t=e.value}var i={id:e.filter?e.filter.id:null,field:e.filter?e.filter.field:null,type:e.filter?e.filter.type:null,input:e.filter?e.filter.input:null,operator:e.operator?e.operator.type:null,value:t};if(e.filter&&e.filter.data||e.data){i.data=v.extendext(true,"replace",{},e.filter.data,e.data)}if(o.get_flags){var n=a.getRuleFlags(e.flags,o.get_flags==="all");if(!v.isEmptyObject(n)){i.flags=n}}r.rules.push(a.change("ruleToJson",i,e))},function(e){var t=i(e);if(t.rules.length!==0||!o.skip_empty){r.rules.push(t)}},this);return a.change("groupToJson",r,e)}(this.model.root);t.valid=e;return this.change("getRules",t)};f.prototype.setRules=function(e,r){r=v.extend({allow_invalid:false},r);if(v.isArray(e)){e={condition:this.settings.default_condition,rules:e}}if(!e||!e.rules||e.rules.length===0&&!this.settings.allow_empty){m.error("RulesParse","Incorrect data object passed")}this.clear();this.setRoot(false,e.data,this.parseGroupFlags(e));e=this.change("setRules",e,r);var o=this;(function i(e,n){if(n===null){return}if(e.condition===undefined){e.condition=o.settings.default_condition}else if(o.settings.conditions.indexOf(e.condition)==-1){m.error(!r.allow_invalid,"UndefinedCondition",'Invalid condition "{0}"',e.condition);e.condition=o.settings.default_condition}n.condition=e.condition;e.rules.forEach(function(e){var t;if(e.rules!==undefined){if(o.settings.allow_groups!==-1&&o.settings.allow_groups<n.level){m.error(!r.allow_invalid,"RulesParse","No more than {0} groups are allowed",o.settings.allow_groups);o.reset()}else{t=o.addGroup(n,false,e.data,o.parseGroupFlags(e));if(t===null){return}i(e,t)}}else{if(!e.empty){if(e.id===undefined){m.error(!r.allow_invalid,"RulesParse","Missing rule field id");e.empty=true}if(e.operator===undefined){e.operator="equal"}}t=o.addRule(n,e.data,o.parseRuleFlags(e));if(t===null){return}if(!e.empty){t.filter=o.getFilterById(e.id,!r.allow_invalid)}if(t.filter){t.operator=o.getOperatorByType(e.operator,!r.allow_invalid);if(!t.operator){t.operator=o.getOperators(t.filter)[0]}}if(t.operator&&t.operator.nb_inputs!==0){if(e.value!==undefined){t.value=e.value}else if(t.filter.default_value!==undefined){t.value=t.filter.default_value}}if(o.change("jsonToRule",t,e)!=t){m.error("RulesParse","Plugin tried to change rule reference")}}});if(o.change("jsonToGroup",n,e)!=n){m.error("RulesParse","Plugin tried to change group reference")}})(e,this.model.root);this.trigger("afterSetRules")};f.prototype.validateValue=function(e,t){var i=e.filter.validation||{};var n=true;if(i.callback){n=i.callback.call(this,t,e)}else{n=this._validateValue(e,t)}return this.change("validateValue",n,t,e)};f.prototype._validateValue=function(e,t){var i=e.filter;var n=e.operator;var r=i.validation||{};var o=true;var a,s;if(e.operator.nb_inputs===1){t=[t]}for(var l=0;l<n.nb_inputs;l++){if(!n.multiple&&v.isArray(t[l])&&t[l].length>1){o=["operator_not_multiple",n.type,this.translate("operators",n.type)];break}switch(i.input){case"radio":if(t[l]===undefined||t[l].length===0){if(!r.allow_empty_value){o=["radio_empty"]}break}break;case"checkbox":if(t[l]===undefined||t[l].length===0){if(!r.allow_empty_value){o=["checkbox_empty"]}break}break;case"select":if(t[l]===undefined||t[l].length===0||i.placeholder&&t[l]==i.placeholder_value){if(!r.allow_empty_value){o=["select_empty"]}break}break;default:s=v.isArray(t[l])?t[l]:[t[l]];for(var u=0;u<s.length;u++){switch(f.types[i.type]){case"string":if(s[u]===undefined||s[u].length===0){if(!r.allow_empty_value){o=["string_empty"]}break}if(r.min!==undefined){if(s[u].length<parseInt(r.min)){o=[this.getValidationMessage(r,"min","string_exceed_min_length"),r.min];break}}if(r.max!==undefined){if(s[u].length>parseInt(r.max)){o=[this.getValidationMessage(r,"max","string_exceed_max_length"),r.max];break}}if(r.format){if(typeof r.format=="string"){r.format=new RegExp(r.format)}if(!r.format.test(s[u])){o=[this.getValidationMessage(r,"format","string_invalid_format"),r.format];break}}break;case"number":if(s[u]===undefined||s[u].length===0){if(!r.allow_empty_value){o=["number_nan"]}break}if(isNaN(s[u])){o=["number_nan"];break}if(i.type=="integer"){if(parseInt(s[u])!=s[u]){o=["number_not_integer"];break}}else{if(parseFloat(s[u])!=s[u]){o=["number_not_double"];break}}if(r.min!==undefined){if(s[u]<parseFloat(r.min)){o=[this.getValidationMessage(r,"min","number_exceed_min"),r.min];break}}if(r.max!==undefined){if(s[u]>parseFloat(r.max)){o=[this.getValidationMessage(r,"max","number_exceed_max"),r.max];break}}if(r.step!==undefined&&r.step!=="any"){var c=(s[u]/r.step).toPrecision(14);if(parseInt(c)!=c){o=[this.getValidationMessage(r,"step","number_wrong_step"),r.step];break}}break;case"datetime":if(s[u]===undefined||s[u].length===0){if(!r.allow_empty_value){o=["datetime_empty"]}break}if(r.format){if(!("moment"in window)){m.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com")}var d=moment(s[u],r.format);if(!d.isValid()){o=[this.getValidationMessage(r,"format","datetime_invalid"),r.format];break}else{if(r.min){if(d<moment(r.min,r.format)){o=[this.getValidationMessage(r,"min","datetime_exceed_min"),r.min];break}}if(r.max){if(d>moment(r.max,r.format)){o=[this.getValidationMessage(r,"max","datetime_exceed_max"),r.max];break}}}}break;case"boolean":if(s[u]===undefined||s[u].length===0){if(!r.allow_empty_value){o=["boolean_not_valid"]}break}a=(""+s[u]).trim().toLowerCase();if(a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"&&s[u]!==1&&s[u]!==0){o=["boolean_not_valid"];break}}if(o!==true){break}}}if(o!==true){break}}if((e.operator.type==="between"||e.operator.type==="not_between")&&t.length===2){switch(f.types[i.type]){case"number":if(t[0]>t[1]){o=["number_between_invalid",t[0],t[1]]}break;case"datetime":if(r.format){if(!("moment"in window)){m.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com")}if(moment(t[0],r.format).isAfter(moment(t[1],r.format))){o=["datetime_between_invalid",t[0],t[1]]}}break}}return o};f.prototype.nextGroupId=function(){return this.status.id+"_group_"+this.status.group_id++};f.prototype.nextRuleId=function(){return this.status.id+"_rule_"+this.status.rule_id++};f.prototype.getOperators=function(i){if(typeof i=="string"){i=this.getFilterById(i)}var e=[];for(var t=0,n=this.operators.length;t<n;t++){if(i.operators){if(i.operators.indexOf(this.operators[t].type)==-1){continue}}else if(this.operators[t].apply_to.indexOf(f.types[i.type])==-1){continue}e.push(this.operators[t])}if(i.operators){e.sort(function(e,t){return i.operators.indexOf(e.type)-i.operators.indexOf(t.type)})}return this.change("getOperators",e,i)};f.prototype.getFilterById=function(e,t){if(e=="-1"){return null}for(var i=0,n=this.filters.length;i<n;i++){if(this.filters[i].id==e){return this.filters[i]}}m.error(t!==false,"UndefinedFilter",'Undefined filter "{0}"',e);return null};f.prototype.getOperatorByType=function(e,t){if(e=="-1"){return null}for(var i=0,n=this.operators.length;i<n;i++){if(this.operators[i].type==e){return this.operators[i]}}m.error(t!==false,"UndefinedOperator",'Undefined operator "{0}"',e);return null};f.prototype.getRuleInputValue=function(e){var t=e.filter;var i=e.operator;var n=[];if(t.valueGetter){n=t.valueGetter.call(this,e)}else{var r=e.$el.find(f.selectors.value_container);for(var o=0;o<i.nb_inputs;o++){var a=m.escapeElementId(e.id+"_value_"+o);var s;switch(t.input){case"radio":n.push(r.find("[name="+a+"]:checked").val());break;case"checkbox":s=[];r.find("[name="+a+"]:checked").each(function(){s.push(v(this).val())});n.push(s);break;case"select":if(t.multiple){s=[];r.find("[name="+a+"] option:selected").each(function(){s.push(v(this).val())});n.push(s)}else{n.push(r.find("[name="+a+"] option:selected").val())}break;default:n.push(r.find("[name="+a+"]").val())}}n=n.map(function(e){if(i.multiple&&t.value_separator&&typeof e=="string"){e=e.split(t.value_separator)}if(v.isArray(e)){return e.map(function(e){return m.changeType(e,t.type)})}else{return m.changeType(e,t.type)}});if(i.nb_inputs===1){n=n[0]}if(t.valueParser){n=t.valueParser.call(this,e,n)}}return this.change("getRuleValue",n,e)};f.prototype.setRuleInputValue=function(e,t){var i=e.filter;var n=e.operator;if(!i||!n){return}e._updating_input=true;if(i.valueSetter){i.valueSetter.call(this,e,t)}else{var r=e.$el.find(f.selectors.value_container);if(n.nb_inputs==1){t=[t]}for(var o=0;o<n.nb_inputs;o++){var a=m.escapeElementId(e.id+"_value_"+o);switch(i.input){case"radio":r.find("[name="+a+'][value="'+t[o]+'"]').prop("checked",true).trigger("change");break;case"checkbox":if(!v.isArray(t[o])){t[o]=[t[o]]}t[o].forEach(function(e){r.find("[name="+a+'][value="'+e+'"]').prop("checked",true).trigger("change")});break;default:if(n.multiple&&i.value_separator&&v.isArray(t[o])){t[o]=t[o].join(i.value_separator)}r.find("[name="+a+"]").val(t[o]).trigger("change");break}}}e._updating_input=false};f.prototype.parseRuleFlags=function(e){var t=v.extend({},this.settings.default_rule_flags);if(e.readonly){v.extend(t,{header_readonly:true,filter_readonly:true,operator_readonly:true,value_readonly:true,no_delete:true,no_sortable:true})}if(e.flags){v.extend(t,e.flags)}return this.change("parseRuleFlags",t,e)};f.prototype.getRuleFlags=function(i,e){if(e){return v.extend({},i)}else{var n={};v.each(this.settings.default_rule_flags,function(e,t){if(i[e]!==t){n[e]=i[e]}});return n}};f.prototype.parseGroupFlags=function(e){var t=v.extend({},this.settings.default_group_flags);if(e.readonly){v.extend(t,{condition_readonly:true,no_add_rule:true,no_add_group:true,no_delete:true})}if(e.flags){v.extend(t,e.flags)}return this.change("parseGroupFlags",t,e)};f.prototype.getGroupFlags=function(i,e){if(e){return v.extend({},i)}else{var n={};v.each(this.settings.default_group_flags,function(e,t){if(i[e]!==t){n[e]=i[e]}});return n}};f.prototype.translate=function(e,t){if(!t){t=e;e=undefined}var i;if(typeof t==="object"){i=t[this.settings.lang_code]||t["en"]}else{i=(e?this.lang[e]:this.lang)[t]||t}return this.change("translate",i,t,e)};f.prototype.getValidationMessage=function(e,t,i){return e.messages&&e.messages[t]||i};f.templates.group='<div id="{{= it.group_id }}" class="rules-group-container">   <div class="rules-group-header">     <div class="btn-group pull-right group-actions">       <button type="button" class="btn btn-xs btn-success" data-add="rule">         <i class="{{= it.icons.add_rule }}"></i> {{= it.translate("add_rule") }}       </button>       {{? it.settings.allow_groups===-1 || it.settings.allow_groups>=it.level }}         <button type="button" class="btn btn-xs btn-success" data-add="group">           <i class="{{= it.icons.add_group }}"></i> {{= it.translate("add_group") }}         </button>       {{?}}       {{? it.level>1 }}         <button type="button" class="btn btn-xs btn-danger" data-delete="group">           <i class="{{= it.icons.remove_group }}"></i> {{= it.translate("delete_group") }}         </button>       {{?}}     </div>     <div class="btn-group group-conditions">       {{~ it.conditions: condition }}         <label class="btn btn-xs btn-primary">           <input type="radio" name="{{= it.group_id }}_cond" value="{{= condition }}"> {{= it.translate("conditions", condition) }}         </label>       {{~}}     </div>     {{? it.settings.display_errors }}       <div class="error-container"><i class="{{= it.icons.error }}"></i></div>     {{?}}   </div>   <div class=rules-group-body>     <div class=rules-list></div>   </div> </div>';f.templates.rule='<div id="{{= it.rule_id }}" class="rule-container">   <div class="rule-header">     <div class="btn-group pull-right rule-actions">       <button type="button" class="btn btn-xs btn-danger" data-delete="rule">         <i class="{{= it.icons.remove_rule }}"></i> {{= it.translate("delete_rule") }}       </button>     </div>   </div>   {{? it.settings.display_errors }}     <div class="error-container"><i class="{{= it.icons.error }}"></i></div>   {{?}}   <div class="rule-filter-container"></div>   <div class="rule-operator-container"></div>   <div class="rule-value-container"></div> </div>';f.templates.filterSelect='{{ var optgroup = null; }} <select class="form-control" name="{{= it.rule.id }}_filter">   {{? it.settings.display_empty_filter }}     <option value="-1">{{= it.settings.select_placeholder }}</option>   {{?}}   {{~ it.filters: filter }}     {{? optgroup !== filter.optgroup }}       {{? optgroup !== null }}</optgroup>{{?}}       {{? (optgroup = filter.optgroup) !== null }}         <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}">       {{?}}     {{?}}     <option value="{{= filter.id }}" {{? filter.icon}}data-icon="{{= filter.icon}}"{{?}}>{{= it.translate(filter.label) }}</option>   {{~}}   {{? optgroup !== null }}</optgroup>{{?}} </select>';f.templates.operatorSelect='{{? it.operators.length === 1 }} <span> {{= it.translate("operators", it.operators[0].type) }} </span> {{?}} {{ var optgroup = null; }} <select class="form-control {{? it.operators.length === 1 }}hide{{?}}" name="{{= it.rule.id }}_operator">   {{~ it.operators: operator }}     {{? optgroup !== operator.optgroup }}       {{? optgroup !== null }}</optgroup>{{?}}       {{? (optgroup = operator.optgroup) !== null }}         <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}">       {{?}}     {{?}}     <option value="{{= operator.type }}" {{? operator.icon}}data-icon="{{= operator.icon}}"{{?}}>{{= it.translate("operators", operator.type) }}</option>   {{~}}   {{? optgroup !== null }}</optgroup>{{?}} </select>';f.templates.ruleValueSelect='{{ var optgroup = null; }} <select class="form-control" name="{{= it.name }}" {{? it.rule.filter.multiple }}multiple{{?}}>   {{? it.rule.filter.placeholder }}     <option value="{{= it.rule.filter.placeholder_value }}" disabled selected>{{= it.rule.filter.placeholder }}</option>   {{?}}   {{~ it.rule.filter.values: entry }}     {{? optgroup !== entry.optgroup }}       {{? optgroup !== null }}</optgroup>{{?}}       {{? (optgroup = entry.optgroup) !== null }}         <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}">       {{?}}     {{?}}     <option value="{{= entry.value }}">{{= entry.label }}</option>   {{~}}   {{? optgroup !== null }}</optgroup>{{?}} </select>';f.prototype.getGroupTemplate=function(e,t){var i=this.templates.group({builder:this,group_id:e,level:t,conditions:this.settings.conditions,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getGroupTemplate",i,t)};f.prototype.getRuleTemplate=function(e){var t=this.templates.rule({builder:this,rule_id:e,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getRuleTemplate",t)};f.prototype.getRuleFilterSelect=function(e,t){var i=this.templates.filterSelect({builder:this,rule:e,filters:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getRuleFilterSelect",i,e,t)};f.prototype.getRuleOperatorSelect=function(e,t){var i=this.templates.operatorSelect({builder:this,rule:e,operators:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getRuleOperatorSelect",i,e,t)};f.prototype.getRuleValueSelect=function(e,t){var i=this.templates.ruleValueSelect({builder:this,name:e,rule:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getRuleValueSelect",i,e,t)};f.prototype.getRuleInput=function(e,t){var i=e.filter;var n=e.filter.validation||{};var r=e.id+"_value_"+t;var o=i.vertical?" class=block":"";var a="";if(typeof i.input=="function"){a=i.input.call(this,e,r)}else{switch(i.input){case"radio":case"checkbox":m.iterateOptions(i.values,function(e,t){a+="<label"+o+'><input type="'+i.input+'" name="'+r+'" value="'+e+'"> '+t+"</label> "});break;case"select":a=this.getRuleValueSelect(r,e);break;case"textarea":a+='<textarea class="form-control" name="'+r+'"';if(i.size)a+=' cols="'+i.size+'"';if(i.rows)a+=' rows="'+i.rows+'"';if(n.min!==undefined)a+=' minlength="'+n.min+'"';if(n.max!==undefined)a+=' maxlength="'+n.max+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';a+="></textarea>";break;case"number":a+='<input class="form-control" type="number" name="'+r+'"';if(n.step!==undefined)a+=' step="'+n.step+'"';if(n.min!==undefined)a+=' min="'+n.min+'"';if(n.max!==undefined)a+=' max="'+n.max+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';if(i.size)a+=' size="'+i.size+'"';a+=">";break;default:a+='<input class="form-control" type="text" name="'+r+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';if(i.type==="string"&&n.min!==undefined)a+=' minlength="'+n.min+'"';if(i.type==="string"&&n.max!==undefined)a+=' maxlength="'+n.max+'"';if(i.size)a+=' size="'+i.size+'"';a+=">"}}return this.change("getRuleInput",a,e,r)};var m={};f.utils=m;m.iterateOptions=function(e,i){if(e){if(v.isArray(e)){e.forEach(function(e){if(v.isPlainObject(e)){if("value"in e){i(e.value,e.label||e.value,e.optgroup)}else{v.each(e,function(e,t){i(e,t);return false})}}else{i(e,e)}})}else{v.each(e,function(e,t){i(e,t)})}}};m.fmt=function(e,i){if(!Array.isArray(i)){i=Array.prototype.slice.call(arguments,1)}return e.replace(/{([0-9]+)}/g,function(e,t){return i[parseInt(t)]})};m.error=function(){var e=0;var t=typeof arguments[e]==="boolean"?arguments[e++]:true;var i=arguments[e++];var n=arguments[e++];var r=Array.isArray(arguments[e])?arguments[e]:Array.prototype.slice.call(arguments,e);if(t){var o=new Error(m.fmt(n,r));o.name=i+"Error";o.args=r;throw o}else{console.error(i+"Error: "+m.fmt(n,r))}};m.changeType=function(e,t){if(e===""||e===undefined){return undefined}switch(t){case"integer":if(typeof e==="string"&&!/^-?\d+$/.test(e)){return e}return parseInt(e);case"double":if(typeof e==="string"&&!/^-?\d+\.?\d*$/.test(e)){return e}return parseFloat(e);case"boolean":if(typeof e==="string"&&!/^(0|1|true|false){1}$/i.test(e)){return e}return e===true||e===1||e.toLowerCase()==="true"||e==="1";default:return e}};m.escapeString=function(e){if(typeof e!="string"){return e}return e.replace(/[\0\n\r\b\\\'\"]/g,function(e){switch(e){case"\0":return"\\0";case"\n":return"\\n";case"\r":return"\\r";case"\b":return"\\b";default:return"\\"+e}}).replace(/\t/g,"\\t").replace(/\x1a/g,"\\Z")};m.escapeRegExp=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};m.escapeElementId=function(e){return e?e.replace(/(\\)?([:.\[\],])/g,function(e,t,i){return t?e:"\\"+i}):e};m.groupSort=function(e,i){var n=[];var r=[];e.forEach(function(e){var t;if(e[i]){t=n.lastIndexOf(e[i]);if(t==-1){t=n.length}else{t++}}else{t=n.length}n.splice(t,0,e[i]);r.splice(t,0,e)});return r};m.defineModelProperties=function(e,t){t.forEach(function(i){Object.defineProperty(e.prototype,i,{enumerable:true,get:function(){return this.__[i]},set:function(e){var t=this.__[i]!==null&&typeof this.__[i]=="object"?v.extend({},this.__[i]):this.__[i];this.__[i]=e;if(this.model!==null){this.model.trigger("update",this,i,e,t)}}})})};function n(){this.root=null;this.$=v(this)}v.extend(n.prototype,{trigger:function(e){var t=new v.Event(e);this.$.triggerHandler(t,Array.prototype.slice.call(arguments,1));return t},on:function(){this.$.on.apply(this.$,Array.prototype.slice.call(arguments));return this},off:function(){this.$.off.apply(this.$,Array.prototype.slice.call(arguments));return this},once:function(){this.$.one.apply(this.$,Array.prototype.slice.call(arguments));return this}});var r=function(e,t){if(!(this instanceof r)){return new r(e,t)}Object.defineProperty(this,"__",{value:{}});t.data("queryBuilderModel",this);this.__.level=1;this.__.error=null;this.__.flags={};this.__.data=undefined;this.$el=t;this.id=t[0].id;this.model=null;this.parent=e};m.defineModelProperties(r,["level","error","data","flags"]);Object.defineProperty(r.prototype,"parent",{enumerable:true,get:function(){return this.__.parent},set:function(e){this.__.parent=e;this.level=e===null?1:e.level+1;this.model=e===null?null:e.model}});r.prototype.isRoot=function(){return this.level===1};r.prototype.getPos=function(){if(this.isRoot()){return-1}else{return this.parent.getNodePos(this)}};r.prototype.drop=function(){var e=this.model;if(!!this.parent){this.parent.removeNode(this)}this.$el.removeData("queryBuilderModel");if(e!==null){e.trigger("drop",this)}};r.prototype.moveAfter=function(e){if(!this.isRoot()){this.move(e.parent,e.getPos()+1)}};r.prototype.moveAtBegin=function(e){if(!this.isRoot()){if(e===undefined){e=this.parent}this.move(e,0)}};r.prototype.moveAtEnd=function(e){if(!this.isRoot()){if(e===undefined){e=this.parent}this.move(e,e.length()===0?0:e.length()-1)}};r.prototype.move=function(e,t){if(!this.isRoot()){if(typeof e==="number"){t=e;e=this.parent}this.parent.removeNode(this);e.insertNode(this,t,false);if(this.model!==null){this.model.trigger("move",this,e,t)}}};var u=function(e,t){if(!(this instanceof u)){return new u(e,t)}r.call(this,e,t);this.rules=[];this.__.condition=null};u.prototype=Object.create(r.prototype);u.prototype.constructor=u;m.defineModelProperties(u,["condition"]);u.prototype.empty=function(){this.each("reverse",function(e){e.drop()},function(e){e.drop()})};u.prototype.drop=function(){this.empty();r.prototype.drop.call(this)};u.prototype.length=function(){return this.rules.length};u.prototype.insertNode=function(e,t,i){if(t===undefined){t=this.length()}this.rules.splice(t,0,e);e.parent=this;if(i&&this.model!==null){this.model.trigger("add",this,e,t)}return e};u.prototype.addGroup=function(e,t){return this.insertNode(new u(this,e),t,true)};u.prototype.addRule=function(e,t){return this.insertNode(new a(this,e),t,true)};u.prototype.removeNode=function(e){var t=this.getNodePos(e);if(t!==-1){e.parent=null;this.rules.splice(t,1)}};u.prototype.getNodePos=function(e){return this.rules.indexOf(e)};u.prototype.each=function(e,t,i,n){if(typeof e!=="boolean"&&typeof e!=="string"){n=i;i=t;t=e;e=false}n=n===undefined?null:n;var r=e?this.rules.length-1:0;var o=e?0:this.rules.length-1;var a=e?-1:1;var s=function(){return e?r>=o:r<=o};var l=false;for(;s();r+=a){if(this.rules[r]instanceof u){if(!!i){l=i.call(n,this.rules[r])===false}}else if(!!t){l=t.call(n,this.rules[r])===false}if(l){break}}return!l};u.prototype.contains=function(t,e){if(this.getNodePos(t)!==-1){return true}else if(!e){return false}else{return!this.each(function(){return true},function(e){return!e.contains(t,true)})}};var a=function(e,t){if(!(this instanceof a)){return new a(e,t)}r.call(this,e,t);this._updating_value=false;this._updating_input=false;this.__.filter=null;this.__.operator=null;this.__.value=undefined};a.prototype=Object.create(r.prototype);a.prototype.constructor=a;m.defineModelProperties(a,["filter","operator","value"]);a.prototype.isRoot=function(){return false};f.Group=u;f.Rule=a;v.fn.queryBuilder=function(e){if(this.length===0){m.error("Config","No target defined")}if(this.length>1){m.error("Config","Unable to initialize on multiple target")}var t=this.data("queryBuilder");var i=typeof e=="object"&&e||{};if(!t&&e=="destroy"){return this}if(!t){var n=new f(this,i);this.data("queryBuilder",n);n.init(i.rules)}if(typeof e=="string"){return t[e].apply(t,Array.prototype.slice.call(arguments,1))}return this};v.fn.queryBuilder.constructor=f;v.fn.queryBuilder.defaults=f.defaults;v.fn.queryBuilder.extend=f.extend;v.fn.queryBuilder.define=f.define;v.fn.queryBuilder.regional=f.regional;f.define("bt-checkbox",function(u){if(u.font=="glyphicons"){this.$el.addClass("bt-checkbox-glyphicons")}this.on("getRuleInput.filter",function(r,e,o){var a=e.filter;if((a.input==="radio"||a.input==="checkbox")&&!a.plugin){r.value="";if(!a.colors){a.colors={}}if(a.color){a.colors._def_=a.color}var s=a.vertical?' style="display:block"':"";var l=0;m.iterateOptions(a.values,function(e,t){var i=a.colors[e]||a.colors._def_||u.color;var n=o+"_"+l++;r.value+="<div"+s+' class="'+a.input+" "+a.input+"-"+i+'">   <input type="'+a.input+'" name="'+o+'" id="'+n+'" value="'+e+'">   <label for="'+n+'">'+t+"</label> </div>"})}})},{font:"glyphicons",color:"default"});f.define("bt-selectpicker",function(i){if(!v.fn.selectpicker||!v.fn.selectpicker.Constructor){m.error("MissingLibrary",'Bootstrap Select is required to use "bt-selectpicker" plugin. Get it here: http://silviomoreto.github.io/bootstrap-select')}var n=f.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(n.rule_filter).removeClass("form-control").selectpicker(i)});this.on("afterCreateRuleOperators",function(e,t){t.$el.find(n.rule_operator).removeClass("form-control").selectpicker(i)});this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(n.rule_filter).selectpicker("render")});this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(n.rule_operator).selectpicker("render")});this.on("beforeDeleteRule",function(e,t){t.$el.find(n.rule_filter).selectpicker("destroy");t.$el.find(n.rule_operator).selectpicker("destroy")})},{container:"body",style:"btn-inverse btn-xs",width:"auto",showIcon:false});f.define("bt-tooltip-errors",function(n){if(!v.fn.tooltip||!v.fn.tooltip.Constructor||!v.fn.tooltip.Constructor.prototype.fixTitle){m.error("MissingLibrary",'Bootstrap Tooltip is required to use "bt-tooltip-errors" plugin. Get it here: http://getbootstrap.com')}var r=this;this.on("getRuleTemplate.filter getGroupTemplate.filter",function(e){var t=v(e.value);t.find(f.selectors.error_container).attr("data-toggle","tooltip");e.value=t.prop("outerHTML")});this.model.on("update",function(e,t,i){if(i=="error"&&r.settings.display_errors){t.$el.find(f.selectors.error_container).eq(0).tooltip(n).tooltip("hide").tooltip("fixTitle")}})},{placement:"right"});f.extend({setFilters:function(e,t){var i=this;if(t===undefined){t=e;e=false}t=this.checkFilters(t);t=this.change("setFilters",t);var n=t.map(function(e){return e.id});if(!e){(function e(t){t.each(function(e){if(e.filter&&n.indexOf(e.filter.id)===-1){m.error("ChangeFilter",'A rule is using filter "{0}"',e.filter.id)}},e)})(this.model.root)}this.filters=t;(function e(t){t.each(true,function(e){if(e.filter&&n.indexOf(e.filter.id)===-1){e.drop();i.trigger("rulesChanged")}else{i.createRuleFilters(e);e.$el.find(f.selectors.rule_filter).val(e.filter?e.filter.id:"-1");i.trigger("afterUpdateRuleFilter",e)}},e)})(this.model.root);if(this.settings.plugins){if(this.settings.plugins["unique-filter"]){this.updateDisabledFilters()}if(this.settings.plugins["bt-selectpicker"]){this.$el.find(f.selectors.rule_filter).selectpicker("render")}}if(this.settings.default_filter){try{this.getFilterById(this.settings.default_filter)}catch(e){this.settings.default_filter=null}}this.trigger("afterSetFilters",t)},addFilter:function(e,i){if(i===undefined||i=="#end"){i=this.filters.length}else if(i=="#start"){i=0}if(!v.isArray(e)){e=[e]}var t=v.extend(true,[],this.filters);if(parseInt(i)==i){Array.prototype.splice.apply(t,[i,0].concat(e))}else{if(this.filters.some(function(e,t){if(e.id==i){i=t+1;return true}})){Array.prototype.splice.apply(t,[i,0].concat(e))}else{Array.prototype.push.apply(t,e)}}this.setFilters(t)},removeFilter:function(t,e){var i=v.extend(true,[],this.filters);if(typeof t==="string"){t=[t]}i=i.filter(function(e){return t.indexOf(e.id)===-1});this.setFilters(e,i)}});f.define("chosen-selectpicker",function(i){if(!v.fn.chosen){m.error("MissingLibrary",'chosen is required to use "chosen-selectpicker" plugin. Get it here: https://github.com/harvesthq/chosen')}if(this.settings.plugins["bt-selectpicker"]){m.error("Conflict","bt-selectpicker is already selected as the dropdown plugin. Please remove chosen-selectpicker from the plugin list")}var n=f.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(n.rule_filter).removeClass("form-control").chosen(i)});this.on("afterCreateRuleOperators",function(e,t){t.$el.find(n.rule_operator).removeClass("form-control").chosen(i)});this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(n.rule_filter).trigger("chosen:updated")});this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(n.rule_operator).trigger("chosen:updated")});this.on("beforeDeleteRule",function(e,t){t.$el.find(n.rule_filter).chosen("destroy");t.$el.find(n.rule_operator).chosen("destroy")})});f.define("filter-description",function(r){if(r.mode==="inline"){this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(e,t){var i=t.$el.find("p.filter-description");var n=e.builder.getFilterDescription(t.filter,t);if(!n){i.hide()}else{if(i.length===0){i=v('<p class="filter-description"></p>');i.appendTo(t.$el)}else{i.css("display","")}i.html('<i class="'+r.icon+'"></i> '+n)}})}else if(r.mode==="popover"){if(!v.fn.popover||!v.fn.popover.Constructor||!v.fn.popover.Constructor.prototype.fixTitle){m.error("MissingLibrary",'Bootstrap Popover is required to use "filter-description" plugin. Get it here: http://getbootstrap.com')}this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(e,t){var i=t.$el.find("button.filter-description");var n=e.builder.getFilterDescription(t.filter,t);if(!n){i.hide();if(i.data("bs.popover")){i.popover("hide")}}else{if(i.length===0){i=v('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="popover"><i class="'+r.icon+'"></i></button>');i.prependTo(t.$el.find(f.selectors.rule_actions));i.popover({placement:"left",container:"body",html:true});i.on("mouseout",function(){i.popover("hide")})}else{i.css("display","")}i.data("bs.popover").options.content=n;if(i.attr("aria-describedby")){i.popover("show")}}})}else if(r.mode==="bootbox"){if(!("bootbox"in window)){m.error("MissingLibrary",'Bootbox is required to use "filter-description" plugin. Get it here: http://bootboxjs.com')}this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(e,t){var i=t.$el.find("button.filter-description");var n=e.builder.getFilterDescription(t.filter,t);if(!n){i.hide()}else{if(i.length===0){i=v('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="bootbox"><i class="'+r.icon+'"></i></button>');i.prependTo(t.$el.find(f.selectors.rule_actions));i.on("click",function(){bootbox.alert(i.data("description"))})}else{i.css("display","")}i.data("description",n)}})}},{icon:"glyphicon glyphicon-info-sign",mode:"popover"});f.extend({getFilterDescription:function(e,t){if(!e){return undefined}else if(typeof e.description=="function"){return e.description.call(this,t)}else{return e.description}}});f.define("invert",function(i){var n=this;var r=f.selectors;this.on("afterInit",function(){n.$el.on("click.queryBuilder","[data-invert=group]",function(){var e=v(this).closest(r.group_container);n.invert(n.getModel(e),i)});if(i.display_rules_button&&i.invert_rules){n.$el.on("click.queryBuilder","[data-invert=rule]",function(){var e=v(this).closest(r.rule_container);n.invert(n.getModel(e),i)})}});if(!i.disable_template){this.on("getGroupTemplate.filter",function(e){var t=v(e.value);t.find(r.condition_container).after('<button type="button" class="btn btn-xs btn-default" data-invert="group">'+'<i class="'+i.icon+'"></i> '+n.translate("invert")+"</button>");e.value=t.prop("outerHTML")});if(i.display_rules_button&&i.invert_rules){this.on("getRuleTemplate.filter",function(e){var t=v(e.value);t.find(r.rule_actions).prepend('<button type="button" class="btn btn-xs btn-default" data-invert="rule">'+'<i class="'+i.icon+'"></i> '+n.translate("invert")+"</button>");e.value=t.prop("outerHTML")})}}},{icon:"glyphicon glyphicon-random",recursive:true,invert_rules:true,display_rules_button:false,silent_fail:false,disable_template:false});f.defaults({operatorOpposites:{equal:"not_equal",not_equal:"equal",in:"not_in",not_in:"in",less:"greater_or_equal",less_or_equal:"greater",greater:"less_or_equal",greater_or_equal:"less",between:"not_between",not_between:"between",begins_with:"not_begins_with",not_begins_with:"begins_with",contains:"not_contains",not_contains:"contains",ends_with:"not_ends_with",not_ends_with:"ends_with",is_empty:"is_not_empty",is_not_empty:"is_empty",is_null:"is_not_null",is_not_null:"is_null"},conditionOpposites:{AND:"OR",OR:"AND"}});f.extend({invert:function(e,t){if(!(e instanceof r)){if(!this.model.root)return;t=e;e=this.model.root}if(typeof t!="object")t={};if(t.recursive===undefined)t.recursive=true;if(t.invert_rules===undefined)t.invert_rules=true;if(t.silent_fail===undefined)t.silent_fail=false;if(t.trigger===undefined)t.trigger=true;if(e instanceof u){if(this.settings.conditionOpposites[e.condition]){e.condition=this.settings.conditionOpposites[e.condition]}else if(!t.silent_fail){m.error("InvertCondition",'Unknown inverse of condition "{0}"',e.condition)}if(t.recursive){var i=v.extend({},t,{trigger:false});e.each(function(e){if(t.invert_rules){this.invert(e,i)}},function(e){this.invert(e,i)},this)}}else if(e instanceof a){if(e.operator&&!e.filter.no_invert){if(this.settings.operatorOpposites[e.operator.type]){var n=this.settings.operatorOpposites[e.operator.type];if(!e.filter.operators||e.filter.operators.indexOf(n)!=-1){e.operator=this.getOperatorByType(n)}}else if(!t.silent_fail){m.error("InvertOperator",'Unknown inverse of operator "{0}"',e.operator.type)}}}if(t.trigger){this.trigger("afterInvert",e,t);this.trigger("rulesChanged")}}});f.defaults({mongoOperators:{equal:function(e){return e[0]},not_equal:function(e){return{$ne:e[0]}},in:function(e){return{$in:e}},not_in:function(e){return{$nin:e}},less:function(e){return{$lt:e[0]}},less_or_equal:function(e){return{$lte:e[0]}},greater:function(e){return{$gt:e[0]}},greater_or_equal:function(e){return{$gte:e[0]}},between:function(e){return{$gte:e[0],$lte:e[1]}},not_between:function(e){return{$lt:e[0],$gt:e[1]}},begins_with:function(e){return{$regex:"^"+m.escapeRegExp(e[0])}},not_begins_with:function(e){return{$regex:"^(?!"+m.escapeRegExp(e[0])+")"}},contains:function(e){return{$regex:m.escapeRegExp(e[0])}},not_contains:function(e){return{$regex:"^((?!"+m.escapeRegExp(e[0])+").)*$",$options:"s"}},ends_with:function(e){return{$regex:m.escapeRegExp(e[0])+"$"}},not_ends_with:function(e){return{$regex:"(?<!"+m.escapeRegExp(e[0])+")$"}},is_empty:function(e){return""},is_not_empty:function(e){return{$ne:""}},is_null:function(e){return null},is_not_null:function(e){return{$ne:null}}},mongoRuleOperators:{$eq:function(e){return{val:e,op:e===null?"is_null":e===""?"is_empty":"equal"}},$ne:function(e){e=e.$ne;return{val:e,op:e===null?"is_not_null":e===""?"is_not_empty":"not_equal"}},$regex:function(e){e=e.$regex;if(e.slice(0,4)=="^(?!"&&e.slice(-1)==")"){return{val:e.slice(4,-1),op:"not_begins_with"}}else if(e.slice(0,5)=="^((?!"&&e.slice(-5)==").)*$"){return{val:e.slice(5,-5),op:"not_contains"}}else if(e.slice(0,4)=="(?<!"&&e.slice(-2)==")$"){return{val:e.slice(4,-2),op:"not_ends_with"}}else if(e.slice(-1)=="$"){return{val:e.slice(0,-1),op:"ends_with"}}else if(e.slice(0,1)=="^"){return{val:e.slice(1),op:"begins_with"}}else{return{val:e,op:"contains"}}},between:function(e){return{val:[e.$gte,e.$lte],op:"between"}},not_between:function(e){return{val:[e.$lt,e.$gt],op:"not_between"}},$in:function(e){return{val:e.$in,op:"in"}},$nin:function(e){return{val:e.$nin,op:"not_in"}},$lt:function(e){return{val:e.$lt,op:"less"}},$lte:function(e){return{val:e.$lte,op:"less_or_equal"}},$gt:function(e){return{val:e.$gt,op:"greater"}},$gte:function(e){return{val:e.$gte,op:"greater_or_equal"}}}});f.extend({getMongo:function(e){e=e===undefined?this.getRules():e;if(!e){return null}var s=this;return function o(e){if(!e.condition){e.condition=s.settings.default_condition}if(["AND","OR"].indexOf(e.condition.toUpperCase())===-1){m.error("UndefinedMongoCondition",'Unable to build MongoDB query with condition "{0}"',e.condition)}if(!e.rules){return{}}var a=[];e.rules.forEach(function(e){if(e.rules&&e.rules.length>0){a.push(o(e))}else{var t=s.settings.mongoOperators[e.operator];var i=s.getOperatorByType(e.operator);if(t===undefined){m.error("UndefinedMongoOperator",'Unknown MongoDB operation for operator "{0}"',e.operator)}if(i.nb_inputs!==0){if(!(e.value instanceof Array)){e.value=[e.value]}}var n=s.change("getMongoDBField",e.field,e);var r={};r[n]=t.call(s,e.value);a.push(s.change("ruleToMongo",r,e,e.value,t))}});var t={};t["$"+e.condition.toLowerCase()]=a;return s.change("groupToMongo",t,e)}(e)},getRulesFromMongo:function(e){if(e===undefined||e===null){return null}var d=this;e=d.change("parseMongoNode",e);if("rules"in e&&"condition"in e){return e}if("id"in e&&"operator"in e&&"value"in e){return{condition:this.settings.default_condition,rules:[e]}}var t=d.getMongoCondition(e);if(!t){m.error("MongoParse","Invalid MongoDB query format")}return function u(e,t){var i=e[t];var c=[];i.forEach(function(e){e=d.change("parseMongoNode",e);if("rules"in e&&"condition"in e){c.push(e);return}if("id"in e&&"operator"in e&&"value"in e){c.push(e);return}var t=d.getMongoCondition(e);if(t){c.push(u(e,t))}else{var i=Object.keys(e)[0];var n=e[i];var r=d.getMongoOperator(n);if(r===undefined){m.error("MongoParse","Invalid MongoDB query format")}var o=d.settings.mongoRuleOperators[r];if(o===undefined){m.error("UndefinedMongoOperator",'JSON Rule operation unknown for operator "{0}"',r)}var a=o.call(d,n);var s=d.getMongoDBFieldID(i,n);var l=d.change("mongoToRule",{id:s,field:i,operator:a.op,value:a.val},e);c.push(l)}});return d.change("mongoToGroup",{condition:t.replace("$","").toUpperCase(),rules:c},e)}(e,t)},setRulesFromMongo:function(e){this.setRules(this.getRulesFromMongo(e))},getMongoDBFieldID:function(t,e){var i=this.filters.filter(function(e){return e.field===t});var n;if(i.length===1){n=i[0].id}else{n=this.change("getMongoDBFieldID",t,e)}return n},getMongoOperator:function(e){if(e!==null&&typeof e==="object"){if(e.$gte!==undefined&&e.$lte!==undefined){return"between"}if(e.$lt!==undefined&&e.$gt!==undefined){return"not_between"}var t=Object.keys(e).filter(function(e){return!!this.settings.mongoRuleOperators[e]}.bind(this));if(t.length===1){return t[0]}}else{return"$eq"}},getMongoCondition:function(e){var t=Object.keys(e);for(var i=0,n=t.length;i<n;i++){if(t[i].toLowerCase()==="$or"||t[i].toLowerCase()==="$and"){return t[i]}}}});f.define("not-group",function(i){var n=this;this.on("afterInit",function(){n.$el.on("click.queryBuilder","[data-not=group]",function(){var e=v(this).closest(f.selectors.group_container);var t=n.getModel(e);t.not=!t.not});n.model.on("update",function(e,t,i){if(t instanceof u&&i==="not"){n.updateGroupNot(t)}})});this.on("afterAddGroup",function(e,t){t.__.not=false});if(!i.disable_template){this.on("getGroupTemplate.filter",function(e){var t=v(e.value);t.find(f.selectors.condition_container).prepend('<button type="button" class="btn btn-xs btn-default" data-not="group">'+'<i class="'+i.icon_unchecked+'"></i> '+n.translate("NOT")+"</button>");e.value=t.prop("outerHTML")})}this.on("groupToJson.filter",function(e,t){e.value.not=t.not});this.on("jsonToGroup.filter",function(e,t){e.value.not=!!t.not});this.on("groupToSQL.filter",function(e,t){if(t.not){e.value="NOT ( "+e.value+" )"}});this.on("parseSQLNode.filter",function(e){if(e.value.name&&e.value.name.toUpperCase()=="NOT"){e.value=e.value.arguments.value[0];if(["AND","OR"].indexOf(e.value.operation.toUpperCase())===-1){e.value=new SQLParser.nodes.Op(n.settings.default_condition,e.value,null)}e.value.not=true}});this.on("sqlGroupsDistinct.filter",function(e,t,i,n){if(i.not&&n>0){e.value=true}});this.on("sqlToGroup.filter",function(e,t){e.value.not=!!t.not});this.on("groupToMongo.filter",function(e,t){var i="$"+t.condition.toLowerCase();if(t.not&&e.value[i]){e.value={$nor:[e.value]}}});this.on("parseMongoNode.filter",function(e){var t=Object.keys(e.value);if(t[0]=="$nor"){e.value=e.value[t[0]][0];e.value.not=true}});this.on("mongoToGroup.filter",function(e,t){e.value.not=!!t.not})},{icon_unchecked:"glyphicon glyphicon-unchecked",icon_checked:"glyphicon glyphicon-check",disable_template:false});m.defineModelProperties(u,["not"]);f.selectors.group_not=f.selectors.group_header+" [data-not=group]";f.extend({updateGroupNot:function(e){var t=this.plugins["not-group"];e.$el.find(">"+f.selectors.group_not).toggleClass("active",e.not).find("i").attr("class",e.not?t.icon_checked:t.icon_unchecked);this.trigger("afterUpdateGroupNot",e);this.trigger("rulesChanged")}});f.define("sortable",function(n){if(!("interact"in window)){m.error("MissingLibrary",'interact.js is required to use "sortable" plugin. Get it here: http://interactjs.io')}if(n.default_no_sortable!==undefined){m.error(false,"Config",'Sortable plugin : "default_no_sortable" options is deprecated, use standard "default_rule_flags" and "default_group_flags" instead');this.settings.default_rule_flags.no_sortable=this.settings.default_group_flags.no_sortable=n.default_no_sortable}interact.dynamicDrop(true);interact.pointerMoveTolerance(10);var r;var o;var a;var s;this.on("afterAddRule afterAddGroup",function(e,t){if(t==r){return}var i=e.builder;if(n.inherit_no_sortable&&t.parent&&t.parent.flags.no_sortable){t.flags.no_sortable=true}if(n.inherit_no_drop&&t.parent&&t.parent.flags.no_drop){t.flags.no_drop=true}if(!t.flags.no_sortable){interact(t.$el[0]).draggable({allowFrom:f.selectors.drag_handle,onstart:function(e){s=false;a=i.getModel(e.target);o=a.$el.clone().appendTo(a.$el.parent()).width(a.$el.outerWidth()).addClass("dragging");var t=v('<div class="rule-placeholder">&nbsp;</div>').height(a.$el.outerHeight());r=a.parent.addRule(t,a.getPos());a.$el.hide()},onmove:function(e){o[0].style.top=e.clientY-15+"px";o[0].style.left=e.clientX-15+"px"},onend:function(e){if(e.dropzone){l(a,v(e.relatedTarget),i);s=true}o.remove();o=undefined;r.drop();r=undefined;a.$el.css("display","");i.trigger("afterMove",a);i.trigger("rulesChanged")}})}if(!t.flags.no_drop){interact(t.$el[0]).dropzone({accept:f.selectors.rule_and_group_containers,ondragenter:function(e){l(r,v(e.target),i)},ondrop:function(e){if(!s){l(a,v(e.target),i)}}});if(t instanceof u){interact(t.$el.find(f.selectors.group_header)[0]).dropzone({accept:f.selectors.rule_and_group_containers,ondragenter:function(e){l(r,v(e.target),i)},ondrop:function(e){if(!s){l(a,v(e.target),i)}}})}}});this.on("beforeDeleteRule beforeDeleteGroup",function(e,t){if(!e.isDefaultPrevented()){interact(t.$el[0]).unset();if(t instanceof u){interact(t.$el.find(f.selectors.group_header)[0]).unset()}}});this.on("afterApplyRuleFlags afterApplyGroupFlags",function(e,t){if(t.flags.no_sortable){t.$el.find(".drag-handle").remove()}});if(!n.disable_template){this.on("getGroupTemplate.filter",function(e,t){if(t>1){var i=v(e.value);i.find(f.selectors.condition_container).after('<div class="drag-handle"><i class="'+n.icon+'"></i></div>');e.value=i.prop("outerHTML")}});this.on("getRuleTemplate.filter",function(e){var t=v(e.value);t.find(f.selectors.rule_header).after('<div class="drag-handle"><i class="'+n.icon+'"></i></div>');e.value=t.prop("outerHTML")})}},{inherit_no_sortable:true,inherit_no_drop:true,icon:"glyphicon glyphicon-sort",disable_template:false});f.selectors.rule_and_group_containers=f.selectors.rule_container+", "+f.selectors.group_container;f.selectors.drag_handle=".drag-handle";f.defaults({default_rule_flags:{no_sortable:false,no_drop:false},default_group_flags:{no_sortable:false,no_drop:false}});function l(e,t,i){var n,r;var o=f.selectors;n=t.closest(o.rule_container);if(n.length){r="moveAfter"}if(!r){n=t.closest(o.group_header);if(n.length){n=t.closest(o.group_container);r="moveAtBegin"}}if(!r){n=t.closest(o.group_container);if(n.length){r="moveAtEnd"}}if(r){e[r](i.getModel(n));if(i&&e instanceof a){i.setRuleInputValue(e,e.value)}}}f.define("sql-support",function(e){},{boolean_as_integer:true});f.defaults({sqlOperators:{equal:{op:"= ?"},not_equal:{op:"!= ?"},in:{op:"IN(?)",sep:", "},not_in:{op:"NOT IN(?)",sep:", "},less:{op:"< ?"},less_or_equal:{op:"<= ?"},greater:{op:"> ?"},greater_or_equal:{op:">= ?"},between:{op:"BETWEEN ?",sep:" AND "},not_between:{op:"NOT BETWEEN ?",sep:" AND "},begins_with:{op:"LIKE(?)",mod:"{0}%"},not_begins_with:{op:"NOT LIKE(?)",mod:"{0}%"},contains:{op:"LIKE(?)",mod:"%{0}%"},not_contains:{op:"NOT LIKE(?)",mod:"%{0}%"},ends_with:{op:"LIKE(?)",mod:"%{0}"},not_ends_with:{op:"NOT LIKE(?)",mod:"%{0}"},is_empty:{op:"= ''"},is_not_empty:{op:"!= ''"},is_null:{op:"IS NULL"},is_not_null:{op:"IS NOT NULL"}},sqlRuleOperator:{"=":function(e){return{val:e,op:e===""?"is_empty":"equal"}},"!=":function(e){return{val:e,op:e===""?"is_not_empty":"not_equal"}},LIKE:function(e){if(e.slice(0,1)=="%"&&e.slice(-1)=="%"){return{val:e.slice(1,-1),op:"contains"}}else if(e.slice(0,1)=="%"){return{val:e.slice(1),op:"ends_with"}}else if(e.slice(-1)=="%"){return{val:e.slice(0,-1),op:"begins_with"}}else{m.error("SQLParse",'Invalid value for LIKE operator "{0}"',e)}},"NOT LIKE":function(e){if(e.slice(0,1)=="%"&&e.slice(-1)=="%"){return{val:e.slice(1,-1),op:"not_contains"}}else if(e.slice(0,1)=="%"){return{val:e.slice(1),op:"not_ends_with"}}else if(e.slice(-1)=="%"){return{val:e.slice(0,-1),op:"not_begins_with"}}else{m.error("SQLParse",'Invalid value for NOT LIKE operator "{0}"',e)}},IN:function(e){return{val:e,op:"in"}},"NOT IN":function(e){return{val:e,op:"not_in"}},"<":function(e){return{val:e,op:"less"}},"<=":function(e){return{val:e,op:"less_or_equal"}},">":function(e){return{val:e,op:"greater"}},">=":function(e){return{val:e,op:"greater_or_equal"}},BETWEEN:function(e){return{val:e,op:"between"}},"NOT BETWEEN":function(e){return{val:e,op:"not_between"}},IS:function(e){if(e!==null){m.error("SQLParse","Invalid value for IS operator")}return{val:null,op:"is_null"}},"IS NOT":function(e){if(e!==null){m.error("SQLParse","Invalid value for IS operator")}return{val:null,op:"is_not_null"}}},sqlStatements:{question_mark:function(){var i=[];return{add:function(e,t){i.push(t);return"?"},run:function(){return i}}},numbered:function(i){if(!i||i.length>1)i="$";var n=0;var r=[];return{add:function(e,t){r.push(t);n++;return i+n},run:function(){return r}}},named:function(n){if(!n||n.length>1)n=":";var r={};var o={};return{add:function(e,t){if(!r[e.field])r[e.field]=1;var i=e.field+"_"+r[e.field]++;o[i]=t;return n+i},run:function(){return o}}}},sqlRuleStatement:{question_mark:function(t){var i=0;return{parse:function(e){return e=="?"?t[i++]:e},esc:function(e){return e.replace(/\?/g,"'?'")}}},numbered:function(t,i){if(!i||i.length>1)i="$";var n=new RegExp("^\\"+i+"[0-9]+$");var r=new RegExp("\\"+i+"([0-9]+)","g");return{parse:function(e){return n.test(e)?t[e.slice(1)-1]:e},esc:function(e){return e.replace(r,"'"+(i=="$"?"$$":i)+"$1'")}}},named:function(t,i){if(!i||i.length>1)i=":";var n=new RegExp("^\\"+i);var r=new RegExp("\\"+i+"("+Object.keys(t).join("|")+")","g");return{parse:function(e){return n.test(e)?t[e.slice(1)]:e},esc:function(e){return e.replace(r,"'"+(i=="$"?"$$":i)+"$1'")}}}}});f.extend({getSQL:function(u,c,e){e=e===undefined?this.getRules():e;if(!e){return null}c=!!c?"\n":" ";var d=this.getPluginOptions("sql-support","boolean_as_integer");if(u===true){u="question_mark"}if(typeof u=="string"){var t=o(u);u=this.settings.sqlStatements[t[1]](t[2])}var f=this;var i=function s(e){if(!e.condition){e.condition=f.settings.default_condition}if(["AND","OR"].indexOf(e.condition.toUpperCase())===-1){m.error("UndefinedSQLCondition",'Unable to build SQL query with condition "{0}"',e.condition)}if(!e.rules){return""}var l=[];e.rules.forEach(function(i){if(i.rules&&i.rules.length>0){l.push("("+c+s(i)+c+")"+c)}else{var n=f.settings.sqlOperators[i.operator];var e=f.getOperatorByType(i.operator);var r="";if(n===undefined){m.error("UndefinedSQLOperator",'Unknown SQL operation for operator "{0}"',i.operator)}if(e.nb_inputs!==0){if(!(i.value instanceof Array)){i.value=[i.value]}i.value.forEach(function(e,t){if(t>0){r+=n.sep}if(i.type=="boolean"&&d){e=e?1:0}else if(!u&&i.type!=="integer"&&i.type!=="double"&&i.type!=="boolean"){e=m.escapeString(e)}if(n.mod){e=m.fmt(n.mod,e)}if(u){r+=u.add(i,e)}else{if(typeof e=="string"){e="'"+e+"'"}r+=e}})}var t=function(e){return n.op.replace("?",function(){return e})};var o=f.change("getSQLField",i.field,i);var a=o+" "+t(r);l.push(f.change("ruleToSQL",a,i,r,t))}});var t=l.join(" "+e.condition+c);return f.change("groupToSQL",t,e)}(e);if(u){return{sql:i,params:u.run()}}else{return{sql:i}}},getRulesFromSQL:function(e,p){if(!("SQLParser"in window)){m.error("MissingLibrary","SQLParser is required to parse SQL queries. Get it here https://github.com/mistic100/sql-parser")}var h=this;if(typeof e=="string"){e={sql:e}}if(p===true)p="question_mark";if(typeof p=="string"){var t=o(p);p=this.settings.sqlRuleStatement[t[1]](e.params,t[2])}if(p){e.sql=p.esc(e.sql)}if(e.sql.toUpperCase().indexOf("SELECT")!==0){e.sql="SELECT * FROM table WHERE "+e.sql}var i=SQLParser.parse(e.sql);if(!i.where){m.error("SQLParse","No WHERE clause found")}var n=h.change("parseSQLNode",i.where.conditions);if("rules"in n&&"condition"in n){return n}if("id"in n&&"operator"in n&&"value"in n){return{condition:this.settings.default_condition,rules:[n]}}var r=h.change("sqlToGroup",{condition:this.settings.default_condition,rules:[]},n);var g=r;(function e(t,i){if(t===null){return}t=h.change("parseSQLNode",t);if("rules"in t&&"condition"in t){g.rules.push(t);return}if("id"in t&&"operator"in t&&"value"in t){g.rules.push(t);return}if(!("left"in t)||!("right"in t)||!("operation"in t)){m.error("SQLParse","Unable to parse WHERE clause")}if(["AND","OR"].indexOf(t.operation.toUpperCase())!==-1){var n=h.change("sqlGroupsDistinct",i>0&&g.condition!=t.operation.toUpperCase(),g,t,i);if(n){var r=h.change("sqlToGroup",{condition:h.settings.default_condition,rules:[]},t);g.rules.push(r);g=r}g.condition=t.operation.toUpperCase();i++;var o=g;e(t.left,i);g=o;e(t.right,i)}else{if(v.isPlainObject(t.right.value)){m.error("SQLParse","Value format not supported for {0}.",t.left.value)}var a;if(v.isArray(t.right.value)){a=t.right.value.map(function(e){return e.value})}else{a=t.right.value}if(p){if(v.isArray(a)){a=a.map(p.parse)}else{a=p.parse(a)}}var s=t.operation.toUpperCase();if(s=="<>"){s="!="}var l=h.settings.sqlRuleOperator[s];if(l===undefined){m.error("UndefinedSQLOperator",'Invalid SQL operation "{0}".',t.operation)}var u=l.call(this,a,t.operation);var c;if("values"in t.left){c=t.left.values.join(".")}else if("value"in t.left){c=t.left.value}else{m.error("SQLParse","Cannot find field name in {0}",JSON.stringify(t.left))}var d=h.getSQLFieldID(c,a);var f=h.change("sqlToRule",{id:d,field:c,operator:u.op,value:u.val},t);g.rules.push(f)}})(n,0);return r},setRulesFromSQL:function(e,t){this.setRules(this.getRulesFromSQL(e,t))},getSQLFieldID:function(t,e){var i=this.filters.filter(function(e){return e.field.toLowerCase()===t.toLowerCase()});var n;if(i.length===1){n=i[0].id}else{n=this.change("getSQLFieldID",t,e)}return n}});function o(e){var t=e.match(/(question_mark|numbered|named)(?:\((.)\))?/);if(!t)t=[null,"question_mark",undefined];return t}f.define("unique-filter",function(){this.status.used_filters={};this.on("afterUpdateRuleFilter",this.updateDisabledFilters);this.on("afterDeleteRule",this.updateDisabledFilters);this.on("afterCreateRuleFilters",this.applyDisabledFilters);this.on("afterReset",this.clearDisabledFilters);this.on("afterClear",this.clearDisabledFilters);this.on("getDefaultFilter.filter",function(t,i){var n=t.builder;n.updateDisabledFilters();if(t.value.id in n.status.used_filters){var e=n.filters.some(function(e){if(!(e.id in n.status.used_filters)||n.status.used_filters[e.id].length>0&&n.status.used_filters[e.id].indexOf(i.parent)===-1){t.value=e;return true}});if(!e){m.error(false,"UniqueFilter","No more non-unique filters available");t.value=undefined}}})});f.extend({updateDisabledFilters:function(e){var i=e?e.builder:this;i.status.used_filters={};if(!i.model){return}(function t(e){e.each(function(e){if(e.filter&&e.filter.unique){if(!i.status.used_filters[e.filter.id]){i.status.used_filters[e.filter.id]=[]}if(e.filter.unique=="group"){i.status.used_filters[e.filter.id].push(e.parent)}}},function(e){t(e)})})(i.model.root);i.applyDisabledFilters(e)},clearDisabledFilters:function(e){var t=e?e.builder:this;t.status.used_filters={};t.applyDisabledFilters(e)},applyDisabledFilters:function(e){var i=e?e.builder:this;i.$el.find(f.selectors.filter_container+" option").prop("disabled",false);v.each(i.status.used_filters,function(t,e){if(e.length===0){i.$el.find(f.selectors.filter_container+' option[value="'+t+'"]:not(:selected)').prop("disabled",true)}else{e.forEach(function(e){e.each(function(e){e.$el.find(f.selectors.filter_container+' option[value="'+t+'"]:not(:selected)').prop("disabled",true)})})}});if(i.settings.plugins&&i.settings.plugins["bt-selectpicker"]){i.$el.find(f.selectors.rule_filter).selectpicker("render")}}});f.regional["en"]={__locale:"English (en)",__author:'Damien "Mistic" Sorel, http://www.strangeplanet.fr',add_rule:t("querybuilder.common.add_rule"),add_group:t("querybuilder.common.add_group"),delete_rule:t("querybuilder.common.delete_rule"),delete_group:t("querybuilder.common.delete_group"),conditions:{AND:t("querybuilder.conditions.AND"),OR:t("querybuilder.conditions.OR")},operators:{equal:t("querybuilder.operators.equal"),not_equal:t("querybuilder.operators.not_equal"),in:t("querybuilder.operators.in"),not_in:t("querybuilder.operators.not_in"),less:t("querybuilder.operators.less"),less_or_equal:t("querybuilder.operators.less_or_equal"),greater:t("querybuilder.operators.greater"),greater_or_equal:t("querybuilder.operators.greater_or_equal"),between:t("querybuilder.operators.between"),not_between:t("querybuilder.operators.not_between"),begins_with:t("querybuilder.operators.begins_with"),not_begins_with:t("querybuilder.operators.not_begins_with"),contains:t("querybuilder.operators.contains"),not_contains:t("querybuilder.operators.not_contains"),ends_with:t("querybuilder.operators.ends_with"),not_ends_with:t("querybuilder.operators.not_ends_with"),is_empty:t("querybuilder.operators.is_empty"),is_not_empty:t("querybuilder.operators.is_not_empty"),is_null:t("querybuilder.operators.is_null"),is_not_null:t("querybuilder.operators.is_not_null"),before:t("querybuilder.operators.before"),after:t("querybuilder.operators.after"),like:"Like",not_like:"Not like"},errors:{no_filter:t("querybuilder.errors.no_filter"),empty_group:t("querybuilder.errors.empty_group"),radio_empty:t("querybuilder.errors.radio_empty"),checkbox_empty:t("querybuilder.errors.checkbox_empty"),select_empty:t("querybuilder.errors.select_empty"),string_empty:t("querybuilder.errors.string_empty"),string_exceed_min_length:t("querybuilder.errors.string_exceed_min_length"),string_exceed_max_length:t("querybuilder.errors.string_exceed_max_length"),string_invalid_format:t("querybuilder.errors.string_invalid_format"),number_nan:t("querybuilder.errors.number_nan"),number_not_integer:t("querybuilder.errors.number_not_integer"),number_not_double:t("querybuilder.errors.number_not_double"),number_exceed_min:t("querybuilder.errors.number_exceed_min"),number_exceed_max:t("querybuilder.errors.number_exceed_max"),number_wrong_step:t("querybuilder.errors.number_wrong_step"),number_between_invalid:"Invalid values, {0} is greater than {1}",datetime_empty:t("querybuilder.errors.datetime_empty"),datetime_invalid:t("querybuilder.errors.datetime_invalid"),datetime_exceed_min:t("querybuilder.errors.datetime_exceed_min"),datetime_exceed_max:t("querybuilder.errors.datetime_exceed_max"),datetime_between_invalid:"Invalid values, {0} is greater than {1}",boolean_not_valid:t("querybuilder.errors.boolean_not_valid"),operator_not_multiple:t("querybuilder.errors.operator_not_multiple")},invert:t("querybuilder.common.invert"),NOT:"NOT"};f.defaults({lang_code:"en"});return f});(function(){var n;n=function(e,r,t){var o=this;r=_.bind(r,this);if(t&&t.exists()){t=t.first()}else{t=$(document)}_.each(e,function(e,n){t.on(n,e,function(e,t){o.event=e;o.trigger=n;o.el=$(this);o.data=t;r();var i=$(o.event.target);if(i.is("a")||i.parent("a").length===1){o.event.preventDefault()}})})};n.new=function(e,t,i){new n(e,t,i)};n.translate=function(e){var i={};_.each(e,function(e,t){e=e.split(/,\s?/);e=_.map(e,function(e){return'[data-action="'+e+'"]'}).join(", ");i[t]=e});return i};AGN.Lib.Action=n})();(function(){function a(e,i,n){var r=AGN.Lib.Storage.get("autosave#"+e);if(r){var o=i?i(r.values,r.timestamp):r.values;if(o){var a=AGN.Lib.Template.text("autosave-restore",{modalClass:"",title:t("autosave.confirm.title"),content:t("autosave.confirm.question",new Date(r.timestamp).toLocaleString(window.adminLocale,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),negative:t("autosave.discard"),positive:t("autosave.restore")});var s=AGN.Lib.Confirm.create(a).done(function(){n(o===true?r.values:o,r.timestamp);AGN.Lib.Messages(t("autosave.success.title"),t("autosave.success.message"),"success")}).always(function(){AGN.Lib.Storage.delete("autosave#"+e)});return s.promise()}else{AGN.Lib.Storage.delete("autosave#"+e)}}return $.Deferred().reject().promise()}function s(t,i,e){var n=function(){var e=i();if(e){AGN.Lib.Storage.set("autosave#"+t,{timestamp:(new Date).getTime(),values:e})}return e!==false};if(e>0){var r=setInterval(function(){n()||clearInterval(r)},e*1e3)}var o=function(){n()||$(document).unbind("ajax:unauthorized",o)};$(document).on("ajax:unauthorized",o)}AGN.Lib.AutoSave={initialize:function(e,t,i,n,r){var o=a(e,i,n);s(e,t,r);return o}}})();(function(){AGN.Lib.Breadcrumbs={truncate:function(e){$.each(e.find(".breadcrumbs.js-ellipsis"),function(e,t){var i=$(t);var n=i.children("li");i.find("*").removeClass("breadcrumb-element-small");n.removeClass("abbreviated");n.css({"min-width":"","max-width":""});n.show();if(h(i)){return}i.find("*").addClass("breadcrumb-element-small");if(h(i)){return}var l=[];var u=i.parent().width();$.each(n,function(e,t){var i=$(t);if(i.hasClass("js-ellipsis")){var n=i.html();i.html("&hellip;");var r=i.outerWidth(true);i.html(n);var o=i.outerWidth(true);var a=r<o?r:o;i.addClass("abbreviated");var s=i.outerWidth(true);i.removeClass("abbreviated");l.unshift({$item:i,width:o,minimumWidth:a+1,minimumWidthAbbreviated:a+(s-o)+1})}else{u-=i.outerWidth(true)}});var r=l.length-1;for(var o=0;o<=r;o++){var a=l[o];var s=a.$item;a.width=s.outerWidth(true);if(a.width>u){var c;if(o==r){c=a.minimumWidth}else{s.addClass("abbreviated");c=a.minimumWidthAbbreviated;for(var d=o+1;d<=r;d++){l[d].$item.hide()}}if(c>u&&o>0){s.hide();var f=l[o-1];var p=f.$item;p.addClass("abbreviated");if(p.outerWidth(true)-f.width>u){p.css("max-width",f.width+u)}}else{s.css("max-width",u)}break}else{u-=a.width}}})}};function h(e){var t=e.parent().width();var i=0;e.children("li").each(function(){i+=$(this).outerWidth(true)});return Math.floor(i)<=Math.floor(t)}})();(function(){function e(e,t){try{navigator.clipboard.writeText(e).then(function(){t(true)},function(){t(false)})}catch(e){console.warn(e);t(false)}}function n(e,t){var i=true;try{var n=$("<input>");$("body").append(n);n.val(e);n.select();document.execCommand("copy");n.remove()}catch(e){console.warn(e);i=false}if(t){t(i)}}AGN.Lib.Clipboard={set:function(t,i){e(t,function(e){if(e){if(i){i(t,true)}}else{n(t,function(e){if(i){i(t,e)}})}})}}})();(function(){var o;o=function(e,t){this.$modal=e;this.deferred=t||$.Deferred()};o.get=function(e){var t=o.getWrapper(e);return t.data("_confirm")};o.create=function(e,t){var i,n=AGN.Lib.Modal.create(e);i=new o(n,t);n.data("_confirm",i);return i.promise()};o.createFromTemplate=function(e,t,i){var n,r=AGN.Lib.Modal.createFromTemplate(e,t);n=new o(r,i);r.data("_confirm",n);return n.promise()};o.request=function(e){var r=$.Deferred();var t;if(_.isString(e)){t=$.get(e)}else{t=e}t.done(function(e){var t=$(e),i=t.all(".modal");if(i.length===1){var n=new o(i,r);i.data("_confirm",n);AGN.Lib.Modal.create(i)}else{AGN.Lib.Page.render(e);r.reject()}}).fail(function(){r.reject()});return r.promise()};o.getWrapper=function(e){var t;t=$(e.data("confirm-target"));if(t.length==0){t=e.closest(".modal")}return t};o.prototype.promise=function(){return this.deferred.promise()};o.prototype.positive=function(e){this.deferred.resolve(e);this.$modal.modal("hide");this.$modal.remove()};o.prototype.negative=function(e){this.deferred.reject(e);this.$modal.modal("hide");this.$modal.remove()};AGN.Lib.Confirm=o})();(function(){AGN.Lib.ContextMenu={create:function(e){$.each(e,function(e,i){$.contextMenu({selector:e,build:function(e,t){return n(i,e,t)}})})}};function n(e,n,r){if(e.shown===false||_.isFunction(e.shown)&&e.shown(n,r)===false){return false}var t=e.items;if(_.isFunction(t)){t=t(n,r)}var o={};var a=0;$.each(t,function(e,i){if(!_.isFunction(i.shown)||i.shown(n,r)!==false){var t=o[e]={name:i.name,icon:i.icon};if(_.isFunction(i.disabled)){t.disabled=i.disabled(n,r)===true}else if(i.disabled===true){t.disabled=true}if(_.isFunction(i.clicked)){t.callback=function(e,t){i.clicked(n,e,t)}}a++}});return a?{items:o}:false}})();(function(){var e;e=function(e){e=_.bind(e,this);e()};e.prototype.addAction=function(e,t){AGN.Lib.Action.new(AGN.Lib.Action.translate(e),t)};e.prototype.addInitializer=function(e,t){AGN.Lib.CoreInitializer.new(e,t)};e.prototype.addDomInitializer=function(e,t){AGN.Lib.DomInitializer.new(e,t)};e.prototype.runInitializer=function(e){AGN.Lib.CoreInitializer.run(e)};e.new=function(e,t){AGN.Opt.Controllers[e]=t};e.init=function(e){if(!e){e=$(document)}e.all("[data-controller]").each(function(){var e=$(this),t=AGN.Opt.Controllers[e.data("controller")];if(t){new AGN.Lib.Controller(t);AGN.Opt.Controllers[e.data("controller")]=undefined}})};AGN.Lib.Controller=e})();(function(){var a={};function e(e){var t=null;var i;if(arguments.length>2){t=arguments[1];i=arguments[2]}else{i=arguments[1]}if(_.isFunction(i)){a["key#"+e]={name:e,handler:i,dependencies:t}}else{console.error("Handler must be a function")}}function s(n,e,r,o){var t="key#"+e.name;if(r[t]){return}if(Array.isArray(e.dependencies)&&e.dependencies.length){o.push(e.name);e.dependencies.forEach(function(e){var t=a["key#"+e];if(t){if(o.includes(e)){var i=o.map(function(e){return"`"+e+"`"}).join(" => ");console.error("Cyclic initializer dependency detected ("+i+" => `"+e+"`)");return}s(n,t,r,o)}else{console.error("Unknown initializer dependency: `"+name+"`")}});o.pop()}try{e.handler.call(e.handler,n)}catch(e){console.error(e)}r[t]=true}function t(i){var n={};var r=[];$.each(a,function(e,t){s(i,t,n,r)})}function n(e,t){if(Array.isArray(e)){e.forEach(function(e){n(e,t)})}else{var i=a["key#"+e];if(i){i.handler.call(i.handler,t);return true}else{console.error("Unknown initializer: `"+e+"`");return false}}}AGN.Lib.CoreInitializer={autorun:t,run:n,new:e}})();(function(){function r(){if(o()){return AGN.Lib.Storage.readCookie(window.csrfCookieName)}return""}function e(){return window.csrfParameterName}function o(){return window.csrfHeaderName&&e()&&window.csrfCookieName}function t(e,t){if(o()&&t!=="GET"){const i=r();e.setRequestHeader(window.csrfHeaderName,i)}}function i(e,t){if(!o()){return e}if(!e){e=$(document)}else if(!(e instanceof $)){e=$("<div>").append(e)}const i=r();const n=e.find('input[name="'+window.csrfParameterName+'"]');_.each(n,function(e){$(e).val(i)});if(t){return e.html()}}AGN.Lib.CSRF={readActualToken:r,isProtectionEnabled:o,setTokenToReqHeader:t,getParameterName:e,updateTokenInDOM:i}})();(function(){var r={};r.get=function(e){var t=e.data("provider"),i=e.data("provider-src"),n;switch(t){case"opt":n=r.opt(i);break;case"remote":n=r.remote(i);break;default:break}return n};r.opt=function(e){var t=$.Deferred();if(AGN.Opt[e]){setTimeout(function(){t.resolve(AGN.Opt[e])},100)}else{setTimeout(function(){t.reject()},100)}return t};r.remote=function(e){return $.get(e)};AGN.Lib.DataProvider=r})();(function(){var k;k={MONTH_NAMES:["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DAY_NAMES:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"],LZ:function(e){return(e<0||e>9?"":"0")+e},compareDates:function(e,t,i,n){var r=k.parseFormat(e,t);var o=k.parseFormat(i,n);if(r==0||o==0)return-1;else if(r>o)return 1;return 0},format:function(e,t){t=t+"";var i="";var n=0;var r="";var o="";var a=e.getYear()+"";var s=e.getMonth()+1;var l=e.getDate();var u=e.getDay();var c=e.getHours();var d=e.getMinutes();var f=e.getSeconds();var p,h,g,v,m,y,b,_,w,C,A,c,E,x,T,S;var D=new Object;if(a.length<4){a=""+(a-0+1900)}D["y"]=""+a;D["yyyy"]=a;D["yy"]=a.substring(2,4);D["M"]=s;D["MM"]=k.LZ(s);D["MMM"]=k.MONTH_NAMES[s-1];D["NNN"]=k.MONTH_NAMES[s+11];D["d"]=l;D["dd"]=k.LZ(l);D["E"]=k.DAY_NAMES[u+7];D["EE"]=k.DAY_NAMES[u];D["H"]=c;D["HH"]=k.LZ(c);if(c==0){D["h"]=12}else if(c>12){D["h"]=c-12}else{D["h"]=c}D["hh"]=k.LZ(D["h"]);if(c>11){D["K"]=c-12}else{D["K"]=c}D["k"]=c+1;D["KK"]=k.LZ(D["K"]);D["kk"]=k.LZ(D["k"]);if(c>11){D["a"]="PM"}else{D["a"]="AM"}D["m"]=d;D["mm"]=k.LZ(d);D["s"]=f;D["ss"]=k.LZ(f);while(n<t.length){r=t.charAt(n);o="";while(t.charAt(n)==r&&n<t.length)o+=t.charAt(n++);if(D[o]!=null)i+=D[o];else i+=o}return i},_isInteger:function(e){var t="1234567890";for(var i=0;i<e.length;i++)if(t.indexOf(e.charAt(i))==-1)return false;return true},_getInt:function(e,t,i,n){for(var r=n;r>=i;r--){var o=e.substring(t,t+r);if(o.length<i)return null;if(k._isInteger(o))return o}return null},parseFormat:function(e,t){e=e+"";t=t+"";var i=0;var n=0;var r="";var o="";var a="";var s,l;var u=new Date;var c=u.getYear();var d=u.getMonth()+1;var f=1;var p=u.getHours();var h=u.getMinutes();var g=u.getSeconds();var v="";while(n<t.length){r=t.charAt(n);o="";while(t.charAt(n)==r&&n<t.length)o+=t.charAt(n++);if(o=="yyyy"||o=="yy"||o=="y"){if(o=="yyyy")s=4;l=4;if(o=="yy")s=2;l=2;if(o=="y")s=2;l=4;c=k._getInt(e,i,s,l);if(c==null)return 0;i+=c.length;if(c.length==2){if(c>70)c=1900+(c-0);else c=2e3+(c-0)}}else if(o=="MMM"||o=="NNN"){d=0;for(var m=0;m<k.MONTH_NAMES.length;m++){var y=k.MONTH_NAMES[m];if(e.substring(i,i+y.length).toLowerCase()==y.toLowerCase()){if(o=="MMM"||o=="NNN"&&m>11){d=m+1;if(d>12)d-=12;i+=y.length;break}}}if(d<1||d>12)return 0}else if(o=="EE"||o=="E"){for(var m=0;m<k.DAY_NAMES.length;m++){var b=k.DAY_NAMES[m];if(e.substring(i,i+b.length).toLowerCase()==b.toLowerCase()){i+=b.length;break}}}else if(o=="MM"||o=="M"){d=k._getInt(e,i,o.length,2);if(d==null||d<1||d>12)return 0;i+=d.length}else if(o=="dd"||o=="d"){f=k._getInt(e,i,o.length,2);if(f==null||f<1||f>31)return 0;i+=f.length}else if(o=="hh"||o=="h"){p=k._getInt(e,i,o.length,2);if(p==null||p<1||p>12)return 0;i+=p.length}else if(o=="HH"||o=="H"){p=k._getInt(e,i,o.length,2);if(p==null||p<0||p>23)return 0;i+=p.length}else if(o=="KK"||o=="K"){p=k._getInt(e,i,o.length,2);if(p==null||p<0||p>11)return 0;i+=p.length}else if(o=="kk"||o=="k"){p=k._getInt(e,i,o.length,2);if(p==null||p<1||p>24)return 0;i+=p.length;p--}else if(o=="mm"||o=="m"){h=k._getInt(e,i,o.length,2);if(h==null||h<0||h>59)return 0;i+=h.length}else if(o=="ss"||o=="s"){g=k._getInt(e,i,o.length,2);if(g==null||g<0||g>59)return 0;i+=g.length}else if(o=="a"){if(e.substring(i,i+2).toLowerCase()=="am")v="AM";else if(e.substring(i,i+2).toLowerCase()=="pm")v="PM";else return 0;i+=2}else{if(e.substring(i,i+o.length)!=o)return 0;else i+=o.length}}if(i!=e.length)return 0;if(d==2){if(c%4==0&&c%100!=0||c%400==0){if(f>29)return 0}else if(f>28){return 0}}if(d==4||d==6||d==9||d==11)if(f>30)return 0;if(p<12&&v=="PM")p=p-0+12;else if(p>11&&v=="AM")p-=12;var _=new Date(c,d-1,f,p,h,g);return _},parse:function(e,t){if(t){return k.parseFormat(e,t)}else{var i=arguments.length==2?arguments[1]:false;var n=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");var r=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");var o=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var a=[n,i?o:r,i?r:o];var s=null;for(var l=0;l<a.length;l++){var u=a[l];for(var c=0;c<u.length;c++){s=k.parseFormat(e,u[c]);if(s!=0)return new Date(s)}}return null}},toArray:function(e,t){if(e&&e.getMonth){return[e.getFullYear(),e.getMonth(),e.getDate()]}else{return t}}};AGN.Lib.DateFormat=k})();(function(){var r='script[type="application/json"]';var o="config:";var a={};function s(e,t){this.el=e;if(e.is(r)){this.config=e.json()}else{var i=e.find("script#"+CSS.escape(o+t));if(i.exists()){var n=i.attr("type");if(!n||n==="application/json"){this.config=i.json()}else{console.error("Unexpected config script type: `"+n+"`")}}}}s.prototype.addAction=function(e,t){AGN.Lib.Action.new(AGN.Lib.Action.translate(e),t,this.el)};function e(t){var e=t;if(!e){e=$(document)}e.all("[data-initializer]").each(function(){var e=$(this);n(e.data("initializer"),e,t)})}function n(e,t,i){var n=a["key#"+e];if(n){var r=n.call(new s(t,e),t,i);if(r===false){a["key#"+e]=undefined}return true}else{return false}}function t(e,t){if(a["key#"+e]){var i=t;if(!i){i=$(document)}i.all('[data-initializer="'+CSS.escape(e)+'"]').each(function(){n(e,$(this),t)})}}function i(e,t){if(_.isFunction(t)){a["key#"+e]=t}else{console.error("Handler must be a function")}}AGN.Lib.DomInitializer={autorun:e,run:n,try:t,new:i}})();(function(){var t,i,n,r,o;t=function(e){var t=this,i,n,r,o;this.el=$(e);o=!!this.el.attr("readonly");this.isFullHeight=!!this.el.data("full-height-editor");this.height=parseInt(this.el.attr("rows")||15)*15;i=this.el.attr("id")+"Editor";n=$("#"+i);if(n.length===1){r=i;var a=n.data("full-height-editor");n.css("height",a?"100%":this.height+"px")}else{r=_.uniqueId("Editor");n=$('<div id="'+r+'" class="form-control"></div>');n.css("height",this.isFullHeight?"100%":this.height+"px");n.insertAfter($(this.el))}this.el.hide();this.editor=ace.edit(r);this.editor.setReadOnly(o);this.editor.getSession().setValue(this.el.val());this.editor.getSession().on("change",function(e){t.el.val(t.editor.getSession().getValue());t.el.trigger("editor:change")});this.langTools=ace.require("ace/ext/language_tools");this.decorate();if(this.el.hasClass("js-editor-validate")){this.editor.getSession().setUseWorker(true)}if(this.el.hasClass("js-editor-wrap")){this.editor.getSession().setUseWrapMode(true)}t.el.trigger("editor:create")};t.get=function(e){var t=e.data("_editor");if(t){return t}if(e.hasClass("js-editor")){t=new i(e)}else if(e.hasClass("js-editor-text")){t=new n(e)}else if(e.hasClass("js-editor-eql")){t=new r(e)}else if(e.hasClass("js-editor-css")){t=new o(e)}e.data("_editor",t);return t};t.all=function(){return _.map($(".js-editor, .js-editor-text, .js-editor-eql, .js-editor-css"),function(e){return t.get($(e))})};t.prototype.decorate=function(){if($("body").hasClass("dark-theme")){this.editor.setTheme("ace/theme/idle_fingers")}else{this.editor.setTheme("ace/theme/chrome")}this.editor.session.setUseWrapMode(true);this.editor.session.setWrapLimitRange(null,null);this.editor.setBehavioursEnabled(true);this.editor.setShowPrintMargin(false);this.editor.session.setUseSoftTabs(true);this.editor.getSession().setUseWorker(false);this.editor.setOptions({enableBasicAutocompletion:true,enableSnippets:true,enableLiveAutocompletion:true,minLines:20})};t.prototype.resize=function(){this.editor.resize()};t.prototype.val=function(e){if(typeof e!=="undefined"){this.editor.getSession().setValue(e)}else{return this.editor.getSession().getValue()}};i=function(e){t.apply(this,e)};i.prototype=Object.create(t.prototype);i.prototype.constructor=i;i.prototype.decorate=function(){t.prototype.decorate.call(this);this.editor.getSession().setMode("ace/mode/html")};n=function(e){t.apply(this,e)};n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.prototype.decorate=function(){if($("body").hasClass("dark-theme")){this.editor.setTheme("ace/theme/idle_fingers")}else{this.editor.setTheme("ace/theme/chrome")}this.editor.session.setUseWrapMode(false);this.editor.session.setWrapLimitRange(null,null);this.editor.setBehavioursEnabled(true);this.editor.setShowPrintMargin(false);this.editor.session.setUseSoftTabs(true);this.editor.getSession().setUseWorker(false);this.editor.setOptions({enableBasicAutocompletion:false,enableSnippets:false,enableLiveAutocompletion:false,minLines:20});this.editor.getSession().setMode("ace/mode/text")};r=function(e){t.apply(this,e)};r.prototype=Object.create(t.prototype);r.prototype.constructor=r;r.prototype.decorate=function(){if($("body").hasClass("dark-theme")){this.editor.setTheme("ace/theme/idle_fingers")}else{this.editor.setTheme("ace/theme/chrome")}this.editor.session.setUseWrapMode(false);this.editor.session.setWrapLimitRange(null,null);this.editor.setBehavioursEnabled(true);this.editor.setShowPrintMargin(false);this.editor.session.setUseSoftTabs(true);this.editor.getSession().setUseWorker(false);this.langTools.setCompleters([this.langTools.keyWordCompleter,this.langTools.snippetCompleter]);this.editor.setOptions({enableBasicAutocompletion:true,enableSnippets:false,enableLiveAutocompletion:true,minLines:20});ace.config.loadModule("ace/ext/eql_constructions_tokens");ace.config.loadModule("ace/ext/eql_constructions_basic");ace.config.loadModule("ace/ext/eql_constructions_extended");this.editor.getSession().setMode("ace/mode/eql")};o=function(e){t.apply(this,e)};o.prototype=Object.create(t.prototype);o.prototype.constructor=o;o.prototype.decorate=function(){t.prototype.decorate.call(this);this.editor.getSession().setMode("ace/mode/css")};AGN.Lib.Editor=t;AGN.Lib.EditorHtml=i;AGN.Lib.EditorText=n;AGN.Lib.EditorEql=r;AGN.Lib.EditorCss=o})();(function(){var e;e=function(e){var t=$(e),i=t.find("[data-equalizer-watch]:visible"),n=t.data("equalizer"),r=parseInt(t.data("equalizer-min"))||0,o=parseInt(t.data("equalizer-max"))||1e4,a,s;if(i.length==0){return}if(i.length==1&&n=="min"){o=r}i.css({height:"",overflow:"","overflow-y":""});a=_.map(i,function(e){return $(e).outerHeight(false)});if(n=="min"){s=Math.min.apply(null,a)}else{s=Math.max.apply(null,a)}if(s<r){s=r}if(s>o){s=o}i.css({height:s,overflow:"hidden","overflow-y":"auto"})};AGN.Lib.Equalizer=e})();(function(){function r(){}r.defaults=function(){return[{active:false,time:""}]};r.create=function(e,t){e=$.extend(r.defaults()[0],e);if(t){return AGN.Lib.Template.dom("schedule-extended-time-wrapper",{scheduleElement:e})}else{return AGN.Lib.Template.dom("schedule-time-wrapper",{scheduleElement:e})}};r.get=function(e){return e.closest(".schedule-time-wrapper")};function a(e){var t=this;if(!e.exists()){e=a.create({})}t.$rowWrapper=e}a.prototype.toJson=function(){var e=this;var t=e.$rowWrapper.find("select[name=dayOfTheWeek]").val();var i=_.map(e.$rowWrapper.find(".schedule-time-wrapper"),function(e){var t=$(e).find(".time-checkbox");var i=!t.is(":disabled")&&t.is(":checked"),n=$(e).find(".time-input").val();return{active:i,time:n}});var n=e.$rowWrapper.find(".hour-checkbox");var r={active:n.is(":checked")&&!n.is(":disabled"),interval:e.$rowWrapper.find("select.hour-select").val()};return $.extend(a.defaults(),{weekDay:t,scheduledTime:i,scheduledInterval:r})};a.prototype.addSchedule=function(e){var t=this,i=t.$rowWrapper;var n=r.create(e,true);i.find(".schedule-settings-wrapper").append(n);AGN.runAll(n);i.trigger("row:add-schedule")};a.prototype.removeSchedule=function(e){r.get(e).remove();this.$rowWrapper.trigger("row:remove-schedule")};a.prototype.hourCheckboxToggle=function(e){var t=e.attr("disables"),i=e.is(":checked");this.$rowWrapper.find(t).prop("disabled",i)};a.prototype.timeCheckboxToggle=function(e){var t=e.attr("disables"),i=e.is(":checked"),n=this.$rowWrapper.find(".time-checkbox"),r=this.$rowWrapper.find(".hour-checkbox"),o;for(var a=0;a<n.length;a++){var s=n[a];if(e[0]!==s&&$(s).is(":checked")){o=true;break}}if(!r.is(":disabled")||!o){this.$rowWrapper.find(t).prop("disabled",i)}};a.prototype.getAllScheduleTimes=function(){var e=this.toJson();var t=[];e.scheduledTime.forEach(function(e){if(e.active){t.push(parseInt(e.time.replace(":","")))}});return t};a.prototype.isValidTimeIntervals=function(){var e=new i;var t=this.getAllScheduleTimes();return e.valid(t)};a.prototype.showTimeScheduleErrors=function(e){var t=this.$rowWrapper.find(".schedule-time-wrapper");var i=$('<div class="form-control-feedback-message js-form-error-msg">'+e+"</div>");_.each(t,function(e){var t=$(e);if(!t.find(".js-form-error-msg").exists()){t.find(".time-input").after(i.clone());t.addClass("has-alert has-feedback js-form-error")}})};a.prototype.hideTimeScheduleErrors=function(){var e=this.$rowWrapper.find(".schedule-time-wrapper");e.find(".js-form-error-msg").remove();e.removeClass("has-alert has-feedback js-form-error")};a.defaults=function(){return{weekDay:"",scheduledInterval:{active:false,interval:""},scheduledTime:[{active:false,time:""}]}};a.get=function(e){var t;if(e.hasClass("tr.l-time-schedule-row")){t=e}else{t=e.closest("tr.l-time-schedule-row")}return new a(t)};a.create=function(e){e=$.extend(a.defaults(),e);var r=AGN.Lib.Template.dom("schedule-day-row",{entry:e});var o=new a(r);r.on("row:add-schedule",function(){var e=r.find(".schedule-time-wrapper");var t=e.length>1;r.find('[data-action="remove-schedule"]').closest(".input-group-addon").toggleClass("hidden",!t);r.find(".interval-reminder").toggleClass("hidden",!t);var i=r.find(".hour-checkbox");o.hourCheckboxToggle(i);var n=r.find(".time-checkbox");o.timeCheckboxToggle(n)});r.on("row:remove-schedule",function(){var e=r.find(".schedule-time-wrapper");var t=e.length>1;r.find('[data-action="remove-schedule"]').closest(".input-group-addon").toggleClass("hidden",!t);r.find(".interval-reminder").toggleClass("hidden",!t);if(e.length===0){o.addSchedule()}});return r};a.deserialize=function(e){return a.create(e)};function o(e){var t=this;if(!e.exists()){e=o.create({})}t.$rowWrapper=e}o.prototype.toJson=function(){var e=this;var t=e.$rowWrapper.find("input[name=type]:checked").val();var i=undefined;var n=undefined;if(t=="TYPE_MONTHLY"){n=e.$rowWrapper.find("select[name=dayOfTheMonth]").val()}else{i=e.$rowWrapper.find("select[name=dayOfTheWeek]").val()}var r=_.map(e.$rowWrapper.find(".schedule-time-wrapper"),function(e){var t=$(e).find(".time-checkbox");var i=true;if(t.exists()){i=!t.is(":disabled")&&t.is(":checked")}var n=$(e).find(".time-input").val();return{active:i,time:n}});return $.extend(o.defaults(),{type:t,weekDay:i,monthDay:n,scheduledTime:r})};o.prototype.addSchedule=function(e){var t=this,i=t.$rowWrapper;var n=r.create(e);i.find(".schedule-settings-wrapper").append(n);AGN.runAll(n);i.trigger("row:add-schedule")};o.prototype.removeSchedule=function(e){r.get(e).remove();this.$rowWrapper.trigger("row:remove-schedule")};o.defaults=function(){return{type:"1",weekDay:"",monthDay:"",scheduledTime:[{active:false,time:""}]}};o.deserialize=function(e,t){var i=$.extend(o.defaults(),e);i.type=n(e.type);i.monthDay=s(e.monthDay);return o.create(i)};function n(e){switch(e){case"TYPE_MONTHLY":return 2;case"TYPE_WEEKLY":default:return 1}}function s(e){switch(e){case"TYPE_MONTHLY_FIRST":return 1;case"TYPE_MONTHLY_15TH":return 15;case"TYPE_MONTHLY_LAST":return 99;default:return 1}}o.get=function(e){var t;if(e.hasClass("tr.l-time-schedule-row")){t=e}else{t=e.closest("tr.l-time-schedule-row")}return new o(t)};o.create=function(e){e=$.extend(o.defaults(),e);var t=AGN.Lib.Template.dom("schedule-period-row",{entry:e});var i=new o(t);t.on("row:add-schedule",function(){var e=t.find(".schedule-time-wrapper");if(e.length>1){t.find('[data-action="remove-schedule"]').closest(".input-group-addon").removeClass("hidden")}});t.on("row:remove-schedule",function(){var e=t.find(".schedule-time-wrapper");if(e.length<2){t.find('[data-action="remove-schedule"]').closest(".input-group-addon").addClass("hidden")}if(e.length===0){i.addSchedule()}});return t};function e(e){var t=this;t.$container=e.find("table tbody");t.$container.on("scheduler:add-day",function(){var e=t.$container.find(".l-time-schedule-row");if(e.length>1){t.$container.find('[data-action="remove-day"]').removeClass("hidden")}});t.$container.on("scheduler:remove-day",function(){var e=t.$container.find(".l-time-schedule-row");if(e.length<=1){e.find('[data-action="remove-day"]').addClass("hidden")}})}e.prototype.clean=function(){this.$container.find("tr.l-time-schedule-row").remove()};e.prototype.deleteRow=function(e){this.deleteRowByNeedle(e.$rowWrapper)};e.prototype.deleteRowByNeedle=function(e){this.$container.find(e).remove();this.$container.trigger("scheduler:remove-day")};e.prototype.addRow=function(e){if(e){this.$container.append(e);AGN.runAll(e);this.$container.trigger("scheduler:add-day",e);e.trigger("row:add-schedule",e)}};e.prototype.addEmptyDayRow=function(){this.addRow(a.create())};e.prototype.addEmptyPeriodRow=function(){this.addRow(o.create())};e.prototype.getAllDayRows=function(){var e=this.$container.find("tr.l-time-schedule-row");return _.map(e,function(e){return a.get($(e))})};e.prototype.getAllPeriodRows=function(){var e=this.$container.find("tr.l-time-schedule-row");return _.map(e,function(e){return o.get($(e))})};e.prototype.getSubmissionJson=function(e){var t={};if(e=="day"){t=_.map(this.getAllDayRows(),function(e){return e.toJson()})}else if(e=="period"){t=_.map(this.getAllPeriodRows(),function(e){return e.toJson()})}return JSON.stringify(t)};function i(e){var t=100;if(e){t=Number(e)}this.intervalPad=t}i.prototype.valid=function(e){var t=this.intervalPad;return e.every(i.hasCorrectInterval,t)};i.hasCorrectInterval=function(t,e,i){var n=this;var r=true;i.splice(e,1);i.forEach(function(e){if(Math.abs(e-t)<n){r=false}});return r};AGN.Lib.ScheduleTimeTable=e;AGN.Lib.ScheduleTimeTable.DayRow=a,AGN.Lib.ScheduleTimeTable.PeriodRow=o})();(function(){var a,e,i,n,r,o,s,l,u,c,d;a=function(e){this.el=e};a.create=function(e){var t,i=e.data("field");t=AGN.Opt.Fields[i]||a;return new t(e)};a.prototype.valid=function(){return true};a.prototype.errors=function(){return[]};AGN.Lib.Field=a;e=function(e){a.apply(this,[e]);var t=this.el.find("[data-field-validator]");this.$target=t;this.validatorName=t.data("field-validator");var i=t.data("validator-options");this.options=i?AGN.Lib.Helpers.objFromString(i)||{}:{}};e.prototype=Object.create(a.prototype);e.prototype.constructor=e;e.prototype.valid=function(){var e=AGN.Lib.Validator.get(this.validatorName);if(e&&this.$target.exists()){return e.valid(this.$target,this.options)}else{console.debug("Validator `"+this.validatorName+"` doesn't exist");return true}};e.prototype.errors=function(){var e=AGN.Lib.Validator.get(this.validatorName);if(e&&this.$target.exists()){return e.errors(this.$target,this.options)}else{console.debug("Validator `"+this.validatorName+"` doesn't exist");return[]}};AGN.Lib.CustomField=e;AGN.Opt.Fields["validator"]=e;i=function(e){a.apply(this,[e]);var t=this;this.$source=this.el.find(".js-double-select-trigger");this.$target=this.el.find(".js-double-select-target");this.$source.on("change",function(){t.$target.val([]);t.update()});AGN.Lib.DataProvider.get(e).done(function(e){t.options=e;t.update()})};i.prototype=Object.create(a.prototype);i.prototype.constructor=i;i.prototype.update=function(){var e=this.$source.find("option:selected").val(),t=this.$target.find("option:selected").val(),i='{{ _.forEach(opts, function(name, value) { }}<option value="{{- value }}" {{- ( value == valueSelected ) ? "selected" : "" }}>{{- name }}</option>{{ }); }}';i=_.template(i)({opts:this.options[e],valueSelected:t});this.$target.html(i);AGN.runAll(this.el)};AGN.Lib.DoubleSelectField=i;AGN.Opt.Fields["double-select"]=i;n=function(e){a.apply(this,[e]);var t=this;this.$source=this.el.find("[data-field-vis]");this.$source.on("change",function(){t.update()});t.update()};n.prototype=Object.create(a.prototype);n.prototype.constructor=n;n.prototype._updateSelects=function(){var t=this;_.each(this.$source.filter("select"),function(e){t._toggleFields($(e).find(":selected"))})};n.prototype._updateDefaults=function(){var t=this;_.each(this.el.find("[data-field-vis-default]"),function(e){t._toggleFields($(e))})};n.prototype._updateCheckboxes=function(){var t=this;_.each(this.$source.filter(":checked"),function(e){t._toggleFields($(e))})};n.prototype._toggleFields=function(t){var e,i;if(t.is(":disabled")&&!t.is("[data-field-vis-nondisabled]")){return}e=t.data("field-vis-hide");i=t.data("field-vis-show");_.each(this.el.find(e),function(e){t=$(e);t.all(":input").each(function(){var e=$(this);if(!e.prop("disabled")){e.data("field-disabled",true);e.prop("disabled",true)}});t.hide();if(t.data("select2")){t.select2("container").hide();t.select2("enable",false)}if(t.is("option")){t.prop("disabled",true);AGN.Lib.CoreInitializer.run("select",t.parents("select"))}});_.each(this.el.find(i),function(e){t=$(e);t.all(":input").each(function(){var e=$(this);if(e.data("field-disabled")){e.prop("disabled",false);e.removeData("field-disabled")}});t.show();if(t.data("select2")){t.select2("container").show();t.select2("enable",true)}if(t.is("option")){t.prop("disabled",false);AGN.Lib.CoreInitializer.run("select",t.parents("select"))}})};n.prototype.update=function(){this._updateDefaults();this._updateSelects();this._updateCheckboxes()};AGN.Lib.ToggleVisField=n;AGN.Opt.Fields["toggle-vis"]=n;c=function(e){a.apply(this,[e]);this.$target=this.el.find("[data-field-required]")};c.prototype=Object.create(a.prototype);c.prototype.constructor=c;c.prototype.valid=function(){if(this.$target.exists()){return $.trim(this.$target.val())}else{return true}};c.prototype.errors=function(){var e=[];if(this.valid())return e;e.push({field:this.$target,msg:t("fields.required.errors.missing")});return e};AGN.Lib.RequiredField=c;AGN.Opt.Fields["required"]=c;r=function(e){a.apply(this,[e]);var t=this;this.$strength=this.el.find(".js-password-strength");this.$strengthIndicator=this.el.find(".js-password-strength-indicator");this.$match=this.el.find(".js-password-match");this.$matchIndicator=this.el.find(".js-password-match-indicator");this.$strength.on("keyup",function(){t.updateStrength();t.updateMatch()});this.$match.on("keyup",function(){t.updateMatch()})};r.prototype=Object.create(a.prototype);r.prototype.constructor=r;r.prototype.match=function(){return this.$strength.val()==this.$match.val()};r.prototype.safe=function(){return this._getSecurityIssues().length===0};r.prototype._getSecurityIssues=function(){var e=[];var i=this,n=this.$strength.val();if(n.length==0)return e;var r=this.$strength.attr("data-rule");var o=AGN.Lib.PasswordPolicies.find_password_policy(r);var a=o(n);if(a!=null&&a.length>0){e.push(t("fields.password.errors.unsafe"));for(var s=0;s<a.length;s++){e.push(t(a[s]))}}return e};r._getRule=function(e){var t=8;var i=["[a-z]","[A-Z]","[0-9]","[^a-zA-Z0-9]"];switch(e){case"LENGTH_8_MIXED":t=8;i=["[a-z]","[A-Z]","[0-9]","[^a-zA-Z0-9]"];break;case"LENGTH_12_SIMPLE":t=12;i=["."];break;case"WEBSERVICE":t=32;i=["."];break;default:console.log("Don't know password policy '"+name+"'");return false}return{minLength:t,checks:i}};r.prototype.passesCheck=function(e,t){if(e.match(t)){return true}return false};r.prototype.valid=function(){if(this.$match.length==0)return true;return this.match()&&this.safe()};r.prototype.errors=function(){var i=this,n=[];if(this.valid())return n;if(!this.match()){n.push({field:this.$match,msg:t("fields.password.errors.notMatching")})}var e=this._getSecurityIssues();if(e.length>0){e.forEach(function(e){n.push({field:i.$strength,msg:e})})}return n};r.prototype.resetStrength=function(){var e=AGN.Lib.Form.get(this.el);e.cleanErrors(this.$strengthIndicator.parents(".form-group"));this.$strengthIndicator.addClass("hidden");this.$strengthIndicator.removeClass("state-alert");this.$strengthIndicator.removeClass("state-success");this.$strengthIndicator.html("")};r.prototype.resetMatch=function(){var e=AGN.Lib.Form.get(this.el);e.cleanErrors(this.$matchIndicator.parents(".form-group"));this.$matchIndicator.addClass("hidden");this.$matchIndicator.removeClass("state-success");this.$matchIndicator.removeClass("state-alert");this.$matchIndicator.html("")};r.prototype.updateStrength=function(){this.resetStrength();if(this.$strength.val().length==0){return}this.$strengthIndicator.removeClass("hidden");if(this.safe()){this.$strengthIndicator.addClass("state-success");this.$strengthIndicator.html(t("fields.password.successHtml",t("fields.password.safe")))}else{this.$strengthIndicator.addClass("state-alert");this.$strengthIndicator.html(t("fields.password.unsuccessHtml",t("fields.password.unsafe")))}};r.prototype.updateMatch=function(){this.resetMatch();if(this.$match.val().length==0){return}this.$matchIndicator.removeClass("hidden");if(this.match()){this.$matchIndicator.addClass("state-success");this.$matchIndicator.html(t("fields.password.successHtml",t("fields.password.matches")))}else{this.$matchIndicator.addClass("state-alert");this.$matchIndicator.html(t("fields.password.unsuccessHtml",t("fields.password.matchesNot")))}};AGN.Lib.PasswordField=r;AGN.Opt.Fields["password"]=r;o=function(e){a.apply(this,[e]);this.$source=this.el.find("[data-field-split]");this.targets=this.$source.data("field-split").split(/,\s?/);this.rule=new RegExp(this.$source.data("field-split-rule"))};o.prototype=Object.create(a.prototype);o.prototype.constructor=o;o.prototype.valid=function(){var i,n=AGN.Lib.Form.get(this.el);i=this.$source.val().split(this.rule);_.each(this.targets,function(e,t){n.setValueOnce(e,i[t])});return true};AGN.Lib.ValueSplitField=o;AGN.Opt.Fields["split"]=o;s=function(e){var t=this;a.apply(this,[e]);this.$filters=this.el.find("[data-field-filter]");this.$filters.on("change",function(){t.update()});t.position();t.update()};s.prototype=Object.create(a.prototype);s.prototype.constructor=s;s.prototype.position=function(){var e;e=$(this.el.data("filter-target"));this.el.detach();this.el.appendTo(e);e.parents("table").hide();e.parents("table").show()};s.prototype.isEnabled=function(){return this.$filters.get().some(function(e){var t=$(e);if(t.is("input")){var i=t.attr("type");if(i=="text"||i=="number"||i=="password"){return!!t.val()}}return!!t.serialize()})};s.prototype.isDisabled=function(){return!this.isEnabled()};s.prototype.update=function(){if(this.isEnabled()){this.el.addClass("filter-active")}else{this.el.removeClass("filter-active")}};AGN.Lib.FilterField=s;AGN.Opt.Fields["filter"]=s;l=function(e){var t=this;a.apply(this,[e]);this.$filterMin=this.el.find("[data-filter-date-min]");this.$filterMax=this.el.find("[data-filter-date-max]");this.$filters=this.el.find("[data-filter-date-min],[data-filter-date-max]");this.$filterMin.on("change",function(){var e=t.$filterMax.data("pickadate");e.set("min",t.$filterMin.val())});this.$filterMax.on("change",function(){var e=t.$filterMin.data("pickadate");e.set("max",t.$filterMax.val())});this.$filters.on("change",function(){t.update()});t.position();t.update()};l.prototype=Object.create(s.prototype);l.prototype.constructor=l;l.prototype.isEnabled=function(){return _.some(this.$filters,function(e){return $(e).val()!=""})};AGN.Lib.DateFilterField=l;AGN.Opt.Fields["date-filter"]=l;u=function(e){var t=this;a.apply(this,[e]);this.$source=this.el.find("[data-field-date-split]");this.$source.on("change",function(){t.update()})};u.prototype=Object.create(a.prototype);u.prototype.constructor=u;u.prototype.update=function(){var i=null;var e=this.$source.val();if(e){i=new Date(parseInt(e))}var t=this.el.find("[data-date-split-target]");t.each(function(){var e=$(this);var t=e.attr("data-date-split-target");if(i&&t){switch(t.toUpperCase()){case"MILLISECONDS":e.val(i.getMilliseconds());break;case"SECONDS":e.val(i.getSeconds());break;case"MINUTES":e.val(i.getMinutes());break;case"HOURS":e.val(i.getHours());break;case"DAY":e.val(i.getDate());break;case"MONTH":e.val(i.getMonth()+1);break;case"YEAR":e.val(i.getFullYear());break;default:e.val(i.toJSON())}}else{e.val("")}})};AGN.Lib.DateSplitField=u;AGN.Opt.Fields["date-split"]=u;d=function(e){a.apply(this,[e]);var t=$(this.el);var i=t.data("property");var n=_.extend({},AGN.Lib.Helpers.objFromString(t.data("field-options")));var r=n.value||n.defaultValue||"";var o=n.dateFormat||"dd.mm.yyyy";y(t,i,r,o);t.on("change",function(){f(i,o)})};d.prototype=Object.create(a.prototype);d.prototype.constructor=d;AGN.Lib.DateTimeField=d;AGN.Opt.Fields["datetime"]=d;function f(e,t){var i=e.replace(/([:.\[\],=@])/g,"\\$1");var n=$("#"+i+"_date");var r=$("#"+i+"_time");$('[name="'+e+'"]').val(p(n,r,t))}function p(e,t,i){var n=t?t.val():"";n=n?n.replaceAll("_","0"):"00:00";return e.val()?h(e.pickadate("picker"),n,i):""}function h(e,t,i){return e.get("select",i)+(g(t)?" "+t:"")}function g(e){return/^(\d{2}):(\d{2})$/.test(e)}function v(e){if(e){return e.split(" ")[0]}return""}function m(e){if(e){var t=e.split(" ");if(t.length==2){return t[1]}}return""}function y(e,t,i,n){var r=document.createElement("input");r.type="hidden";r.name=t;r.value=i;e.append(_.template(AGN.Opt.Templates["datetime-picker"])({date:v(i),time:m(i),property:t,dateFormat:n}));e.append(r);AGN.runAll(e)}})();(function(){var r=_.template('<div class="form-group email-list-manager-row" data-action="change-trigger">'+'        <div class="col-sm-12">'+'            <div class="input-group">'+'                <div class="input-group-controls">'+'                    <input type="text" value="{{= value}}" class="form-control" size="42" maxlength="99"/>'+"                </div>"+'                <div class="input-group-btn">'+'                    <button type="button" class="btn btn-regular btn-primary email-list-manager-add-btn" data-action="create-email">'+'                        <i class="icon icon-plus"></i>'+"                    </button>"+"                </div>"+"            </div>"+"        </div>"+"    </div>");var o=_.template('<button type="button" class="btn btn-regular btn-alert email-list-manager-delete-btn" data-action="delete-email">'+'        <i class="icon icon-trash-o"></i>'+"    </button>");function n(e,t,i){this.scope=e;this.data=t;this.options=$.extend({rowTemplate:r,rowSelector:".email-list-manager-row",addBtnSelector:".email-list-manager-add-btn",deleteBtnSelector:".email-list-manager-delete-btn",rowDataMapper:function(e){return{value:e}}},i);var n=this;_.each(n.data,function(e){s(n.scope,e,null,n.options)})}n.initialize=function(e,t,i){return new n(e,t,i)};n.prototype.createRowAfter=function(e){var t=this;s(t.scope,"",$(e),t.options)};n.prototype.deleteRow=function(e){$(e).closest(this.options.rowSelector).remove();a(this.scope,this.options)};n.prototype.getJsonData=function(){var i=[];_.each(this.scope.find(this.options.rowSelector+" input"),function(e){var t=e.value;if(t.trim()!==""){i.push(t)}});return i};function a(e,n){var t=e.find(n.rowSelector);if(t.length===1){var i=t.find(n.deleteBtnSelector);i.remove()}else{_.each(t,function(e){var t=$(e);var i=t.find(n.deleteBtnSelector);if(!i.exists()){t.find(".input-group-btn").append(o({}))}})}}function s(e,t,i,n){var r=n.rowTemplate(n.rowDataMapper(t));if(i&&i.exists()){i.closest(n.rowSelector).after(r)}else{e.append(r)}a(e,n)}AGN.Lib.EmailsListManager=n})();(function(){var a,i=AGN.Lib.Field,n=AGN.Lib.CSRF,r;r=function(e){this.group=e;this.$controls=$()};r.prototype._collect=function(e){var t=$("[data-controls-group]");if(e==="*"){return t}if(e){return t.filter(function(){return e===$(this).attr("data-controls-group")})}else{return $()}};r.prototype.collect=function(){if(this.group){this.$controls=this._collect(this.group).filter(function(){var e=$(this);return!e.prop("disabled")&&!e.hasClass("disabled")})}};r.prototype.setDisabled=function(e){if(e===false){this.$controls.removeClass("disabled");this.$controls.prop("disabled",false)}else{this.$controls.addClass("disabled");this.$controls.prop("disabled",true)}};a=function(e){this.$form=e;this.form=e[0];this._abort=null;this._data={};this._dataNextRequest={};this.fields=[];this.validatorName=null;this.validatorOptions=null;this.dirtyChecking=e.is("[data-form-dirty-checking]");this.editable=!e.is("[data-editable]")||!!e.data("editable");this.url=e.attr("action");this.urlNextRequest=null;this.method=e.attr("method");this.isMultipart="multipart/form-data"==(e.attr("enctype")||"").toLowerCase();this.isCustomLoader=e.is("[data-custom-loader]");this.controlsToDisable=new r(e.attr("data-disable-controls"));if(e.is("[data-custom-loader]")){this.isCustomLoader=e.attr("data-custom-loader")!=="false"}else{this.isCustomLoader=false}this.initFields();this.initValidator();this.handleMessages($("body"),true);if(this.dirtyChecking){o(e)}if(!this.editable){e.find(":input, button").prop("disabled",true)}};function o(e){e.dirty({preventLeaving:true,leavingMessage:t("grid.layout.leaveQuestion")});window.onbeforeunload=function(){if(!e.dirty("isDirty")===true){AGN.Lib.Loader.show()}}}a.get=function(e){var t,i,n,r;t=a.getWrapper(e);r=t.data("_form");if(!r){n=t.data("form");i=AGN.Opt.Forms[n]||AGN.Lib.Form;r=new i(t);t.data("_form",r)}return r};a.getWrapper=function(e){var t;t=$(e.data("form-target"));if(t.length==0){t=e.closest("form")}return t};a.prototype.valid=function(e){var t=$.Event("validation");e=_.merge({},this.validatorOptions,e);this.$form.trigger(t,e);if(t.isDefaultPrevented()){return false}var i=_.every(this.fields,function(e){return e.valid()});if(this.validatorName){var n=AGN.Lib.Validator.get(this.validatorName);if(n){return n.valid(this,e,i)}}return i};a.prototype.validate=function(e){if(this.valid(e)){return true}else{this.handleErrors();return false}};a.prototype.get$=function(){return this.$form};a.prototype.getAction=function(){if(this.urlNextRequest){var e=this.urlNextRequest;this.urlNextRequest=null;return e}return this.url};a.prototype.setActionOnce=function(e){this.urlNextRequest=e};a.prototype.errors=function(){var t=[];_.each(this.fields,function(e){t=t.concat(e.errors())});if(this.validatorName){var e=AGN.Lib.Validator.get(this.validatorName);if(e){t=t.concat(e.errors(this,this.validatorOptions))}}return t};a.prototype.setValue=function(e,t){var i=this.form[e];if(typeof i==="object"){$(i).val([t]);$(i).trigger("change")}else{if(typeof t==="undefined"){delete this._data[e]}else{this._data[e]=t}}};a.prototype.setValueOnce=function(e,t){if(typeof t==="undefined"){delete this._dataNextRequest[e]}else{this._dataNextRequest[e]=t}};a.prototype.getValue=function(e){var t=this.form[e];if(typeof t==="object"){return t.value}else{return this._data[e]}};a.prototype.data=function(){if(this.isMultipart){var n=new FormData;var i=this.$form.serializeFormDataObject();$.each(this._data,function(e,t){if(!i.hasOwnProperty(e)){i[e]=t}});$.each(this._dataNextRequest,function(e,t){i[e]=t});$.each(i,function(i,e){if($.isArray(e)){$.each(e,function(e,t){n.append(i,t)})}else{n.append(i,e)}});return n}else{return _.merge({},this._data,this.$form.serializeObject(),this._dataNextRequest)}};a.prototype.params=function(){return $.param(this.data(),true)};a.prototype.jqxhr=function(){var i=this,e=$.ajaxSettings.xhr(),t,o=$.Deferred();this.$form.trigger("form:submit");var n={url:this.getAction(),method:this.method,loader:this.loader(),xhr:function(){return e}};if(this.isMultipart){n.data=this.data();n.enctype="multipart/form-data";n.processData=false;n.contentType=false}else{n.data=this.params()}if(this.isCustomLoader){var r=function(e){var t=true;if(e.lengthComputable){t=(e.loaded/e.total*100).toFixed(1)}i.$form.trigger("form:progress",{loaded:e.loaded,total:e.total,progress:t})};if("upload"in e){n.xhr=function(){e.upload.onprogress=r;return e}}else{n.xhrFields={onprogress:r}}}if(typeof e.abort==="function"){this._abort=function(){e.abort()}}t=$.ajax(n);this._dataNextRequest={};this.setLoaderShown(true);o.always(function(){i.setLoaderShown(false)});t.done(function(i){var e=$(i),t,n,r;t=e.filter('[data-form="polling"]').add(e.find('[data-form="polling"]'));if(t.length==1){n=a.get(t);r=n.jqhxr();r.done(function(){o.resolve.apply(this,arguments);var e=$("body");var t=$("<div></div>");t.html(i);t.find('script[data-message][type="text/html"]').appendTo(e);t.find('script[data-message][type="text/javascript"]').each(function(){try{eval.call(window,$(this).html())}catch(e){}});t.remove()});r.fail(function(){o.reject.apply(this,arguments)})}else{o.resolve(i)}});t.fail(function(){o.reject.apply(this,arguments)});return o.promise()};a.prototype._submit=function(){var e,t=this;this.setLoaderShown(true);e=this.jqxhr();e.done(function(e){t.setLoaderShown(false);t.updateHtml(e);t.$form.trigger("submitted",e);if(t.dirtyChecking){s(t.$form)}});return e};function s(e){const t=$("body").has(e).length===0;if(t){e.dirty("destroy")}else{e.dirty("setAsClean")}}a.prototype._submitStatic=function(){var e=this.data(),r;if(n.isProtectionEnabled()){e[n.getParameterName()]=n.readActualToken()}r=$('<form method="'+this.method+'" action="'+this.getAction()+'"></form>');_.each(e,function(e,t){if(_.isArray(e)){var i=$('<select multiple name="'+t+'"></select>');_.each(e,function(e){var t=$('<option selected="selected"></option>');t.val(e);t.appendTo(i)});i.appendTo(r)}else{var n=$('<input type="hidden" name="'+t+'"/>');n.val(e);n.appendTo(r)}});r.appendTo($("body"));r.submit();r.remove();this._dataNextRequest={}};a.prototype._submitAction=function(e){this.setValue("previousAction",this.getValue("actionList"));this.setValueOnce("action",e);return this.submit()};a.prototype._submitEvent=function(){var e=$.Event("submission");this.$form.trigger(e);if(!e.isDefaultPrevented()){this.$form.trigger("submitted");this._dataNextRequest={}}};a.prototype._submitConfirm=function(e){this.setValue("previousAction",this.getValue("actionList"));this.setValueOnce("action",e);var t=this.jqxhr();var i=this;t.done(function(e){i.$form.trigger("submitted",e)});return t};a.prototype.submit=function(e){var t=0;var i={};if((e=="confirm"||e=="action")&&(typeof arguments[1]==="number"||typeof arguments[1]==="string")){t=arguments[1];i=arguments[2]}else{i=arguments[1]}if(this.valid(i)){this.cleanErrors()}else{this.handleErrors();return false}switch(e){case"static":return this._submitStatic();case"confirm":return this._submitConfirm(t);case"action":return this._submitAction(t);case"event":return this._submitEvent();default:return this._submit()}};a.prototype.revertAction=function(){};a.prototype.reset=function(){this.$form.trigger("reset")};a.prototype.abort=function(){this.$form.trigger("form:abort");if(this._abort){this._abort();this._abort=null}};a.prototype.bulkUpdate=function(e,t){if(e){this.$form.find('[name^="'+e+'"]').prop("checked",t)}else{this.$form.find(".js-bulk-ids").prop("checked",t)}};a.prototype.handleMessages=function(e,t){const n=this;if(!(e instanceof $)){e=$(e)}e.all('script[data-message][type="text/html"]').each(function(){const e=$(this);const t=e.text();const i=e.data("message");if(t&&i){n.showFieldError(i,t,false)}});if(t===true){return}const i=e.filter("script[data-message]").add(e.find("script[data-message]"));_.each(i,function(e){$("body").append(e)})};a.prototype.initFields=function(e){var t=this;if(!e){e=this.$form}t.fields.length=0;_.each(e.find("[data-field]"),function(e){t.fields.push(i.create($(e)))})};a.prototype.initValidator=function(){this.validatorName=this.$form.data("validator");var e=this.$form.data("validator-options");this.validatorOptions=e?AGN.Lib.Helpers.objFromString(e):null};a.prototype.updateHtml=function(e){var t,i=$(e);if(this.$form.attr("id")){t=$(e).filter("#"+this.$form.attr("id")).add(i.find("#"+this.$form.attr("id")))}else if(this.$form.attr("name")){t=$(e).filter('[name="'+this.$form.attr("name")+'"]').add(i.find('[name="'+this.$form.attr("name")+'"]'))}else{t=$(e).filter("form").add(i.find("form"))}this.$form.html(t.html());this.handleMessages(e);this.initFields();this.initValidator();AGN.Lib.Controller.init(this.$form);AGN.runAll(this.$form)};a.prototype.loader=function(){var e=this;return{show:function(){e.controlsToDisable.collect();e.controlsToDisable.setDisabled(true);e.setLoaderShown(true)},hide:function(){e.controlsToDisable.setDisabled(false);e.setLoaderShown(false)}}};a.prototype.setLoaderShown=function(e){if(this.isCustomLoader){if(e){this.$form.trigger("form:loadershow")}else{this.$form.trigger("form:loaderhide")}}else{if(e){AGN.Lib.Loader.show()}else{AGN.Lib.Loader.hide()}}};a.prototype.cleanErrors=function(e){if(!e){e=this.$form.find(".js-form-error")}_.each(e,function(e){var t=$(e);t.removeClass("has-alert has-feedback js-form-error");t.find(".js-form-error-ind").remove();t.find(".js-form-error-msg").remove()})};function l(e,t){var i=e;var n=e.data("_editor");var r=e.data("emojioneArea");var o=true;if(n){n=n.editor;if(n.container){o=false;i=$(n.container)}}else if(r){if(r.editor){o=false;i=r.editor.parent()}}else{if(i.is("select")){o=false;if(i.is(".input-group .input-group-controls .js-select")){i=i.closest(".input-group")}}}if(o){const a=i.next("span[class*='icon-state-']");if(a){a.hide()}i.after('<span class="icon icon-state-alert form-control-feedback js-form-error-ind"></span>')}i.parent().append('<div class="form-control-feedback-message js-form-error-msg">'+t+"</div>")}a.prototype.handleErrors=function(){var n=[];this.cleanErrors();var e=this.errors().filter(function(e){return e.field&&e.field.length>0});_.each(e,function(e){var t=e.field;u(t);l(t,e.msg)});_.each(this.errors(),function(e){var t=e.field;if(t.data("select2")){n.push(t.parent().find(".select2-container").offset().top)}else if(t.data("_editor")&&t.data("_editor").editor){var i=t.data("_editor").editor;n.push($(i.container).offset().top)}else{n.push(t.offset().top)}});var t=false;var i=this.$form.closest(".modal");if(!i.exists()){i=$('.tile-content[data-sizing="scroll"]');if(i.exists()){t=true}}if(!i.exists()){i=$(document)}if(i.find(".popover.support-popover").exists()){return}var r=this.$form.offset().top;var o;if(t){o=_.sortBy(n)[0]+i.scrollTop()-i.offset().top-25}else{o=_.sortBy(n)[0]-r-25}i.scrollTop(o)};a.prototype.cleanFieldError=function(e){if(this.form[e]){this.cleanFieldError$($(this.form[e]))}};a.prototype.cleanFieldError$=function(e){var t=e.closest(".js-form-error");t.removeClass("has-alert has-feedback js-form-error");t.find(".js-form-error-ind").remove();t.find(".js-form-error-msg").remove()};a.prototype.showFieldError=function(e,t,i){if(this.form[e]){this.showFieldError$($(this.form[e]),t,i)}};a.prototype.showFieldError$=function(e,t,i){var n=e.parents(".form-group");n.addClass("has-alert has-feedback js-form-error");n.find(".js-form-error-ind").remove();n.find(".js-form-error-msg").remove();l(e,t);if(i!==true){var r=this.$form.closest("[data-sizing=scroll], .modal").first();if(r.exists()){var o=$(".has-alert").first();r.animate({scrollTop:o.offset().top-r.offset().top+r.scrollTop()})}else{r=$(document);r.scrollTop(e.offset().top-125)}}};AGN.Lib.Form=a;function u(e){var t=e.closest("td");if(t.length&&t.parents(".table-form").length){t.addClass("has-alert js-form-error")}else{e.parents(".form-group").addClass("has-alert has-feedback js-form-error")}}})();(function(){var e;e=function(e){this.$el=e};e.prototype.update=function(e){this.config=e;this.draw()};e.prototype.template=function(){var e=this.config;return _.template('<div class="grid-stage center-block" style="width: {{= viewWidth}} px; height: {{= viewHeight }}px;">'+'<svg class="grid-view center-block" viewBox="0 0 {{= viewWidth }} {{= viewHeight }}" style="width: {{= viewWidth }}px; height: {{= viewHeight }}px">'+'<g class="grid-columns"></g>'+"</svg>"+"</div>")({viewWidth:e.templateWidth,viewHeight:100})};e.prototype.data=function(){var t=[],i=this.config;_.times(i.columnNum,function(e){t.push({type:"gutter",width:i.gutter/2,offset:_.reduce(t,function(e,t){return e+t.width},0)});t.push({type:"col",width:i.columnWidth,offset:_.reduce(t,function(e,t){return e+t.width},0)});t.push({type:"gutter",width:i.gutter/2,offset:_.reduce(t,function(e,t){return e+t.width},0)})});return t};e.prototype.draw=function(){var e;this.$el.html(this.template());e=d3.select(this.$el.find(".grid-columns")[0]).selectAll("g").data(this.data()).enter().append("g").attr("transform",function(e,t){return"translate("+e.offset+",0)"});e.append("rect").attr("class",function(e){return"grid-view-"+e.type}).attr("width",function(e){return e.width}).attr("height",100)};AGN.Lib.GridView=e})();(function(){var e;e=function(e){this.$el=e};e.prototype.update=function(e){this.config=e;this.draw()};e.prototype.template=function(){var e=this.config;return _.template('<div class="grid-stage center-block" style="width: {{= viewWidth }}"px"; height: {{= viewHeight }}px;">'+'<svg class="column-view center-block" viewBox="0 0 {{= viewWidth }} {{= viewHeight }}" style="width: {{= viewWidth }}px; height: {{= viewHeight }}px">'+'<g class="grid-columns"></g>'+"</svg>"+"</div>")({viewWidth:e.templateWidth,viewHeight:e.columnNum*35-5})};e.prototype.data=function(){var i=this.config,n=[];_.times(i.columnNum,function(e){var t=[];t.push({type:"gutter",width:i.gutter/2,offset:0});t.push({type:"col",width:(e+1)*i.columnWidth+e*i.gutter,offset:_.reduce(t,function(e,t){return e+t.width},0)});t.push({type:"gutter",width:i.gutter/2,offset:_.reduce(t,function(e,t){return e+t.width},0)});_.times(i.columnNum-(e+1),function(e){t.push({type:"gutter",width:i.gutter/2,offset:_.reduce(t,function(e,t){return e+t.width},0)});t.push({type:"empty-col",width:i.columnWidth,offset:_.reduce(t,function(e,t){return e+t.width},0)});t.push({type:"gutter",width:i.gutter/2,offset:_.reduce(t,function(e,t){return e+t.width},0)})});n.push(t)});return n};e.prototype.draw=function(){var i=this.config,e,t;this.$el.html(this.template());t=d3.select(this.$el.find(".grid-columns")[0]).selectAll(".row").data(this.data()).enter().append("g").attr("class","row").attr("transform",function(e,t){return"translate(0,"+t*35+")"});e=t.selectAll(".col").data(function(e){return e}).enter().append("g").attr("class","col").attr("transform",function(e){return"translate("+e.offset+",0)"});e.append("rect").attr("class",function(e){return"column-view-"+e.type}).attr("width",function(e){return e.width}).attr("height",30);t.append("text").attr("class","column-view-text").attr("x",i.gutter/2+10).attr("y",20).text(function(e,t){return _.template("{{= width }}px / {{= perc }}%")({width:e[1].width,perc:Math.floor(100*(t+1)/i.columnNum)})})};AGN.Lib.GridColumnView=e})();(function(){var i;var a='<div class="popover" role="tooltip">'+'<div class="arrow"></div>'+'<h3 class="popover-title"></h3>'+'<div class="popover-content popover-scrollable"></div>'+"</div>";i=function(e){var t=AGN.url(e.data("help")),i=this,n;this.el=e;n=$.get(t);n.done(function(e){i.config=$(e);i.popoverInteractive();i.show()})};i.show=function(e){var t;t=e.data("_help");if(t){t.show();return}t=new i(e);e.data("_help",t)};i.prototype.show=function(){this.el.popover("show")};i.prototype.getConfig=function(e){var t=this.config.find(e).text();return t.replace("<![CDATA[","").replace("]]>","")};i.prototype.popover=function(){if(!this.config){return}this.el.popover("destroy");AGN.Lib.Popover.new(this.el,{template:a,title:this.getConfig("title"),content:this.getConfig("content"),html:true,trigger:this.el.data("trigger")||"focus"})};i.prototype.popoverInteractive=function(){if(!this.config){return}this.el.popover("destroy");var e=AGN.Lib.Popover.new(this.el,{template:a,title:this.getConfig("title"),content:this.getConfig("content"),html:true,trigger:"manual"});var t=this.el;var n=e.tip();n.attr("tabindex",0);n.css("outline","none");var i=null;var r=function(){i=setTimeout(function(){e.hide()},100)};var o=function(){clearTimeout(i)};n.focusout(r);t.focusout(r);n.focusin(o);t.focusin(o);t.on("shown.bs.popover",function(){var e=n.children(".popover-content");var t=e.css("min-width");var i=e.outerWidth();e.css("min-width","100%");e.css("min-width",e.outerWidth());if(i>e.outerWidth()){e.css("min-width",t||"0px")}})};AGN.Lib.Help=i})();(function(){AGN.Lib.Helpers={paramsFromUrl:function(e){var t={};var i;if(e){i=e.indexOf("?")}else{return t}if(i==-1)return t;var n=e.substring(i+1);var r=n.split("&");for(var o=0;o<r.length;o++){var a=r[o].split("=");t[a[0]]=a[1]}return t},objFromString:function(optsAsString){var optsArray,optsSplitRegex=/,\s*(?=(?:[^'\\]*(?:\\.|'(?:[^'\\]*\\.)*[^'\\]*'))*[^']*$)/m,tupleSplitRegex=/:\s*(?=(?:[^'\\]*(?:\\.|'(?:[^'\\]*\\.)*[^'\\]*'))*[^']*$)/m,floatRegex=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,arrayRegex=/^\s?\[.*?\]$/i;opts={};if(optsAsString===""||optsAsString===undefined){return opts}optsArray=optsAsString.split(optsSplitRegex);_.forEach(optsArray,function(opt){var tup=opt.split(tupleSplitRegex),name,value;tup=_.filter(tup);name=tup[0].replace(/^'([^]*?)'$/m,"$1");name=name.replace(/\\/,"");value=tup[1];if(typeof value==="undefined"){value=""}if(value=="true"){value=true}else if(value=="false"){value=false}else if(floatRegex.test(value)){value=parseFloat(value)}else if(arrayRegex.test(value)){value=value.replace(/\[|\]/g,"");value=value.split(/\s+/);value=_.map(value,function(v){if(/^\'(.*?)\'$/.test(v)){return v.replace(/^\'(.*?)\'$/g,"$1")}else{return eval(v)}})}else{value=value.replace(/^'(.*?)'$/m,"$1");value=value.replace(/\\/,"")}opts[name]=value});return opts},disableCSSAnimations:function(){var e=$('<style class="disable-animation">* { -webkit-transition: none !important; -o-transition: none !important; transition: none !important; }</style>');$("body").append(e)},enableCSSAnimations:function(){window.setTimeout(function(){$(".disable-animation").remove()},10)},clearFormField:function(e){var t=$("<form></form>");var i=$("<div></div>");i.insertAfter(e);t.append(e);t.get(0).reset();e.insertBefore(i);i.remove()},renameFile:function(e,t){Object.defineProperty(e,"name",{writable:true,value:t})},formatBytes:function(e,t){if(e==0)return"0 Bytes";if(e==1)return"1 Byte";if(e==-1)return"-1 Byte";var e=Math.abs(e);if(t&&t.toLowerCase()&&t.toLowerCase()=="iec"){var i=Math.pow(2,10);var n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]}else{var i=Math.pow(10,3);var n=["Bytes","kB","MB","GB","TB","PB","EB","ZB","YB"]}var r=Math.floor(Math.log(e)/Math.log(i));var o=e/Math.pow(i,r);if(e<0){o*=-1}if(o>=99.995||r==0){return o.toFixed(0)+" "+n[r]}else{return o.toFixed(2)+" "+n[r]}},pad:function(e,t,i){i=i||"0";var n=e+"";if(n.length<t){return new Array(t-n.length+1).join(i)+n}else{return n}},caching:function(e,t){var i=false;var n;if(arguments.length>1){e=_.bind.apply(null,Array.prototype.slice.call(arguments))}return function(){if(!i){i=true;n=e()}return n}},replaceAgnTags:function(e,s){try{return e.replace(/\[(agn[A-Z0-9]+)(?:[^'"\]]|'.*?'|".*?")+]/g,function(e,t){var i=$("<"+e.substring(1,e.length-1)+">")[0];if(i instanceof HTMLElement){var n=i.attributes;var r={};for(var o=0;o<n.length;o++){var a=n[o];r[a.nodeName]=a.nodeValue}return s({name:t,attributes:r},e)}return e})}catch(e){}return e},escapeAgnTags:function(e){try{if(e){return e.replace(/\[agn[A-Z0-9]+(?:[^'"\]]|'.*?'|".*?")+]/g,function(e){if(e.includes("'")||e.includes('"')){return _.escape(e)}else{return e}})}}catch(e){}return e},unescapeAgnTags:function(e){try{if(e){return e.replace(/\[agn[A-Z0-9]+(?:(?!&#39;|&quot;)[^'"\]]|=\s*&#39;.*?&#39;|=\s*&quot;.*?&quot;)*]/g,function(e){return _.unescape(e)})}}catch(e){}return e},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(String(e).toLowerCase())}}})();(function(){var n;n=function(e){var t,i=this;i.el=e;i.url=e.data("load");i.interval=parseInt(e.data("load-interval"));i.target=e.data("load-target");if(i.interval){t=function(){i.load()};i._interval=window.setInterval(t,i.interval)}i.el.removeAttr("data-load")};n.load=function(e,t){var i;i=e.data("_load");if(i){i.load();return}if(e.is(":hidden")&&t!==true){return}i=new n(e);i.load();e.data("_load",i)};n.get=function(e){return e.data("_load")};n.prototype.stop=function(){window.clearInterval(this._interval)};n.prototype.load=function(){var e,r=this;if(r.loading){return}r.loading=true;e=$.get(r.url);e.always(function(){if(r.interval){r.loading=false}});e.fail(function(){r.stop()});e.done(function(e){var t=$(e),i,n;n=t.all("[data-load-stop]");if(n.length!=0){r.stop()}if(!r.target){i=e}else if(r.target=="body"){i=/<body[^>]*>((.|[\n\r])*)<\/body>/im.exec(e)[1]}else{i=t.all(r.target)}r.el.html(i);AGN.Lib.Controller.init(r.el);AGN.runAll(r.el)})};AGN.Lib.Load=n})();(function(){var e={},t,i=0,n=false;e.show=function(){window.clearTimeout(t);if(!n){i+=1;$(".loader").show()}else{n=false}};e.hide=function(){i-=1;if(i<=0){t=window.setTimeout(function(){$(".loader").hide()},5);i=0}};e.prevent=function(){n=true};AGN.Lib.Loader=e})();(function(){var e,t=AGN.Lib.Form;e=function(e){t.apply(this,[e]);AGN.Lib.Loader.show();this.submit()};e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.prototype.jqxhr=function(){var t=this,i=$.Deferred();this.$form.trigger("form:submit");window.setTimeout(function(){var e=$.ajax({url:t.url,method:t.method,data:t.params(),loader:t.loader()});e.done(function(e){i.resolve.apply(this,arguments)})},parseInt(this.$form.data("polling-interval")));return i.promise()};e.prototype.submit=function(){var e,t=this;e=this.jqxhr();e.done(function(e){t.updateHtml(e)});return e};e.prototype.updateHtml=function(e){var t,i=$(e);t=i.filter('[data-form="loading"]').add(i.find('[data-form="loading"]'));if(t.length==1){this.$form.html(t.html());AGN.runAll(this.$form);this.submit()}else{AGN.Lib.Loader.hide();AGN.Lib.Page.render(e)}};AGN.Lib.LoadingForm=e;AGN.Opt.Forms["loading"]=e})();(function(){var e;e={init:function(){var e=AGN.Lib.Storage.get("menu_state")||"close";if(e=="open"){this.openDirectly()}else{this.closeDirectly()}this.updateInits()},isOpen:function(){return $("body").hasClass("menu-is-active")},openDirectly:function(){AGN.Lib.Helpers.disableCSSAnimations();this.open();AGN.Lib.Helpers.enableCSSAnimations()},closeDirectly:function(){AGN.Lib.Helpers.disableCSSAnimations();this.close();AGN.Lib.Helpers.enableCSSAnimations()},close:function(){AGN.Lib.Storage.set("menu_state","close");$("body").removeClass("menu-is-active");this.updateInits()},open:function(){AGN.Lib.Storage.set("menu_state","open");$("body").addClass("menu-is-active");this.updateInits()},updateInits:function(){window.setTimeout(function(){AGN.Lib.CoreInitializer.run(["truncate","scrollable","dropdown-expand"])},600)}};AGN.Lib.Menu=e})();(function(){var Messages=function(r,o,e,t,i){var n,a,s={timeout:{success:3e3,warning:3e3}};if(!e){e="info"}if(i===null){i=true}a=s["timeout"][e||"info"]||0;_.each($(".notification"),function(e){var t=$(e),i,n;i=t.data("message-head");n=t.data("message-content");if(r===i&&o===n){t.remove()}});n=toastr[e](r,o,{timeOut:a,extendedTimeOut:a,onCloseClick:t,newestOnTop:i});n.data("message-head",r);n.data("message-content",o);AGN.Lib.Controller.init(n);AGN.runAll(n)};var displayMessages=function(t,e,i){e.forEach(function(e){Messages(t,e,i)})};var hideMessages=function(){_.each($(".notification"),function(e){e.remove()})};var JsonMessages=function(e,i){if(!!i){hideMessages()}if(e){if(e.success){displayMessages(t("defaults.success"),e.success,"success")}if(e.warning){displayMessages(t("defaults.warning"),e.warning,"warning")}if(e.alert){displayMessages(t("defaults.error"),e.alert,"alert")}}};var RenderMessages=function($resp){$resp.all('script[data-message][type="text/html"]').appendTo($(document.body));$resp.all('script[data-message][type="text/javascript"]').each(function(){try{eval($(this).html())}catch(exception){console.debug(exception)}})};AGN.Lib.Messages=Messages;AGN.Lib.JsonMessages=JsonMessages;AGN.Lib.RenderMessages=RenderMessages})();(function(){var r={};function e(e){var t="key#"+e;var i=r[t];var n=Array.prototype.slice.call(arguments,1);if(i){r[t]=i.filter(function(e){return e.apply(this,n)!==false})}}function t(e,t){var i="key#"+e;if($.isFunction(t)){if(!r[i]){r[i]=[]}r[i].push(t)}else{console.error("Callback must be a function")}}function i(e,t){if(arguments.length){var i="key#"+e;if(arguments.length>1){r[i]=r[i].filter(function(e){return e!==t})}else{r[i]=[]}}}AGN.Lib.Messaging={send:e,subscribe:t,unsubscribe:i}})();(function(){var i;i=function(){};i.create=function(e,t){var i=null,n=null;if(e instanceof $){n=e}else{n=$(e)}var r=n.filter(".modal");var o=n.filter("script");if(r){i=$(r[0]);i.data("_modal",t);o.each(function(){$(this).appendTo(i)});i=i.modal();AGN.Lib.Controller.init(i);AGN.runAll(i)}return i};i.createFromTemplate=function(e,t){t=AGN.Opt.Templates[t]||AGN.Opt.Templates["modal"];return i.create(_.template(t)(e),e)};i.get=function(e){var t=i.getWrapper(e);return t.data("_modal")};i.getWrapper=function(e){return e.closest(".modal")};AGN.Lib.Modal=i})();(function(){var c=AGN.Lib.Confirm,d={};function r(e){if(e){e=e.toUpperCase();switch(e){case"CONNECT":case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return e}}return"GET"}d.render=function(e,t){if(/<\s*\/\s*body\s*>/i.test(e)){var i=new DOMParser;var n=i.parseFromString(e,"text/html");if(t!==false&&n.head){var r=$(n.head).data("origin-uri");if(r){t=r}}if(t){window.history.pushState({},"",t)}var o=$(document).scrollTop();setTimeout(function(){AGN.Lib.Controller.init();AGN.runAll();$(document).scrollTop(o)},100);document.body=n.body;document.title=n.title;var a=$(document.body);a.find("script").each(function(e,t){var i=$(t);if(i.attr("src")){var n=$("<script><\/script>");$.each(t.attributes,function(){if(this.specified){n.attr(this.name,this.value)}});try{n.appendTo(a)}catch(e){console.debug(e)}}else if(i.attr("type")=="text/javascript"){try{eval.call(window,i.html())}catch(e){console.debug(e)}}})}else{var s=$(e);var l=s.filter(".modal");if(l.exists()){var u=$.Deferred();AGN.Lib.RenderMessages(s);c.create(s);u.resolve(c.get(s));return u.promise()}else{l=s.all("script[data-load]");if(l.exists()){return d.reload(l.data("load"),true).done(function(){AGN.Lib.RenderMessages(s)})}else{AGN.Lib.RenderMessages(s)}}}};d.reload=function(i,e,t){if(e){i=i||window.location.href;var n=$.Deferred();$.ajax(i,{method:r(t)}).done(function(e){var t=d.render(e,i);if(t){t.done(n.resolve).fail(n.reject)}else{n.resolve()}}).fail(function(){n.reject()});return n.promise()}else{if(i&&i!=window.location.href){window.location.assign(i)}else{window.location.reload(true)}return null}};AGN.Lib.Page=d})();(function(){var e={};var t=function(e){var t=[];if(e.length<8){t.push("password.error.too_short_min8")}if(!e.match("[a-z]")){t.push("password.error.no_lower_case")}if(!e.match("[A-Z]")){t.push("password.error.no_upper_case")}if(!e.match("[0-9]")){t.push("password.error.no_digits")}if(!e.match("[^a-zA-Z0-9]")){t.push("password.error.no_special")}return t};var i=function(e){if(e.length<12){return["password.error.too_short_min12"]}else{return null}};var n=function(e){if(e.length<32){return["password.error.too_short_min32"]}else{return null}};var r=function(e){return["password.error.generic_error"]};var o=[];a("LENGTH_8_MIXED",t);a("LENGTH_12_SIMPLE",i);a("WEBSERVICE",n);function a(e,t){o.push({name:e,fn:t})}e.find_password_policy=function(e){for(var t=0;t<o.length;t++){if(o[t].name==e){return o[t].fn}}return r};AGN.Lib.PasswordPolicies=e})();(function(){var e,r=AGN.Lib.Page,t=AGN.Lib.Form;e=function(e){t.apply(this,[e])};e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.prototype.jqhxr=function(){var n=this,r=$.Deferred();this.$form.trigger("form:submit");window.setTimeout(function(){var e=$.ajax({url:n.url,method:n.method,data:n.params(),loader:n.loader()});e.done(function(e){var t=$(e);var i=t.all('[data-form="polling"]');if(i.length==1){n.$form.data("polling-interval",i.data("polling-interval"));n.jqhxr().done(function(){r.resolve.apply(this,arguments)})}else{r.resolve.apply(this,arguments)}})},parseInt(this.$form.data("polling-interval")));return r.promise()};e.prototype.submit=function(){var e,t=this;AGN.Lib.Loader.show();e=this.jqxhr();e.done(function(e){AGN.Lib.Loader.hide();t.updateHtml(e)});return e};e.prototype.updateHtml=function(e){var t,i=$(e),n=this.$form.data("render");if(n=="page"){r.render(e)}else{if(this.$form.attr("id")){t=i.all("#"+this.$form.attr("id"))}else if(this.$form.attr("name")){t=i.all('[name="'+this.$form.attr("name")+'"]')}else{t=i.all("form")}setTimeout(function(){AGN.Lib.Controller.init();AGN.runAll()},100);this.handleMessages(e);this.$form.replaceWith(t)}};AGN.Lib.PollingForm=e;AGN.Opt.Forms["polling"]=e})();(function(u){var e={};var n=function(e,t){var i=u(e);var n=u(t);var r=u(window).scrollTop();var o=u(window).outerHeight();var a=n.outerHeight();var s=n.offset().top-r;var l=s+a;if(i.outerHeight()<=s){return"top"}return o-l>s?"bottom":"top"};e.new=function(e,t){if(e.length!==1){return false}e.popover(u.extend({container:"body",placement:n},t));var i=e.data("bs.popover");if(t&&t.enableAgnRunAll){e.on("shown.bs.popover",function(){var e=i.tip();AGN.Lib.Controller.init(e);AGN.runAll(e)})}return i};e.get=function(e){if(e.length!==1){return null}var t=e.data("bs.popover");if(t){return t}return e.closest("div.popover").data("bs.popover")};e.remove=function(e){if(e.length!==1){return false}e.popover("destroy");return true};e.validate=function(){u(".popover").each(function(){var e=u(this).data("bs.popover");if(e&&e.$element){if(!u.contains(document.body,e.$element[0])){e.destroy()}}})};AGN.Lib.Popover=e})(jQuery);(function(){var e,t=AGN.Lib.Form,a=AGN.Lib.Page;e=function(e){t.apply(this,[e]);this.resourceSelector=e.data("resource-selector")};e.prototype=Object.create(t.prototype);e.prototype.getResourceSelector=function(){if(this.resourceSelectorNextRequest){var e=this.resourceSelectorNextRequest;this.resourceSelectorNextRequest=null;return e}return this.resourceSelector};e.prototype.setResourceSelectorOnce=function(e){this.resourceSelectorNextRequest=e};e.prototype.updateHtml=function(e){var t=this.getResourceSelector();if(t){var i=$(e);var n=$(t);var r=i.all(t);if(n.length==1&&r.length==1){var o=false;if(n[0]==this.$form[0]||$.contains(n[0],this.$form[0])){o=true}n.html(r.html());this.handleMessages(i);if(o){this.initFields();this.initValidator()}AGN.Lib.Controller.init(n);AGN.runAll(n)}else{a.render(e);this.handleMessages(e,true)}}else{a.render(e);this.handleMessages(e,true)}};AGN.Lib.ResourceForm=e;AGN.Opt.Forms["resource"]=e})();(function(){function t(e,t){this.src=e;this.promises={};this.cache=$.extend({},t)}t.prototype.retrieve=function(i){var e=this.promises;var n=this.cache;var t=e[i];if(t&&t.state()=="pending"){return t}var r=$.Deferred();t=r.promise();if(n[i]){r.resolve(n[i])}else if(this.src){var o=$.ajax(this.src,{type:"POST",data:{mailingId:i}});e[i]=t;o.always(function(){delete e[i]});o.done(function(e){if(e&&e.mailingId==i){var t=e.links||[];n[i]=t;r.resolve(t,i)}else{r.reject(i)}});o.fail(function(){r.reject(i)})}else{r.reject(i)}return t};var l="DATE",u="DATETIME",i="INTEGER",n="DOUBLE",r="FLOAT",o="NUMBER",c="MAILING",d="MAILING_LINKS",f="INTERVAL_MAILING";function p(e){switch(e){case i:case n:case r:case o:return true;default:return false}}function s(e,t){switch(t){case l:case u:return e.dateOperators;case c:case d:return e.mailingOperators;case f:return e.intervalMailingOperators;default:if(p(t)){return e.numericOperators}else{return e.stringOperators}}}function e(e,t){var i=S("columnAndType",e);if(i){var n=i.options[i.selectedIndex];var r=n.value.toUpperCase();var o=n.getAttribute("data-extra").toUpperCase();var a=S("primaryOperator",e);var s=S("primaryValue",e);if(a.value==t["OPERATOR_IS"]){y(t,s,e)}else if(a.value==t["OPERATOR_MOD"]&&p(o)){b(t,s,e)}else if(o==l||o===u){A(t,s,e)}else if(o==f){E(t,s,e)}else if(o==c){x(t,s,e)}else if(o==d){T(t,s,e)}else if(r=="MAILTYPE"){w(t,s,e)}else if(r=="GENDER"){C(t,s,e)}else{_(t,s,e)}h(t,a,o,e)}}function h(e,t,i,n){var r=t.value;var o=O(D("primaryOperator",n),"form-control","1",n);var a=s(e,i);$.each(M(a),function(e,t){I(o,r,t.id,t.value)});G(t,o)}function a(e,t){var i=S("primaryValue",t);var n=i.value;var r=O(D("secondaryValue",t),"form-control js-select js-option-popovers","1",t);r.setAttribute("data-action","updateMailingLinkId"+(t==null?"New":""));k(e,n,r,e.mailingLinksSelectionsCache[t]&&e.mailingLinksSelectionsCache[t][n]);var o=$(i);var a=o.clone();a.val(o.val());a.css({display:"block"});R([a,r],$(i.parentNode))}function g(e,t,i){var n=S("primaryValue",t);var r=n.value;var o=e.mailingLinksSelectionsCache[t];if(!o){o={};e.mailingLinksSelectionsCache[t]=o}o[r]=i}function v(e){return $('select[name="'+e+'"] option')}function m(e){return L(v(e))}function L(e){return $.map(e.toArray(),function(e){var t=$(e);return{id:t.val(),value:t.text()}})}function F(e){var i={};$('select[name="all_mailings_urls_config"] optgroup').each(function(){var e=$(this);var t=e.find("option");i[e.attr("label")]=t.map(function(){var e=$(this);return{id:e.val(),value:e.text()}})});return $.extend(e,{mailingLinks:new t(e&&e["URL_GET_MAILING_LINKS"],i),mailingLinksSelectionsCache:{},allColumns:v("all_columns_config"),intervalMailings:m("interval_mailings_config"),modSecondaryOperators:m("mod_secondary_operators_config"),allMailings:m("all_mailings_config"),dateOperators:m("date_operators_config"),mailingOperators:m("mailing_operators_config"),intervalMailingOperators:m("interval_mailing_operators_config"),numericOperators:m("numeric_operators_config"),stringOperators:m("string_operators_config"),mailTypes:m("mail_types_config"),genders:m("genders_config"),dateFormats:m("date_formats_config")})}function y(e,t,i){var n=t.value==null?"":t.value;var r=O(D("primaryValue",i),"form-control","1",null);I(r,n,"null","null");I(r,n,"not null","not null");R([r],$(t.parentNode))}function b(e,t,i){var n=e.modSecondaryOperators;var r=t.value==null?"":t.value;var o=S("secondaryOperator",i);var a=o==null?"":o.value;var s=S("secondaryValue",i);var l=s==null?"":s.value;var u=P(D("primaryValue",i),r,"form-control");var c=O(D("secondaryOperator",i),"form-control","1",null);$.each(M(n),function(e,t){I(c,a,t.id,t.value)});var d=P(D("secondaryValue",i),l,"form-control");R([u,c,d],$(t.parentNode))}function _(e,t,i){var n=t.value==null?"":t.value;var r=P(D("primaryValue",i),n,"form-control");R([r],$(t.parentNode))}function w(e,t,i){var n=e.mailTypes;var r=t.value==null?"":t.value;var o=O(D("primaryValue",i),"form-control","1",null);$.each(M(n),function(e,t){I(o,r,t.id,t.value)});R([o],$(t.parentNode))}function C(e,t,i){var n=e.genders;var r=t.value==null?"":t.value;var o=O(D("primaryValue",i),"form-control","1",null);$.each(M(n),function(e,t){I(o,r,t.id,t.value)});R([o],$(t.parentNode))}function A(e,t,i){var n=e.dateFormats;var r=t.value==null?"":t.value;var o=S("dateFormat",i);var a=o==null?"":o.value;var s=P(D("primaryValue",i),r,"form-control");var l=O(D("dateFormat",i),"form-control","1",null);$.each(M(n),function(e,t){I(l,a,t.id,t.value)});R([s,l],$(t.parentNode))}function E(e,t,i){var n=e.intervalMailings;var r=t.value==null?"":t.value;var o=O(D("primaryValue",i),"form-control js-select","1",null);$.each(M(n),function(e,t){I(o,r,t.id,t.value)});R([o],$(t.parentNode))}function x(e,t,i){var n=e.allMailings;var r=t.value==null?"":t.value;var o=O(D("primaryValue",i),"form-control js-select","1",null);$.each(M(n),function(e,t){I(o,r,t.id,t.value)});R([o],$(t.parentNode))}function T(e,t,i){var n=e.allMailings;var r=t.value==null?"":t.value;var o=S("secondaryValue",i);var a=o==null?"":o.value;var s=O(D("primaryValue",i),"form-control js-select","1",i);s.setAttribute("data-action","resetMailingUrls"+(i==null?"New":""));$.each(M(n),function(e,t){I(s,r,t.id,t.value)});r=s.value;var l=O(D("secondaryValue",i),"form-control js-select js-option-popovers","1",i);l.setAttribute("data-action","updateMailingLinkId"+(i==null?"New":""));k(e,r,l,e.mailingLinksSelectionsCache[i]&&e.mailingLinksSelectionsCache[i][r]);R([s,l],$(t.parentNode))}function S(e,t){return document.getElementsByName(D(e,t))[0]}function D(e,t){return e+(t!=null?"["+t+"]":"New")}function k(e,t,n,r){e.mailingLinks.retrieve(t).done(function(e){if(e.length==0){return}var t=null;$.each(e,function(e){if(e==0||this.id==r){t=this.id}});var i=$(n);$.each(e,function(){i.append($("<option/>",{value:this.id,text:this.value,selected:t==this.id}))});if(i.data("select2")){i.select2("val",t)}})}function O(e,t,i,n){var r=document.createElement("select");r.setAttribute("name",e);r.setAttribute("class",t);r.setAttribute("size",i);r.setAttribute("data-action",e.replace(/\[\d+\]/,""));if(n!=null){r.setAttribute("data-ruleid",n)}return r}function G(e,t){var i=$(t);$(e).parent().html(i);if(i.is("select")){N(i)}}function R(e,i){if(e.length>0){var t=12;var n="col-sm-"+Math.round(t/e.length);i=i.parent();i.empty();$.each(e,function(){var e=$(this);var t=$("<div>").addClass(n);t.append(e);i.append(t);if(e.is("select")){N(e)}})}}function N(e){AGN.Lib.CoreInitializer.run("select",e.parent())}function I(e,t,i,n){var r=$("<option/>",{value:i,text:n,selected:t.localeCompare(i)==0});r.appendTo($(e));return r}function P(e,t,i){var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("name",e);n.setAttribute("value",t);n.setAttribute("class",i);return n}function M(e){var t=[];for(var i in e){if(e.hasOwnProperty(i)){t.push(e[i])}}return t}AGN.Lib.RuleService={changedColumn:e,resetPrimaryOperators:h,resetMailingUrls:a,updateMailingLinksCache:g,switchTo:{operators:{mod:b,is:y},types:{string:_,mail:w,gender:C,date:A,mailing:x,mailingLinks:T,intervalMailing:E}},configure:F}})();(function(){var e,t=AGN.Lib.Form;e=function(e){t.apply(this,[e])};e.prototype=Object.create(t.prototype);e.prototype.updateHtml=function(e){var t=$(e).find("[data-form-content]"),i=this.$form.find("[data-form-content]");i.html(t.html());this.handleMessages(e);this.initFields(i);AGN.Lib.Controller.init(i);AGN.runAll(i);i.trigger("scrollTo",i)};AGN.Lib.SearchForm=e;AGN.Opt.Forms["search"]=e})();(function(){var n;n=function(e){this.$select=e;this.select=e[0];this.api=function(){args=Array.prototype.slice.call(arguments,0);e.select2.apply(e,args)}};n.get=function(e){var t,i;t=e;i=t.data("_select");if(!i){i=new n(t);t.data("_select",i)}return i};n.prototype.map=function(){var i=this;return _.reduce(i.values(),function(e,t){e[t]=i.$select.find("option[value='"+t+"']").html();return e},{})};n.prototype.values=function(){return _.map(this.$select.find("option"),function(e){return $(e).val()})};n.prototype.hasOption=function(e){const t=this.values();return t.indexOf(e)!==-1};n.prototype.clear=function(){this.api("val","")};n.prototype.selectNext=function(){const e=this.values();const t=this.getSelectedValue();const i=e.indexOf(t)+1;if(i<e.length){this.selectValue(e[i])}};n.prototype.selectValue=function(e){this.api("val",e)};n.prototype.getFirstValue=function(){return this.$select.find("option:first").val()};n.prototype.selectFirstValue=function(){this.api("val",this.getFirstValue())};n.prototype.selectValueOrSelectFirst=function(e){var t=false,i=this.values();if(!_.isArray(e)){e=[e]}t=_.every(e,function(e){return i.indexOf(e+"")!=-1});if(t&&e.length!=0){this.selectValue(e)}else{this.selectFirstValue()}};n.prototype.resetOptions=function(){this.$select.html("")};n.prototype.setOptions=function(e){var t;t=_.reduce(e,function(e,t){e+='<option value="'+t.id+'">'+t.text+"</option>";return e},"");this.$select.html(t)};n.prototype.addFormattedOption=function(e){this.$select.append(e)};n.prototype.getSelectedValue=function(){var e=this.$select.val();return e?e:""};AGN.Lib.Select=n})();(function(){var e,t=AGN.Lib.Form;e=function(e){t.apply(this,[e])};e.prototype=Object.create(t.prototype);e.prototype.jqxhr=function(){return this.form.submit()};e.prototype.submit=function(){var n=this,e=_.merge({},this._data,this._dataNextRequest);if(!this.valid()){this.handleErrors();return false}this.$form.trigger("form:submit");_.each(e,function(e,t){var i=$('<input type="hidden" name="'+t+'"/>');i.val(e);i.appendTo(n.$form)});this._dataNextRequest={};this.$form.submit();return $.Deferred().promise()};AGN.Lib.StaticForm=e;AGN.Opt.Forms["static"]=e})();(function(d){var f,p,e,t,i,a,n,r;r=function(i){function t(e,t,i){var n,r;if(i){n=new Date;n.setTime(n.getTime()+i*24*60*60*1e3);r="; expires="+n.toGMTString()}else{r=""}document.cookie=e+"="+t+r+"; path=/"}function n(e){e=JSON.stringify(e);if(i=="session"){window.name=e}else{t("localStorage",e,365)}}function e(){if(i=="session"){window.name=""}else{t("localStorage","",365)}}function r(){var t=i=="session"?window.name:a("localStorage");try{return JSON.parse(t)}catch(e){console.warn("Could not parse storage data: "+t+" cause: "+e)}return{}}var o=r();return{length:0,clear:function(){o={};this.length=0;e()},getItem:function(e,t){if(t===true){var i=r();return i[e]===undefined?null:i[e]}else{return o[e]===undefined?null:o[e]}},key:function(e){var t=0;for(var i in o){if(t==e)return i;else t++}return null},removeItem:function(e){delete o[e];this.length--;n(o)},setItem:function(e,t){o[e]=t+"";this.length++;n(o)}}};a=function(e){var t=e+"=",i=document.cookie.split(";"),n,r;for(n=0;n<i.length;n++){r=i[n];while(r.charAt(0)==" "){r=r.substring(1,r.length)}if(r.indexOf(t)==0){return r.substring(t.length,r.length)}}return null};try{if(!window.localStorage){n=new r("local")}else{n=window.localStorage}}catch(e){n=new r("local")}f=function(t){try{var e=n.getItem(l(t));if(e){return JSON.parse(e)}}catch(e){console.warn("Could not get Storage key: "+t+" cause: "+e)}return undefined};p=function(t,i){try{i=JSON.stringify(i);n.setItem(l(t),i)}catch(e){console.warn("Could not set Storage key:value "+t+":"+i+" cause: "+e)}};e=function(t){try{n.removeItem(l(t))}catch(e){console.warn("Could not remove Storage key:"+t+" cause: "+e)}};t=function(e){e.each(function(){var e=d(this);if(e.is("[data-stored-field]")&&(e.is("input")||e.is("select"))){o(e)}else{e.find("[data-stored-field]").each(function(){o(d(this))})}})};i=function(e){var t=false;e.each(function(){var e=d(this);if(e.is("[data-stored-field]")&&(e.is("input")||e.is("select"))){if(s(e)){t=true}}else{e.find("[data-stored-field]").each(function(){if(s(d(this))){t=true}})}});return t};function o(e){var t=e.data("stored-field")|"";var i=e.prop("name");if(i!=undefined){var n=undefined;if(e.prop("type")=="checkbox"){n=e.is(":checked")}else if(e.is("input")||e.is("select")){n=e.val()}if(n!=undefined){p(g(i,t),n)}}}function s(e){var t=e.data("stored-field")|"";var i=false;var n=e.prop("name");if(n!=undefined){var r=e.prop("type")||e.prop("type");var o=f(g(n,t));if(o===undefined){o=f(h(n,t));if(o===undefined){return false}p(g(n,t),o)}if(r=="radio"){if(e.val()!==o&&e.is(":checked")){e.prop("checked",false);return true}else if(e.val()==o&&!e.is(":checked")){e.prop("checked",true);return true}}else if(r=="checkbox"){if(e.prop("checked")!==o){e.prop("checked",o);i=true}}else if(r=="select-one"){var a=false;e.find("option").each(function(){if(d(this).val()==o){a=true;return false}});if(a&&e.val()!==o){e.val(o).change();i=true}}else if(r=="select-multiple"){var s=[];var l=e.value();e.find("option").each(function(){var i=d(this);d.each(o,function(e,t){if(i.val()==t){s.push(t)}})});s.sort();l.sort();var u=true;if(s.length!=l.length)u=false;for(var c=0;c<s.length;++c){if(s[c]!==l[c])u=false}if(!u){e.val(s).change();i=true}}else if(r=="textarea"||r=="text"){if(e.val()!==o){e.val(o);i=true}}}return i}function h(e,t){var i="stored_field_";if(e){i=i+e}if(t){i=i+"_"+t;return i}return undefined}function g(e,t){var i=h(e,t);if(i){return l(i)}else{return i}}function l(e){if(window.adminId){return window.adminId+"-"+e}return e}AGN.Lib.Storage={get:f,set:p,delete:e,readCookie:a,saveChosenFields:t,restoreChosenFields:i}})(jQuery);(function(){var s=AGN.Lib.Storage;var e,o,l,u;e=function(e){var t=e.data("toggle-tab"),i=u(e,t),n=s.get("toggle_tab"+i)||{},r=$(t);if(typeof r.data("tab-show")!=="undefined"){n.hidden=false;r.data("tab-show",undefined)}if(typeof r.data("tab-hide")!=="undefined"){n.hidden=true;r.data("tab-hide",undefined)}if(n.hidden===false||n.hidden!==true&&r.is(":visible")){o(e)}};o=function(e){var t=e.parents("ul").find("[data-toggle-tab]").not(e),i=e.data("toggle-tab"),n=u(e,i),r=$(i),o=e.find(".tab-toggle"),a=$(e.data("extends-tab"));_.each(t,function(e){l($(e))});e.parent().addClass("active");o.removeClass("icon-angle-down").addClass("icon-angle-up");r.removeClass("hidden");a.removeClass("hidden");r.trigger("tile:show");s.set("toggle_tab"+n,{hidden:false});AGN.Lib.CoreInitializer.run("load",r)};l=function(e){var t=e.data("toggle-tab"),i=u(e,t),n=e.find(".tab-toggle");e.parent().removeClass("active");n.removeClass("icon-angle-up").addClass("icon-angle-down");$(t).addClass("hidden");$(t).trigger("tile:hide");s.set("toggle_tab"+i,{hidden:true})};toggle=function(e){var t=e.data("toggle-tab"),i=$(t);if(i.is(":visible")){l(e)}else{o(e)}};u=function(e,t){var i=e.data("tab-group");if(i){return"/"+i}else{return t}};AGN.Lib.Tab={init:e,show:o,hide:l,toggle:toggle}})();(function(){var a=AGN.Lib.Popover;var n,s;s='<div class="pagination-top"></div>'+'<div class="ag-theme-bootstrap" style="height: calc(100% - 106px); width: 100%"></div>'+'<div class="pagination-bottom"></div>';n=function(e,i,n,r){var o=this;this.$el=e;this.$el.html(s);this.$el.data("_table",o);this.$paginationTop=this.$el.find(".pagination-top");this.$paginationBottom=this.$el.find(".pagination-bottom");i.forEach(function(e){if(e.cellRenderer){e.cellRenderer=AGN.Opt.TableCellRenderers[e.cellRenderer]}if(e.headerComponent){e.headerComponent=AGN.Opt.TableHeaderComponents[e.headerComponent]}if(e.comparator){e.comparator=AGN.Opt.Table["comparators"][e.comparator]}});this.gridOptions=_.merge({autoSizePadding:4,columnDefs:i,enableSorting:true,accentedSort:true,enableFilter:true,enableColResize:true,pagination:true,showRecordsCount:true,filtersDescription:{enabled:false,templateName:"",templateParams:{}},paginationPageSize:100,rowSelection:"multiple",unSortIcon:true,onCellClicked:function(e){switch(e.colDef.cellAction){case"select":e.node.setSelected(!e.node.isSelected());break;case"goTo":var t=e.data.show;if(t){if(e.event.ctrlKey){window.open(t,"_blank")}else{window.location.href=t}}break}},onCellMouseOver:function(e){if(e.colDef.textInPopoverIfTruncated===true){var t=e.event.target,i=t.clientWidth<t.scrollWidth;if(i){l(e).show()}}},onCellMouseOut:function(e){if(e.colDef.textInPopoverIfTruncated===true){var t=a.get($(e.event.target));if(t){t.hide()}}},suppressRowClickSelection:true,headerHeight:41,rowHeight:34,suppressPaginationPanel:true,onPaginationChanged:function(){o.renderPagination()},defaultColDef:{headerComponentParams:{template:'<div class="ag-cell-label-container" role="presentation">'+'  <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button"></span>'+'  <div ref="eLabel" class="ag-header-cell-label" role="presentation">'+'    <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon" ></span>'+'    <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon" ></span>'+'    <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon" ></span>'+'    <span ref="eText" class="ag-header-cell-text" role="columnheader"></span>'+'    <span ref="eFilter" class="ag-header-icon ag-filter-icon"></span>'+'    <span ref="eSortOrder" class="ag-header-icon ag-sort-order" ></span>'+"  </div>"+"</div>"},filterParams:{clearButton:true}},columnTypes:{numberColumn:{width:83,filter:"agNumberColumnFilter",comparator:AGN.Lib.TableNumberComparator},dateColumn:{filter:AGN.Lib.TableDateFilter},setColumn:{filter:AGN.Lib.TableSetFilter},bulkSelectColumn:{headerName:"",editable:false,checkboxSelection:true,headerCheckboxSelection:true,headerComponent:AGN.Opt.TableHeaderComponents["NoLabelHeader"],suppressResize:true,suppressMenu:true,suppressSorting:true,cellAction:"select",suppressSizeToFit:true,cellStyle:{textAlign:"center"}},deleteColumn:{headerName:"",editable:false,suppressResize:true,suppressMenu:true,suppressSorting:true,cellAction:null,cellRenderer:AGN.Opt.TableCellRenderers["DeleteCellRenderer"],suppressSizeToFit:true,"button-tooltip":t("defaults.delete")},textCaseInsensitiveColumn:{comparator:AGN.Lib.TableCaseInsensitiveComparator}},icons:{menu:'<i class="icon icon-filter"/>',filter:'<i class="icon icon-filter"/>',columns:'<i class="icon icon-handshake-o"/>',sortAscending:'<i class="icon icon-sort-asc"/>',sortDescending:'<i class="icon icon-sort-desc"/>',checkboxChecked:'<i class="icon icon-check-square-o"/>',checkboxUnchecked:'<i class="icon icon-square-o"/>',checkboxIndeterminate:'<i class="icon icon-square-o"/>',checkboxCheckedReadOnly:'<i class="icon icon-check-square-o"/>',checkboxUncheckedReadOnly:'<i class="icon icon-square-o"/>',checkboxIndeterminateReadOnly:'<i class="icon icon-square-o"/>',sortUnSort:'<i class="icon-fa5 icon-fa5-sort"/>'},localeText:window.I18n.tables},r||{});if(!this.gridOptions.showRecordsCount&&!this.gridOptions.pagination){this.$el.find(".ag-theme-bootstrap").height(this.gridOptions.autoHeight?"auto":this.$el.parent().height())}this.grid=new agGrid.Grid(this.$el.find(".ag-theme-bootstrap").get(0),this.gridOptions);this.api=this.gridOptions.api;this.columnApi=this.gridOptions.columnApi;this.api.setRowData(n);this.redraw()};n.prototype.renderPagination=function(){var e=this.api,t,i,n,r,o=AGN.Lib.Template.prepare("table-controls-top");paginationBottomTemplate=AGN.Lib.Template.prepare("table-controls-bottom");if(!e){return}t=e.paginationGetCurrentPage()+1;i=e.paginationGetTotalPages();n=[t];_.times(5,function(e){if(t-(e+1)>0){n.unshift(t-(e+1))}if(t+(e+1)<=i){n.push(t+(e+1))}});r={pagination:this.gridOptions.pagination,showRecordsCount:this.gridOptions.showRecordsCount,currentPage:t,totalPages:i,itemStart:e.paginationGetPageSize()*(t-1)+1,itemEnd:t==i?e.paginationGetRowCount():e.paginationGetPageSize()*t,itemTotal:e.paginationGetRowCount(),pageSelects:n};this.$paginationTop.html(o(r));var a=this.gridOptions.filtersDescription;if(a.enabled&&a.templateName){this.$paginationTop.find("#filtersDescription").html(AGN.Lib.Template.text(a.templateName),a.templateParams)}this.$paginationBottom.html(paginationBottomTemplate(r));this.api.redrawRows()};n.prototype.redraw=function(){var e=this.columnApi.getAllDisplayedColumns().filter(function(e){return e.getColDef().suppressSizeToFit===true}).map(function(e){return e.getColId()});if(e.length){this.columnApi.autoSizeColumns(e)}this.api.sizeColumnsToFit()};n.get=function(e){var t,i;t=n.getWrapper(e);i=t.data("_table");return i};n.getWrapper=function(e){var t;t=$(e.data("table-body"));if(t.length==0){t=e.closest(".js-data-table-body")}return t};AGN.Lib.Table=n;function l(e){var t=$(e.event.target),i=a.get(t);if(!i){return a.new(t,{trigger:"manual",container:"body",content:e.value})}return i}})();(function(){var e;e=function(){};e.getComplexityColor=function(e){var t;if(e<10){t="green"}else if(e>=10&&e<17){t="yellow"}else{t="red"}return t};AGN.Lib.TargetGroup=e})();(function(){const i=AGN.Lib.CSRF;const n=AGN.Opt.Templates;function r(e){if(e in n){const t=_.template(n[e]);return o(t)}throw new Error("There's no template `"+e+"` registered")}function o(t){return function(){const e=t.apply(this,arguments);return i.updateTokenInDOM(e,true)}}function a(e,t){return r(e)(t)}function e(e,t){return $(a(e,t))}AGN.Lib.Template={prepare:r,text:a,dom:e}})();(function(){const o=AGN.Lib.Storage;var e,t,i,r,a;e=function(e){const t=e.data("toggle-tile"),i=o.get("toggle_tile"+t);if(!i){const n=e.data("toggle-tile-default-state");if(typeof n!=="undefined"){if(n==="open"){s(e,false)}else{l(e,false)}}return}if(i.hidden){a(e)}else{r(e)}};t=function(e){const t=$(e.data("toggle-tile"));if(t.hasClass("hidden")){r(e)}else{a(e)}};r=function(e){s(e,true)};function s(e,t){const i=e.find(".icon"),n=e.data("toggle-tile"),r=$(n);r.removeClass("hidden");i.addClass("icon-angle-up");i.removeClass("icon-angle-down");if(t){o.set("toggle_tile"+n,{hidden:false})}AGN.Lib.CoreInitializer.run("load",r)}i=function(e){return e.closest(".tile").find("[data-toggle-tile]")};a=function(e){l(e,true)};function l(e,t){const i=e.find(".icon"),n=e.data("toggle-tile");$(n).addClass("hidden");i.addClass("icon-angle-down");i.removeClass("icon-angle-up");if(t){o.set("toggle_tile"+n,{hidden:true})}}AGN.Lib.Tile={toggle:t,init:e,show:r,hide:a,trigger:i}})();(function(){var r={},o=AGN.Lib.Template,a=AGN.Lib.Helpers;var n=function(){var i=o.prepare("tooltip-message-with-title");var n=o.prepare("tooltip-message-just-content");return function(e,t){if(e){return i({title:e,content:t})}return n({content:t})}}();var s=function(){var n=o.prepare("tooltip-template");return function(e,t,i){return n({tooltipStyle:e,arrowStyle:t,innerStyle:i})}}();function l(e,t){return{title:e,container:"body",template:s(t)}}function u(e,t,i){return{title:n(e,t),container:"body",html:true,placement:"auto top",template:s(i,"helper-popup-arrow","helper-popup")}}r.options=function(e){var t={};if(e.is("[data-tooltip]")){var i=e.data("tooltip");var n=e.data("tooltip-src");if(n){i=o.text(n,{element:e})}t=l(i,e.data("tooltip-style"))}else if(e.is("[data-tooltip-help]")){t=u(e.data("tooltip-help"),e.data("tooltip-help-text"),e.data("tooltip-style"))}return $.extend(t,a.objFromString(e.data("tooltip-options")))};r.create=function(e,t){r.remove(e);e.bsTooltip(t);e.on({"dragstart.tooltip":function(){e.bsTooltip("hide");e.bsTooltip("disable")},"dragstop.tooltip":function(){e.bsTooltip("enable")}});e.on("remove",function(){r.remove(e)})};r.remove=function(e){e.bsTooltip("hide");e.bsTooltip("destroy");e.off("dragstart.tooltip dragstop.tooltip")};r.setEnabled=function(e,t){if(t||t===undefined){e.bsTooltip("enable")}else{e.bsTooltip("hide");e.bsTooltip("disable")}};r.setShown=function(e,t){if(t||t===undefined){e.bsTooltip("show")}else{e.bsTooltip("hide")}};r.createTip=function(e,t,i){r.create(e,l(t,i))};r.createHelpTip=function(e,t,i,n){r.create(e,u(t,i,n))};AGN.Lib.Tooltip=r})();(function(){var e=AGN.Lib.Action;var t;var n;var o;t=function(){};t.prototype.load=function(e,t){o=t;n=_.template(AGN.Opt.Templates["trackablelink-extension-table-row"]);_.each(e,function(e,t){r(t,e.name,e.value)});i("","")};t.prototype.collect=function(){if(o&&o.length){return _.map(o.find("[data-extension-row]"),function(e){var t=$(e);return{name:l(t),value:u(t)}}).filter(function(e){return e.name&&e.value})}return[]};e.new({click:"[data-extension-add]",enterdown:"[data-extension-row]"},function(){this.event.preventDefault();if(a("","")){s();i("","")}o.find("[data-extension-name]:last").focus()});e.new({click:"[data-extension-delete]"},function(){var e=this.el.closest("tr");e.remove()});e.new({click:"[data-add-default-extensions]"},function(){var e=o.find("tr:last");if(l(e)==""&&u(e)==""){e.remove()}else{s()}_.each(AGN.Opt.DefaultExtensions,function(e){i(e.name,e.value)});i("","")});function r(e,t,i){if(a(t,i)){o.append(n({index:e,name:t,value:i}))}}function i(e,t){var i=o.find("[data-extension-row]:last-child").data("extension-row")||0;r(++i,e,t)}function a(i,n){var r=true;_.each(o.find("[data-extension-row]"),function(e){var t=$(e);if(r){if(l(t)==i&&u(t)==n){r=false}}});return r}function s(){var e=o.find("#newExtensionBtn");e.after("<a href='#' class='btn btn-regular btn-alert' data-extension-delete>"+"<i class='icon icon-trash-o'></i></a>");e.remove()}function l(e){return e.find("[data-extension-name]").val()}function u(e){return e.find("[data-extension-value]").val()}AGN.Lib.TrackableLinkExtensions=t})();(function(){AGN.Lib.Truncate={run:function(e,t){var i,n;i=e.width();n=_.reduce(e.children().not(t),function(e,t){return e+$(t).outerWidth(true)},0);n=n+($(t).outerWidth(true)-$(t).outerWidth());n=n*.05>5?1.05*n:n+5;n=n>i?i:n;e.children(t).css({"max-width":i-n+"px",overflow:"hidden"})}}})();(function(){var n;n=function(e){if(e.init){e.init();delete e.init}return $.extend(this,e)};n.exists=function(e){return AGN.Opt.Validators.hasOwnProperty(e)};n.get=function(e){return n.exists(e)?AGN.Opt.Validators[e]:null};n.new=function(e,t){if(n.exists(e)){console.debug("Validator with name `"+e+"` was overridden")}var i=new n(t);AGN.Opt.Validators[e]=i;return i};n.prototype.valid=function(){return true};n.prototype.errors=function(){return[]};AGN.Lib.Validator=n})();(function(){var e,t,i;e=function(){var e=$("[data-view]:checked"),t=AGN.Lib.Storage.get("view_"+e.data("view"));if(t){$('[data-view][value="'+t.view+'"]').prop("checked",true)}else{t={view:e.val()}}i(t.view)};t=function(e){var t=e.val();i(t);AGN.Lib.Storage.set("view_"+e.data("view"),{view:t})};i=function(i){_.each($("[data-view-"+i+"]"),function(e){var t=$(e);t.attr("class",t.data("view-"+i))});$(window).trigger("resize");AGN.Lib.CoreInitializer.run("load");if($("#preview").length){s(i)}};function n(){$("#preview-contents").css("height","");$(".mailing-preview-wrapper").css("overflow-y","")}function r(e){e.css({"flex-grow":"1","overflow-y":"auto"})}function o(e){var t=$(".tile").first().offset().top;$('[data-load-target="#preview"]').parent().css({position:"sticky",top:(e?15:t)+"px"})}function a(e){return e.length&&e.find("iframe").length}function s(e){var t=$("#gt-wrapper").exists();var i=$(".mailing-preview-wrapper");if(!i.length&&t){i=$("#preview").find(".tile-content-padded")}if(a(i)){if(e==="block"){n(i)}else if(e==="split"){i.css("height","0px");o(t);l(i,t);r(i,t);i.css("height","")}}}function l(e,t){var i=e.parent();i.css({display:"flex","flex-direction":"column",height:"calc(100vh - "+Math.ceil(i.offset().top-$(window).scrollTop()+(t?45:10))+"px)","min-height":"200px"})}AGN.Lib.View={init:e,trigger:t}})();(function(){var i=AGN.Lib.Storage;var n={};n.get=function(e){var t="web-storage#"+$.trim(e);try{return i.get(t)}catch(e){console.error(e)}return null};n.set=function(e,t){i.set("web-storage#"+$.trim(e),t)};n.extend=function(e,t){var i=n.get(e);if(i!=null){i=$.extend(i,t)}else{i=t}n.set(e,i);return i};AGN.Lib.WebStorage=n})();(function(){var e={actionbased_mailing:{icons:{inactive:"icon_actionbased_mailing_g.png",active:"icon_actionbased_mailing_l.png",dialog:"icon_actionbased_mailing_s.png"},anchors:[[.07,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},mailing_mediatype_sms:{icons:{inactive:"icon_sms_g.png",active:"icon_sms_l.png",dialog:"icon_sms_s.png"},anchors:[[.07,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},mailing_mediatype_post:{icons:{inactive:"icon_post_g.png",active:"icon_post_l.png",dialog:"icon_post_s.png"},anchors:[[.07,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},archive:{icons:{inactive:"icon_archive_g.png",active:"icon_archive_l.png",dialog:"icon_archive_s.png"},anchors:[[.1,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.8,0,1]]},datebased_mailing:{icons:{inactive:"icon_datebased_mailing_g.png",active:"icon_datebased_mailing_l.png",dialog:"icon_datebased_mailing_s.png"},anchors:[[.07,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},deadline:{icons:{inactive:"icon_deadline_g.png",active:"icon_deadline_l.png",dialog:"icon_deadline_s.png"},anchors:[[.1,.5,-1,0],[.5,.05,0,-1],[.9,.5,1,0],[.5,.9,0,1]]},decision:{icons:{inactive:"icon_decision_g.png",active:"icon_decision_l.png",dialog:"icon_decision_s.png"},anchors:[[.06,.5,-1,0],[.5,.06,0,-1],[.94,.5,1,0],[.5,.94,0,1]]},export:{icons:{inactive:"icon_export_g.png",active:"icon_export_l.png",dialog:"icon_export_s.png"},anchors:[[.1,.5,-1,0],[.5,.1,0,-1],[.9,.5,1,0],[.5,.9,0,1]]},followup_mailing:{icons:{inactive:"icon_followup_mailing_g.png",active:"icon_followup_mailing_l.png",dialog:"icon_followup_mailing_s.png"},anchors:[[.04,.5,-1,0],[.5,.2,0,-1],[.96,.5,1,0],[.5,.8,0,1]]},form:{icons:{inactive:"icon_form_g.png",active:"icon_form_l.png",dialog:"icon_form_s.png"},anchors:[[.1,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},import:{icons:{inactive:"icon_import_g.png",active:"icon_import_l.png",dialog:"icon_import_s.png"},anchors:[[.1,.5,-1,0],[.5,.1,0,-1],[.9,.5,1,0],[.5,.9,0,1]]},mailing:{icons:{inactive:"icon_mailing_g.png",active:"icon_mailing_l.png",dialog:"icon_mailing_s.png"},anchors:[[.1,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},ownWorkflow:{icons:{inactive:"icon_ownWorkflow_g.png",active:"icon_ownWorkflow_l.png",dialog:"icon_ownWorkflow_s.png"},anchors:[[.1,.5,-1,0],[.5,.22,0,-1],[.9,.5,1,0],[.5,.78,0,1]]},parameter:{icons:{inactive:"icon_parameter_g.png",active:"icon_parameter_l.png",dialog:"icon_parameter_s.png"},anchors:[[.1,.5,-1,0],[.5,.1,0,-1],[.9,.5,1,0],[.5,.9,0,1]]},recipient:{icons:{inactive:"icon_recipient_g.png",active:"icon_recipient_l.png",dialog:"icon_recipient_s.png"},anchors:[[.1,.5,-1,0],[.5,.1,0,-1],[.9,.5,1,0],[.5,.9,0,1]]},scABTest:{icons:{inactive:"icon_scABTest_g.png",active:"icon_scABTest_l.png",dialog:"icon_scABTest_s.png"},anchors:[[.1,.5,-1,0],[.5,.15,0,-1],[.9,.5,1,0],[.5,.85,0,1]]},scBirthday:{icons:{inactive:"icon_scBirthday_g.png",active:"icon_scBirthday_l.png",dialog:"icon_scBirthday_s.png"},anchors:[[.1,.5,-1,0],[.5,.1,0,-1],[.9,.5,1,0],[.5,.85,0,1]]},scDOI:{icons:{inactive:"icon_scDOI_g.png",active:"icon_scDOI_l.png",dialog:"icon_scDOI_s.png"},anchors:[[.3,.5,-1,0],[.5,.04,0,-1],[.72,.5,1,0],[.5,.96,0,1]]},start:{icons:{inactive:"icon_start_g.png",active:"icon_start_l.png",dialog:"icon_start_s.png"},anchors:[[0,.5,-1,0],[.5,.15,0,-1],[1,.5,1,0],[.5,.85,0,1]]},stop:{icons:{inactive:"icon_start_g.png",active:"icon_stop_l.png",dialog:"icon_start_s.png"},anchors:[[0,.5,-1,0],[.5,.15,0,-1],[1,.5,1,0],[.5,.85,0,1]]}};var t={"*":{deadline:function(e,t){return!t.connections.incoming.some(function(e){return e.source.getType()==="import"})},mailing:function(e,t){return t.connections.incoming.length===0},datebased_mailing:function(e,t){return t.connections.incoming.length===0}},start:{recipient:true,form:true,import:true,export:true},stop:false,decision:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,actionbased_mailing:true,datebased_mailing:true,followup_mailing:true,mailing:true},parameter:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,actionbased_mailing:true,datebased_mailing:true,followup_mailing:true,mailing:true},deadline:{decision:true,parameter:true,recipient:true,archive:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,actionbased_mailing:true,datebased_mailing:true,followup_mailing:true,mailing:true,import:true,export:true},recipient:{decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,actionbased_mailing:true,datebased_mailing:true,followup_mailing:true,mailing:true,import:true,export:true},actionbased_mailing:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},datebased_mailing:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},followup_mailing:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},mailing:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},mailing_mediatype_sms:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},mailing_mediatype_post:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,import:true,export:true},archive:{decision:true,parameter:true,deadline:true,recipient:true,actionbased_mailing:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,datebased_mailing:true,followup_mailing:true,mailing:true,import:true,export:true},form:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,form:true,archive:true,actionbased_mailing:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,datebased_mailing:true,followup_mailing:true,mailing:true,import:true,export:true},import:{deadline:function(e){return e.connections.outgoing.length===0}},export:{stop:true,decision:true,parameter:true,deadline:true,recipient:true,actionbased_mailing:true,mailing_mediatype_sms:true,mailing_mediatype_post:true,datebased_mailing:true,followup_mailing:true,mailing:true,import:true,export:true,archive:true,form:true}};AGN.Lib.WM.Definitions={KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_SPACE:32,KEY_DELETE:46,MOUSE_BUTTON_LEFT:0,MOUSE_BUTTON_MIDDLE:1,DEFAULT_DRAG_MODE:0,GRID_CELL_DRAG_MODE:1,BOTTOM:"BOTTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP",NODE_ANIMATION_DROPPED:"animate-dropped",NODE_ANIMATION_AUTO_DROPPED:"animate-auto-dropped",Z_INDEX_VIEW_PORT:10,Z_INDEX_ICON_PANEL:50,Z_INDEX_DRAGGABLE_BUTTON:60,Z_INDEX_ICON_TITLES_CONTAINER:5,Z_INDEX_CONNECTION_OVERLAY:9,Z_INDEX_ICON:10,Z_INDEX_CONNECTION_HOVER:11,Z_INDEX_CONNECTION_OVERLAY_HOVER:12,Z_INDEX_ICON_HOVER:13,Z_INDEX_ICON_TITLE_HOVER:19,Z_INDEX_DRAGGED_ICON_NODE:20,Z_INDEX_JSPLUMB_DRAG_OPTIONS:25,Z_INDEX_NAVIGATOR_GLOBE:30,Z_INDEX_NAVIGATOR_ARROWS:31,Z_INDEX_CONTEXT_MENU:40,CANVAS_DEFAULT_GRID_SIZE:20,CANVAS_GRID_SIZE:20,NODE_SIZE:64,NODE_MIN_MARGIN:.1,TITLE_WIDTH:94,MINIMAP_PADDING:2,DEFAULT_AUTO_ALIGN_STEP_X:5,GRID_AUTO_ALIGN_STEP_X:2,AUTO_ALIGN_STEP_X:5,AUTO_ALIGN_EXTRA_STEP_X:.5,DEFAULT_AUTO_ALIGN_STEP_Y:6,GRID_AUTO_ALIGN_STEP_Y:2,AUTO_ALIGN_STEP_Y:6,AUTO_ALIGN_STEP_BETWEEN_GROUPS:2,AUTO_DROP_STEP_X:4,AUTO_DROP_STEP_Y:3,MIN_ZOOM:.5,MAX_ZOOM:1.5,DEFAULT_ZOOM:1,ZOOM_STEP:.1,NAVIGATION_STEP:100,MAX_UNDO_STEPS:17,CONNECTION_COLOR:"#61B7CF",CONNECTION_THICKNESS:3,CONNECTION_OUTLINE_COLOR:"transparent",CONNECTION_OUTLINE_WIDTH:4,CONNECTION_HOVER_COLOR:"#216477",CONNECTION_ARROW_SIZE:10,NODE_TYPE_START:"start",NODE_TYPE_STOP:"stop",NODE_TYPE_DECISION:"decision",NODE_TYPE_DEADLINE:"deadline",NODE_TYPE_PARAMETER:"parameter",NODE_TYPE_RECIPIENT:"recipient",NODE_TYPE_ARCHIVE:"archive",NODE_TYPE_FORM:"form",NODE_TYPE_MAILING:"mailing",NODE_TYPE_OWN_WORKFLOW:"ownWorkflow",NODE_TYPE_SC_BIRTHDAY:"scBirthday",NODE_TYPE_SC_DOI:"scDOI",NODE_TYPE_SC_ABTEST:"scABTest",NODE_TYPE_ACTION_BASED_MAILING:"actionbased_mailing",NODE_TYPE_MAILING_MEDIATYPE_SMS:"mailing_mediatype_sms",NODE_TYPE_MAILING_MEDIATYPE_POST:"mailing_mediatype_post",NODE_TYPE_DATE_BASED_MAILING:"datebased_mailing",NODE_TYPE_FOLLOWUP_MAILING:"followup_mailing",NODE_TYPE_IMPORT:"import",NODE_TYPE_EXPORT:"export",NODE_TYPES_MAILING:["mailing","followup_mailing","actionbased_mailing","datebased_mailing","mailing_mediatype_sms","mailing_mediatype_post"],NODE_TYPES_IMPORT_EXPORT:["import","export"],NODE_TYPE_START_ID:0,NODE_TYPE_STOP_ID:1,NODE_TYPE_DECISION_ID:2,NODE_TYPE_DEADLINE_ID:3,NODE_TYPE_PARAMETER_ID:4,NODE_TYPE_RECIPIENT_ID:6,NODE_TYPE_ARCHIVE_ID:7,NODE_TYPE_FORM_ID:8,NODE_TYPE_MAILING_ID:9,NODE_TYPE_OWN_WORKFLOW_ID:10,NODE_TYPE_SC_BIRTHDAY_ID:11,NODE_TYPE_SC_DOI_ID:12,NODE_TYPE_SC_ABTEST_ID:13,NODE_TYPE_ACTION_BASED_MAILING_ID:14,NODE_TYPE_DATE_BASED_MAILING_ID:15,NODE_TYPE_FOLLOWUP_MAILING_ID:16,NODE_TYPE_IMPORT_ID:17,NODE_TYPE_EXPORT_ID:18,NODE_TYPE_MAILING_MEDIATYPE_SMS_ID:19,NODE_TYPE_MAILING_MEDIATYPE_POST_ID:20,MAILING_PARAM_MAILING_LIST:1,MAILING_PARAM_TARGET_GROUPS:2,MAILING_PARAM_ARCHIVE:3,MAILING_PARAM_LIST_SPLIT:4,MAILING_PARAM_PLANNED_DATE:5,MAILING_PARAM_SEND_DATE:6,MAILING_PARAM_ALTGS:7,DEPENDENCY_TYPE_ARCHIVE:1,DEPENDENCY_TYPE_AUTO_EXPORT:2,DEPENDENCY_TYPE_AUTO_IMPORT:3,DEPENDENCY_TYPE_MAILING_DELIVERY:4,DEPENDENCY_TYPE_MAILING_LINK:5,DEPENDENCY_TYPE_MAILING_REFERENCE:6,DEPENDENCY_TYPE_MAILINGLIST:7,DEPENDENCY_TYPE_PROFILE_FIELD:8,DEPENDENCY_TYPE_PROFILE_FIELD_HISTORY:9,DEPENDENCY_TYPE_TARGET_GROUP:11,DEPENDENCY_TYPE_USER_FORM:12,GENDER_PROFILE_FIELD:"gender",FIELD_TYPE_DATE:"date",SPLIT_DEFAULT_PARAMETERS:[5,10,15,20,25,30,33,40,50],TITLE_MAX_TARGETS:2,PDF_SIZE:"A4",PDF_ORIENTATION:"landscape",PAGE_DIMENSIONS:{A4:{width:800,height:1360}},ICONS_CONFIG:e,CONNECTION_CONSTRAINTS:t,NODE_POPOVER_TEMPLATE:'<div class="popover popover-wide" role="tooltip" ><div class="arrow"></div><div class="popover-content" style="width: auto; height: auto; max-width: 300px; max-height: 350px; overflow: auto;"></div></div>',EMPTY_OPTION_PLACEHOLDER:"--"}})();(function(){var n=AGN.Lib.WM.Definitions,i=AGN.Lib.Helpers,o=AGN.Lib.DateFormat;AGN.Lib.WM.Utils={checkActivation:function(e){var i=$("#workflow-status").val();if(n.constants.initialWorkflowStatus===n.constants.statusActive&&(i===n.constants.statusActive||i===n.constants.statusTesting)){if(e){AGN.Lib.Messages(t("workflow.defaults.error"),t("error.workflow.saveActivatedWorkflow"),"alert")}return true}else{return false}},getConfigData:function(e){return i.objFromString(e.data("config"))},mapAsOptionsHtml:function(i){var n="";Object.keys(i).forEach(function(e){var t='value="'+e+'"';n+="<option "+t+">"+i[e]+"</option>"});return n},arrayAsOptionsHtml:function(e){var r="";e.forEach(function(e){var t='value="'+e.id+'"';var i=e.data;if(i){Object.keys(i).forEach(function(e){t+=" data-"+e+'="'+i[e].replace('"',"&quot;")+'"'})}var n=e.text.replace("<","&lt;").replace(">","&gt;");r+="<option "+t+">"+n+"</option>"});return r}};AGN.Lib.WM.DateTimeUtils={toDateTime:function(e,t,i){var n=null;if(!!e&&e.getMonth){n=new Date(e);if(!!t&&t!==0){n.setHours(t)}if(!!i&&i!==0){n.setMinutes(i)}}return n},getDateTimeValue:function(e,t,i){var n=this.toDateTime(e,t,i);return n!=null?n.getTime():null},getDateTimeStr:function(e,t,i,n){if(!e||!e.getMonth){return""}t=t||e.getHours();i=i||e.getMinutes();var r=this.toDateTime(e,t,i);if(!!r){return o.format(r,n)}else{return""}},getDateStr:function(e,t){return this.getDateTimeStr(e,null,null,t)}}})();(function(){function e(e){this.rules=e}e.prototype.isConstraint=function(e){return _.isBoolean(e)||_.isFunction(e)};e.prototype.evaluate=function(e,t,i){if(e===true||e===false){return e}if(_.isFunction(e)){return e(t,i)}return undefined};e.prototype.getRulesToCheck=function(e,t){return[{from:e.type,to:[t.type,"*"]},{from:"*",to:[t.type,"*"]}]};e.prototype.getRelevantConstraints=function(e,t){var r=this.isConstraint;var i=this.getRulesToCheck(e,t);var o=this.rules;var a=[];i.forEach(function(t){var i=true;if(_.has(o,t.from)){var n=o[t.from];if(r(n)){a.push(n);i=false}else{t.to.forEach(function(e){if(_.has(o[t.from],e)){n=o[t.from][e];if(r(n)){a.push(n);i=false}}})}}if(i&&t.from!="*"){a.push(false)}});return a};e.prototype.check=function(e,t){var i=this.getRelevantConstraints(e,t);var n=false;for(var r=0;r<i.length;r++){if(this.evaluate(i[r],e,t)){n=true}else{return false}}return n};AGN.Lib.WM.ConnectionConstraints=e})();(function(){var t=AGN.Lib.WM.DateTimeUtils,i=AGN.Lib.Template,l=AGN.Lib.WM.Definitions,n=AGN.Lib.Popover;function u(e,t){this.id=null;this.x=0;this.y=0;this.type=e;this.title="";this.overlayTitle="";this.overlayImage={image:"",title:"",visible:false};this.filled=false;this.editable=true;this.expandable=false;this.dependent=false;this.inRecipientsChain=false;this.anchors=l.ICONS_CONFIG[e].anchors;this.data=t;this.$element=u.create$(e);this.$element.data("agn:node",this);this.$connectionButton=this.$element.find(".node-connect-button");this.$titleDiv=u.createTitleDiv$();this.$titleSpan=this.$titleDiv.find(".icon-title-span");this.$overlayTitle=this.$element.find(".icon-overlay-title");this.$overlayImage=this.$element.find(".icon-overlay-image img");this.nodePopover=new c(this);this.lastTitleAnchor=l.BOTTOM}u.restore=function(e){var t=e.get$().data("agn:node");if(!t){e.get$().data("agn:node",e)}return e};u.get=function(e){if(e instanceof HTMLElement){e=$(e)}if(!e.is(".node")){e=e.closest(".node")}return e.data("agn:node")};u.isDecisionNode=function(e){return e.getType()===l.NODE_TYPE_DECISION};u.isMailingNode=function(e){if(!e){return false}return l.NODE_TYPES_MAILING.includes(e.getType())};u.isBranchingDecisionNode=function(e){if(u.isDecisionNode(e)){var t=e.getData();if(t.decisionType===l.constants.decisionTypeDecision){return true}}return false};u.isDecisionBranchesOrderFromPositiveToNegative=function(e,t,i){if(t.y<=e.y&&i.y<=e.y){if(t.y<i.y){return true}else if(i.y<t.y){return false}else{return t.x<i.x}}else if(t.y>e.y&&i.y>e.y){return t.x>i.x}else{return t.y<i.y}};u.getDecisionBranches=function(e){if(e.length===2){var t=u.getPosition(e[0].source.get$());var i=u.getPosition(e[0].target.get$());var n=u.getPosition(e[1].target.get$());if(this.isDecisionBranchesOrderFromPositiveToNegative(t,i,n)){return{positive:e[0],negative:e[1]}}else{return{positive:e[1],negative:e[0]}}}return null};u.isCommented=function(e){return!!_.trim(e.getComment())};u.isSelected=function(e){return e.hasClass("ui-selected")};u.setSelected=function(e,t){return e.toggleClass("ui-selected",!!t)};u.isChainSource=function(e){return e.hasClass("chain-mode-source")};u.setChainSource=function(e,t){e.toggleClass("chain-mode-source",!!t)};u.getAnchors=function(e){var t=u.get(e);if(t){return t.getAnchors()}return l.ICONS_CONFIG[e.data("type")].anchors};u.getAnchorsInUse=function(e){var i={};e.forEach(function(e){var t=e.anchor.getOrientation();if(t[0]>0){i[l.RIGHT]=true}else if(t[0]<0){i[l.LEFT]=true}else if(t[1]>0){i[l.BOTTOM]=true}else if(t[1]<0){i[l.TOP]=true}});return i};u.getPosition=function(e){var t=e.position();return{x:t.left,y:t.top}};u.getBox=function(e){var t=e.position();var i=e[0].getBoundingClientRect();return{minX:t.left,minY:t.top,maxX:t.left+i.width,maxY:t.top+i.height}};u.isInRegion=function(e,t){var i=u.getBox(e);return(i.minX>=t.minX&&i.minX<=t.maxX||i.maxX>=t.minX&&i.maxX<=t.maxX)&&(i.minY>=t.minY&&i.minY<=t.maxY||i.maxY>=t.minY&&i.maxY<=t.maxY)};u.getCollisionBox=function(e){var t=u.getAnchors(e);var i=e.position();var n=e[0].getBoundingClientRect();var r=(t[0][0]-l.NODE_MIN_MARGIN)*n.width;var o=(t[1][1]-l.NODE_MIN_MARGIN)*n.height;var a=(1-t[2][0]-l.NODE_MIN_MARGIN)*n.width;var s=(1-t[3][1]-l.NODE_MIN_MARGIN)*n.height;return{minX:i.left+r,minY:i.top+o,maxX:i.left+n.width-a,maxY:i.top+n.height-s}};u.detectBoxCollision=function(e,t){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)};u.create$=function(){var t=null;return function(e){if(t==null){t=i.prepare("workflow-node")}return $(t({icons:l.ICONS_CONFIG[e].icons}))}}();u.createDraggable$=function(){var t=null;return function(e){if(t==null){t=i.prepare("workflow-draggable-node")}return $(t({type:e,icons:l.ICONS_CONFIG[e].icons}))}}();u.createTitleDiv$=function(){var e=null;return function(){if(e==null){e=i.prepare("workflow-icon-title")}return $(e({}))}}();u.create=function(e){var t={iconComment:""};var i=new u(e,t);switch(e){case"scABTest":case"scBirthday":case"scDOI":i.setFilled(true);i.setExpandable(true);t.copyContent=true;t.created=false;break;case"ownWorkflow":i.setExpandable(true);t.ownWorkflowId=0;t.copyContent=true;t.created=false;break;case"start":t.startType=null;t.date=null;t.hour=0;t.minute=0;t.sendReminder=false;t.remindAdminId=0;t.remindAtOnce=false;t.scheduleReminder=false;t.remindSpecificDate=false;t.remindDate=new Date;t.remindHour=0;t.remindMinute=0;t.event=null;t.reaction=null;t.mailingId=0;t.profileField="";t.dateProfileField="";t.dateFieldOperator=1;t.dateFieldValue="";t.useRules=false;t.rules=[];t.executeOnce=true;t.comment="";t.recipients="";t.adminTimezone="";break;case"stop":t.endType=null;t.date=null;t.hour=0;t.minute=0;t.sendReminder=false;t.remindAdminId=0;t.remindAtOnce=false;t.scheduleReminder=false;t.remindSpecificDate=false;t.remindDate=new Date;t.remindHour=0;t.remindMinute=0;t.event=null;t.reaction=null;t.mailingId=0;t.profileField="";t.useRules=false;t.rules=[];t.executeOnce=true;t.comment="";t.recipients="";t.adminTimezone="";break;case"decision":t.decisionType=null;t.decisionCriteria=null;t.reaction=null;t.mailingId=0;t.linkId=0;t.profileField="";t.aoDecisionCriteria=null;t.threshold="";t.decisionDate=new Date;t.rules=[];t.includeVetoed=true;break;case"deadline":t.deadlineType=null;t.date=new Date;t.timeUnit=null;t.delayValue=0;t.hour=0;t.minute=0;t.useTime=false;break;case"parameter":t.value=0;break;case"recipient":i.setDependent(false);t.mailinglistId=0;t.targets=[];t.altgs=[];t.targetsOption=null;break;case"archive":t.campaignId=0;t.archived=false;break;case"form":t.userFormId=0;t.formType="form";break;case"mailing":t.mailingId=0;t.skipEmptyBlocks=false;t.doubleCheck=true;break;case"actionbased_mailing":case"datebased_mailing":case"mailing_mediatype_sms":case"mailing_mediatype_post":t.mailingId=0;break;case"followup_mailing":t.baseMailingId=0;t.mailingId=0;t.decisionCriterion="OPENED";break;case"import":case"export":t.importexportId=0;t.errorTolerant=false;break}return i};u.isExpandableType=function(e){switch(e){case"scABTest":case"scBirthday":case"scDOI":case"ownWorkflow":return true;default:return false}};u.deserialize=function(e){var n=$.extend({},e);var t=new u(e.type,n);t.setId(e.id);t.setCoordinates(e.x,e.y);t.setTitle(e.iconTitle);t.setComment(e.iconComment);t.setFilled(e.filled);t.setEditable(e.editable);if(["ownWorkflow","scBirthday","scDOI","scABTest"].includes(e.type)){t.setExpandable(true)}delete n["id"];delete n["x"];delete n["y"];delete n["type"];delete n["iconTitle"];delete n["filled"];delete n["editable"];["date","remindDate","decisionDate"].forEach(function(e){if(n[e]){var t=n[e].toString();if(t.includes("-")){var i=t.split("-");n[e]=new Date(i[0],i[1]-1,i[2])}else{n[e]=new Date(n[e])}}});return t};u.deserializeConnections=function(e,n){var r=[];e.forEach(function(e){var i=n[e.id];if(i instanceof u){if(e.connections){e.connections.forEach(function(e){var t=n[e.targetIconId];if(t instanceof u){r.push({source:i,target:t})}})}}});return r};u.toMap=function(e){var t={};e.forEach(function(e){t[e.getId()]=e});return t};u.prototype.appendTo=function(e,t,i){this.$container=e;this.$titlesContainer=t;if(i){this.$element.addClass(i)}e.append(this.$element);t.append(this.$titleDiv);this.$titleDiv.toggleClass("expandable",this.$titleSpan.height()>this.$titleDiv.height())};u.prototype.isAppended=function(){return!!this.$container};u.prototype.get$=function(){return this.$element};u.prototype.getId=function(){return this.id};u.prototype.setId=function(e){this.id=e;this.$element.prop("id",e)};u.prototype.getX=function(){return this.x};u.prototype.getY=function(){return this.y};u.prototype.getCoordinates=function(){return{x:this.x,y:this.y}};u.prototype.setCoordinates=function(e,t){this.x=e;this.y=t;this.$element.css("left",e*l.CANVAS_GRID_SIZE);this.$element.css("top",t*l.CANVAS_GRID_SIZE)};u.prototype.updateCoordinates=function(e){var t=u.getPosition(this.$element);this.x=t.x/e/l.CANVAS_GRID_SIZE;this.y=t.y/e/l.CANVAS_GRID_SIZE};u.prototype.getType=function(){return this.type};u.prototype.setType=function(e){this.type=e};u.prototype.getTitle=function(){return this.title};u.prototype.setTitle=function(e){this.title=e;if(e){this.$titleSpan.text(e);this.positionTitle(this.lastTitleAnchor);this.$titleDiv.toggleClass("expandable",this.$titleSpan.height()>this.$titleDiv.height())}this.setTitleEnabled(!!e)};u.prototype.setTitleEnabled=function(e){this.$titleDiv.toggle(!!e&&!!this.title)};u.prototype.setTitleExpanded=function(e){this.$titleDiv.toggleClass("expanded",!!e);if(this.isAppended()){if(e){this.$titleDiv.appendTo(this.$container)}else{this.$titleDiv.appendTo(this.$titlesContainer)}}};u.prototype.positionTitle=function(e){this.lastTitleAnchor=e;var t=this.x*l.CANVAS_GRID_SIZE;var i=t+l.NODE_SIZE;var n=this.y*l.CANVAS_GRID_SIZE;var r=n+l.NODE_SIZE;switch(e){case l.BOTTOM:this.$titleDiv.css({top:r,left:t+(l.NODE_SIZE-l.TITLE_WIDTH)/2,transform:"none"});break;case l.LEFT:this.$titleDiv.css({top:(n+r)/2,left:t-l.TITLE_WIDTH,transform:"translateY(-50%)"});break;case l.RIGHT:this.$titleDiv.css({top:(n+r)/2,left:i,transform:"translateY(-50%)"});break;case l.TOP:this.$titleDiv.css({top:n,left:t+(l.NODE_SIZE-l.TITLE_WIDTH)/2,transform:"translateY(-100%)"});break;default:return}};u.prototype.getOverlayTitle=function(){return this.overlayTitle};u.prototype.setOverlayTitle=function(e){this.overlayTitle=e;this.$overlayTitle.text(_.trim(e))};u.prototype.getOverlayImage=function(){return this.overlayImage};u.prototype.setOverlayImage=function(e){this.overlayImage=$.extend({image:"",title:"",visible:false},e);var t=!!_.trim(this.overlayImage.image)?l.constants.imagePath+"/"+_.trim(this.overlayImage.image):"";this.$overlayImage.prop("src",t);this.$overlayImage.prop("title",this.overlayImage.title);if(this.overlayImage.visible){this.$overlayImage.show()}else{this.$overlayImage.hide()}};u.prototype.getComment=function(){return this.comment};u.prototype.setComment=function(e){this.comment=this.data.iconComment=e;this.$element.toggleClass("icon-commented",!!_.trim(e))};u.prototype.updateCommentLabels=function(){this.$element.toggleClass("icon-commented",!!_.trim(this.comment))};u.prototype.setFootnote=function(e){if(e>0){this.$element.attr("comment-footnote",e)}else{this.$element.removeAttr("comment-footnote")}};u.prototype.isFilled=function(){return this.filled};u.prototype.setFilled=function(e){this.filled=e;this.$element.toggleClass("active",e)};u.prototype.isEditable=function(){return this.editable};u.prototype.setEditable=function(e){this.editable=e};u.prototype.isExpandable=function(){return this.expandable};u.prototype.setExpandable=function(e){this.expandable=e};u.prototype.isDependent=function(){return this.dependent};u.prototype.setDependent=function(e){this.dependent=e};u.prototype.isInRecipientsChain=function(){return this.inRecipientsChain};u.prototype.setInRecipientsChain=function(e){this.inRecipientsChain=e};u.prototype.getAnchors=function(){return this.anchors};u.prototype.setAnchors=function(e){this.anchors=e};u.prototype.getData=function(){return this.data};u.prototype.setData=function(e){this.data=e};u.prototype.setInteractionEnabled=function(e){this.$connectionButton.toggle(!!e)};u.prototype.removePopover=function(){this.nodePopover.remove()};u.prototype.setPopoverEnabled=function(e){if(!e){this.nodePopover._hidePopover(true)}this.nodePopover.setEnabled(e)};u.prototype.setPopoverShown=function(e){if(e){this.nodePopover.show()}else{this.nodePopover.hide()}};u.prototype.setHovered=function(e){this.setPopoverShown(e);this.setTitleExpanded(e)};u.prototype.remove=function(){this.nodePopover.remove();this.$element.remove();this.$titleDiv.remove();this.$container=null;this.$titlesContainer=null};u.prototype.serialize=function(){var e=$.extend({},this.data,{id:this.id,x:this.x,y:this.y,type:this.type,filled:this.filled,editable:this.editable,iconTitle:this.title});if("date"in e&&"hour"in e&&"minute"in e){e.date=t.getDateTimeValue(e.date,e.hour,e.minute)}if("remindDate"in e&&"remindHour"in e&&"remindMinute"in e){e.remindDate=t.getDateTimeValue(e.remindDate,e.remindHour,e.remindMinute)}if("decisionDate"in e){e.decisionDate=t.getDateTimeValue(e.decisionDate)}return e};function c(e){if(e instanceof u){this.node=e}else{this.node=u.get(e)}this.popover=undefined;this.timeoutId=undefined;this.isEnabled=true}c.prototype.remove=function(){if(this.popover){this.popover.hide()}n.remove(this.node.get$());this.popover=null};c.destroyAll=function(){$("[rel=popover]").each(function(e,t){u.get($(t)).removePopover()});$(".popover").remove()};c.prototype.initPopover=function(){var e=this;e.deferred=false;e.content=null;var t=n.new(e.node.get$(),{trigger:"manual",html:true,template:l.NODE_POPOVER_TEMPLATE,content:function(){return e.getPopoverContent()}});if(e.isEnabled){t.enable()}else{t.disable()}var i=t.tip();i.on({mouseenter:function(){e._showPopover()},mouseleave:function(){e._hidePopover(true)}});return t};c.prototype.show=function(){c.destroyAll();this.popover=this.initPopover();if(this.popover.hasContent()&&this.popover.enabled){this._showPopover()}};c.prototype.hide=function(e){this._hidePopover(e)};c.prototype.getPopoverContent=function(){const e=this;var t=this.node;var i="";var n=c.getThumbnail(t);if(n&&!_.isEmpty(n.src)){i+='<img src="'+n.src+'" style="width: 100%; height: 100%;" />'}if(u.isCommented(t)){i+="<div>"+t.getComment()+"</div>"}if(i&&e.deferred===false){this.deferred=$.Deferred();var r=$("<div></div>");r.css({position:"fixed",visibility:"hidden"});r.html(i);$elements=r.children();$(document.body).append(r);this.deferred.done(function(){$elements.detach();r.remove();e.content=$elements});var o=$elements.find("img").add($elements.filter("img")).filter(function(){return this.complete?null:this});if(o.length>0){e.deferred.done(function(){if(e.popover){e.popover.setContent();if(t.get$().is(":hover")){e._showPopover()}}});var a=function(){var e=true;for(var t=0;t<o.length;t++){var i=o[t];if(i){if(i.complete){$(i).off("load error");o[t]=null}else{e=false}}}return e};for(var s=0;s<o.length;s++){$(o[s]).on("load error",function(){if(a()){e.deferred.resolve()}})}}else{e.deferred.resolve()}}return this.content};c.getThumbnail=function(e){if(u.isMailingNode(e)&&e.getData().mailingId>0){return c.getMailingThumbnail(e.getData().mailingId)}return""};c.getMailingThumbnail=_.memoize(function(e){var t="";$.ajax({type:"POST",url:AGN.url("/workflow/getMailingThumbnail.action"),async:false,data:{mailingId:e},success:function(e){if(e>0){t=new Image;t.src=AGN.url("/sc?compID="+e)}}});return t});c.prototype._stopHiding=function(){if(this.timeoutId){clearTimeout(this.timeoutId);this.timeoutId=undefined}};c.prototype._showPopover=function(){this._stopHiding();this.popover.show()};c.prototype._hidePopover=function(e){this._stopHiding();if(!this.popover){return}if(e===true){if(this.popover){this.popover.hide()}}else{var t=this;this.timeoutId=setTimeout(function(){t._hidePopover(true)},200)}};c.prototype.setEnabled=function(e){this.isEnabled=e;if(!this.popover){return}if(e){this.popover.enable()}else{this.popover.disable()}};AGN.Lib.WM.NodePopover=c;AGN.Lib.WM.Node=u})();(function(){var n=AGN.Lib.WM.Node;function r(e){this.id=e.getId();this.node=e;this.position=n.getPosition(e.get$());this.box=n.getBox(e.get$());this.connections={incoming:[],outgoing:[]}}r.nodesToVertices=function(e){return e.map(function(e){return new r(e)})};r.verticesToMap=function(e){var t={};e.forEach(function(e){t[e.id]=e});return t};r.verticesFrom=function(e,t){var i=r.nodesToVertices(e);var n=r.verticesToMap(i);t.forEach(function(e){var t,i;if("sourceId"in e){t=n[e.sourceId];i=n[e.targetId]}else{t=n[e.source.getId()];i=n[e.target.getId()]}t.connections.outgoing.push(i);i.connections.incoming.push(t)});return i};r.compareByPosition=function(e,t){var i=e.box;var n=t.box;if(i.minX==n.minX){return i.minY-n.minY}return i.minX-n.minX};r.filterUnvisited=function(e,t){return e.filter(function(e){if(t[e.id]){return false}else{t[e.id]=true;return true}})};r.getDecisionBranches=function(t){var e=t.connections.outgoing.map(function(e){return{source:t.node,target:e.node,targetVertex:e}});var i=n.getDecisionBranches(e);if(i){return{positive:i.positive.targetVertex,negative:i.negative.targetVertex}}return null};r.getIncomingChains=function(e){var t={};var i=[];o([],e,t,i);return i};r.getOutgoingChains=function(e){var t={};var i=[];a([],e,t,i);return i};r.prototype.getNode=function(){return this.node};r.prototype.siblings=function(){return this.connections.incoming.concat(this.connections.outgoing)};r.prototype.rightSiblingsOrdered=function(){var e=this.connections.outgoing;if(n.isBranchingDecisionNode(this.node)){var t=r.getDecisionBranches(this);if(t){return[t.positive,t.negative]}}return e.sort(function(e,t){return e.node.getY()-t.node.getY()})};function o(t,e,i,n){if(i[e.id]){n.push(t)}else{t.push(e.node);var r=e.connections.incoming;if(r.length){i[e.id]=true;if(r.length==1){o(t,r[0],i,n)}else{r.forEach(function(e){o(t.slice(),e,i,n)})}i[e.id]=false}else{n.push(t)}}}function a(t,e,i,n){if(i[e.id]){n.push(t)}else{t.push(e.node);var r=e.connections.outgoing;if(r.length){i[e.id]=true;if(r.length==1){a(t,r[0],i,n)}else{r.forEach(function(e){a(t.slice(),e,i,n)})}i[e.id]=false}else{n.push(t)}}}AGN.Lib.WM.Vertex=r})();(function(){var r=AGN.Lib.WM.Vertex;function o(e){this.vertices=e;this.box=e.map(function(e){return e.box}).reduce(function(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}})}o.detectGroups=function(e){var i=[];var n={};e.forEach(function(e){var t=o.detectGroup(e,n);if(t){i.push(t)}});return i.sort(o.compareByPosition)};o.detectGroup=function(e,t){if(t[e.id]){return null}var i=[];var n=e.siblings();i.push(e);t[e.id]=true;while(n.length){n=_.flatMap(n,function(e){if(t[e.id]){return[]}else{i.push(e);t[e.id]=true;return e.siblings()}})}return new o(i)};o.compareByPosition=function(e,t){var i=e.box.minX+e.box.maxX-(t.box.minX+t.box.maxX);if(i==0){return e.box.minY+e.box.maxY-(t.box.minY+t.box.maxY)}return i};o.prototype.getNodes=function(){return this.vertices.map(function(e){return e.getNode()})};o.prototype.getStartingVertices=function(){var e=this.vertices.filter(function(e){return e.connections.incoming.length==0});if(e.length){return e.sort(r.compareByPosition)}var t=this.vertices.reduce(function(e,t){var i=e.connections.outgoing.length/e.connections.incoming.length;var n=t.connections.outgoing.length/t.connections.incoming.length;if(i==n){return r.compareByPosition(e,t)>=0?e:t}return i>n?e:t});return[t]};AGN.Lib.WM.VertexGroup=o})();(function(){var a=AGN.Lib.WM.Definitions,n=AGN.Lib.WM.DateTimeUtils;var r={};var s=function(){};function i(t,e,i){if(e<=0){return""}if(_.isEmpty(r[t])){$.ajax({url:AGN.url(i),async:false}).done(function(e){r[t]=_.extend({},e)})}var n=r[t][e];return!!n?n:""}s.getWebFormName=function(e){return i("form",e,"/workflow/ajax/getWebFormNames.action")};s.getTargetName=function(e){return i("target",e,"/workflow/ajax/getTargetNames.action")};s.getMailingName=function(e){return i("mailing",e,"/workflow/ajax/getMailingNames.action")};s.getArchiveName=function(e){return i("archive",e,"/workflow/ajax/getArchiveNames.action")};s.getAutoExportName=function(e){return i("autoExport",e,"/workflow/ajax/getAutoExportNames.action")};s.getAutoImportName=function(e){return i("autoImport",e,"/workflow/ajax/getAutoImportNames.action")};s.getMailinglistName=function(e){return i("mailinglist",e,"/workflow/ajax/getMailinglistNames.action")};function o(e){switch(e){case a.constants.reactionOpened:return"reaction_opened.png";case a.constants.reactionNotOpened:return"reaction_notopened.png";case a.constants.reactionClicked:return"reaction_clicked.png";case a.constants.reactionNotClicked:return"reaction_notclicked.png";case a.constants.reactionBought:return"reaction_bought.png";case a.constants.reactionNotBought:return"reaction_notbought.png";case a.constants.reactionChangeOfProfile:return"reaction_profilechange.png";case a.constants.reactionWaitingForConfirm:return"reaction_wfc.png";case a.constants.reactionOptIn:return"reaction_optin.png";case a.constants.reactionOptOut:return"reaction_optout.png";case a.constants.reactionClickedLink:return"reaction_clicked.png";case a.constants.reactionOpenedAndClicked:return"reaction_profilechange.png";case a.constants.reactionOpenedOrClicked:return"reaction_profilechange.png"}}function l(e){switch(e){case a.constants.reactionOpened:return t("workflow.reaction.opened");case a.constants.reactionNotOpened:return t("workflow.reaction.not_opened");case a.constants.reactionClicked:return t("workflow.reaction.clicked");case a.constants.reactionNotClicked:return t("workflow.reaction.not_clicked");case a.constants.reactionBought:return t("workflow.reaction.bought");case a.constants.reactionNotBought:return t("workflow.reaction.not_bought");case a.constants.reactionChangeOfProfile:return t("workflow.reaction.change_of_profile");case a.constants.reactionWaitingForConfirm:return t("workflow.reaction.waiting_for_confirm");case a.constants.reactionOptIn:return t("workflow.reaction.opt_in");case a.constants.reactionOptOut:return t("workflow.reaction.opt_out");case a.constants.reactionClickedLink:return t("workflow.reaction.clicked_on_link");case a.constants.reactionOpenedAndClicked:return t("workflow.reaction.opened_and_clicked");case a.constants.reactionOpenedOrClicked:return t("workflow.reaction.opened_or_clicked")}}function u(e,i){if(e>1){switch(i){case a.constants.deadlineTimeUnitMinute:return t("workflow.deadline.minutes");case a.constants.deadlineTimeUnitHour:return t("workflow.defaults.hours");case a.constants.deadlineTimeUnitDay:return t("workflow.defaults.days");case a.constants.deadlineTimeUnitWeek:return t("workflow.defaults.weeks");case a.constants.deadlineTimeUnitMonth:return t("workflow.defaults.months")}}else{switch(i){case a.constants.deadlineTimeUnitMinute:return t("workflow.deadline.minute");case a.constants.deadlineTimeUnitHour:return t("workflow.defaults.hour");case a.constants.deadlineTimeUnitDay:return t("workflow.defaults.day");case a.constants.deadlineTimeUnitWeek:return t("workflow.defaults.week");case a.constants.deadlineTimeUnitMonth:return t("workflow.defaults.month")}}}function c(e){switch(e){case a.constants.decisionAOCriteriaClickRate:return t("workflow.defaults.ckickrate");case a.constants.decisionAOCriteriaOpenrate:return t("workflow.opening_rate");default:return t("workflow.statistic.revenue")}}function d(e){switch(Number(e)){case 1:return")";case 0:return""}}function f(e){switch(Number(e)){case 1:return"(";case 0:return""}}function p(e,t){if(e&&a.GENDER_PROFILE_FIELD===e.toLowerCase()){return a.constants.genderOptions[!t?0:t]}else{return _.isEmpty(t)?"":t}}function h(i,e){var n="";e.forEach(function(e){n+=(_.isEmpty(n)?"":" "+e.chainOperator+" ")+f(e.parenthesisOpened)+i+" "+a.constants.operatorsMap[e.primaryOperator]+" "+p(i,e.primaryValue)+d(e.parenthesisClosed)});return t("workflow.start.rule")+(!!n?": "+n:"")}function g(e,i){var n=[];for(var r=0;r<a.TITLE_MAX_TARGETS&&r<e.length;r++){n.push(s.getTargetName(e[r]))}var o=", ";if(a.constants.targetOptions[i]){o=" "+a.constants.targetOptions[i]+" "}if(e.length>a.TITLE_MAX_TARGETS){return n.join(o)+" "+t("defaults.andMore",e.length-a.TITLE_MAX_TARGETS)+"..."}else{return n.join(o)}}function v(e,t,i){if(e){if(arguments.length===1){return n.getDateStr(e,a.constants.localeDateTimePattern)}else{return n.getDateTimeStr(e,t,i,a.constants.localeDateTimePattern)}}else{return""}}function m(e,t){return e+" "+u(e,t)}function y(e,i){return t("workflow.reaction.title")+": "+l(e)+",\n"+t("workflow.defaults.mailing")+": "+s.getMailingName(i)}function b(e,i,n){var r=c(e)+(_.isEmpty(i)?"":": "+i)+"\n";if(!!n){r+=t("workflow.defaults.date")+": "+v(n)}return r}function w(e,t,i){return e+" "+a.constants.operatorsMap[t]+(!i?"":" "+i)}function C(e,t,i){if(e){if(t){return t+" ("+l(i)+") "+e}else{return e}}}function A(e,i,n,r){var o="";if(r){o+=t("workflow.mailinglist.short")+": "+s.getMailinglistName(e)}if(!_.isEmpty(i)){if(!_.isEmpty(o)){o+="\n"}o+=t("workflow.target.short")+": "+g(i,n)}return o}s.positionTitle=function(e,t){if(t[a.BOTTOM]){if(t[a.LEFT]){if(t[a.RIGHT]){if(t[a.TOP]){e.positionTitle(a.BOTTOM)}else{e.positionTitle(a.TOP)}}else{e.positionTitle(a.RIGHT)}}else{e.positionTitle(a.LEFT)}}else{e.positionTitle(a.BOTTOM)}};var e=function(e){var i=e.startType;var n="";if(a.constants.startTypeDate===i){n=t("workflow.start.start_date")+":\n"+v(e.date,e.hour,e.minute)}else if(a.constants.startTypeEvent===i){var r=e.event;if(a.constants.startEventReaction===r){n=t("workflow.start.start_event")+":\n"+l(e.reaction)+": ("+v(e.date,e.hour,e.minute)+")"}else if(a.constants.startEventDate===r){n=t("workflow.start.start_event")+":\n"+w(e.dateProfileField,e.dateFieldOperator,e.dateFieldValue)+":\n"+"("+v(e.date,e.hour,e.minute)+")"}}return n};var E=function(e,i,n){var r=e.endType;var o="";if(a.constants.endTypeDate===r){o=t("workflow.stop.end_date")+":\n"+v(e.date,e.hour,e.minute)}else if(a.constants.endTypeAutomatic===r){o=n?t("workflow.stop.automatic_end"):t("workflow.stop.open_end")}return o};var x=function(e){var i=e.deadlineType;var n="";if(a.constants.deadlineTypeFixedDeadline===i){n=t("workflow.deadline.title")+":\n"+v(e.date,e.hour,e.minute)}else if(a.constants.deadlineTypeDelay===i){n=t("workflow.defaults.delay")+":\n"+m(e.delayValue,e.timeUnit)}return n};var T=function(e){var i=e.decisionType;var n="";if(a.constants.decisionTypeAutoOptimization===i){n=t("workflow.mailing.autooptimization")+":\n"+b(e.aoDecisionCriteria,e.threshold,e.decisionDate)}else{if(a.constants.decisionReaction===e.decisionCriteria){n=t("workflow.decision")+",\n"+y(e.reaction,e.mailingId)}else{n=t("workflow.decision")+",\n"+h(e.profileField,e.rules)}}return n};var S=function(e,t){var i,n;var r=t.getTitle();i=s.getMailingName(e.baseMailingId)||"?";n=s.getMailingName(e.mailingId)||"?";var o=C(n,i,e.decisionCriterion);if(o){r=o}return r};var D={title:function(e){return s.getMailingName(e.mailingId)}};var k={"*":{overlayImage:{},overlayTitle:"",title:""},start:{title:e,isImageAvailable:function(e){return a.constants.startTypeEvent===e.startType&&a.constants.startEventReaction===e.event},overlayImage:function(e){if(this.isImageAvailable(e)){return{visible:true,image:o(e.reaction),title:l(e.reaction)}}else{return{}}}},stop:{title:E},deadline:{title:x},parameter:{title:"",overlayTitle:function(e){return e.value}},decision:{title:T,branches:{title:function(){return{positive:t("workflow.defaults.yes"),negative:t("workflow.defaults.no")}}}},recipient:{title:function(e,t){return A(e.mailinglistId,e.targets,e.targetsOption,!t.isInRecipientsChain())}},archive:{title:function(e){return s.getArchiveName(e.campaignId)}},form:{title:function(e){return s.getWebFormName(e.userFormId)}},mailing:D,mailing_mediatype_sms:D,mailing_mediatype_post:D,actionbased_mailing:D,datebased_mailing:D,followup_mailing:{title:S},import:{title:function(e){return s.getAutoImportName(e.importexportId)}},export:{title:function(e){return s.getAutoExportName(e.importexportId)}}};function O(e){var t=e.getType();if(a.NODE_TYPES_MAILING.includes(t)||a.NODE_TYPES_IMPORT_EXPORT.includes(t)){return!!e.getTitle()}return false}s.getDecisionBranchesLabels=function(){return k.decision.branches.title()};s.updateTitle=function(e,t,i){if(!i&&O(e)){return}if(!e.isFilled()){e.setTitle("");e.setOverlayImage({});e.setOverlayTitle("");return}e.setTitle(I(e,t));e.setOverlayImage(R(e));e.setOverlayTitle(N(e))};function R(e){return P(e.getType(),"overlayImage",e.getData())}function N(e){return P(e.getType(),"overlayTitle",e.getData())}function I(e,t){return P(e.getType(),"title",e.getData(),e,t)}function P(e,t){var i=k[e];if(!i.hasOwnProperty(t)){i=k["*"]}var n=i[t];var r=Array.prototype.slice.call(arguments,2);return _.isFunction(n)?n.apply(i,r):n}AGN.Lib.WM.NodeTitleHelper=s})();(function(){var n=AGN.Lib.WM.Node,l=AGN.Lib.WM.Definitions;var i=function(e,t,i){this.minimap=e;this.$element=e.$container.find(t);this.scale=1};i.prototype.setScale=function(e){this.scale=e};i.prototype.getScale=function(){return this.scale};i.prototype.getPosition=function(){var e=this.$element.position();return{x:e.left,y:e.top}};i.prototype.update=function(){this.reset();var e=this.minimap.getPureIconsBox();var t=l.MINIMAP_PADDING*2;var i=e.maxX-e.minX+t;var n=e.maxY-e.minY+t;var r=(this.minimap.getWidth()-t)/i;var o=(this.minimap.getHeight()-t)/n;this.setScale(Math.min(r,o));var a=-e.minX*this.scale+l.MINIMAP_PADDING;var s=-e.minY*this.scale+l.MINIMAP_PADDING;this.$element.css({transform:"scale("+this.scale+")",width:i,height:n,left:a,top:s});this.renderIcons()};i.prototype.renderIcons=function(){var i=this;this.minimap.getPureIconsPosition().forEach(function(e){var t=$('<div class="miniview-element"></div>').css({width:l.NODE_SIZE,height:l.NODE_SIZE,left:e.x,top:e.y});i.$element.append(t)})};i.prototype.reset=function(){this.scale=1;this.$element.css({transform:"scale(1)",width:0,height:0,left:0,top:0});this.$element.html("")};var o=function(e,t,i){this.minimap=e;this.$element=e.get$().find(t);this.onDrag=_.isFunction(i.onPannerDrag)?i.onPannerDrag:_.noop;this.containment=$.extend({mode:"",padding:0},i.containment);this.containmentBox=null;var s=this;var l=0;var u=0;this.$element.draggable({start:function(e,t){l=t.position.left;u=t.position.top;if(!s.containmentBox){s.containmentBox=s.getContainmentBox(s.containment)}},drag:function(e,t){var i=s.getScale();if(s.containmentBox){var n=t.position.left;var r=t.position.top;if(n<s.containmentBox.minX){t.position.left=s.containmentBox.minX}else if(n>s.containmentBox.maxX){t.position.left=s.containmentBox.maxX}if(r<s.containmentBox.minY){t.position.top=s.containmentBox.minY}else if(r>s.containmentBox.maxY){t.position.top=s.containmentBox.maxY}}var o=(l-t.position.left)/i;var a=(u-t.position.top)/i;l=t.position.left;u=t.position.top;s.onDrag.call(s,o,a)}})};o.prototype.getContainmentBox=function(e){if(!e.mode||e.mode=="none"){return undefined}var t=this.minimap.get$();var i=this.getScaledWidth();var n=this.getScaledHeight();if(e.mode=="panner-box"){return{minX:-i+e.padding,maxX:t.width()-e.padding,minY:-n+e.padding,maxY:t.height()-e.padding}}else if(e.mode=="minimap-box"){return{minX:e.padding,maxX:Math.max(0,t.width()-i)-e.padding,minY:e.padding,maxY:Math.max(0,t.height()-n)-e.padding}}return undefined};o.prototype.getScale=function(){return this.minimap.getMiniCanvasScale()/this.minimap.getCanvasZoom()};o.prototype.getScaledWidth=function(){return this.getWidth()*this.getScale()};o.prototype.getScaledHeight=function(){return this.getHeight()*this.getScale()};o.prototype.getWidth=function(){return this.$element.width()};o.prototype.getHeight=function(){return this.$element.height()};o.prototype.update=function(){var e=this.minimap.getCanvasParent$();var t=e.width();var i=e.height();var n=t+l.MINIMAP_PADDING*2;var r=i+l.MINIMAP_PADDING*2;this.$element.css({width:n,height:r});this.containmentBox=this.getContainmentBox(this.containment);this.updatePosition()};o.prototype.updatePosition=function(){var e=this.minimap.getCanvasPosition();var t=this.minimap.getMiniCanvasPosition();var i=this.getScale();var n=-e.x*i+t.x;var r=-e.y*i+t.y;this.$element.css({transform:"scale("+i+")",left:n,top:r})};var e=function(e,t){this.$container=$("#minimap");this.canvas=e;this.$collapseBtn=this.$container.find(".minimap-collapse");this.miniCanvas=new i(this,".minimap-canvas",t);this.miniPanner=new o(this,".minimap-panner",t);this.enabled=false;var r=this;this.$container.on("click",".minimap-panner, .minimap-collapse",function(e){e.preventFocusOnArea=true});this.$collapseBtn.on("click",function(e){r.collapseMinimap()});this.$container.on("click",function(e){if(e.preventFocusOnArea){return}var t=r.$container[0].getBoundingClientRect();var i=e.clientX-t.left;var n=e.clientY-t.top;r.focusOnClickedArea(i,n)})};e.prototype.get$=function(){return this.$container};e.prototype.getWidth=function(){return this.get$().width()};e.prototype.getHeight=function(){return this.get$().height()};e.prototype.moveCanvasTo=function(e,t){this.canvas.moveTo(e,t)};e.prototype.getCanvas$=function(){return this.canvas.get$()};e.prototype.getCanvasParent$=function(){return this.canvas.get$().parent()};e.prototype.focusOnClickedArea=function(e,t){var i=this.getMiniCanvasPosition();var n=this.getMiniPannerScale();var r=(e-i.x)/n;var o=(t-i.y)/n;var a=this.getMiniPannerCenter();var s=this.getCanvasZoom();var l=(r-a.x)*s;var u=(o-a.y)*s;this.moveCanvasTo(-l,-u)};e.prototype.collapseMinimap=function(){this.$container.toggleClass("minimap-collapsed");this.updateMinimap()};e.prototype.getIcons=function(){return this.canvas.getIcons()};e.prototype.getPureIconsPosition=function(){var i=this.getCanvasZoom();return this.getIcons().map(function(e){var t=n.getPosition(e);return{x:t.x/i,y:t.y/i}})};e.prototype.getPureIconsBox=function(){return this.canvas.getPureIconsBox()};e.prototype.getMiniCanvasScale=function(){return this.miniCanvas.getScale()};e.prototype.getMiniCanvasPosition=function(){return this.miniCanvas.getPosition()};e.prototype.getMiniPannerScale=function(){return this.miniCanvas.getScale()};e.prototype.getMiniPannerCenter=function(){return{x:this.miniPanner.getWidth()/2,y:this.miniPanner.getHeight()/2}};e.prototype.getCanvasZoom=function(){return this.canvas.getZoom()};e.prototype.getCanvasPosition=function(){return this.canvas.getPosition()};e.prototype.updateMinimap=function(){if(this.enabled){this.miniCanvas.update();this.miniPanner.update()}};e.prototype.onPanZoom=function(){if(this.enabled){this.miniPanner.updatePosition()}};e.prototype.setEnabled=function(e){this.enabled=e;if(e){this.updateMinimap();this.get$().show()}else{this.get$().hide()}};AGN.Lib.WM.Minimap=e})();(function(){var h=AGN.Lib.WM.Definitions,r=AGN.Lib.WM.Node,t=AGN.Lib.WM.Minimap;var e=function(e){var n=this;this.$canvas=e;this.mouseWheelZoomEnabled=false;this.panningEnabled=false;this.zoomEventHandler=null;this.moveEventHandler=null;this.ignoreNextZoomEvent=false;this.minimap=new t(this,{containment:{mode:"panner-box",padding:5},onPannerDrag:function(e,t){if(e||t){var i=n.getPosition();n.moveTo(i.x+e,i.y+t)}}});this.panzoom=panzoom(e[0],{minZoom:h.MIN_ZOOM,maxZoom:h.MAX_ZOOM,initialZoom:h.DEFAULT_ZOOM,disableKeyboardInteraction:true,smoothScroll:false,onDoubleClick:function(){return false},beforeWheel:function(){return!n.mouseWheelZoomEnabled},beforeMouseDown:function(){return!n.panningEnabled}});this.panzoom.on("zoom",function(){if(n.zoomEventHandler){if(n.ignoreNextZoomEvent){n.ignoreNextZoomEvent=false}else{n.zoomEventHandler.call(null,n.getZoom());n.minimap.onPanZoom()}}});this.panzoom.on("pan",function(){n.minimap.onPanZoom();if(n.moveEventHandler){n.moveEventHandler.call(null,n.getPosition())}})};e.prototype.get$=function(){return this.$canvas};e.prototype.setMinimapEnabled=function(e){this.minimap.setEnabled(e)};e.prototype.updateMinimap=function(){this.minimap.updateMinimap()};e.prototype.setPanningEnabled=function(e){this.panningEnabled=!!e};e.prototype.setMouseWheelZoomEnabled=function(e){this.mouseWheelZoomEnabled=e};e.prototype.getZoom=function(){var e=this.panzoom.getTransform();return e.scale};e.prototype.getPosition=function(){var e=this.panzoom.getTransform();return{x:e.x,y:e.y}};e.prototype.getVisibleArea=function(){var e=this.$canvas.parent();var t=e.width();var i=e.height();var n=this.panzoom.getTransform();return{minX:-n.x/n.scale,minY:-n.y/n.scale,maxX:(t-n.x)/n.scale,maxY:(i-n.y)/n.scale}};e.prototype.moveTo=function(e,t){this.panzoom.moveTo(e,t)};e.prototype.setZoom=function(e){var t=this.panzoom.getTransform();this.ignoreNextZoomEvent=true;this.panzoom.zoomAbs(t.x,t.y,e);this.minimap.onPanZoom()};e.prototype.setOnZoom=function(e){this.zoomEventHandler=e};e.prototype.setOnMove=function(e){this.moveEventHandler=e};e.prototype.getCanvasParent$=function(){return this.get$().parent()};e.prototype.getIcons=function(){var i=[];this.get$().children(".node").each(function(e,t){i.push($(t))});return i};e.prototype.getPureIconsBox=function(){var e=this.getIcons();var t=this.getZoom();if(e.length){var i=e.map(function(e){return r.getBox(e)}).reduce(function(e,t,i){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}});return{minX:i.minX/t-h.CANVAS_GRID_SIZE,minY:i.minY/t-h.CANVAS_GRID_SIZE,maxX:i.maxX/t+h.CANVAS_GRID_SIZE,maxY:i.maxY/t+h.CANVAS_GRID_SIZE}}else{var n=this.getCanvasParent$();return{minX:-h.CANVAS_GRID_SIZE,minY:-h.CANVAS_GRID_SIZE,maxX:n.width()/t+h.CANVAS_GRID_SIZE,maxY:n.height()/t+h.CANVAS_GRID_SIZE}}};e.prototype.fitPdfPage=function(e,t){var i=this.getPureIconsBox();var n=i.maxX-i.minX+h.NODE_MIN_MARGIN;var r=i.maxY-i.minY+h.NODE_MIN_MARGIN;if(!h.PAGE_DIMENSIONS[e]){return}var o=h.PAGE_DIMENSIONS[e];var a=t=="landscape";var s=a?o.height:o.width;var l=a?o.width:o.height;var u=0;var c=0;var d=1;if(n>s||r>l){if(n/r<s/l){d=l/r}else{d=s/n}}if(i.minX<0){u=-i.minX*d}if(i.minY<0){c=-i.minY*d}var f="matrix("+d+", 0, 0, "+d+", "+u+", "+c+")";var p="left top 0";this.getCanvasParent$().css({transform:f,"-webkit-transform":f,"transform-origin":p,"-webkit-transform-origin":p,"backface-visibility":"hidden","-webkit-backface-visibility":"hidden",overflow:"visible"})};AGN.Lib.WM.Canvas=e})();(function(){var i=AGN.Lib.WM.Definitions,n=AGN.Lib.Confirm;var e={Activation:r,Deactivation:o,confirmSaveBeforePdfGenerating:l,confirmTestingStartStop:u,confirmMailingDataTransfer:a,confirmOwnWorkflowExpanding:s,confirmCopy:c};function r(e,i,n){var r=$("#activating-campaign-dialog");if(!n){$("#activating-campaign-mailings").html(i)}r.css("visibility","visible");r.show();var o=$("#activating-campaign-activate-button");o.off("click");o.on("click",function(){e();r.dialog("close");return false});r.dialog({open:function(){var e=r.parent().find(".ui-dialog-title");e.empty();e.append('<span class="dialog-title-image">'+t(n?"workflow.activating.unpauseTitle":"workflow.activating.title")+"</span>");e.find(".dialog-title-image").css("padding-left","0px")},modal:true,resizable:false,width:650,minHeight:0,close:function(){return false}})}function o(e){var i=$("#inactivating-campaign-dialog");i.css("visibility","visible");i.show();var n=$("#inactivating-campaign-inactivate-button");n.off("click");n.on("click",function(){e();i.dialog("close");return false});i.dialog({open:function(){var e=i.parent().find(".ui-dialog-title");e.empty();e.append('<span class="dialog-title-image">'+t("workflow.inactivating.title")+"</span>");e.find(".dialog-title-image").css("padding-left","0px")},modal:true,resizable:false,width:650,minHeight:0,close:function(){return false}})}function a(e){return n.createFromTemplate({Def:i,paramsToAsk:e},"mailing-data-transfer-modal")}function s(){return n.createFromTemplate({},"own-workflow-expanding-modal")}function l(e,i){var n=$("#workflow-save-before-pdf-dialog");var r=$("#save-before-pdf-btn-cancel");r.off("click");r.on("click",function(){n.dialog("close");return false});if(_.isFunction(e)){e=_.noop}var o=$("#save-before-pdf-btn-save");o.off("click");o.on("click",function(){e();n.dialog("close");return false});$("#workflow-save-before-pdf-dialog .dialog-message").html(i);n.dialog({title:'<span class="dialog-fat-title">'+t("workflow.pdf.save_campaign")+"</span>",dialogClass:"no-close",width:650,modal:true,resizable:false,close:function(){return false}})}function u(e){return n.createFromTemplate({startTesting:e,shortname:i.shortname},"testing-modal")}function c(e){return n.createFromTemplate({hasContent:e===true},"workflow-copy-modal")}AGN.Lib.WM.Dialogs=e})();(function(){var s=AGN.Lib.WM.Definitions,r=AGN.Lib.WM.Node;var e={};e.loadSample=function(e,t,i){if([s.NODE_TYPE_SC_ABTEST,s.NODE_TYPE_SC_BIRTHDAY,s.NODE_TYPE_SC_DOI].includes(e)){$.ajax({url:AGN.url("/workflow/getSampleWorkflowContent.action"),type:"POST",async:false,data:{type:e,gridEnabled:t},success:n(i)})}else{console.error("Unknown sample type: "+e)}};e.loadOwnWorkflow=function(e,t,i){$.ajax({url:AGN.url("/workflow/getWorkflowContent.action"),type:"POST",async:false,data:{workflowId:e,isWithContent:t},success:n(i)})};e.removeStartStop=function(e,t,i,n){if(i||n){var r=[];var o=e.filter(function(e){var t=e.getType();if(i&&t===s.NODE_TYPE_START||n&&t===s.NODE_TYPE_STOP){r.push(e);return false}else{return true}});if(o.length<e.length){Array.prototype.splice.apply(e,[0,e.length].concat(o));var a=t.filter(function(e){return!(r.includes(e.source)||r.includes(e.target))});if(a.length<t.length){Array.prototype.splice.apply(t,[0,t.length].concat(a))}}}};e.adjustPositions=function(e,t,i,n){var r=0,o=0;if(n){var a=f(e);r=a.getX();o=a.getY()}else{var s=0,l=0,u=0,c=0;var d=true;e.forEach(function(e){if(d){s=l=e.getX();u=c=e.getY();d=false}else{s=Math.min(s,e.getX());l=Math.max(l,e.getX());u=Math.min(u,e.getY());c=Math.max(c,e.getY())}});r=Math.round((s+l)/2);o=Math.round((u+c)/2)}e.forEach(function(e){e.setCoordinates(t+e.getX()-r,i+e.getY()-o)})};function n(n){return function(e){var t=e.map(r.deserialize);var i=r.deserializeConnections(e,r.toMap(t));n.call(null,t,i)}}function f(e){var t=e.filter(function(e){return s.NODE_TYPE_START==e.getType()});if(t.length==0){t=e}if(t.length>1){return t.reduce(function(e,t){if(e.getX()==t.getX()){return e.getY()<t.getY()?e:t}else{return e.getX()<t.getX()?e:t}})}else{return t[0]}}AGN.Lib.WM.Snippets=e})();(function(){var l=AGN.Lib.WM.Definitions,r=AGN.Lib.WM.Node;var e=".js-draggable-button";function o(e,t){var i=r.getCollisionBox(t.helper);return e.some(function(e){return r.detectBoxCollision(i,e)})}function t(a){this.enabled=!!a.enabled;this.$buttons=$(e);var s=this;this.$buttons.each(function(){var e=$(this);var t=e.data("type");var n=[];e.draggable({revert:true,revertDuration:0,zIndex:l.Z_INDEX_DRAGGABLE_BUTTON,disabled:!s.enabled,cursorAt:function(){var e=this.helper[0].getBoundingClientRect();return[e.width/2-1,e.height/2]},appendTo:"#canvas",helper:function(){return r.createDraggable$(t)},start:function(){n=a.getOccupiesAreas.call(s);a.onStart.call(s)},stop:function(){a.onStop.call(s)},drag:function(e,t){var i=a.getZoom.call(s);t.position.left=Math.round(t.position.left/i/l.CANVAS_GRID_SIZE)*l.CANVAS_GRID_SIZE;t.position.top=Math.round(t.position.top/i/l.CANVAS_GRID_SIZE)*l.CANVAS_GRID_SIZE;t.helper.toggleClass("js-collision-detected",o(n,t,i))}}).on("dblclick",function(){if(s.enabled){a.onDrop.call(s,t)}})});$("#viewPort").droppable({accept:e,tolerance:"fit",drop:function(e,t){if(t.helper.hasClass("js-collision-detected")){return}var i=a.getZoom.call(s);var n=$("#canvas").offset();var r=Math.round((t.offset.left-n.left)/i);var o=Math.round((t.offset.top-n.top)/i);a.onDrop.call(s,t.helper.data("type"),{x:Math.round(r/l.CANVAS_GRID_SIZE),y:Math.round(o/l.CANVAS_GRID_SIZE)})}})}t.prototype.setEnabled=function(e){this.enabled=!!e;this.$buttons.draggable("option","disabled",!e)};AGN.Lib.WM.DraggableButtons=t})();(function(){var a=AGN.Lib.WM.Definitions,o=AGN.Lib.WM.Vertex,r=AGN.Lib.WM.VertexGroup;function s(e,t){this.layers=e;this.height=t}s.fromVertexGroup=function(e){var t=[];var i={};var n=o.filterUnvisited(e.getStartingVertices(),i);var r=0;while(n.length){r=Math.max(r,n.length);t.push(n);n=_.flatMap(n,function(e){return o.filterUnvisited(e.rightSiblingsOrdered(),i)})}return new s(t,r)};s.prototype.align=function(n,r){var o=null;this.layers.forEach(function(e){var t=Math.max(Math.round(a.AUTO_ALIGN_STEP_Y*(r-e.length)/2),1);if(o){var i=Math.abs(o.length-e.length);if(i>1){n+=Math.round(a.AUTO_ALIGN_EXTRA_STEP_X*i)}}e.forEach(function(e){e.node.setCoordinates(n,t);t+=a.AUTO_ALIGN_STEP_Y});n+=a.AUTO_ALIGN_STEP_X;o=e});return n};function e(e){var t=r.detectGroups(e).map(function(e){return s.fromVertexGroup(e)});var i=0;t.forEach(function(e){i=Math.max(i,e.height)});var n=1;t.forEach(function(e){n=e.align(n,i);n+=a.AUTO_ALIGN_STEP_BETWEEN_GROUPS})}AGN.Lib.WM.AutoAlignment={align:e}})();(function(){var i=AGN.Lib.WM.Definitions,n=AGN.Lib.WM.Node;function r(e){this.maxLength=e;this._undoStack=[];this._transactionStack=[];this._transaction=false}r.prototype.add=function(e){while(this._undoStack.length>=this.maxLength){this._undoStack.shift()}this._undoStack.push(e)};r.prototype.pop=function(){return this._undoStack.pop()};r.prototype.addOperation=function(e){this._transactionStack.push(e)};r.prototype.isEmpty=function(){return _.isEmpty(this._undoStack)};r.prototype.startTransaction=function(){this._transaction=true};r.prototype.endTransaction=function(){this.flush();this._transaction=false};r.prototype.flush=function(){if(!_.isEmpty(this._transactionStack)){this.add(this._transactionStack)}this._transactionStack=[]};r.prototype.isTransactionStarted=function(){return this._transaction===true};function e(e,t){this.editor=e;this.undoOperations={nodeAdded:this.undoAddNode,nodeDeleted:this.undoDeleteNode,nodeMoved:this.undoMoveNode,nodeDataUpdated:this.undoSaveNodeData,connectionCreated:this.undoCreateConnection,connectionDeleted:this.undoDeleteConnection};this.manualStart=false;this.undoStack=new r(i.MAX_UNDO_STEP);this.onChange=_.isFunction(t.onChange)?t.onChange:_.noop}e.prototype.undoAddNode=function(e){this.editor.deleteNode(e)};e.prototype.undoDeleteNode=function(e){if(e instanceof n){this.editor.add(n.restore(e))}else{this.editor.add(n.get(e))}};e.prototype.undoCreateConnection=function(e){this.editor.deleteConnectionBetween(e.source,e.target)};e.prototype.undoDeleteConnection=function(e){this.editor.connect(n.get(e.source),n.get(e.target))};e.prototype.undoMoveNode=function(e){var n=this.editor.getZoom();var r=this;e.forEach(function(e){e.node.setTitleEnabled(false)});this.editor.batch(function(){e.forEach(function(e){var t=e.coordinates;var i=e.node;if(r.editor.getCurrentDragMode()!==e.dragMode){r.editor.convertCoordinates(t)}i.setCoordinates(t.x,t.y);i.updateCoordinates(n)});r.editor.updateOverlays();r.editor.positionTitles();r.editor.updateMinimap()});e.forEach(function(e){e.node.setTitleEnabled(true)})};e.prototype.undoSaveNodeData=function(e,t){t=t instanceof n?t:n.get(t);e=e instanceof n?e:n.get(e);e.setTitle(t.getTitle());e.setOverlayTitle(t.getOverlayTitle());e.setOverlayImage(t.getOverlayImage());e.setComment(t.getComment());e.setFilled(t.isFilled());e.setDependent(t.isDependent());e.setInRecipientsChain(t.isInRecipientsChain());e.setData(t.getData());this.editor.positionTitles()};e.prototype.canUndo=function(){return!this.undoStack.isEmpty()};e.prototype.startTransaction=function(){this.manualStart=true;this.undoStack.startTransaction()};e.prototype.endTransaction=function(){this.undoStack.endTransaction();this.onChange();this.manualStart=false};e.prototype.transaction=function(e){if(_.isFunction(e)){if(!this.undoStack.isTransactionStarted()){this.manualStart=false;this.undoStack.startTransaction()}e.call();if(!this.manualStart){this.undoStack.endTransaction()}this.onChange()}};e.prototype.operation=function(e){if(this.undoStack.isTransactionStarted()){var t=[].slice.call(arguments);t.shift();this.undoStack.addOperation({operation:e,args:t})}};e.prototype.undo=function(){if(this.canUndo()){var e=this.undoStack.pop();var t=function(e,t){var i=e.operation;var n=t.operation;var r=["nodeAdded","nodeDeleted","nodeDataUpdated"];var o=["connectionCreated","connectionDeleted"];if(o.includes(i)&&r.includes(n)){return 1}if(r.includes(i)&&o.includes(n)){return-1}return 0};var i=this;this.editor.batch(function(){e.sort(t).forEach(function(e){var t=i.undoOperations[e.operation];if(t){t.apply(i,e.args)}})});this.onChange()}};AGN.Lib.WM.UndoManager=e})();(function(){var l=AGN.Lib.WM.Definitions,i=AGN.Lib.Select;var e=function(){var s={};this.editors=[];this.curEditor;this.curEditingNode;this.getCurrentNode=function(){return this.curEditingNode};this.getCurrentNodeId=function(){return this.curEditingNode.getId()};this.getCurrentNodeAnchorsInUse=function(){if(s.getNodeAnchorsInUse){return s.getNodeAnchorsInUse(this.curEditingNode)}return{}};this.getCurrentEditor=function(){return this.curEditor};this.assignOptions=function(e){$.extend(s,e)};this.registerEditor=function(e,t){return this.editors[e]=t};this.isPausedWorkflow=function(){return $("#workflow-status").val()===l.constants.statusPaused};this._notAllowedToChangeDuringPause=function(e){return this.isPausedWorkflow()&&!_.union(l.NODE_TYPES_MAILING,[l.NODE_TYPE_STOP]).includes(e.getType())};this.showEditDialog=function(n,r){var o=this;var a=n.getType();this.curEditingNode=n;this.curEditor=this.editors[a];this.curEditor.fillEditor(n);this.getEditorPanel(a).dialog({open:function(e){var t=$(this);var i=t.parent().find(".ui-dialog-title");i.empty();i.append($('<span class="dialog-title-image">'+o.curEditor.getTitle()+"</span>"));i.find(".dialog-title-image").attr("data-type",a);if(a==l.NODE_TYPE_RECIPIENT){t.parent().find(".recipient-editor-select").prop("disabled",n.isDependent()||n.isInRecipientsChain())}$(e.target).find(".js-datepicker").each(function(e,t){var i=$(t).pickadate("picker");i.set("select",i.get("select"))});if(r||o._notAllowedToChangeDuringPause(o.curEditingNode)){u($(e.target))}},close:function(){if(o.curEditor.closeEditor){o.curEditor.closeEditor()}},width:650,height:"auto",minHeight:"auto",modal:true,resizable:false})};this.showIconCommentDialog=function(e){var t=this;this.curEditingNode=e;this.curEditor=this.editors["icon-comment"];this.curEditor.fillEditor(e);this.getEditorPanel("icon-comment").dialog({open:function(){t.getEditorPanel("icon-comment").parent().find(".ui-dialog-titlebar").hide()},width:300,height:"auto",minHeight:"auto",modal:true,resizable:false,fluid:true,position:{my:"left top",at:"left bottom",of:e.get$()}})};this.saveIconComment=function(t){var i=this;s.getUndoManager().transaction(function(){var e=i.curEditingNode;s.getUndoManager().operation("nodeDataUpdated",e,_.cloneDeep(e));e.setComment(t);s.onChange(e)})};this.saveCurrentEditorWithUndo=function(e,t){var i=this;_.defer(function(){s.getUndoManager().startTransaction();i.saveCurrentEditor(e,t,function(){s.getUndoManager().endTransaction()})})};this.saveCurrentEditor=function(t,i,n){n=_.isFunction(n)?n:_.noop;var r=this;var e=this.curEditingNode;s.getUndoManager().operation("nodeDataUpdated",e,_.cloneDeep(e),r.curEditor);var o=r.curEditor.saveEditor();if(!t){r.cancelEditor()}if(r.isNodeIsMailing(e)){var a=o.mailingId;if(i){i.checkDifferentMailingLists(a,function(e){r.mailingSpecificSave(t,e,o,i);n()},function(e){r.curEditor.storedMailingContent=e;r.curEditor.storedMailingId=a;r.curEditor.storedLeaveOpen=t;r.curEditor.storedEditorData=o;i.initOneMailinglistWarningDialog(i);n()})}}else{$.extend(e.getData(),o);if(!e.isFilled()){e.setFilled(true)}if(e.isFilled()&&_.isFunction(r.curEditor.isSetFilledAllowed)){if(!r.curEditor.isSetFilledAllowed()){e.setFilled(false)}}if(s.supplement){s.supplement(e)}if(s.onChange){s.onChange(e)}n()}};this.resave=function(e){var t=this.curEditingNode;var i=this.curEditor;try{this.curEditingNode=e;this.curEditor=this.editors[e.getType()];this.curEditor.fillEditor(e);this.saveCurrentEditor()}finally{this.curEditingNode=t;this.curEditor=i}};this.modify=function(e,t){s.getUndoManager().operation("nodeDataUpdated",e,_.cloneDeep(e));t(e);if(s.onChange){s.onChange(e)}};this.isNodeIsMailing=function(e){return l.NODE_TYPES_MAILING.includes(e.getType())};this.mailingSpecificSave=function(e,t,i,n){var r=this;var o=this.curEditingNode;var a=o.getData();$.extend(a,i);if(o.isFilled()&&_.isFunction(r.curEditor.isSetFilledAllowed)){if(!r.curEditor.isSetFilledAllowed()){o.setFilled(false)}}if(s.supplement){s.supplement(o,n,t)}if(s.onChange){s.onChange(o)}};this.mailingSpecificSaveAfterMailinglistCheckModal=function(e){this.curEditor.storedMailingContent.mailinglistId=e.configuredMailingData.mailinglistId;this.mailingSpecificSave(this.curEditor.storedLeaveOpen,this.curEditor.storedMailingContent,this.curEditor.storedEditorData,e)};this.cancelEditor=function(){var e=this.curEditingNode.getType();var t=this.getEditorPanel(e);if(t.dialog("instance")){t.dialog("close")}};this.getEditorPanel=function(e){var t=e=="stop"?"start":e;return $("#"+t+"-editor")};this.formToObject=function(e){var t=$('form[name="'+e+'"]').serializeArray();var n={};$.each(t,function(){if(this.name.indexOf("[")!=-1){var e=this.name.substring(0,this.name.indexOf("["));if(n[e]==undefined){n[e]=[]}var t=this.name.substring(this.name.indexOf("[")+1,this.name.indexOf("]"));if(n[e][t]==undefined){n[e][t]={}}if(this.name.indexOf(".")!=-1){var i=this.name.substring(this.name.indexOf(".")+1);n[e][t][i]=this.value}else{n[e][t]=this.value}}else{n[this.name]=this.value||""}});$('form[name="'+e+'"] [type="checkbox"]').each(function(){n[this.name]=$(this).prop("checked")});return n};this.fillFormFromObject=function(e,t,i,n){if(typeof t==="string"){this.fillFormFromObjectItem(e,i,i,t||n)}else{for(var r in t){if(t.hasOwnProperty(r)){var o=t[r];if(!o&&n&&n[r]){o=n[r]}this.fillFormFromObjectItem(e,i,r,o)}}}};this.fillFormFromObjectItem=function(e,t,i,n){if(Object.prototype.toString.call(n)==="[object Array]"){for(var r=0;r<n.length;r++){this.fillFormFromObject(e,n[r],i+"["+r+"]"+".")}}else{var o=$('form[name="'+e+'"] [name="'+t+i+'"]');var a=o.attr("type");switch(a){case"checkbox":o.prop("checked",Boolean(n));break;case"radio":o.filter('[value="'+n+'"]').prop("checked",true);break;default:var s=o.prop("tagName");switch(s){case"SELECT":o.val(n);this.initSelectWithValueOrChooseFirst(o,n);break;default:o.val(n)}}}};this.processForward=function(e,t,i,n){var r=[];r.push("nodeId="+this.curEditingNode.getId());r.push("elementId="+encodeURIComponent(t));if(!!n){r.push(n)}var o={forwardName:e,forwardParams:r.join(";")};if(this.curEditor.safeToSave){this.saveCurrentEditor()}i(false,o)};this.getFirstOptionValue=function(e){return i.get(e).getFirstValue()};this.resetSelect=function(e){i.get(e).clear()};this.initSelectWithFirstValue=function(e){i.get(e).selectFirstValue()};this.initSelectWithValueOrChooseFirst=function(e,t){i.get(e).selectValueOrSelectFirst(t)};this.getNodesByTypes=function(e){if(s.getNodesByTypes){return s.getNodesByTypes(e)}return[]};this.getNodesByType=function(e){return this.getNodesByTypes([e])};this.getNodesByIncomingConnections=function(e){if(s.getNodesByIncomingConnections){return s.getNodesByIncomingConnections(e)}return[]};this.getNodesByOutgoingConnections=function(e){if(s.getNodesByOutgoingConnections){return s.getNodesByOutgoingConnections(e)}return[]};this.getFirstIncomingChain=function(){if(this.curEditingNode&&s.getFirstIncomingChain){return s.getFirstIncomingChain(this.curEditingNode)}return[]};this.forEachPreviousNode=function(t){var i=this;if(this.curEditingNode&&s.forEachPreviousNode){return s.forEachPreviousNode(this.curEditingNode,function(e){return t.call(i,e)})}return[]};this.deleteNode=function(e){if(s.deleteNodeById){s.deleteNodeById(e)}};this.openNode=function(e,t){if(s.editNode){s.editNode(e,t)}}};function u(e){e.find(".disable-for-active").each(function(e,t){$(t).attr("disabled",true)});e.find(".hide-for-active").each(function(e,t){$(t).hide()});e.find(':input:enabled[type!="hidden"]').not(":button, .select2, .js-select, .js-datepicker").each(function(e,t){if($(t).prop("type")=="radio"||$(t).prop("type")=="checkbox"){$(t).attr("disabled",true)}else{$(t).attr("readonly",true)}});e.find(":input:enabled.select2, :input:enabled.js-select, .select2-container").not(".disabled, :disabled").each(function(e,t){if($(t).prop("type")=="text"||$(t).is("input, select")){$(t).attr("disabled",true)}else{$(t).select2("disable")}});e.find(".js-datepicker").each(function(e,t){$(t).attr("disabled",true)})}AGN.Lib.WM.EditorsHelper=new e})();(function(){var C=AGN.Lib.WM.Definitions,h=AGN.Lib.WM.Node,A=AGN.Lib.WM.EditorsHelper,E=AGN.Lib.WM.Utils,x=AGN.Lib.WM.Dialogs;var e=function(e,o){this.MAILING_TYPE_ACTIONBASED=1;this.MAILING_TYPE_DATEBASED=2;this.MAILING_TYPE_FOLLOWUP=3;this.node={};this.mailingsStatus="all";this.defaultMailingsSort=e.defaultMailingsSort;this.defaultMailingsOrder=e.defaultMailingsOrder;this.mailingsSort=this.defaultMailingsSort;this.mailingsOrder=this.defaultMailingsOrder;this.formNameJId='form[name="'+e.form+'"]';this.containerId=e.container;this.mailingType=e.mailingType;this.mediaType=e.mediaType;this.mediatypes=e.mediatypes;this.mailingTypesForLoading=e.mailingTypesForLoading;this.statusName=e.mailingStatus;this.selectName=e.selectName;this.selectNameJId="select[name="+e.selectName+"]";this.mailingId=0;this.showCreateEditLinks=e.showCreateEditLinks;this.$dropdown=null;if(e.$dropdown){this.$dropdown=e.$dropdown}this.isChangeDecisionOptions=e.isFollowUpBaseMailing;this.followUpContainer=e.followUpContainer;this.advertisingAdditionalOptions=e.advertisingAdditionalOptions;this.nodesChain=[];this.mailingData={};this.configuredMailingData=null;var u=this;this.fillEditorBase=function(e){this.node=e;if(E.checkActivation()){this.mailingsStatus="all"}else{this.mailingsStatus=$(this.formNameJId).find("input[checked=checked]").val()||"all"}this.mailingsSort=this.defaultMailingsSort;this.mailingsOrder=this.defaultMailingsOrder;this.cleanOptions();this.hideSendSettings();this.changeDecisionOptionsSet($(this.containerId),this.isChangeDecisionOptions)};this.cleanOptions=function(){this.setDefaultSortOptions();$(this.containerId+" #"+this.statusName+"_all").attr("checked","checked");this.activateInputs();this.setSelectMailingOptions(this.node.data[this.selectName]);this.getMailingsByWorkStatus(this.mailingsStatus,this.mailingsSort,this.mailingsOrder,this.node.data.mailingId)};this.setDefaultSortOptions=function(){this.mailingsSort=this.defaultMailingsSort;this.mailingsOrder=this.defaultMailingsOrder;$(this.containerId+" .arrowUp").hide();$(this.containerId+" .arrowDown").hide();$(this.containerId+" #shortname_sort").attr("press",1);$(this.containerId+" #change_date_sort").attr("press",2);if(this.mailingType==this.MAILING_TYPE_ACTIONBASED||this.mailingType==this.MAILING_TYPE_DATEBASED){$(this.containerId+" #shortname_sort .arrowUp").show()}else{$(this.containerId+" #change_date_sort .arrowDown").show()}};this.onMailingsStatusChange=function(e){this.setSelectMailingOptions(0);this.getMailingsByWorkStatus(e,this.mailingsSort,this.mailingsOrder);this.changeDecisionOptionsSet($(this.containerId),this.isChangeDecisionOptions)};this.onMailingSelectChange=function(e){this.setSelectMailingOptions(e);this.changeDecisionOptionsSet($(this.containerId),this.isChangeDecisionOptions)};this.changeDecisionOptionsSet=function(e,t){if(t){var i=this.mailingId;var n=$(e.find(this.followUpContainer));var r=this.advertisingAdditionalOptions;$(n.find(".advertisingOption")).remove();if(i){$.ajax({type:"POST",url:AGN.url("/mailing/ajax/"+i+"/isAdvertisingContentType.action")}).done(function(e){if(e&&e.success){var t=AGN.Lib.Template.text("followupAdvertisingOptions",{items:r});n.append(t)}})}}};this.onMailingSortClick=function(e,t){$(this.containerId+" .arrowUp").hide();$(this.containerId+" .arrowDown").hide();var i=$(this.containerId+" .sort");var n=this.containerId+" #"+e+"_sort";var r=$(n);var o=$(n+" .arrowUp");var a=$(n+" .arrowDown");var s=r.attr("press");var l=$(this.formNameJId+" "+this.selectNameJId).val();if(!s){i.attr("press",2);r.attr("press",2);o.show();this.mailingsOrder="ASC"}else{switch(s){case"1":r.attr("press",2);a.show();this.mailingsOrder="DESC";break;case"2":r.attr("press",1);o.show();this.mailingsOrder="ASC";break}}this.getMailingsByWorkStatus(this.mailingsStatus,t,this.mailingsOrder,l)};this.setMailingId=function(e){this.mailingId=e;if(this.$dropdown){if(this.mailingId>0){this.$dropdown.show()}else{this.$dropdown.hide()}}};this.setSelectMailingOptions=function(e){this.setMailingId(e);if(this.showCreateEditLinks){this.setMailingLinks(e)}};this.setMailingLinks=function(e){var i="";if(e!="0"){if(!E.checkActivation()){i='<a href="#" data-action="mailing-editor-edit">'+t("workflow.mailing.edit_mailing_link")+"</a> "}else{const r=AGN.url("/mailing/"+e+"/settings.action");i='<a href="'+r+'">'+t("workflow.mailing.edit_mailing_link")+"</a>"}}else{i=""+'<a href="#" class="setting-mailing-left" data-action="mailing-editor-new"> '+t("workflow.mailing.new")+"</a>"}var n=$(this.containerId+" #mailing_create_edit_link");n.html("");n.append(i)};this.showSecurityQuestion=function(){this.setSecurityQuestion();this.setIsUsedInCMAttr();if(this.isSentMailing(this.mailingIsSent)||this.mailingIsUsedInCM){var e=this.getSelectedMailingOption();$(this.containerId+"-security-dialog").dialog({title:'<span class="dialog-fat-title">'+e.html()+"</span>",dialogClass:"no-close",open:function(e,t){},width:650,modal:true,resizable:false});return false}return true};this.isSentMailing=function(e){return e=="mailing.status.sent"||e=="mailing.status.scheduled"||e=="mailing.status.norecipients"};this.cancelSecurityDialog=function(){$(this.containerId+"-security-dialog").dialog("close")};this.getMailingsByWorkStatus=function(i,n,r,o){var a=this;var s=$(this.formNameJId+" "+this.selectNameJId);s.attr("readonly","readonly");$.ajax({type:"POST",url:AGN.url("/workflow/getMailingsByWorkStatus.action"),data:{mailingTypes:this.mailingTypesForLoading.join(","),mediatypes:this.mediatypes?this.mediatypes.join(","):"",status:i,sort:n,order:r},success:function(e){s.empty();s.append($("<option></option>",{value:0,text:t("workflow.defaults.no_mailing")}));e.forEach(function(e){var t=$("<option></option>",{value:e.MAILING_ID,text:e.SHORTNAME,selected:o==e.MAILING_ID});if(a.isSentMailing(e.WORK_STATUS)){t.css("color","#808080")}t.attr({status:e.WORK_STATUS,senddate:e.SENDDATE});t.data({status:e.WORK_STATUS,"send-date":e.SENDDATE,"dependent-campaigns":e.USEDINWORKFLOWS||""});s.append(t)});s.removeAttr("readonly");a.mailingsStatus=i;a.mailingsSort=n;a.mailingsOrder=r;s.val(a.mailingId);A.initSelectWithValueOrChooseFirst(s,a.mailingId)}})};this.disableInputs=function(){$(this.containerId+' [name="'+this.statusName+'"]').attr("disabled","disabled")};this.activateInputs=function(){$(this.containerId+' [name="'+this.statusName+'"]').removeAttr("disabled")};this.setNodeFields=function(){this.node.setFilled(parseInt(this.mailingId,10)>0)};this.setSecurityQuestion=function(){var e=this.getSelectedMailingOption();this.mailingIsSent="";if(parseInt(this.mailingId,10)>0){this.mailingIsSent=e.data("status")}};this.setIsUsedInCMAttr=function(){var e=this.getSelectedMailingOption();var t=e.data("dependent-campaigns");var i=e.val();this.mailingIsUsedInCM=false;if(parseInt(this.mailingId,10)>0&&i==this.mailingId&&t){var n=C.workflowId||0;if(t>0){if(n>0){this.mailingIsUsedInCM=n!==t}else{this.mailingIsUsedInCM=true}}}};this.getSelectedMailingOption=function(){return $(this.formNameJId+" "+this.selectNameJId+" option[value="+this.mailingId+"]")};this.getSelectedDecisionOption=function(){var e="decisionCriterion";var t=$(this.formNameJId+' select[name="'+e+'"]').val();return $(this.formNameJId+' select[name="'+e+'"] option[value='+t+"]")};this.createNewMailing=function(e){r({node:this.node,successCallback:i,forwardName:e,mailingEditorBase:this})};var i=function(e,i,n){if(!e.hasMailingList){$(n.containerId+" .editor-error-messages").html(t("error.workflow.notAddedMailingList"));$(n.containerId+" .editor-error-messages").css("display","block")}else{var r=[];r.push("mailingType="+n.mailingType);if(n.mediaType){r.push("mediaType="+n.mediaType)}if(n.mailingType==n.MAILING_TYPE_FOLLOWUP){r.push("workflowFollowUpParentMailing="+n.node.data.baseMailingId);r.push("workflowFollowUpDecisionCriterion="+n.node.data.decisionCriterion)}A.processForward(i,n.formNameJId+" "+n.selectNameJId,o,r.join(";"))}};this.processCopyAndEditMailingForward=function(e,t,i,n){$("#forwardTargetItemId").val(e);var r=[];if(this.mailingType==this.MAILING_TYPE_FOLLOWUP){r.push("workflowFollowUpParentMailing="+this.node.data.baseMailingId);r.push("workflowFollowUpDecisionCriterion="+this.node.data.decisionCriterion)}if(r.length>0){A.processForward(t,i+" "+n,o,r.join(";"))}else{A.processForward(t,i+" "+n,o)}};this.editMailing=function(e){this.processCopyAndEditMailingForward(this.mailingId,e,this.formNameJId,this.selectNameJId)};this.copyMailing=function(e){this.processCopyAndEditMailingForward(this.mailingId,e,this.formNameJId,this.selectNameJId)};this.trySupplementChain=function(e,t,i){if(e.length>0){this.configuredMailingData=s(e);this.nodesChain=e;this.mailingData=t;var n=c(u,true);if(n.length){x.confirmMailingDataTransfer(n).done(function(e){u.transferMailingData(e);u.supplementChain(i)}).fail(function(){u.transferMailingData();u.supplementChain(i)})}else{u.supplementChain(i)}}};this.checkDifferentMailingLists=function(e,r,o){var a=this;n(e).then(function(e){var t=A.getFirstIncomingChain();a.configuredMailingData=s(t);a.nodesChain=t;a.mailingData=e;var i=0;t.forEach(function(e){if(e.getType()==C.NODE_TYPE_MAILING){i++}});var n=a.configuredMailingData.mailinglistId;if(i>1&&n!=0&&n!=e.mailinglistId){o(e)}else{r(e)}})};var s=function(e){var t={parameterValue:0,campaignId:0,mailinglistId:0,targets:[],date:null};for(var i=e.length-1;i>=0;i--){var n=e[i];var r=n.getData();switch(n.getType()){case C.NODE_TYPE_PARAMETER:t.parameterValue=r.value;break;case C.NODE_TYPE_ARCHIVE:t.campaignId=r.campaignId;break;case C.NODE_TYPE_RECIPIENT:if(t.mailinglistId==0){t.mailinglistId=r.mailinglistId}if(r.targets!==null){r.targets.forEach(function(e){if(!t.targets.includes(e)){t.targets.push(parseInt(e))}})}break;case C.NODE_TYPE_START:if(r.date){t.date=y(r.date);t.date.setHours(r.hour);t.date.setMinutes(r.minute)}else{t.date=null}break;case C.NODE_TYPE_DEADLINE:if(r.deadlineType==C.constants.deadlineTypeFixedDeadline){if(r.date){t.date=y(r.date);t.date.setHours(r.hour);t.date.setMinutes(r.minute)}else{t.date=null}}else if(r.deadlineType==C.constants.deadlineTypeDelay){if(t.date!=null){if(r.timeUnit==C.constants.deadlineTimeUnitMinute){t.date.setMinutes(t.date.getMinutes()+parseInt(r.delayValue))}else if(r.timeUnit==C.constants.deadlineTimeUnitHour){t.date.setHours(t.date.getHours()+parseInt(r.delayValue))}else if(r.timeUnit==C.constants.deadlineTimeUnitDay){t.date.setDate(t.date.getDate()+parseInt(r.delayValue));if(r.useTime||r.useTime=="true"){t.date.setMinutes(t.date.getMinutes()+parseInt(r.minute));t.date.setHours(t.date.getHours()+parseInt(r.hour))}}}}break}}return t};var c=function(e,t){var i=e.configuredMailingData;var n=e.mailingData;var r=[];var o=[];var a=[];if(n.mailinglistId==0){a.push(C.MAILING_PARAM_MAILING_LIST)}else{if(i.mailinglistId==0){r.push(C.MAILING_PARAM_MAILING_LIST)}else{if(i.mailinglistId!=n.mailinglistId){if(t){o.push(C.MAILING_PARAM_MAILING_LIST)}else{r.push(C.MAILING_PARAM_MAILING_LIST)}}}}var s=i.targets;var l=n.targetGroupIds;if(l==null||l.length==0){a.push(C.MAILING_PARAM_TARGET_GROUPS)}else{if(s==null||s.length==0){r.push(C.MAILING_PARAM_TARGET_GROUPS)}else{if(!b(i,n)){if(t){o.push(C.MAILING_PARAM_TARGET_GROUPS)}else{r.push(C.MAILING_PARAM_TARGET_GROUPS)}}}}if(C.constants.isAltgExtended){var u=i.altgs;var c=n.altgIds;if(c==null||c.length==0){a.push(C.MAILING_PARAM_ALTGS)}else{if(u==null||u.length==0){r.push(C.MAILING_PARAM_ALTGS)}else{if(!w(i,n)){if(t){o.push(C.MAILING_PARAM_TARGET_GROUPS)}else{r.push(C.MAILING_PARAM_TARGET_GROUPS)}}}}}var d=e.getParameterValue(n.splitBase,n.splitPart);if(d==null){a.push(C.MAILING_PARAM_LIST_SPLIT)}else{if(i.parameterValue==0){r.push(C.MAILING_PARAM_LIST_SPLIT)}else{if(i.parameterValue!=d){if(t){o.push(C.MAILING_PARAM_LIST_SPLIT)}else{r.push(C.MAILING_PARAM_LIST_SPLIT)}}}}if(n.campaignId==0){a.push(C.MAILING_PARAM_ARCHIVE)}else{if(i.campaignId==0){r.push(C.MAILING_PARAM_ARCHIVE)}else{if(i.campaignId!=n.campaignId){if(t){o.push(C.MAILING_PARAM_ARCHIVE)}else{r.push(C.MAILING_PARAM_ARCHIVE)}}}}var f=i.date;var p=m(n);var h=v(n);if(p==null&&h==null){a.push(C.MAILING_PARAM_PLANNED_DATE)}else{if(f==null){if(p!=null){r.push(C.MAILING_PARAM_PLANNED_DATE)}else{r.push(C.MAILING_PARAM_SEND_DATE)}}else{if(y(p)>y(f)){if(t){o.push(C.MAILING_PARAM_PLANNED_DATE)}else{r.push(C.MAILING_PARAM_PLANNED_DATE)}}else if(p&&y(p)<y(f)){a.push(C.MAILING_PARAM_PLANNED_DATE)}if(h>f){if(t){o.push(C.MAILING_PARAM_SEND_DATE)}else{r.push(C.MAILING_PARAM_SEND_DATE)}}else if(h&&h<f){a.push(C.MAILING_PARAM_SEND_DATE)}}}g(e,a);return t?o:r};var g=function(e,t){var i=e.configuredMailingData;var n=e.mailingData;for(var r=0;r<t.length;r++){switch(t[r]){case C.MAILING_PARAM_MAILING_LIST:n.mailinglistId=i.mailinglistId;break;case C.MAILING_PARAM_TARGET_GROUPS:n.targetGroupIds=i.targets;break;case C.MAILING_PARAM_ALTGS:n.altgIds=i.altgs;break;case C.MAILING_PARAM_ARCHIVE:n.campaignId=i.campaignId;break;case C.MAILING_PARAM_LIST_SPLIT:n.splitBase="";n.splitPart="";break;case C.MAILING_PARAM_PLANNED_DATE:var o=y(i.date);if(o){n.planDate=o.getTime()}else{n.planDate=0}break;case C.MAILING_PARAM_SEND_DATE:n.sendDate=y(i.date);if(i.date){n.sendHour=i.date.getHours();n.sendMinute=i.date.getMinutes()}break}}};var n=function(e){return new Promise(function(t){_.defer(function(){$.ajax({type:"POST",url:AGN.url("/workflow/getMailingContent.action"),data:{mailingId:e},success:function(e){t(e)}})})})};var r=function(e){var t=e.node||A.curEditingNode;var i=e.successCallback;var n=e.forwardName;function r(e){var t=0;A.curEditingNode=e;A.forEachPreviousNode(function(e){if(e.type===C.NODE_TYPE_RECIPIENT){t=e.data.mailinglistId;return false}});return t>0}i({hasMailingList:r(t)},n,e.mailingEditorBase)};this.transferMailingData=function(e){if(e){g(u,e)}else{g(u,c(u,true))}};this.supplementChain=function(e){var n=c(this,false);var r=this.mailingData;var o=this.configuredMailingData;var t=this.nodesChain;var i=false;var a=false;for(var s=1;s<t.length;s++){if(C.NODE_TYPES_MAILING.includes(t[s].getType())){t.splice(s+1);a=true;break}}if(!a){if(n.includes(C.MAILING_PARAM_PLANNED_DATE)||n.includes(C.MAILING_PARAM_SEND_DATE)){if(C.NODE_TYPE_START==t[t.length-1].getType()){i=true}else{var l=A.getNodesByType(C.NODE_TYPE_START);if(l.length==0&&r.mailingType!=this.MAILING_TYPE_ACTIONBASED&&r.mailingType!=this.MAILING_TYPE_DATEBASED){i=true}}if(i){this.supplementSingleNode(C.NODE_TYPE_START,function(e){var t=e.getData();if(n.includes(C.MAILING_PARAM_PLANNED_DATE)){t.date=m(r);var i=o.date;if(i){t.hour=i.getHours();t.minute=i.getMinutes()}A.resave(e)}else if(n.includes(C.MAILING_PARAM_SEND_DATE)){t.date=v(r);t.hour=t.date.getHours();t.minute=t.date.getMinutes()}})}}}if(n.includes(C.MAILING_PARAM_LIST_SPLIT)){this.supplementSingleNode(C.NODE_TYPE_PARAMETER,function(e){var t=e.getData();t.value=u.getParameterValue(r.splitBase,r.splitPart)})}if(n.includes(C.MAILING_PARAM_ARCHIVE)){this.supplementSingleNode(C.NODE_TYPE_ARCHIVE,function(e){var t=e.getData();t.campaignId=r.campaignId})}if(n.includes(C.MAILING_PARAM_MAILING_LIST)||n.includes(C.MAILING_PARAM_TARGET_GROUPS)){this.supplementSingleNode(C.NODE_TYPE_RECIPIENT,function(e){var t=e.getData();if(n.includes(C.MAILING_PARAM_MAILING_LIST)){t.mailinglistId=r.mailinglistId;e.setDependent(true)}if(n.includes(C.MAILING_PARAM_TARGET_GROUPS)){t.targets=r.targetGroupIds;if(C.constants.isAltgExtended){t.targetsOption="ONE_TARGET_REQUIRED"}else{t.targetsOption=C.constants.accessLimitTargetId>0?"ALL_TARGETS_REQUIRED":"ONE_TARGET_REQUIRED"}}if(C.constants.isAltgExtended){if(n.includes(C.MAILING_PARAM_ALTGS)){t.altgs=r.altgIds}}})}if(!i&&(n.includes(C.MAILING_PARAM_PLANNED_DATE)||n.includes(C.MAILING_PARAM_SEND_DATE))){this.supplementSingleNode(C.NODE_TYPE_DEADLINE,function(e){var t=e.getData();if(n.includes(C.MAILING_PARAM_PLANNED_DATE)){t.date=m(r);var i=o.date;if(i){t.date.setHours(i.getHours());t.date.setMinutes(i.getMinutes())}}else if(n.includes(C.MAILING_PARAM_SEND_DATE)){t.date=v(r)}t.deadlineType=C.constants.deadlineTypeFixedDeadline;t.hour=t.date.getHours();t.minute=t.date.getMinutes()})}e(t)};this.supplementSingleNode=function(e,t){var i;switch(e){case C.NODE_TYPE_START:i=false;break;case C.NODE_TYPE_PARAMETER:i=[];break;case C.NODE_TYPE_ARCHIVE:i=[C.NODE_TYPE_PARAMETER];break;case C.NODE_TYPE_RECIPIENT:i=[C.NODE_TYPE_PARAMETER,C.NODE_TYPE_ARCHIVE];break;case C.NODE_TYPE_DEADLINE:i=[C.NODE_TYPE_PARAMETER,C.NODE_TYPE_ARCHIVE,C.NODE_TYPE_RECIPIENT];break;default:console.error("Unexpected supplement node type: "+e);return}if(!a(e,t)){l(e,i,t)}};var a=function(e,t){var i=u.nodesChain;for(var n=1;n<i.length;n++){var r=i[n];if(e==r.getType()){t(r);A.resave(r);return true}}return false};var l=function(e,t,i){var n=u.nodesChain;var r=h.create(e);i(r);if(t===false){n.push(r)}else{for(var o=1;o<n.length;o++){var a=n[o];if(!t.includes(a.getType())){n.splice(o,0,r);return}}n.push(r)}};this.closeOneMailinglistWarningDialog=function(){$(this.containerId+"-oneMailinglistWarning-dialog").dialog("close")};this.acceptOneMailinglistPerCampaign=function(){this.closeOneMailinglistWarningDialog();A.mailingSpecificSaveAfterMailinglistCheckModal(u)};this.validateEditor=function(e){var i=$(this.containerId+" .editor-error-messages");i.html("");i.css("display","none");var n=false;if($(this.containerId+" .delivery-settings").length){var r=$(this.containerId+' [name="maxRecipients"]').val();if(parseInt(r)!=r){i.html(t("error.workflow.wrongMaxRecipientsFormat"));n=true}else if(parseInt(r)<0){i.html(t("error.workflow.maxRecipientsLessThanZero"));n=true}else if(parseInt(r)>1e9){i.html(t("error.workflow.maxRecipientsTooBig"));n=true}}var o=$(this.formNameJId+" "+this.selectNameJId);if(o.val()<=0){if(i.html()!=""){i.html(i.html()+"<br>")}i.html(i.html()+t("error.workflow.noMailing"));n=true}if(!n){if(e){e()}else{A.saveCurrentEditor()}}else{i.css("display","block")}};this.toggleSendSettings=function(e){if($("#sendSettings_"+e).css("display")=="none"){$("#sendSettingsToggle_"+e).removeClass("toggle_closed");$("#sendSettingsToggle_"+e).addClass("toggle_open")}else{$("#sendSettingsToggle_"+e).removeClass("toggle_open");$("#sendSettingsToggle_"+e).addClass("toggle_closed")}$("#sendSettings_"+e).toggle("blind",200)};this.hideSendSettings=function(){$(".wm-mailing-send-settings-link").removeClass("toggle_open");$(".wm-mailing-send-settings-link").addClass("toggle_closed");$(".wm-mailing-send-settings").css("display","none")};this.getParameterValue=function(e,t){if(e.length>4){for(var i=0;i<e.length/2;i++){if(i+1==t){return e.substring(i*2,(i+1)*2)}}}else{for(var i=0;i<e.length/2;i++){if(e.substring(i*2,(i+1)*2)==t){return e.substring(i*2,(i+1)*2)}}}return null};this.initOneMailinglistWarningDialog=function(e){$(e.containerId+"-oneMailinglistWarning-dialog").dialog({title:'<span class="dialog-fat-title">'+e.getSelectedMailingOption().html()+"</span>",dialogClass:"no-close",width:350,modal:true,resizable:false})};var d=function(e){return e.sendDate!=undefined&&e.sendDate!=null&&e.sendHour!=null&&e.sendMinute!=null};var f=function(e){return e.planDate>0};var v=function(e){if(d(e)){return new Date(e.sendDate+"T"+e.sendHour+":"+e.sendMinute+":00")}return null};var m=function(e){if(f(e)){return new Date(e.planDate)}return null};var y=function(e){if(e==null){return null}else{return new Date(e.getFullYear(),e.getMonth(),e.getDate())}};var b=function(e,t){var i=e.targets;var n=t.targetGroupIds;if(i==null&&n==null){return true}if(i.length!=n.length){return false}for(var r=0;r<n.length;r++){if(!p(i,n[r])){return false}}return true};var w=function(e,t){var i=e.altgs;var n=t.altgIds;if(i==null&&n==null){return true}if(i.length!=n.length){return false}for(var r=0;r<n.length;r++){if(!p(i,n[r])){return false}}return true};var p=function(e,t){return e.indexOf(t)!=-1}};AGN.Lib.WM.MailingEditorHelper=e})();(function(){var a=AGN.Lib.WM.EditorsHelper;AGN.Lib.WM.MailingSelector=function(e,i,n,r){this.formNameJId='form[name="'+e+'"]';this.container=i;this.selectNameJId="select[name="+n+"]";this.defaultSortField="date";this.mailingId=0;this.noMailingOption=r;this.cleanOptions=function(e){if(e==undefined){e=0}$(this.container+" .sort").prop("press",e);this.onMailingSortClick(this.defaultSortField)};this.onMailingSelectChange=function(e){};this.onMailingSortClick=function(e){$(this.container+" .arrowUp").hide();$(this.container+" .arrowDown").hide();var t=$(this.container+" .sort");var i=this.container+" #"+e+"_sort";var n=$(i);var r=$(i+" .arrowUp");var o=$(i+" .arrowDown");var a=parseInt(n.prop("press"));var s="asc";t.prop("press",0);switch(a){case 0:n.prop("press",1);r.show();s="asc";break;case 1:n.attr("press",2);o.show();s="desc";break;case 2:n.prop("press",1);r.show();s="asc";break}this.getAllMailingSorted(e,s)};this.setMailingId=function(e){this.mailingId=e};this.getAllMailingSorted=function(e,i){var n=this;var r=$(this.formNameJId+" "+this.selectNameJId);var o=r.val();if(o!=null){n.mailingId=o}r.attr("readonly","readonly");$.ajax({type:"GET",url:AGN.url("/workflow/getAllMailingSorted.action"),data:{sortField:e,sortDirection:i},success:function(e){r.html("");if(n.noMailingOption){r.append('<option value="0">'+t("workflow.defaults.no_mailing")+"</option>")}for(var i=0;i<e.length;i++){r.append("<option "+' value="'+e[i].mailingID+'">'+e[i].shortname+"</option>")}r.removeAttr("readonly");if(n.mailingId==0&&n.noMailingOption==false&&e.length>0){r.val(e[0].mailingID)}else{r.val(n.mailingId)}a.initSelectWithValueOrChooseFirst(r,r.val())}})};this.getSelectedMailingOption=function(){return $(this.formNameJId+" "+this.selectNameJId+" option[value="+this.mailingId+"]")}}})();(function(){var m=AGN.Lib.WM.Definitions,d=AGN.Lib.WM.Node,r=AGN.Lib.WM.Vertex,f=AGN.Lib.WM.VertexGroup,o=AGN.Lib.WM.NodeTitleHelper,n=AGN.Lib.WM.Canvas,a=AGN.Lib.WM.ConnectionConstraints,s=AGN.Lib.WM.DraggableButtons,l=AGN.Lib.WM.AutoAlignment,u=AGN.Lib.WM.UndoManager,p=AGN.Lib.WM.EditorsHelper,c=AGN.Lib.WM.Dialogs,h=AGN.Lib.WM.Snippets,g=AGN.Lib.ContextMenu,v=AGN.Lib.Helpers,i=AGN.Lib.WM.Utils;var y={blurInputFields:function(){if(document.activeElement&&$(document.activeElement).is("input, textarea")){document.activeElement.blur()}},setConnectionLabel:function(e,t){if(t){var i=e.origin.getOverlay("label");if(i){i.setLabel(t);i.show()}else{e.origin.addOverlay(["Label",{location:.5,id:"label",cssClass:"connection-label",label:t}])}}else{e.origin.hideOverlay("label")}},setDeleteButtonEnabled:function(e){$("#deleteButton").toggleClass("disabled",!e);$("#deleteItem").prop("disabled",!e)},setUndoButtonEnabled:function(e){$("#undoButton").toggleClass("disabled",!e);$("#undoItem").prop("disabled",!e)}};function b(e,t,i){this.$viewport=$("#viewPort");this.$gridBackground=$("#grid-background");this.$container=$("#canvas");this.$titlesContainer=this.$container.find("#icon-titles-container");this.canvas=new n(this.$container);this.canvasZoomHandler=null;this.instance=jsPlumb.getInstance(b.defaults(this.$container));this.editable=!!e;this.lastAllocatedId=0;this.drag=null;this.chainModeEnabled=false;this.multiConnectionEnabled=false;this.scale=1;this.dragMode=m.DEFAULT_DRAG_MODE;var r=this;this.updateBackgroundCellSize(this.scale);this.canvas.setOnZoom(function(e){r.instance.setZoom(e);if(r.canvasZoomHandler){r.canvasZoomHandler.call(null,e)}});this.canvas.setOnMove(function(e){r.moveGridBackground(e)});this.draggableButtons=new s({enabled:!!e,getZoom:function(){return r.getZoom()},getOccupiesAreas:function(){return r.getNodes$().get().map(function(e){return d.getCollisionBox($(e))})},onStart:function(){},onStop:function(){},onDrop:function(e,t){r.newNode(e,t)}});this.$viewport.selectable({filter:".node",distance:10,disabled:!this.editable,start:function(){$("#selection-backdrop").show()},stop:function(){$("#selection-backdrop").hide()},selected:function(e,t){r.instance.addToDragSelection(t.selected);r.onSelectionChanged()},unselected:function(e,t){r.instance.removeFromDragSelection(t.unselected);r.onSelectionChanged()}});this.$viewport.on("mousedown",function(e){if(["canvas","viewPort","icon-titles-container"].includes(e.target.id)||$.contains(r.$titlesContainer[0],e.target)){r.deselectAll()}y.blurInputFields()});this.instance.bind("connection",function(e){r.undoManager.operation("connectionCreated",e);r.autofillStopNodesIfPossible();r.autoConvertMailingNodesTypeIfPossible();r.updateOverlays();r.positionTitles();r.processRecipientsChains()});this.instance.bind("connectionDetached",function(e){r.undoManager.operation("connectionDeleted",e);r.autofillStopNodesIfPossible();r.autoConvertMailingNodesTypeIfPossible();r.updateOverlays();r.positionTitles();r.processRecipientsChains()});this.instance.bind("mousedown",function(e,t){if(r.editable&&t.button===m.MOUSE_BUTTON_MIDDLE){_.defer(function(){r.undoManager.transaction(function(){r.deleteConnection(e)})})}y.blurInputFields()});this.instance.bind("beforeDrag",function(){r.undoManager.startTransaction()});this.instance.bind("connectionDragStop",function(){r.undoManager.endTransaction()});this.instance.bind("connectionDrag",function(e){r.deselectAll();if(e.source){var t=$(e.source);r.setNodeSelected(t,true);if(r.isChainMode()){d.setChainSource(t,true)}}});this.instance.bind("beforeDrop",function(e){var t=d.get(document.getElementById(e.sourceId));var i=d.get(document.getElementById(e.targetId));var n=r.connect(t,i,true);if(n){return true}if(n===false){workflowNotAllowedConnectionDialogHandler.showDialog()}return false});this.$footnotesContainer=$("#footnotes-container ol");this.isFootnotesEnabled=i;this.undoManager=new u(this,{onChange:function(){y.setUndoButtonEnabled(this.canUndo());r.processRecipientsChains();r.autofillStopNodesIfPossible();r.autoConvertMailingNodesTypeIfPossible()}});p.assignOptions({getUndoManager:function(){return r.getUndoManager()},getNodesByTypes:function(e){return r.getNodesByTypes(e)},getNodesByIncomingConnections:function(e){return r.getNodeIncomingConnections(e).map(function(e){return e.source})},getNodesByOutgoingConnections:function(e){return r.getNodeOutgoingConnections(e).map(function(e){return e.target})},getFirstIncomingChain:function(e){return r.getFirstIncomingChain(e)},forEachPreviousNode:function(e,t){return r.forEachPreviousNode(e,t)},getNodeAnchorsInUse:function(e){return r.getAnchorsInUse(e)},onChange:function(e){r.updateNodeTitle(e,true);r.updateFootnotes();r.updateMinimap()},supplement:function(e){r.supplement.apply(r,arguments)},editNode:function(e,t){alert("Missing editorsHelper.editNode")},deleteNodeById:function(e){alert("Missing editorsHelper.deleteNodeById")}});if(t){g.create(b.contextMenuOptions(r))}}b.defaults=function(e){return{Container:e,Anchor:[[0,.5,-1,0],[.5,0,0,-1],[1,.5,1,0],[.5,1,0,1]],DragOptions:{cursor:"pointer",zIndex:m.Z_INDEX_JSPLUMB_DRAG_OPTIONS},Endpoint:"Blank",Connector:["FixedBezierConnector"],PaintStyle:{stroke:m.CONNECTION_COLOR,strokeWidth:m.CONNECTION_THICKNESS,outlineStroke:m.CONNECTION_OUTLINE_COLOR,outlineWidth:m.CONNECTION_OUTLINE_WIDTH},HoverPaintStyle:{stroke:m.CONNECTION_HOVER_COLOR,strokeWidth:m.CONNECTION_THICKNESS,outlineStroke:m.CONNECTION_OUTLINE_COLOR,outlineWidth:m.CONNECTION_OUTLINE_WIDTH},ConnectionOverlays:[["Arrow",{id:"arrow",visible:true,location:1,width:m.CONNECTION_ARROW_SIZE,length:m.CONNECTION_ARROW_SIZE}]]}};b.contextMenuOptions=function(i){return{".jtk-connector":{shown:function(){return i.editable},items:{delete:{name:t("workflow.defaults.delete"),icon:"delete",disabled:function(e){return!i.canDeleteConnection(i.getConnectionByConnector$(e))},clicked:function(t){i.undoManager.transaction(function(){var e=i.getConnectionByConnector$(t);i.deleteConnection(e.origin)})}}}},".node":{shown:function(){return true},items:{connect:{name:t("workflow.connect"),icon:"connect",shown:function(){return i.editable&&i.getSelectionSize()>1},clicked:function(){i.undoManager.transaction(function(){if(i.getSelectionSize()==2&&i.multiConnectionEnabled){i.connectBetweenSelected()}else{i.connectSelected()}})}},disconnect:{name:t("workflow.disconnect"),icon:"disconnect",shown:function(){return i.editable&&i.getSelectionSize()>1},clicked:function(){i.undoManager.transaction(function(){i.disconnectSelected()})}},edit:{name:t("workflow.defaults.edit"),icon:"edit",shown:function(){return i.getSelectionSize()<=1},clicked:function(e){i.editIcon(d.get(e))},disabled:function(e){return!d.get(e).isEditable()}},delete:{name:t("workflow.defaults.delete"),icon:"delete",clicked:function(){i.undoManager.transaction(function(){i.deleteSelected()})},disabled:function(){return!i.editable}},comment:{name:t("workflow.defaults.comment"),icon:"comment",clicked:function(e){i.editIconComment(d.get(e))},disabled:function(){return!i.editable}}}}}};b.prototype.updateFootnotes=_.throttle(function(){this.forEachNode(function(e){e.setFootnote(-1)});this.$footnotesContainer.html("");if(this.isFootnotesEnabled){var t=this;var i=1;this.forEachNode(function(e){if(d.isCommented(e)){t.$footnotesContainer.append('<li id="#fn:'+i+'">'+e.getComment()+"</li>");e.setFootnote(i);i++}})}},150);b.prototype.moveGridBackground=function(e){const t=this.calculateBackgroundOffsetDelta(e.x);const i=this.calculateBackgroundOffsetDelta(e.y);this.$gridBackground.css({left:"-"+t+"px",top:"-"+i+"px",width:"calc(100% + "+t+"px)",height:"calc(100% + "+i+"px)"})};b.prototype.calculateBackgroundOffsetDelta=function(e){if(e<=0){return e*-1}const t=m.NODE_SIZE*this.scale;const i=e/t%1;return t-t*i};b.prototype.isActionBasedWorkflow=function(){return this.getNodes().some(function(e){return e.getType()===m.NODE_TYPE_ACTION_BASED_MAILING})};b.prototype.isDateBasedWorkflow=function(){return this.getNodes().some(function(e){return e.getType()===m.NODE_TYPE_DATE_BASED_MAILING})};b.prototype.isNormalWorkflow=function(){return!this.isActionBasedWorkflow()&&!this.isDateBasedWorkflow()};b.prototype.getNodes$=function(){return this.$container.find(".node")};b.prototype.getNodes=function(){return this.getNodes$().get().map(function(e){return d.get(e)})};b.prototype.getVertices=function(){return r.verticesFrom(this.getNodes(),this.instance.getAllConnections())};b.prototype.getNodesByTypes=function(t){return this.getNodes().filter(function(e){return t.includes(e.type)})};b.prototype.forEachNode$=function(e){var t=this.getNodes$();var i=this;t.each(function(){e.call(i,$(this))})};b.prototype.forEachNode=function(t){var i=this;this.forEachNode$(function(e){t.call(i,d.get(e))})};b.prototype.forEachPreviousNode=function(t,e){var i=this.getConnections();var n=i.filter(function(e){return e.target===t}).map(function(e){return e.source});var r={};while(n.length){for(var o=0;o<n.length;o++){var a=n[o];var s=a.getId();var l=e.call(this,a);if(l===false){return}r[s]=true}n=i.filter(function(e){if(n.includes(e.target)){var t=e.source.getId();if(r[t]){return false}else{r[t]=true;return true}}else{return false}}).map(function(e){return e.source})}};b.prototype.getNodeIncomingChains=function(t){var e=this.getVertices();var i=e.find(function(e){return e.node==t});var n=[];if(i){return r.getIncomingChains(i)}return n};b.prototype.getNodeOutgoingChains=function(t){var e=this.getVertices();var i=e.find(function(e){return e.node==t});var n=[];if(i){return r.getOutgoingChains(i)}return n};b.prototype.getFirstOutgoingChain=function(e){const t=this.getNodeOutgoingChains(e);if(t.length){return t[0]}return[]};b.prototype.getFirstIncomingChain=function(e){var t=this.getNodeIncomingChains(e);if(t.length){return t[0]}return[]};b.prototype.getNodeIncomingConnections=function(t){return this.getConnections(function(e){return d.get(e.target)===t})};b.prototype.getNodeOutgoingConnections=function(t){return this.getConnections(function(e){return d.get(e.source)===t})};b.prototype.getNodeConnections=function(t){return this.getConnections(function(e){return d.get(e.source)===t||d.get(e.target)===t})};b.prototype.hasNodeIncomingConnections=function(t){return this.instance.getAllConnections().some(function(e){return d.get(e.target)===t})};b.prototype.hasNodeOutgoingConnections=function(t){return this.instance.getAllConnections().some(function(e){return d.get(e.source)===t})};b.prototype.hasConnection=function(t){return this.instance.getAllConnections().some(function(e){return t.call(null,{origin:e,source:d.get(e.source),target:d.get(e.target)})})};b.prototype.getConnections=function(e){var t=this.instance.getAllConnections();if(e){t=t.filter(e)}return t.map(function(e){return{origin:e,source:d.get(e.source),target:d.get(e.target)}})};b.prototype.getConnectionByConnector$=function(t){return this.getConnections(function(e){return e.canvas==t[0]})[0]};b.prototype.getConnectionBetween=function(t,i){return this.getConnections(function(e){return $(e.source).is(t)&&$(e.target).is(i)})[0]};b.prototype.recycle=function(){this.instance.reset();this.$container.empty()};b.prototype.batch=function(){this.instance.batch.apply(this.instance,arguments)};b.prototype.newNode=function(e,t){var i=this;if(this.editable){if(d.isExpandableType(e)){switch(e){case m.NODE_TYPE_SC_ABTEST:case m.NODE_TYPE_SC_BIRTHDAY:case m.NODE_TYPE_SC_DOI:if(m.workflowId===0&&this._isInInitialState()){this.deleteAllNodes()}this.newSnippetFromSample(e,t);break;case m.NODE_TYPE_OWN_WORKFLOW:c.confirmOwnWorkflowExpanding().done(function(e){if(m.workflowId===0&&i._isInInitialState()){i.deleteAllNodes()}i.newSnippetFromOwnWorkflow(e.workflowId,e.copyContent,t)});break}}else{var n=d.create(e);var r=m.NODE_ANIMATION_DROPPED;if(!t){t=this.pickNewNodePosition();r=m.NODE_ANIMATION_AUTO_DROPPED}n.setCoordinates(t.x,t.y);this.undoManager.transaction(function(){i.add(n,r);i.supplement(n)})}}};b.prototype._isInInitialState=function(){return m.intialSchema===this.serializeIcons()};b.prototype.newSnippetFromSample=function(e,i){var n=this;h.loadSample(e,this.isGridDisplayed(),function(e,t){n.newSnippet(e,t,i)})};b.prototype.newSnippetFromOwnWorkflow=function(e,t,i){var n=this;h.loadOwnWorkflow(e,t,function(e,t){if(n.isGridDisplayed()){e.forEach(function(e){n.convertNodeCoordinates(e)})}n.newSnippet(e,t,i)})};b.prototype.newSnippet=function(e,t,i){var n=this;var r=i?m.NODE_ANIMATION_DROPPED:m.NODE_ANIMATION_AUTO_DROPPED;var o=this.getNodesByTypes([m.NODE_TYPE_START]).length>0;var a=this.getNodesByTypes([m.NODE_TYPE_STOP]).length>0;h.removeStartStop(e,t,o,a);if(i){h.adjustPositions(e,i.x,i.y,true)}else{i=this.getCenterPosition();h.adjustPositions(e,i.x,i.y,false)}this.undoManager.transaction(function(){n.batch(function(){var i=n.allocateIds(e.length);n.allocateSpaceForSnippet(e);e.forEach(function(e,t){e.setId(i[t]);n.add(e,r)});t.forEach(function(e){n.connect(e.source,e.target)})})})};b.prototype.allocateId=function(){return this.allocateIds(1)[0]};b.prototype.allocateIds=function(e){var t=[];var i={};this.forEachNode(function(e){i[e.getId()]=true});while(e>0){do{this.lastAllocatedId++}while(i[this.lastAllocatedId]);t.push(this.lastAllocatedId);e--}return t};b.prototype._findMaxNodeId=function(){var t=0;this.forEachNode(function(e){if(e.getId()>t){t=e.getId()}});return t};b.prototype.pickNewNodePosition=function(){var e=this.canvas.getVisibleArea();var n=Math.ceil(e.minY/m.CANVAS_GRID_SIZE);var r=Math.floor(e.maxY/m.CANVAS_GRID_SIZE)-(m.AUTO_DROP_STEP_Y>>1);var o=[];var t;this.forEachNode(function(e){var t=e.getCoordinates();o.push({minX:t.x-m.AUTO_DROP_STEP_X+1,minY:t.y-m.AUTO_DROP_STEP_Y+1,maxX:t.x+m.AUTO_DROP_STEP_X-1,maxY:t.y+m.AUTO_DROP_STEP_Y-1})});var i=function(t,i){if(i<n||i>r){return false}var e=!o.some(function(e){return!(t<e.minX||t>e.maxX||i<e.minY||i>e.maxY)});if(e){return{x:t,y:i}}return false};var a=function(){for(var e=0;e+1<arguments.length;e+=2){var t=i(arguments[e],arguments[e+1]);if(t){return t}}return false};var s=Math.round((e.minX+e.maxX-m.NODE_SIZE)/2/m.CANVAS_GRID_SIZE);var l=Math.round((e.minY+e.maxY-m.NODE_SIZE)/2/m.CANVAS_GRID_SIZE);t=a(s,l);if(t){return t}var u=s;var c=s;var d=l;var f=l;var p=0;while(true){t=a(u-m.AUTO_DROP_STEP_X,l,s,d-m.AUTO_DROP_STEP_Y,s,f+m.AUTO_DROP_STEP_Y,c+m.AUTO_DROP_STEP_X,l);if(t){return t}for(var h=1;h<=p;h++){var g=h*m.AUTO_DROP_STEP_X;var v=h*m.AUTO_DROP_STEP_Y;t=a(u-m.AUTO_DROP_STEP_X,l-v,u-m.AUTO_DROP_STEP_X,l+v,s-g,d-m.AUTO_DROP_STEP_Y,s+g,d-m.AUTO_DROP_STEP_Y,s-g,f+m.AUTO_DROP_STEP_Y,s+g,f+m.AUTO_DROP_STEP_Y,c+m.AUTO_DROP_STEP_X,l-v,c+m.AUTO_DROP_STEP_X,l+v);if(t){return t}}t=a(u-m.AUTO_DROP_STEP_X,d-m.AUTO_DROP_STEP_Y,u-m.AUTO_DROP_STEP_X,f+m.AUTO_DROP_STEP_Y,c+m.AUTO_DROP_STEP_X,d-m.AUTO_DROP_STEP_Y,c+m.AUTO_DROP_STEP_X,f+m.AUTO_DROP_STEP_Y);if(t){return t}u-=m.AUTO_DROP_STEP_X;c+=m.AUTO_DROP_STEP_X;d-=m.AUTO_DROP_STEP_Y;f+=m.AUTO_DROP_STEP_Y;p++}};b.prototype.getCenterPosition=function(){var e=this.canvas.getVisibleArea();var t=Math.round((e.minX+e.maxX-m.NODE_SIZE)/2/m.CANVAS_GRID_SIZE);var i=Math.round((e.minY+e.maxY-m.NODE_SIZE)/2/m.CANVAS_GRID_SIZE);return{x:t,y:i}};b.prototype.getLinkedFilledStartNodes=function(e){return _.compact(this.getNodeIncomingChains(e).map(function(e){return _.find(e,function(e){return e.getType()===m.NODE_TYPE_START})})).filter(function(e){return e.isFilled()})};b.prototype.isAutoOptimizationDecisionAllowed=function(e){const t=this.getLinkedFilledStartNodes(e);if(t.length===0){return true}return t.every(function(e){return m.constants.startTypeEvent!==e.data.startType})};b.prototype.isAllLinkedFilledStartsHasDateType=function(e){const t=this.getLinkedFilledStartNodes(e);return!!t.length&&t.every(function(e){return m.constants.startTypeDate===e.data.startType})};b.prototype.autofillStopNodesIfPossible=function(){const t=this;this.getNodesByTypes([m.NODE_TYPE_STOP]).forEach(function(e){t.autofillAutomaticEndIfPossible(e)})};b.prototype.autofillAutomaticEndIfPossible=function(e){if(!this.isAllLinkedFilledStartsHasDateType(e)){return}e.data.endType=m.constants.endTypeAutomatic;e.setFilled(true);this.updateNodeTitle(e,true)};b.prototype._possibleToAutoConvertMailingsTypeToActionBased=function(e){const t=this.getLinkedFilledStartNodes(e);return!!t.length&&t.every(function(e){return m.constants.startTypeEvent===e.data.startType&&"EVENT_REACTION"===e.data.event})};b.prototype._possibleToAutoConvertMailingsTypeToDateBased=function(e){const t=this.getLinkedFilledStartNodes(e);return!!t.length&&t.every(function(e){return m.constants.startTypeEvent===e.data.startType&&"EVENT_DATE"===e.data.event})};b.prototype.autoConvertMailingNodesTypeIfPossible=function(){const i=this;const e=[m.NODE_TYPE_MAILING,m.NODE_TYPE_ACTION_BASED_MAILING,m.NODE_TYPE_DATE_BASED_MAILING];this.getNodesByTypes(e).forEach(function(e){const t=i._getAutoConvertedMailingTypeIfPossible(e);if(e.type===t){return}e.type=t;if(e.isFilled()){e.data.mailingId=0;e.setFilled(false);i.updateNodeTitle(e,true)}i._updateNodeImages(e)})};b.prototype._getAutoConvertedMailingTypeIfPossible=function(e){if(this.isAllLinkedFilledStartsHasDateType(e)){return m.NODE_TYPE_MAILING}if(this._possibleToAutoConvertMailingsTypeToActionBased(e)){return m.NODE_TYPE_ACTION_BASED_MAILING}if(this._possibleToAutoConvertMailingsTypeToDateBased(e)){return m.NODE_TYPE_DATE_BASED_MAILING}return e.type};b.prototype.allocateSpaceForSnippet=function(a){var t=this;function n(e,t){var i=e.getCoordinates();var n=t.getCoordinates();return Math.abs(i.x-n.x)<m.AUTO_DROP_STEP_X&&Math.abs(i.y-n.y)<m.AUTO_DROP_STEP_Y}function s(e,i){return e.some(function(t){return i.some(function(e){return n(t,e)})})}function i(e){var t=0,i=0,n=0,r=0;e.forEach(function(e){t=Math.min(t,e.getX());i=Math.max(i,e.getX());n=Math.min(n,e.getY());r=Math.max(r,e.getY())});return{x:(i-t)/2,y:(r-n)/2}}function r(e,t){if(Math.abs(e.x-t.x)>=Math.abs(e.y-t.y)){return e.x<t.x?{x:-m.AUTO_DROP_STEP_X,y:0}:{x:m.AUTO_DROP_STEP_X,y:0}}else{return e.y<t.y?{x:0,y:-m.AUTO_DROP_STEP_Y}:{x:0,y:m.AUTO_DROP_STEP_Y}}}function l(e,i){e.forEach(function(e){var t=e.getCoordinates();e.setCoordinates(t.x+i.x,t.y+i.y)})}if(a.length){var e=this.getNodes();var o=e.map(function(e){return{node:e,coordinates:e.getCoordinates(),dragMode:t.getCurrentDragMode()}});var u=i(a);var c=f.detectGroups(this.getVertices()).map(function(e){var t=e.getNodes();return{nodes:t,moveDirection:r(i(t),u)}});c.forEach(function(t){if(s(t.nodes,a)){var i=t.moveDirection;var n=t.nodes.slice(0);var r=a.slice(0);var e=c.filter(function(e){return e!==t});do{l(n,i);var o;do{o=false;e=e.filter(function(e){if(s(n,e.nodes)){if(e.moveDirection.x==i.x&&e.moveDirection.y==i.y){l(e.nodes,i);Array.prototype.push.apply(n,e.nodes);o=true}else{Array.prototype.push.apply(r,e.nodes)}return false}else{return true}})}while(o)}while(s(n,r))}});o=o.filter(function(e){var t=e.node.getCoordinates();var i=e.coordinates;return t.x!=i.x||t.y!=i.y});if(o.length){this.undoManager.operation("nodeMoved",o)}}};b.prototype.allocateSpaceForSupplement=function(e,t){var n=[];var i=function(t,i){return!n.some(function(e){return!(t<e.minX||t>e.maxX||i<e.minY||i>e.maxY)})};this.forEachNode(function(e){var t=e.getCoordinates();n.push({minX:t.x-m.AUTO_DROP_STEP_X+1,minY:t.y-m.AUTO_DROP_STEP_Y+1,maxX:t.x+m.AUTO_DROP_STEP_X-1,maxY:t.y+m.AUTO_DROP_STEP_Y-1})});var r=0;var o=0;switch(t){case m.LEFT:default:r=-1;break;case m.RIGHT:r=+1;break;case m.TOP:o=-1;break;case m.BOTTOM:o=+1;break}var a=e.getX()+m.AUTO_DROP_STEP_X*r;var s=e.getY()+m.AUTO_DROP_STEP_Y*o;while(!i(a,s)){a+=r;s+=o}return{x:a,y:s}};b.prototype.allocateSpaceForIncomingSupplement=function(e){var t=this.getAnchorsInUse(e);var i=m.LEFT;if(!t[m.LEFT]&&t[m.TOP]){i=m.TOP}return this.allocateSpaceForSupplement(e,i)};b.prototype.allocateSpaceForOutgoingSupplement=function(e){var t=this.getAnchorsInUse(e);var i=m.RIGHT;if(!t[m.RIGHT]&&t[m.BOTTOM]){i=m.BOTTOM}return this.allocateSpaceForSupplement(e,i)};b.prototype.add=function(i,e){var n=this;var r=i.get$();if(!i.getId()){i.setId(this.allocateId())}i.appendTo(this.$container,this.$titlesContainer,e);i.setInteractionEnabled(this.editable);i.updateCommentLabels();this.instance.makeTarget(r,{anchor:i.getAnchors()});this.instance.makeSource(r,{anchor:i.getAnchors(),filter:".node-connect-button img"});this.initDraggableOptions(r);var o;r.on({mousedown:function(e){if(e.button===m.MOUSE_BUTTON_MIDDLE){if(n.editable){n.undoManager.transaction(function(){n.deleteNode(r)})}}else{i.wasDragging=false;o=d.isSelected(r);if(!o){if(n.isChainMode()){if(!n.isChainSourceSelected()){n.setNodeSelected(r,true);d.setChainSource(r,true)}else{var t=n.getChainSource();_.defer(function(){n.undoManager.transaction(function(){var e=n.connect(d.get(t),i);if(e){n.deselectAll();n.setNodeSelected(r,true);d.setChainSource(r,true)}else if(e===false){workflowNotAllowedConnectionDialogHandler.showDialog()}})})}}else if(!e.shiftKey&&!e.ctrlKey){n.deselectAll();n.setNodeSelected(r,true)}else{n.setNodeSelected(r,true)}}}y.blurInputFields()},mouseup:function(e){if(o&&!i.wasDragging){if(n.isChainMode()){n.setNodeSelected(r,false);d.setChainSource(r,false)}else if(e.shiftKey||e.ctrlKey){n.setNodeSelected(r,false)}else{n.deselectAll();n.setNodeSelected(r,true)}}},dblclick:function(){n.editIcon(i)},mouseenter:function(){i.setHovered(true)},mouseleave:function(){i.setHovered(false)}});this.undoManager.operation("nodeAdded",i);this.updateMinimap();this.updateFootnotes()};b.prototype.supplement=function(e,t,i){var l=this;if(e.isFilled()){if(m.NODE_TYPES_MAILING.includes(e.getType())&&!p.isPausedWorkflow()){const a=this._findFinalParameterNode(e);if(a){this._fillOptimizationFinalMailingIfPossible(a)}t.trySupplementChain(this.getFirstIncomingChain(e),i,function(s){l.batch(function(){var e=s[0];for(var t=1;t<s.length;t++){var i=s[t];if(i.isAppended()){e=i}else{for(var n=t;n<s.length;n++){var r=s[n];if(r.isAppended()){l.deleteConnectionBetween(r.get$(),e.get$());e=r;t=n;break}}}}for(var t=1;t<s.length;t++){var i=s[t];if(!i.isAppended()){var o=s[t-1];var a=l.allocateSpaceForIncomingSupplement(o);i.setCoordinates(a.x,a.y);l.add(i);l.connect(i,o);if(t+1<s.length&&s[t+1].isAppended()){l.connect(s[t+1],i)}p.resave(i)}}})});this.autoConvertMailingNodesTypeIfPossible()}else if(m.NODE_TYPE_RECIPIENT==e.getType()){this.processRecipientsChains()}else if(m.NODE_TYPE_PARAMETER===e.getType()){const a=l._findFinalParameterNode(e);if(a){const s=l._findTestMailingsParamsNodes(a);const u=e.getData().value;l._setParameterNodesValue(s,u);const c=u*s.length;p.modify(a,function(e){e.setFilled(true);e.setEditable(false);e.getData().value=100-c})}}else if(m.NODE_TYPE_START==e.getType()){this.autofillStopNodesIfPossible();this.autoConvertMailingNodesTypeIfPossible()}}else{if(m.NODE_TYPE_IMPORT==e.getType()){var n=!this.hasNodeOutgoingConnections(e);if(n){var r=d.create(m.NODE_TYPE_DEADLINE);var o=this.allocateSpaceForOutgoingSupplement(e);r.setCoordinates(o.x,o.y);this.add(r);this.connect(e,r)}}}};b.prototype.isAutoOptimizationWorkflow=function(e){const t=this._findFinalParameterNode(e);if(!t){return false}const i=this._findOptimizationFinalMailingNode(t);if(!i){return false}const n=this.getFirstIncomingChain(t).find(function(e){return e.getType()===m.NODE_TYPE_DECISION});return!!n&&n.data.decisionType===m.constants.decisionTypeAutoOptimization};b.prototype.getParametersOptions=function(e){const t=this._findFinalParameterNode(e);var i=m.SPLIT_DEFAULT_PARAMETERS;if(t){const n=this._findTestMailingsParamsNodes(t);const r=n.length+1;const o=Math.floor(100/r);i=i.filter(function(e){return e<=o})}return i.map(function(e){return{id:e,text:e}})};b.prototype._fillOptimizationFinalMailingIfPossible=function(e){if(!this._isAllOptimizationTestMailingsFilled(e)){return}const t=this._findOptimizationFinalMailingNode(e);const i=t.getTitle();p.modify(t,function(e){e.setFilled(true)});t.setTitle(i)};b.prototype._findFinalParameterNode=function(e){const t=this.getNodeOutgoingChains(e);for(var i=0;i<t.length;i++){const n=t[i];const r=n.find(function(e,t){return t>0&&m.NODE_TYPE_PARAMETER===e.getType()});if(r){return r}}return null};b.prototype._findTestMailingsParamsNodes=function(e){const i=[];this.getNodeIncomingChains(e).forEach(function(e){const t=e.find(function(e,t){return t>0&&m.NODE_TYPE_PARAMETER===e.getType()});if(t){i.push(t)}});return i};b.prototype._findOptimizationFinalMailingNode=function(e){const t=this.getFirstOutgoingChain(e);return t.find(function(e){return e.getType()===m.NODE_TYPE_MAILING&&!e.isEditable()})};b.prototype._isAllOptimizationTestMailingsFilled=function(e){const t=this._findTestMailingsParamsNodes(e);for(var i=0;i<t.length;i++){const n=t[i];const r=this.getFirstOutgoingChain(n);if(r.length<=1){return false}const o=r[1];if(o.getType()!==m.NODE_TYPE_MAILING||!o.isFilled()||!o.isEditable()){return false}}return true};b.prototype._setParameterNodesValue=function(e,t){e.forEach(function(e){p.modify(e,function(e){e.setFilled(true);e.getData().value=t})})};b.prototype.processRecipientsChains=_.debounce(function(){var e=this._findInitialRecipientsNodes();var r=this;e.forEach(function(n){n.setInRecipientsChain(false);r.updateNodeTitle(n);var e=r.getNodeOutgoingChains(n);e.forEach(function(e){var t=1;for(;t<e.length;++t){var i=e[t];if(i.type!=m.NODE_TYPE_RECIPIENT){break}i.data.mailinglistId=n.data.mailinglistId;i.setInRecipientsChain(true);r.updateNodeTitle(i)}})})},150);b.prototype._findInitialRecipientsNodes=function(){var e=this.getNodesByTypes([m.NODE_TYPE_RECIPIENT]);var t=this.getConnections();var i=[];t.filter(function(e){return e.target.type==m.NODE_TYPE_RECIPIENT&&e.source.type==m.NODE_TYPE_RECIPIENT}).forEach(function(e){i.push(e.target.id)});return e.filter(function(e){return!i.includes(e.id)})};b.prototype.getAnchorsInUse=function(e){var t=e.get$();return d.getAnchorsInUse(this.instance.getEndpoints(t[0]))};b.prototype.positionTitle=function(e){o.positionTitle(e,this.getAnchorsInUse(e))};b.prototype.updateNodeTitle=function(e,t){var i=this.isNormalWorkflow();o.updateTitle(e,i,t);this.positionTitle(e)};b.prototype.updateNodeTitles=_.throttle(function(t){var i=this;var n=this.isNormalWorkflow();this.forEachNode(function(e){o.updateTitle(e,n,t);i.positionTitle(e)})},150);b.prototype.positionTitles=_.throttle(function(){var t=this;this.forEachNode(function(e){t.positionTitle(e)})},150);b.prototype.setMinimapEnabled=function(e){this.canvas.setMinimapEnabled(e)};b.prototype.updateMinimap=_.debounce(function(){this.canvas.updateMinimap()},100);b.prototype.isChainSourceSelected=function(){return this.$container.find(".node.chain-mode-source").exists()};b.prototype.getChainSource=function(){return this.$container.find(".node.chain-mode-source")};b.prototype.setNodeSelected=function(e,t){if(t){this.instance.addToDragSelection(e)}else{this.instance.removeFromDragSelection(e)}d.setSelected(e,!!t);this.onSelectionChanged()};b.prototype.isConnectionPossible=function(t,i){if(t instanceof d&&i instanceof d){if(t===i){return false}return!this.hasConnection(function(e){return e.source===t&&e.target===i||e.source===i&&e.target===t})}return false};b.prototype._updateNodeImages=function(e){const t=m.ICONS_CONFIG[e.type].icons;e.get$().find(".active-node-image").attr("src",m.constants.imagePath+t.active);e.get$().find(".inactive-node-image").attr("src",m.constants.imagePath+t.inactive)};b.prototype.isConnectionAllowed=function(e,t){var i=new a(m.CONNECTION_CONSTRAINTS);var n=this;var r={node:e,type:e.getType(),connections:{}};var o={node:t,type:t.getType(),connections:{}};Object.defineProperty(r.connections,"incoming",{get:v.caching(n.getNodeIncomingConnections,n,e)});Object.defineProperty(r.connections,"outgoing",{get:v.caching(n.getNodeOutgoingConnections,n,e)});Object.defineProperty(o.connections,"incoming",{get:v.caching(n.getNodeIncomingConnections,n,t)});Object.defineProperty(o.connections,"outgoing",{get:v.caching(n.getNodeOutgoingConnections,n,t)});if(r.type==m.NODE_TYPE_STOP&&!this.hasNodeIncomingConnections(e)){r.type=m.NODE_TYPE_START;r.node.type=m.NODE_TYPE_START;n._updateNodeImages(r.node)}if(o.type==m.NODE_TYPE_START&&!this.hasNodeOutgoingConnections(t)){o.type=m.NODE_TYPE_STOP;o.node.type=m.NODE_TYPE_STOP;n._updateNodeImages(o.node)}return i.check(r,o)};b.prototype.connect=function(e,t,i){if(this.isConnectionPossible(e,t)){if(!this.isConnectionAllowed(e,t)){return false}if(e.getType()===m.NODE_TYPE_STOP){e.setType(m.NODE_TYPE_START)}if(t.getType()===m.NODE_TYPE_START){t.setType(m.NODE_TYPE_STOP)}if(i!==true){this.instance.connect({source:e.get$(),target:t.get$()})}return true}else{return null}};b.prototype.deselectAll=function(){this.$container.find(".node.ui-selected").removeClass("ui-selected");this.instance.clearDragSelection();this.clearSelectedSource();this.onSelectionChanged()};b.prototype.clearSelectedSource=function(){this.$container.find(".node.chain-mode-source").removeClass("chain-mode-source")};b.prototype.alignAll=function(){var t=this;var e=this.getNodes();var i={};e.forEach(function(e){i[e.getId()]=e.getCoordinates()});this.batch(function(){l.align(t.getVertices())});var n=e.filter(function(e){var t=i[e.getId()];return t.x!=e.getX()||t.y!=e.getY()}).map(function(e){return{node:e,coordinates:i[e.getId()],dragMode:t.getCurrentDragMode()}});if(n.length){t.undoManager.transaction(function(){t.undoManager.operation("nodeMoved",n)});this.positionTitles();this.updateMinimap()}};b.prototype.deleteSelected=function(){this.deleteNodes(this.getSelectedNodes())};b.prototype.deleteNode=function(e){var t=this;if(e instanceof d){}else{e=d.get(e)}if(e.isAppended()){var i=[e];switch(e.getType()){case m.NODE_TYPE_IMPORT:this.getNodeOutgoingConnections(e).forEach(function(e){if(m.NODE_TYPE_DEADLINE==e.target.getType()){i.push(e.target)}});break;case m.NODE_TYPE_DEADLINE:this.getNodeIncomingConnections(e).forEach(function(e){if(m.NODE_TYPE_IMPORT==e.source.getType()){i.push(e.source)}});break}i.forEach(function(e){t.undoManager.operation("nodeDeleted",e);t.instance.remove(e.get$());e.remove()});this.onSelectionChanged();this.positionTitles();this.updateFootnotes();this.updateMinimap()}};b.prototype.deleteAllNodes=function(){this.deleteNodes(this.getNodes())};b.prototype.deleteNodes=function(e){var t=this;this.undoManager.transaction(function(){t.batch(function(){e.forEach(function(e){t.deleteNode(e)})})})};b.prototype.disconnectSelected=function(){this.disconnectNodes(this.getSelectedNodes())};b.prototype.disconnectNode=function(e){var t=this;this.getNodeConnections(e).forEach(function(e){t.deleteConnection(e)})};b.prototype.disconnectNodes=function(e){var t=this;this.batch(function(){e.forEach(function(e){t.disconnectNode(e)})})};b.prototype.canDeleteConnection=function(e){var t,i;if(e.origin){t=e.source;i=e.target}else{t=d.get(e.source);i=d.get(e.target)}return!(m.NODE_TYPE_IMPORT==t.getType()&&m.NODE_TYPE_DEADLINE==i.getType())};b.prototype.deleteConnection=function(e){if(this.canDeleteConnection(e)){if(e.origin){this.instance.deleteConnection(e.origin)}else{this.instance.deleteConnection(e)}return true}return false};b.prototype.deleteConnectionBetween=function(e,t){var i=this.getConnectionBetween(e,t);if(i){this.deleteConnection(i)}};b.prototype.connectSelected=function(){return this.connectNodes(this.getSelectedNodes())};b.prototype.connectBetweenSelected=function(){var e=this.getSelectedNodes$();if(e.length>=2){return this.connectNodes(this.getNodesBetweenSelected(e[0],e[1]))}else{return false}};b.prototype.getNodesBetweenSelected=function(e,t){var i=d.getBox(e);var n=d.getBox(t);var r={minX:Math.min(i.minX,n.minX),maxX:Math.max(i.maxX,n.maxX),minY:Math.min(i.minY,n.minY),maxY:Math.max(i.maxY,n.maxY)};return this.getNodes().filter(function(e){return d.isInRegion(e.get$(),r)})};b.prototype.connectNodes=function(e){var t=this;var i=e.sort(function(e,t){return e.getX()<t.getX()?-1:e.getX()>t.getX()?1:e.getY()<t.getY()?-1:e.getY()>t.getY()?1:0});var n=false;this.undoManager.transaction(function(){t.batch(function(){for(var e=0;e<i.length-1;e++){if(t.connect(i[e],i[e+1])){n=true}}})});return n};b.prototype.getSelectedNodes$=function(){var i=[];this.$container.find(".node.ui-selected").each(function(e,t){i.push($(t))});return i};b.prototype.getSelectedNodes=function(){return this.getSelectedNodes$().map(function(e){return d.get(e)})};b.prototype.getSelectionSize=function(){return this.$container.find(".node.ui-selected").length};b.prototype.onSelectionChanged=function(){y.setDeleteButtonEnabled(this.getSelectionSize()>0)};b.prototype.setOnInitialized=function(e){const t=this;const i=function(){e.apply(this);t.lastAllocatedId=t._findMaxNodeId()};this.instance.ready(i)};b.prototype.setOnZoom=function(e){this.canvasZoomHandler=e};b.prototype.setEditable=function(t){t=!!t;if(this.editable!==t){this.editable=t;this.draggableButtons.setEnabled(t);this.$viewport.selectable(t?"enable":"disable");this.forEachNode(function(e){e.setInteractionEnabled(t)})}};b.prototype.getZoom=function(){return this.instance.getZoom()};b.prototype.setZoom=function(e){this.scale=e;this.canvas.setZoom(e);this.instance.setZoom(e);this.updateBackgroundCellSize(e);this.moveGridBackground(this.canvas.getPosition())};b.prototype.toggleGrid=function(){this.changeGridBackgroundVisibility();this.dragMode=this.isGridDisplayed()?m.GRID_CELL_DRAG_MODE:m.DEFAULT_DRAG_MODE;this.adaptToNewDragMode()};b.prototype.changeGridBackgroundVisibility=function(){this.$gridBackground.toggleClass("hidden")};b.prototype.convertNodeCoordinates=function(e){const t=e.getCoordinates();this.convertCoordinates(t);e.setCoordinates(t.x,t.y)};b.prototype.convertCoordinates=function(e){const t=m.NODE_SIZE/m.CANVAS_DEFAULT_GRID_SIZE;if(this.getCurrentDragMode()===m.GRID_CELL_DRAG_MODE){e.x=e.x/t;e.y=e.y/t}else{e.x=e.x*t;e.y=e.y*t}};b.prototype.adaptToNewDragMode=function(){this.adaptPropertiesToDragMode();const t=this;this.getNodes$().each(function(){t.instance.destroyDraggable(this);t.initDraggableOptions($(this))});this.forEachNode(function(e){t.convertNodeCoordinates(e)})};b.prototype.adaptPropertiesToDragMode=function(){if(this.getCurrentDragMode()===m.GRID_CELL_DRAG_MODE){m.CANVAS_GRID_SIZE=m.NODE_SIZE;m.AUTO_ALIGN_STEP_X=m.GRID_AUTO_ALIGN_STEP_X;m.AUTO_ALIGN_STEP_Y=m.GRID_AUTO_ALIGN_STEP_Y}else{m.CANVAS_GRID_SIZE=m.CANVAS_DEFAULT_GRID_SIZE;m.AUTO_ALIGN_STEP_X=m.DEFAULT_AUTO_ALIGN_STEP_X;m.AUTO_ALIGN_STEP_Y=m.DEFAULT_AUTO_ALIGN_STEP_Y}};b.prototype.initDraggableOptions=function(e){const r=this;const n=d.get($(e));this.instance.draggable(e,{distance:m.CANVAS_GRID_SIZE/2,grid:[m.CANVAS_GRID_SIZE,m.CANVAS_GRID_SIZE],rightButtonCanDrag:false,canDrag:function(){return r.editable},start:function(){n.wasDragging=true;if(r.drag==null){var t=[];var i=[];n.setPopoverEnabled(false);r.forEachNode$(function(e){if(d.isSelected(e)){t.push(e);d.get(e).setTitleEnabled(false)}else{i.push(d.getCollisionBox(e))}});r.drag={lead:e,selected:t,unselected:i}}},stop:function(){r.drag.lead.removeClass("js-no-drop");r.drag.selected.forEach(function(e){d.get(e).setTitleEnabled(true);e.removeClass("js-collision-detected")});n.setPopoverEnabled(true)},drag:function(){if(r.drag&&e==r.drag.lead){var n=false;r.drag.selected.forEach(function(e){var t=d.getCollisionBox(e);var i=r.drag.unselected.some(function(e){return d.detectBoxCollision(e,t)});e.toggleClass("js-collision-detected",i);if(i){n=true}});r.drag.lead.toggleClass("js-no-drop",n)}},revert:function(){if(r.drag){var e=false;r.undoManager.transaction(function(){var t=r.getZoom();e=r.drag.selected.some(function(e){var t=d.getCollisionBox(e);return r.drag.unselected.some(function(e){return d.detectBoxCollision(e,t)})});if(!e){r.undoManager.operation("nodeMoved",r.drag.selected.map(function(e){var t=d.get(e);return{node:t,coordinates:t.getCoordinates(),dragMode:r.getCurrentDragMode()}}));r.drag.selected.forEach(function(e){d.get(e).updateCoordinates(t)})}r.drag=null;r.updateOverlays();r.positionTitles();r.updateMinimap()});return e}else{return false}}})};b.prototype.getCurrentDragMode=function(){return this.dragMode};b.prototype.isGridDisplayed=function(){return!this.$gridBackground.hasClass("hidden")};b.prototype.updateBackgroundCellSize=function(e){const t=m.NODE_SIZE*e;this.$gridBackground.css("background-size",t+"px "+t+"px")};b.prototype.setPanningEnabled=function(e){this.canvas.setPanningEnabled(e);this.$viewport.toggleClass("js-panning",!!e);if(e){this.$viewport.selectable("disable")}else if(this.editable){this.$viewport.selectable("enable")}};b.prototype.setMouseWheelZoomEnabled=function(e){this.canvas.setMouseWheelZoomEnabled(e)};b.prototype.setMultiConnectionEnabled=function(e){this.multiConnectionEnabled=e};b.prototype.setChainModeEnabled=function(e){this.chainModeEnabled=e;this.clearSelectedSource();if(e){var t=this.getSelection().shift();if(t){this.deselectAll();this.setNodeSelected(t,true);d.setChainSource(t,true)}}};b.prototype.isChainMode=function(){return this.chainModeEnabled===true};b.prototype.updateOverlays=_.debounce(function(){this.forEachNode(function(e){if(d.isDecisionNode(e)){this.updateDecisionBranchesOverlays(e)}})},100);b.prototype.updateDecisionBranchesOverlays=function(e){var t=this.getNodeOutgoingConnections(e);if(d.isBranchingDecisionNode(e)){var i=d.getDecisionBranches(t);if(i){var n=o.getDecisionBranchesLabels();y.setConnectionLabel(i.positive,n.positive);y.setConnectionLabel(i.negative,n.negative)}else{t.forEach(function(e){y.setConnectionLabel(e,"?")})}}else{t.forEach(function(e){y.setConnectionLabel(e,false)})}};b.prototype.editIcon=function(e){if(this.drag==null){if(e){if(e.editable){this.deselectAll();p.showEditDialog(e,i.checkActivation(!d.isMailingNode(e)))}}else{var t=this.getSelection();if(t.length==1){this.deselectAll();const e=d.get(t[0]);p.showEditDialog(e,i.checkActivation(!d.isMailingNode(e)))}}}};b.prototype.editIconComment=function(e){p.showIconCommentDialog(e)};b.prototype.serializeIcons=function(){var e=this.getNodes().map(function(e){return e.serialize()});var i={};this.getConnections().forEach(function(e){var t=i[e.source.id];if(!t){t=[]}t.push(e);i[e.source.id]=t});e.forEach(function(e){var t=i[e.id];if(t){e.connections=t.map(function(e){return{targetIconId:e.target.id}})}else{e.connections=[]}});return JSON.stringify(e)};b.prototype.undo=function(){this.undoManager.undo()};b.prototype.getUndoManager=function(){return this.undoManager};b.prototype.enlargeEditor=function(e,t){var i=this;var n=_.isFunction(e)?e:_.noop;var r=_.isFunction(t)?t:_.noop;var o=AGN.Lib.Confirm.createFromTemplate({},"enlarged-editor-template");$("#modalCampaignEditorContainer").append($("#campaignEditorBody"));i.$viewport.selectable("option","appendTo","#modalCampaignEditorContainer");o.done(n).fail(r).always(function(){$("#pageCampaignEditorContainer").append($("#campaignEditorBody"));i.$viewport.selectable("option","appendTo","body")})};b.prototype.hasUnsavedChanges=function(){return this.getUndoManager().canUndo()};b.prototype.fitPdfPage=function(){this.canvas.fitPdfPage(m.PDF_SIZE,m.PDF_ORIENTATION)};AGN.Lib.WM.Editor=b})();agGrid.BaseFilter.prototype.generateTemplate=function(){var e=this.translate.bind(this);var t=this.createConditionBody(0);var i=!this.acceptsBooleanLogic()?t:this.wrapCondition(t);return"<div>\n                    <div class='ag-filter-body-wrapper'>"+i+'</div>\n                    <div class="ag-filter-apply-panel" id="applyPanel">\n                        <a href="#" id="clearButton">'+e("clearFilter")+'</a>\n                        <button type="button" id="applyButton">'+e("applyFilter")+"</button>\n                    </div>\n                </div>"};agGrid.BaseFilter.prototype.createConditionTemplate=function(e){return'<div class="ag-filter-condition">\n            <div class="ag-filter-condition-type radio"><label class="" for="andId"><input id="andId" type="radio" class="and" name="booleanLogic" value="AND" checked="checked" /> AND</label>\n            <label  class="" for="orId"><input id="orId" type="radio" class="or" name="booleanLogic" value="OR" /> OR</label></div>\n            <div>'+this.createConditionBody(e)+"</div>\n        </div>"};agGrid.TextFilter.prototype.bodyTemplate=function(e){var t=this.translate.bind(this);var i=e==0?"filterText":"filterConditionText";return'<div class="ag-filter-body">\n            <input class="ag-filter-filter form-control" id='+i+' type="text" placeholder="'+t("filterOoo","Filter...")+'"/>\n        </div>'};agGrid.TextFilter.prototype.generateFilterHeader=function(e){var i=this;var t=this.getApplicableFilterTypes();var n=this.filterParams.filterOptions;var r=n?n:t;var o=r.map(function(e){var t=i.translate(e);return'<option value="'+e+'">'+t+"</option>"});var a=o.length==1?"disabled":"";var s=e==0?"filterType":"filterConditionType";return o.length<=0?"":'<div>\n                <select class="ag-filter-select form-control" id="'+s+'" '+a+">\n                    "+o.join("")+"\n                </select>\n            </div>"};agGrid.NumberFilter.prototype.bodyTemplate=function(e){var t=this.translate.bind(this);var i=e==0?"filterText":"filterConditionText";var n=e==0?"filterNumberToPanel":"filterNumberToPanelCondition";var r=e==0?"filterToText":"filterToConditionText";return'<div class="ag-filter-body">\n            <div>\n                <input class="ag-filter-filter form-control" id="'+i+'" type="text" placeholder="'+t("filterOoo")+'"/>\n            </div>\n             <div class="ag-filter-number-to" id="'+n+'">\n                <input class="ag-filter-filter form-control" id="'+r+'" type="text" placeholder="'+t("filterOoo")+'"/>\n            </div>\n        </div>'};agGrid.NumberFilter.prototype.generateFilterHeader=agGrid.TextFilter.prototype.generateFilterHeader;agGrid.TextFilter.prototype.createConditionTemplate=function(e){return'<div class="ag-filter-condition">\n            <div class="ag-filter-condition-type radio"><label class="" for="andId"><input id="andId" type="radio" class="and" name="booleanLogic" value="AND" checked="checked" /> AND</label>\n            <label  class="" for="orId"><input id="orId" type="radio" class="or" name="booleanLogic" value="OR" /> OR</label></div>\n            <div>'+this.createConditionBody(e)+"</div>\n        </div>"};(function(){function e(e,t){if(typeof e==="string"&&typeof t==="string"){return e.toLowerCase().localeCompare(t.toLowerCase())}return e.localeCompare(t)}AGN.Lib.TableCaseInsensitiveComparator=e})();(function(){var e=function(){};function t(e,t){if(e.value){if(!e.valueFormatted){e.valueFormatted=moment(e.value).format(t)}return e.valueFormatted}else{return""}}e.prototype.init=function(e){this.eGui=AGN.Lib.TableCellWrapper(e.data.show);if(e.optionDateFormat){this.format=e.optionDateFormat}else{this.format="DD.MM.YYYY";if(e.optionShowTime){if(e.optionShowSeconds){this.format+=" HH:mm:ss"}else{this.format+=" HH:mm"}}}this.eGui.innerHTML=t(e,this.format)};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){this.eGui.innerHTML=t(e,this.format);return true};e.prototype.destroy=function(){};AGN.Opt.TableCellRenderers["DateCellRenderer"]=e})();(function(){var e=function(){};e.prototype.init=function(e){this.eGui=document.createElement("div");this.eGui.innerHTML='<div class="ag-filter">'+"  <div>"+'    <div class="ag-filter-body-wrapper">'+'      <div class="ag-filter-body">'+'        <label class="">'+t("tables.from")+"</label>"+'        <input class="ag-filter-filter form-control js-datepicker js-datepicker-right" id="filterBegin" type="text" placeholder="">'+"      </div>"+'      <div class="ag-filter-body">'+'        <label class="">'+t("tables.till")+"</label>"+'        <input class="ag-filter-filter form-control js-datepicker js-datepicker-right" id="filterEnd" type="text" placeholder="">'+"      </div>"+"    </div>"+'    <div class="ag-filter-apply-panel" id="applyPanel">'+'      <a href="#" id="clearFilter" class="">'+t("tables.clearFilter")+"</a>"+"    </div>"+"  </div>"+"</div>";this.filterBegin=$(this.eGui).find("#filterBegin");this.filterEnd=$(this.eGui).find("#filterEnd");this.beginDate=undefined;this.endDate=undefined;this.clearFilter=$(this.eGui).find("#clearFilter");this.filterBegin.on("change",this.filterBeginChanged.bind(this));this.filterEnd.on("change",this.filterEndChanged.bind(this));this.clearFilter.on("click",this.filterClear.bind(this));AGN.Lib.CoreInitializer.run("pickadate",$(this.eGui));this.filterActive=false;this.filterChangedCallback=e.filterChangedCallback;this.valueGetter=e.valueGetter};e.prototype.afterGuiAttached=function(){};e.prototype.destroy=function(){this.filterBegin.off("change",this.filterBeginChanged.bind(this));this.filterEnd.off("change",this.filterEndChanged.bind(this));this.clearFilter.off("click",this.filterClear.bind(this))};e.prototype.filterBeginChanged=function(){var e=this.filterEnd.data("pickadate");e.set("min",this.filterBegin.val());this.beginDate=this.filterBegin.data("pickadate").get("select").pick;this.filterActive=this.beginDate||this.endDate;this.filterChangedCallback()};e.prototype.filterEndChanged=function(){var e=this.filterBegin.data("pickadate");e.set("max",this.filterEnd.val());this.endDate=this.filterEnd.data("pickadate").get("select").pick;this.filterActive=this.beginDate||this.endDate;this.filterChangedCallback()};e.prototype.filterClear=function(){var e,t;this.filterEnd.val(undefined);this.filterBegin.val(undefined);this.beginDate=undefined;this.endDate=undefined;t=this.filterEnd.data("pickadate");t.set("min",false);e=this.filterBegin.data("pickadate");e.set("max",false);this.filterActive=false;this.filterChangedCallback()};e.prototype.getGui=function(){return this.eGui};e.prototype.doesFilterPass=function(e){var t=this.valueGetter(e.node);if(!this.beginDate&&!this.endDate){return true}if(!t){return false}if(this.beginDate&&this.endDate){return t>=this.beginDate&&t<=this.endDate}if(this.beginDate){return t>=this.beginDate}if(this.endDate){return t<=this.endDate}};e.prototype.parseDate=function(e){if(!e){return}return moment(e,t("date.format").toUpperCase()).valueOf()};e.prototype.isFilterActive=function(){return this.filterActive};e.prototype.getModel=function(){};e.prototype.setModel=function(){};AGN.Lib.TableDateFilter=e})();(function(){var o=AGN.Lib.Table,a=AGN.Lib.Confirm,s=AGN.Lib.Page,t=AGN.Lib.Tooltip,e=function(){};function i(e){return e.valueFormatted?e.valueFormatted:e.value}e.prototype.init=function(r){r.eGridCell.classList.add("ag-cell-table-actions");this.eGui=document.createElement("div");this.eGui.innerHTML='<button type="button" class="btn btn-regular btn-alert"><i class="icon icon-trash-o"></i></button>';this.eButton=this.eGui.querySelector(".btn");if(r.colDef["button-tooltip"]){t.createTip($(this.eButton),r.colDef["button-tooltip"])}var e=i(r);if(e){this.eButton.setAttribute("href",e)}else{this.eGui.style.visibility="hidden"}this.eventListener=function(e){var n=this;$.get(i(r)).done(function(e){var t=$(e),i;i=t.all(".modal");if(i.length==1){a.create(e).done(function(e){var t=$(e);o.get($(n)).api.updateRowData({remove:[r.data]});AGN.Lib.RenderMessages(t)})}else{s.render(e)}});e.preventDefault();return false};this.eButton.addEventListener("click",this.eventListener)};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){var t=i(e);this.eGui.style.visibility=t?"visible":"hidden";this.eButton.dataset.url=t;return true};e.prototype.destroy=function(){this.eButton.removeEventListener("click",this.eventListener)};AGN.Opt.TableCellRenderers["DeleteCellRenderer"]=e})();var cachedTemplates=[];(function(){var n=AGN.Lib.Template;var e=function(){};e.prototype.init=function(e){this.eGui=AGN.Lib.TableCellWrapper(e.data.show);var t;var i=e.templateName;if(cachedTemplates[i]){t=cachedTemplates[i]}else{t=n.prepare(i);cachedTemplates[i]=t}this.eGui.innerHTML=t({value:e.value,entry:e.data})};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(){return false};e.prototype.destroy=function(){};AGN.Opt.TableCellRenderers["MustacheTemplateCellRender"]=e})();(function(){var e=function(){};e.prototype.init=function(e){this.agParams=e;this.eGui=document.createComment("No label")};e.prototype.getGui=function(){return this.eGui};e.prototype.destroy=function(){};AGN.Opt.TableHeaderComponents["NoLabelHeader"]=e})();(function(){var e=function(){};e.prototype.init=function(e){this.gui=AGN.Lib.TableCellWrapper(e.data.show);var t=document.createElement("div");if(e.value){t.innerHTML=e.value}t.style.cssText="text-overflow: ellipsis;"+"overflow: hidden;";this.gui.appendChild(t)};e.prototype.getGui=function(){return this.gui};e.prototype.refresh=function(){return false};AGN.Opt.TableCellRenderers["NotEscapedStringCellRenderer"]=e})();(function(){function e(e,t,i,n,r){e=parseFloat(e);t=parseFloat(t);if(isNaN(e)||isNaN(t)){if(!isNaN(e)){return r?+1:-1}if(!isNaN(t)){return r?-1:+1}return 0}return e-t}AGN.Lib.TableNumberComparator=e})();(function(){var e=AGN.Lib.Table,n=AGN.Lib.Confirm,r=AGN.Lib.Page,t=function(){};function o(e){if(e.deliveryHistoryEnabled){return AGN.url("/recipient/"+e.recipientId+"/mailing/"+e.data.mailingId+"/deliveryHistory.action")}else{return""}}t.prototype.init=function(i){this.eGui=document.createElement("div");var e=o(i);if(!e){this.eGui.innerHTML=i.value}else{i.eGridCell.classList.add("ag-cell-table-actions");this.eGui.innerHTML='<button type="button" class="btn btn-regular "><i class="icon icon-share-square-o"></i><span>'+i.value+"</span></button>";this.eButton=this.eGui.querySelector(".btn");this.eButton.setAttribute("href",e);this.eventListener=function(e){var t=o(i);if(t){$.get(t).done(function(e){var t=$(e),i;i=t.all(".modal");if(i.length==1){n.create(e)}else{r.render(e)}});e.preventDefault();return false}};this.eButton.addEventListener("click",this.eventListener)}};t.prototype.getGui=function(){return this.eGui};t.prototype.refresh=function(e){if(this.eButton){this.eButton.dataset.url=o(e)}return true};t.prototype.destroy=function(){if(this.eButton){this.eButton.removeEventListener("click",this.eventListener)}};AGN.Opt.TableCellRenderers["RecipientDeliveryInfoRenderer"]=t})();(function(){var n=AGN.Lib.Confirm,r=AGN.Lib.Page,e=function(){};function o(e){if(e.deliveryHistoryEnabled){return AGN.url("/recipient/"+e.recipientId+"/mailing/"+e.data.mailingId+"/successfulDeliveryHistory.action")}else{return""}}e.prototype.init=function(i){this.eGui=document.createElement("div");var e=o(i);if(!e){this.eGui.innerHTML=i.value}else{i.eGridCell.classList.add("ag-cell-table-actions");this.eGui.innerHTML='<button type="button" class="btn btn-regular "><i class="icon icon-share-square-o"></i><span>'+i.value+"</span></button>";this.eButton=this.eGui.querySelector(".btn");this.eButton.setAttribute("href",e);this.eventListener=function(e){var t=o(i);if(t){$.get(t).done(function(e){var t=$(e),i;i=t.all(".modal");if(i.length==1){n.create(e)}else{r.render(e)}});e.preventDefault();return false}};this.eButton.addEventListener("click",this.eventListener)}};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){if(this.eButton){this.eButton.dataset.url=o(e)}return true};e.prototype.destroy=function(){if(this.eButton){this.eButton.removeEventListener("click",this.eventListener)}};AGN.Opt.TableCellRenderers["RecipientSuccessDeliveryInfoRenderer"]=e})();(function(){var e=function(){};e.prototype.init=function(i){this.column=i.colDef.field;this.values=_.sortBy(_.uniq(_.map(i.rowModel.rowsToDisplay,function(e){return e.data[i.colDef.field]})));this.labels=_.extend({},i.labels);this.eGui=document.createElement("div");this.eGui.innerHTML='<div class="ag-filter">'+"  <div>"+'    <div class="ag-filter-body-wrapper">'+this.buildOptions()+"    </div>"+'    <div class="ag-filter-apply-panel" id="applyPanel">'+'      <a href="#" id="clearFilter" class="">'+t("tables.clearFilter")+"</a>"+"    </div>"+"  </div>"+"</div>";this.checkBoxes=$(this.eGui).find("input");this.checkedBoxes=[];this.clearFilter=$(this.eGui).find("#clearFilter");this.checkBoxes.on("change",this.checkBoxesChanged.bind(this));this.clearFilter.on("click",this.filterClear.bind(this));this.filterActive=false;this.filterChangedCallback=i.filterChangedCallback;this.valueGetter=i.valueGetter};e.prototype.buildOptions=function(){var i=this.labels;return _.map(this.values,function(e){var t=i.hasOwnProperty(e)?i[e]:e;return'<div class="ag-filter-body">'+'  <label class="">'+'    <input class="" type="checkbox" value="'+e+'">'+"    "+t+"  </label>"+"</div>"}).join("\n")};e.prototype.afterGuiAttached=function(){};e.prototype.destroy=function(){this.checkBoxes.off("change",this.checkBoxesChanged.bind(this));this.clearFilter.off("click",this.filterClear.bind(this))};e.prototype.checkBoxesChanged=function(){this.valuesFiltered=_.map(_.filter(this.checkBoxes,{checked:true}),function(e){return e.value});this.filterActive=this.valuesFiltered.length!==0;this.filterChangedCallback()};e.prototype.filterClear=function(){this.checkBoxes.removeAttr("checked");this.valuesFiltered=[];this.filterActive=false;this.filterChangedCallback()};e.prototype.getGui=function(){return this.eGui};e.prototype.doesFilterPass=function(e){var t=this.valueGetter(e.node);return _.includes(this.valuesFiltered,t)};e.prototype.isFilterActive=function(){return this.filterActive};e.prototype.getModel=function(){};e.prototype.setModel=function(){};AGN.Lib.TableSetFilter=e})();(function(){var e=function(){};e.prototype.init=function(e){this.gui=AGN.Lib.TableCellWrapper(e.data.show);var t=document.createElement("div");if(e.value){t.appendChild(document.createTextNode(e.value))}t.style.cssText="text-overflow: ellipsis;"+"overflow: hidden;";this.gui.appendChild(t)};e.prototype.getGui=function(){return this.gui};e.prototype.refresh=function(){return false};AGN.Opt.TableCellRenderers["StringCellRenderer"]=e})();(function(){AGN.Lib.TableCellWrapper=function(e){if(e){var t=document.createElement("a");t.href=e;t.style.cssText="display: block;"+"height: 33px;"+"margin:  -8px -6px;"+"padding: 8px 6px;";return t}else{return document.createElement("div")}}})();(function(){var e=function(){};e.prototype.init=function(e){this.eGui=AGN.Lib.TableCellWrapper(e.data.show);var i="";if(e.value.endTypeId===1){i=t("workflow.stop.automatic_end")}else if(e.value.endTypeId===2){i=e.value.date}this.eGui.innerHTML=i};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){return false};e.prototype.destroy=function(){};AGN.Opt.TableCellRenderers["WorkflowEndCellRenderer"]=e})();(function(){var e=function(){};e.prototype.init=function(e){this.eGui=AGN.Lib.TableCellWrapper(e.data.show);var i="";if(e.value.startTypeId===1){i=' <span class="badge badge-campaigntype-actionbased">\n'+'              <i class="icon icon-gear"></i>\n'+"              <strong>"+t("workflow.start.action_based")+"</strong>\n"+"         </span>"}else if(e.value.startTypeId===2){i='<span class="badge badge-campaigntype-datebased">\n'+'              <i class="icon icon-calendar-o"></i>\n'+"              <strong>"+t("workflow.start.date_based")+"</strong>\n"+"        </span>"}else{i=e.value.date}this.eGui.innerHTML=i};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){return false};e.prototype.destroy=function(){};AGN.Opt.TableCellRenderers["WorkflowStartCellRenderer"]=e})();(function(){var e=function(){};e.prototype.init=function(e){this.eGui=AGN.Lib.TableCellWrapper(e.data.show);if(e.value){var i=e.value.name;this.eGui.innerHTML='<span class="status-badge campaign.status.'+i+'"></span> '+t("workflow.status."+i)}};e.prototype.getGui=function(){return this.eGui};e.prototype.refresh=function(e){return false};e.prototype.destroy=function(){};AGN.Opt.TableCellRenderers["WorkflowStatusCellRenderer"]=e})();(function(){AGN.Lib.FormBuilder=AGN.Lib.FormBuilder||{};AGN.Lib.FormBuilder.Utils={pushControl:function(e,n){if(!Array.isArray(e)){return}e.push(function(e){var t=function(e){var t=e.prototype.constructor;function i(){return t.apply(this,arguments)}i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:true,configurable:true}});i.__proto__=e;if(n.build){i.prototype.build=n.build}if(n.onRender){i.prototype.onRender=n.onRender}Object.defineProperty(i,"definition",{get:n.definition});return i}(e);e.register(n.newControlName,t);return t})}}})();(function(){AGN.Lib.FormBuilder=AGN.Lib.FormBuilder||{};AGN.Lib.FormBuilder.EmmControls={mediapool:function(r){return{newControlName:"mediapool",build:function(){return{field:this.markup("img",null,{}),layout:"agnMediapool"}},onRender:function(e){if(this.preview){var i=$(e.target).parents(".form-field").find(".field-label");i.html(t("userform.formBuilder.mediapoolImage")+": "+r.options.mediapoolImages[this.config.image])}var n=$(this.element);n.attr("src",this.config.image).attr("alt",this.config.alt);if(this.config.width){n.attr("width",this.config.width)}if(this.config.height){n.attr("height",this.config.height)}},definition:function(){return{i18n:{default:t("userform.formBuilder.mediapoolImage")}}}}},nextform:function(){return{newControlName:"formName",build:function(){return{field:this.markup("input",null,{name:"agnFN",type:"hidden"}),layout:"hidden"}},onRender:function(e){if(this.preview){var i=$(e.target).parents(".form-field").find(".field-label");i.html(t("userform.formBuilder.nextForm")+": "+this.config.formName)}$(this.element).attr("value",this.config.formName)},definition:function(){return{i18n:{default:t("userform.formBuilder.nextForm")}}}}}}})();(function(){AGN.Lib.FormBuilder=AGN.Lib.FormBuilder||{};var n={agnCTOKEN:t("userform.formBuilder.tooltips.agnCTOKEN"),agnUID:t("userform.formBuilder.tooltips.agnUID")};const a=2;const i={gender:[{selected:true,label:"Gender Male",value:0},{selected:false,label:"Gender Female",value:1}]};var s=["agnCTOKEN","agnUID","agnMAILINGLIST","agnSUBSCRIBE"];AGN.Lib.FormBuilder.Templates={default:function(){return{onRender:l}},hidden:function(){return{onRender:e}},dateForRender:function(i){var e=this;var t=(this.config.className||"")+" js-datepicker";var n=$.extend({},this.config,{"data-datepicker-options":"format: 'yyyy/mm/dd', formatSubmit: 'yyyy/mm/dd'",className:t});return{field:e.markup("input",null,n),onRender:function(e){var t=$(e.target);t.append('<input type="hidden" name="'+i.name+'_format" value="'+"yyyy/MM/dd"+'">')}}}};function l(e){var t=$(e.target).parents(".form-field"),i=this.config.emmField,n=t.data("currentEmmField"),r=!n,o=i!==n;if(r){t.data("currentEmmField",i)}else if(o){t.data("currentEmmField",i);c(t,this.config,i,n)}}function e(e){var t=this.config.id.replace("-preview","");var i=$(e.target);var n=i.parents(".form-field").find(".form-elements");var r=n.find(".emmField-wrap");if(s.includes(t)){r.hide()}else{r.show()}if(!s.includes(t)){l.apply(this,arguments)}var o=i.parents(".form-field").find(".tooltip-element");u(o,t)}function u(e,t){var i=n[t];if(!i){e.hide();return}e.attr("tooltip",i);e.show()}function c(e,t,i,n){const r=e.find(".form-elements"),o=r.find('input[name="value"]'),a=r.find('input[name="name"]'),s=i!=="none";var l=s?"$!customerData."+i:"",u=s?i:"";o.val(l);a.val(u);if(s){a.prop("disabled",true)}else{a.prop("disabled",false)}if(t.type==="select"){d(i,n,e,t)}}function d(e,t,i,n){const r=g(e);if(r.length>=a){const o={values:r,name:e};f(i,n,o)}else if(g(t).length>0){const o={values:[],name:e};f(i,n,o)}}function f(t,i,n){const r=t.parents(".js-form-builder");const o=r.data("formBuilder");o.actions.removeField(t.prop("id"));h(function(){const e=_.mergeWith(i,n,function(e,t){return _.isArray(t)?t:undefined});o.actions.addField(e,p(t,r))});h(function(){o.actions.toggleFieldEdit(o.actions.getCurrentFieldId())})}function p(i,e){var n=0;_.each(e.find(".form-field"),function(e,t){if($(e).prop("id")===i.prop("id")){n=t}});return n}function h(e){window.setTimeout(function(){e()},0)}function g(e){const t=i[e];return t?t:[]}})();(function(){var e=AGN.Lib.FormBuilder.Utils;var i=AGN.Lib.FormBuilder.EmmControls;var r=AGN.Lib.FormBuilder.Templates;var o="<html>\n"+"    <head>\n"+'        <script type="text/javascript" src="'+AGN.url("/js/lib/jquery/jquery-3.5.1.js",true)+'"><\/script>\n'+'        <script type="text/javascript" src="'+AGN.url("/assets/js/vendor/pickadate-3.5.6.js",true)+'"><\/script>\n'+'        <script type="text/javascript" src="'+AGN.url("/assets/js/vendor/pickadate-3.5.6.date.js",true)+'"><\/script>\n'+'        <script type="text/javascript" src="'+AGN.url("/js/lib/formbuilder/generated-form.js",true)+'"><\/script>\n'+'        <link rel="stylesheet" href="'+AGN.url("/assets/form.css",true)+'">'+"        {{ if (cssUrl) { }}\n"+'        <link rel="stylesheet" href="{{- cssUrl }}">\n'+"        {{ } }}\n"+"    </head>\n"+"    <body>\n"+'        <div class="container" style="margin-top: 50px;">\n'+'            <form action="form.action">\n'+"                {{= generatedHTML}}\n"+"            </form>\n"+"        </div>\n"+"    </body>\n"+"</html>";var a=AGN.Lib.Confirm;var s;var n=["required","label","description","name","className","placeholder","value"];s=function(e,t){this.options=$.extend({},t);var i=this;i.$el=$(e);i.$target=$(this.$el.data("target"));i.initCustomControls();i.builder=i.$el.formBuilder(s.getBuilderDefaultOptions(i));i.defered=$.Deferred();if(i.options.data){i.setJson(i.options.data)}i.builder.promise.then(function(){i.builder=i.$el.data("formBuilder");i.defered.resolve()})};s.getBuilderDefaultOptions=function(e){return{roles:{},disabledAttrs:["access","description"],disableFields:["file","autocomplete"],defaultFields:s.defaultFields(e),disabledActionButtons:["data","save"],actionButtons:[{id:"downloadHtml",className:"btn btn-info",label:t("workflow.reaction.download"),type:"button",events:{click:function(){e.downloadHtml.bind(e)()}}},{id:"generateHtml",className:"btn btn-success",label:t("userform.formBuilder.generateHtml"),type:"button",events:{click:function(){e.generateHtmlToTarget.bind(e)()}}}],editOnAdd:true,typeUserDisabledAttrs:{formName:n,mediapool:n,text:["subtype"],textarea:["subtype"]},typeUserAttrs:u(e),layoutTemplates:{agnMediapool:function(){return document.createElement("span")}},fields:[{type:"text"},{type:"hidden"},{type:"select"},{type:"radio-group"},{type:"checkbox-group"},{type:"number"},{type:"textarea"},{type:"date"}],templates:{text:r.default,hidden:r.hidden,textarea:r.default,date:r.default,select:r.default,"radio-group":r.default,"checkbox-group":r.default,number:r.default},controls:e.controls,i18n:{locale:window.adminLocale,location:AGN.url("/js/lib/formbuilder/translation/")},controlOrder:["header","paragraph","mediapool","","text","date","textarea","number","","select","radio-group","checkbox-group","","hidden","formName","button"],inputSets:s.getDefaultPresetsConfig(e)}};s.defaultFields=function(e){return[{type:"hidden",name:"agnCTOKEN",value:e.options.companyToken},{type:"hidden",name:"agnUID",value:"$!agnUID"}]};s.getDefaultPresetsConfig=function(e){return[{label:c(t("userform.formBuilder.template.subscribe")),name:"subscribe",fields:[{type:"hidden",name:"agnCTOKEN",value:e.options.companyToken,label:" "},{type:"hidden",name:"agnMAILINGLIST",value:"",label:" "},{type:"hidden",name:"agnSUBSCRIBE",value:"1",label:" "},{type:"hidden",name:"agnUID",value:"$!agnUID",label:" "},{type:"text",name:"firstname",value:"$!customerData.firstname",emmField:"firstname",label:"Firstname:"},{type:"text",name:"lastname",value:"$!customerData.lastname",emmField:"lastname",label:"Lastname:"},{type:"text",name:"email",value:"$!customerData.email",emmField:"email",label:"Email:"},{type:"button",subtype:"submit",style:"primary",label:"Subscribe"},{type:"formName",label:" "}]},{label:c(t("userform.formBuilder.template.unsubscribe")),name:"unsubscribe",fields:[{type:"hidden",name:"agnCTOKEN",value:e.options.companyToken,label:" "},{type:"formName",label:" "},{type:"hidden",name:"agnUID",value:"$!agnUID",label:" "},{type:"button",subtype:"submit",style:"primary",label:"Unsubscribe"}]},{label:c(t("userform.formBuilder.template.profile_change")),name:"profile_change",fields:[{type:"hidden",name:"agnCTOKEN",value:e.options.companyToken,label:" "},{type:"hidden",name:"agnUID",value:"$!agnUID",label:" "},{type:"formName",label:" "},{type:"text",name:"firstname",value:"$!customerData.firstname",emmField:"firstname",label:"Firstname:"},{type:"text",name:"lastname",value:"$!customerData.lastname",emmField:"lastname",label:"Lastname:"},{type:"text",name:"email",value:"$!customerData.email",emmField:"email",label:"Email:"},{type:"button",subtype:"submit",style:"primary",label:"Subscribe"}]},{label:c(t("userform.formBuilder.template.other")),name:"other",fields:[{type:"hidden",name:"agnCTOKEN",value:e.options.companyToken,label:" "},{type:"hidden",name:"agnUID",value:"$!agnUID",label:" "}]}]};s.get=function(e,t){var i=$(e);var n=i.data("_form-builder");if(n){return n}n=new s(e,t);i.data("_form-builder",n);return n};s.isCreated=function(e){return!!$(e).data("_form-builder")};s.prototype.initCustomControls=function(){this.controls=[];e.pushControl(this.controls,i.mediapool(this));e.pushControl(this.controls,i.nextform(this))};s.prototype.generateHtml=function(){var e=this.builder.actions.getData();var t=this.options.cssUrl;var i=$("<form/>");i.formRender({formData:e,controls:this.controls,templates:{date:r.dateForRender}});var n;if(o){n=_.template(o)({generatedHTML:i.html(),cssUrl:t})}else{n=i.html()}i.remove();n=d(n);return n};s.prototype.generateHtmlToTarget=function(){var e=this;var t=this.$target;if(!t){return}var i=AGN.Lib.Editor.get(t);if(!i){return}var n=this.options.confirmationModal;if(!n||!i.val()){l(e,i);return}a.createFromTemplate({},"warning-html-generation-modal").done(function(){l(e,i)})};s.prototype.downloadHtml=function(){var e=this.generateHtml();var t=window.btoa(e);var i="Generated form.txt";if(this.options.formName){i=this.options.formName+".txt"}var n=document.createElement("a");n.setAttribute("href","data:application/octet-stream;charset=utf-8;base64,"+t);n.setAttribute("download",i);n.style.display="none";document.body.appendChild(n);n.click();document.body.removeChild(n)};s.prototype.getJson=function(){return this.builder.actions.getData("json",false)};s.prototype.getData=function(){return this.builder.actions.getData()};s.prototype.setJson=function(e){var t=this;t.defered.done(function(){return t.builder.actions.setData(e)})};s.prototype.promise=function(){return this.defered.promise()};s.prototype.getInitJson=function(){return JSON.stringify(this.options.data)};s.prototype.isChanged=function(){var e=this;if(e.options.data){return e.getInitJson()!==e.getJson()}else{return _.isEqual(e.getData(),s.defaultFields(e))}};function l(e,i){i.val(e.generateHtml());AGN.Lib.Messages(t("defaults.success"),t("userform.formBuilder.success.htmlGenerated"),"success")}function u(i){var n={formName:{formName:{label:t("userform.formBuilder.formName"),options:i.options.namesJson.reduce(function(e,t){e[t]=t;return e},{})}},mediapool:{image:{label:t("userform.formBuilder.mediapoolImage"),options:i.options.mediapoolImages},alt:{label:t("userform.formBuilder.imageAlt"),value:""},width:{label:t("userform.formBuilder.imageWidth"),value:0},height:{label:t("userform.formBuilder.imageHeight"),value:0}},date:{emmField:{label:t("userform.formBuilder.emmField"),options:i.options.dateProfileFields}},number:{emmField:{label:t("userform.formBuilder.emmField"),options:i.options.numberProfileFields}},select:{emmField:{label:t("userform.formBuilder.emmField"),options:i.options.profileFieldsForSelect}}};var e=["text","hidden","textarea","radio-group","checkbox-group"];e.forEach(function(e){n[e]={emmField:{label:t("userform.formBuilder.emmField"),options:i.options.textProfileFields}}});return n}function c(e){return t("userform.formBuilder.template.template")+": "+e}function d(e){if(!e||e.length<=0){return e}return e.replace(/<\/.*?>/g,"$&\n")}AGN.Lib.FormBuilder.FormBuilder=s})();AGN.Lib.DomInitializer.new("account-data",function(){var e=$("#account-data .account-initials");var t=e.next(".account-data-infobox");e.popover({trigger:"hover",container:"body",html:true,content:t.html()})});AGN.Lib.CoreInitializer.new("ace",function(e){if(!e){e=$(document)}_.each(e.find(".js-editor, .js-editor-text, .js-editor-eql, .js-editor-css"),function(e){AGN.Lib.Editor.get($(e))})});(function(){AGN.Lib.CoreInitializer.new("checkbox-hider",function(e){if(!e){e=$(document)}_.each(e.find("[data-show-by-checkbox]"),function(e){var t=$(e);var i=$(t.data("show-by-checkbox"));r(t,i,true);n(t,i,true)});_.each(e.find("[data-hide-by-checkbox]"),function(e){var t=$(e);var i=$(t.data("hide-by-checkbox"));r(t,i,false);n(t,i,false)});_.each(e.find("[data-show-by-select]"),function(e){var t=$(e);var i=$(t.data("show-by-select"));var n=t.data("show-by-select-values");if(i&&n){var r=n.toString().split(",");for(var o=0;o<r.length;o++){r[o]=r[o].trim()}s(t,i,r,true);a(t,i,r,true)}});_.each(e.find("[data-hide-by-select]"),function(e){var t=$(e);var i=$(t.data("hide-by-select"));var n=t.data("hide-by-select-values");if(i&&n){var r=n.toString().split(",");for(var o=0;o<r.length;o++){r[o]=r[o].trim()}s(t,i,r,false);a(t,i,r,false)}})});function n(e,t,i){t.change(function(){r(e,t,i)})}function r(e,t,i){if(i){if(t.is(":checked")){e.removeClass("hidden")}else{e.addClass("hidden")}}else{if(!t.is(":checked")){e.removeClass("hidden")}else{e.addClass("hidden")}}}function a(e,t,i,n){t.change(function(){s(e,t,i,n)})}function s(e,t,i,n){var r=t.val();var o=false;for(var a=0;a<i.length;a++){if(i[a]==r){o=true;break}}var s,l;if(n){s=function(){e.removeClass("hidden")};l=function(){e.addClass("hidden")}}else{s=function(){e.addClass("hidden")};l=function(){e.removeClass("hidden")}}o?s():l()}})();(function(){var l=AGN.Lib.AutoSave;function u(e,t){var i=e.attr("id"),n=e.data("_editor");if(window.CKEDITOR&&CKEDITOR.instances[i]){CKEDITOR.instances[i].setData(t)}else if(n){n.val(t)}else{e.val(t)}}AGN.Lib.CoreInitializer.new("auto-save",["ace"],function(e){if(!e){e=$(document)}_.each(e.find("[data-autosave-scope]"),function(e){var t=$(e);var i=t.data("autosave-scope");var n=t.data("autosave-period");var r=t.all("[data-autosave]");if(r.length>0){function o(){r=r.filter(function(e,t){return document.body.contains(t)});if(r.length>0){var i={};_.each(r,function(e){var t=$(e);i["value#"+t.data("autosave")]=t.val()});return i}return false}function a(o){var e=$.map(r,function(e){var t=$(e);var i="value#"+t.data("autosave");if(i in o){var n=t.val();var r=o[i];if(n!=r){if(t.is("[data-autorestore]")){u(t,r)}else{return{target:t,value:r}}}return null}});if(e.length>0){return e}return false}function s(e){_.each(e,function(e){u(e.target,e.value)})}l.initialize(i,o,a,s,n)}})})})();AGN.Lib.DomInitializer.new("autosubmit",function(e){setTimeout(function(){AGN.Lib.Form.get(e).submit()},100)});AGN.Lib.DomInitializer.new("calendar-table",function(){var i=this.config;AGN.Lib.CalendarService.setUp(i);window.setInterval(AGN.Lib.CalendarService.checkProgress,500);if(AGN.Lib.CalendarService.getMonthMode()){AGN.Lib.CalendarService.generateMonthCalendar(AGN.Lib.CalendarService.getCurMonth(),AGN.Lib.CalendarService.getCurYear())}else{AGN.Lib.CalendarService.generateWeekCalendar(AGN.Lib.CalendarService.getCurMonth(),AGN.Lib.CalendarService.getCurYear(),AGN.Lib.CalendarService.getCurDay())}AGN.Lib.CalendarService.generateUnsentMailingsTable();var e=AGN.Lib.Action;e.new({click:"#dateTimePicker"},function(){this.event.stopPropagation()});e.new({click:"#dateTimePickerButton"},function(){this.event.stopPropagation()});e.new({click:".js-calendar-navigate-previous"},function(){AGN.Lib.CalendarService.prevEntry();this.event.preventDefault();return false});e.new({click:".js-calendar-navigate-next"},function(){AGN.Lib.CalendarService.nextEntry();this.event.preventDefault();return false});e.new({click:".js-calendar-navigate-today"},function(){AGN.Lib.CalendarService.jumpToday();this.event.preventDefault();return false});e.new({click:".js-calendar-view-month"},function(){AGN.Lib.CalendarService.toggleDateSelectionMode("SELECT_MONTH");this.event.preventDefault();return false});e.new({click:".js-calendar-view-week"},function(){AGN.Lib.CalendarService.toggleDateSelectionMode("SELECT_WEEK");this.event.preventDefault();return false});e.new({click:".js-calendar-list-unsent"},function(){AGN.Lib.CalendarService.generateUnsentMailingsTable();this.event.preventDefault();return false});e.new({click:".js-calendar-list-planned"},function(){AGN.Lib.CalendarService.generatePlannedMailingsTable();this.event.preventDefault();return false});e.new({click:"#comment-save-button"},function(){AGN.Lib.ReminderService.reminder.onSave()});e.new({click:".calendar-comments-add"},function(){var e=this.el,t;t=e.parents(".calendar-day-container").data("date");AGN.Lib.CalendarService.showCommentDialog(AGN.Lib.ReminderService.getNewReminder(t,i));return false});e.new({click:".calendar-comments-toggle"},function(){var e=this.el,t;t=e.parents(".calendar-day-container").data("date");AGN.Lib.CalendarService.toggleComment(t);return false});e.new({change:".js-calendar-toggle-all-comments"},function(){if(this.el.prop("checked")){$(".calendar-table").find(".calendar-comment").show()}else{$(".calendar-table").find(".calendar-comment").hide()}AGN.Lib.CalendarService.adjustSidebarHeight()});e.new({change:"#scheduleReminder"},function(){AGN.Lib.ReminderService.onScheduleChanged()});e.new({change:"#isDeadline"},function(){AGN.Lib.ReminderService.onDeadlineChanged()});e.new({change:"#month_list, #month_list_year, #weeks_list"},function(){AGN.Lib.CalendarService.showDate()});e.new({change:"#weeks_list_year"},function(){AGN.Lib.CalendarService.createWeeksList(this.el[0])});e.new({change:'#reminderDetails input[name="userType"]'},function(){var e=this.el[0];AGN.Lib.ReminderService.onUserTypeChanged(e.value)});this.addAction({mouseover:"mailing-popup"},function(){var e=this.el,t=$("#popup-"+e.data("mailing-id"));if(t.exists()){var i=$(window).scrollTop();var n=t.outerHeight();var r=15;var o=e.offset().top;var a=o+e.outerHeight();var s=o-i-r;var l=i+$(window).outerHeight()-a;var u;if(n<=s||s>l){u=o-r-n;t.addClass("top");t.removeClass("bottom")}else{u=a+r;t.addClass("bottom");t.removeClass("top")}t.css({top:u,left:e.offset().left+e.outerWidth()/2-t.outerWidth()/2});t.css("z-index","1500");t.css("display","block")}});this.addAction({mouseout:"mailing-popup"},function(){var e=this.el.data("mailing-id");$("#popup-"+e).css("display","none")})});(function(){var e;e=function(){var i=0;var d;var f;var p;var l;var o;var a;var n;var r;var G;var W;var H;var j;var B;var V;var z;var U;var Y;var q;var X;var K;var Q;var Z=t("date.monthsFull");var h=new Date;h.setHours(0,0,0,0);var s=h.getMonth();var u=h.getFullYear();var c=h.getDate();var g=true;var J=false;var v={};var m="MONTH";var y=[];var e=0;var b=false;var w=0;function ee(){return g}this.getMonthMode=ee;function te(){return i}this.getDayWidth=te;function ie(){return s}this.getCurMonth=ie;function ne(){return u}this.getCurYear=ne;function re(){return c}this.getCurDay=re;function oe(e){i=e}this.setDayWidth=oe;function ae(e){d=e.localeDatePattern;f=new Date(e.currentServerTime);p=e.firstDayOfWeek;l=h.getWeek(p);o=e.pushStatusSent;a=e.pushStatusScheduled;r=e.adminName;n=e.secondsBeforeWaitMessage;G=e.urls.CALENDAR_UNSENT_MAILINGS;W=e.urls.CALENDAR_PLANNED_MAILINGS;H=e.urls.CALENDAR_MAILINGS_LIST;j=e.urls.CALENDAR_MAILINGS_MOVE;B=e.urls.CALENDAR_PUSHES_LIST;V=e.urls.CALENDAR_PUSHES_MOVE;z=e.urls.CALENDAR_AUTO_OPTIMIZATION;U=e.urls.CALENDAR_COMMENT_LIST;Y=e.urls.CALENDAR_COMMENT_SAVE;q=e.urls.CALENDAR_COMMENT_REMOVE;X=e.urls.MAILING_VIEW;K=e.urls.MAILING_STATISTICS_VIEW;Q=e.isStatisticsViewPermitted}this.setUp=ae;function se(e){if(e=="SELECT_MONTH"){$("#linkSelectByMonth").toggleClass("active");$("#linkSelectByWeek").toggleClass("active");$("#dateSelectByMonth").css("display","inline");$("#dateSelectByWeek").css("display","none");D(e);m="MONTH"}if(e=="SELECT_WEEK"){$("#linkSelectByMonth").toggleClass("active");$("#linkSelectByWeek").toggleClass("active");$("#dateSelectByMonth").css("display","none");$("#dateSelectByWeek").css("display","inline");M($("#weeks_list_year")[0]);D(e);m="WEEK"}}this.toggleDateSelectionMode=se;function le(){if(b){e+=.5;if(e>=n){$("#calendar-wait-notification").show()}}else{e=0}}this.checkProgress=le;function C(){b=true;w++}this.startProgress=C;function A(){w--;if(w<=0){w=0;b=false;$("#calendar-wait-notification").hide()}}this.stopProgress=A;function E(e,t){v={};var i=new Date(t,e,1);var n=he(e+1,t);var r=i.getDay()-p;if(r<0){r=7+r}var o=Math.ceil((n+r)/7);var a=new Date(t,e,1-r);var s=new Date(t,e,1+o*7);i=new Date(a);for(var l=0;l<o;l++){var u="row-"+(l+1);$("#calendar-container").append('<tr id="'+u+'">'+'<td class="calendar-week-number-cell">'+i.getWeek(p)+"</td>"+"</tr>");for(var c=0;c<7;c++){var d=i.getMonth()!=e;R(i,i.getDate(),"",true,u,d);i.setDate(i.getDate()+1)}}$("#calendar-days").html(Z[e]+" "+t);ze(a,s);Fe(a,s);je(a,s);Be(a,s);Re();F();N();Je(e,t)}this.generateMonthCalendar=E;function x(e,t,i){var n=6048e5;v={};var r=new Date(t,e,i);var o=r.getDay();r.setDate(i-r.getDay()-1+p);var a=new Date(r.getFullYear(),r.getMonth(),r.getDate());a.setDate(a.getDate()+1);l=a.getWeek(p);if(e==0&&i==1&&a.getWeek(p)!=1){a.setTime(a.getTime()+n);r.setTime(r.getTime()+n)}$("#calendar-container").append('<tr id="week-row"></tr>');$("#week-row").append('<td class="calendar-week-number-cell">'+a.getWeek(p)+"</td>");for(var s=0;s<=6;s++){r.setDate(r.getDate()+1);R(r,AGN.Lib.DateFormat.format(r,d),"calendar-week-day-container",false,"week-row",false)}$("#calendar-days").html(AGN.Lib.DateFormat.format(a,d)+" - "+AGN.Lib.DateFormat.format(r,d));ze(a,r);Fe(a,r);je(a,r);Be(a,r);Re();N();Ze(e,t,i)}this.generateWeekCalendar=x;function ue(e,t){var i;e.draggable({stack:t,revert:"invalid",distance:20,start:function(){i=$("#popup-"+e.prop("id"));i.hide();i.detach();pe()},stop:function(){$("#calendar-popup-holder").append(i)}})}function ce(e){ue(e,".calendar-mail-label")}this.addMailingDragging=ce;function T(e){ue(e,".calendar-comment")}this.addCommentDragging=T;function S(){$(".calendar-comments-toggle").css("visibility","hidden");$(".calendar-day-container").has(".calendar-comment").each(function(){$(this).find(".calendar-comments-toggle").css("visibility","visible")});N()}this.checkHideCommentIconsVisibility=S;function de(){Ye()}this.generateUnsentMailingsTable=de;function fe(){qe()}this.generatePlannedMailingsTable=fe;function pe(){var e;if(document.selection&&document.selection.empty){document.selection.empty()}else if(window.getSelection){e=window.getSelection();if(e&&e.removeAllRanges)e.removeAllRanges()}}this.clearSelection=pe;function he(e,t){return new Date(t,e,0).getDate()}this.daysInMonth=he;function D(e){var t=e=="SELECT_MONTH";if(t&&g||!t&&!g){if(g){Je(s,u)}else{Ze(s,u,c)}return}k();if(t){var i=new Date(u,s,c);i.setDate(i.getDate()+7);if(l==1&&u<i.getFullYear()){s=0;u++;c=1}E(s,u);g=true;J=false}else{x(s,u,c);g=false;J=true}}this.changeCalendarMode=D;function k(){$("#calendar-container").empty();$("#calendar-popup-holder").empty();$(".calendar-mail-label").remove()}this.removeCurrentCalendar=k;function ge(){if(g){me()}else{O(true)}}this.prevEntry=ge;function ve(){if(g){ye()}else{O(false)}}this.nextEntry=ve;function O(e){var t=e?-7:7;k();var i=new Date(u,s,c);i.setDate(i.getDate()+t);c=i.getDate();s=i.getMonth();u=i.getFullYear();i.setDate(i.getDate()+t);var n=$("#month_list_year option");var r=Number(n[n.length-1].value);var o=Number(n[0].value);if(i.getFullYear()<r){Xe()}if(i.getFullYear()>o){I()}x(s,u,c)}this.switchWeek=O;function me(){k();s--;if(s<0){s=11;u--}var e=$("#month_list_year option");var t=Number(e[e.length-1].value);if(u<t){Xe()}E(s,u)}this.prevMonth=me;function ye(){k();s++;if(s>11){s=0;u++}var e=$("#month_list_year option");var t=Number(e[0].value);if(u>t){I()}E(s,u)}this.nextMonth=ye;function R(e,t,i,n,r,o){var a="";var s="";if(o){a="calendar-another-month-day"}else{var l=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(l.getTime()==h.getTime()){a="calendar-current-day"}if(l.getDay()==0||l.getDay()==6){a+=" calendar-weekend-day";s=" calendar-weekend-day-label"}}var u=L(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var c="day-"+u;$("#"+r).append('<td id="'+c+'" data-date="'+u+'" class="calendar-day-container '+i+" "+a+'"></td>');$("#"+c).append('<div class="calendar-day-label'+s+'" id="label-'+c+'"></div>');$("#label-"+c).append(t);_e(c);if(n){be(c)}v[c]=!n}this.addDayToCalendar=R;function be(e){$("#label-"+e).append('<button type="button" class="calendar-comments-toggle" title="'+t("calendar.title.show_hide_comment")+'"><i class="icon icon-comments"></i></button>');$("#"+e+" .calendar-comments-toggle").css("visibility","hidden")}this.addCommentsShowButton=be;function _e(e){$("#"+"label-"+e).append('<button type="button" class="calendar-comments-add" title="'+t("calendar.title.new_comment")+'"><i class="icon icon-plus"></i></button>');$("#"+"label-"+e+" .calendar-comments-add").css("visibility","hidden");$("#"+e).mouseover(function(){if(!$("#"+e).hasClass("calendar-another-month-day")){$("#"+"label-"+e+" .calendar-comments-add").css("visibility","visible")}});$("#"+e).mouseout(function(){$("#"+"label-"+e+" .calendar-comments-add").css("visibility","hidden")})}this.addDayPopup=_e;function we(e){if(v["day-"+e]){$("#day-"+e+" .calendar-comment").hide()}else{$("#day-"+e+" .calendar-comment").show()}v["day-"+e]=!v["day-"+e];N()}this.toggleComment=we;function Ce(e){if(e==""){$("#calendar-comment-error").html(t("calendar.error.empty_comment"));return false}if(nt(e)>1e3){$("#calendar-comment-error").html(t("calendar.error.long_comment"));return false}return true}this.validateComment=Ce;function Ae(e){if(e){var t=e.split(/[,; \t\n]+/);var i=[];for(var n=0;n<t.length;n++){if(t[n]){i.push(t[n])}}return i}else{return[]}}this.parseRecipients=Ae;function Ee(e){if(!e||e.length==0){$("#calendar-comment-error").html(t("calendar.error.empty_recipient_list"));return false}var i=e.join(",");if(nt(i)>2e3){$("#calendar-comment-error").html(t("calendar.error.long_recipient_list"));return false}var n=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;for(var r=0;r<e.length;r++){if(!n.test(e[r])){$("#calendar-comment-error").html(t("calendar.error.invalid_email")+" "+e[r]);return false}}return true}this.validateEmails=Ee;function xe(e){AGN.Lib.Modal.create($("#calendar-dialog-modal-template").html());AGN.Lib.ReminderService.fillCommentDialog(e);$("#calendar-comment-error").html("");AGN.Lib.ReminderService.updateVisibility()}this.showCommentDialog=xe;function Te(e){var i="comment-"+e.id;var n="day-"+e.getDateAsString();var r=e.text.replace(/\n/g,"<br>");var o=$("#"+n);var a=$("#"+i);if(a.exists()||!o.exists()){return}a=$('<div id="'+i+'" data-comment-id="'+e.id+'" class="calendar-mail-label calendar-comment">'+'<span class="calendar-badge comment-badge">'+'<span class="comment-text-content">'+r+"</span>"+"</span>"+"</div>");if(!v[n]){a.css("display","none")}o.append(a);var s=$("#calendar-popup-holder");s.append('<input type="hidden" id="deadline-'+i+'" name="'+i+'" value="'+e.isDeadline+'"/>');s.append('<input type="hidden" id="notified-'+i+'" name="'+i+'" value="'+e.isNotified+'"/>');s.append('<input type="hidden" id="emm-user-type-'+i+'" name="'+i+'" value="'+e.isEmmUserType+'"/>');s.append('<input type="hidden" id="notify-admin-id-'+i+'" name="'+i+'" value="'+e.notifyAdminId+'"/>');s.append('<input type="hidden" id="recipients-'+i+'" name="'+i+'" value="'+e.recipients+'"/>');s.append('<input type="hidden" id="plannedSendDate-'+i+'" name="'+i+'" value="'+e.getPlannedSendDateAsString()+'"/>');a.dblclick(function(){AGN.Lib.CalendarService.showCommentDialog(AGN.Lib.ReminderService.getReminder(i,e.currentAdminName))});var l=$('<button type="button" id="remove-'+i+'" class="calendar-comments-remove"><i class="icon icon-trash-o"></i></button>');a.find(".comment-badge").append(l);l.attr("title",t("calendar.title.delete_comment"));l.on("click",function(){$("#deadline-"+i).remove();$("#popup-"+i).remove();a.remove();Le(i);S();N();return false});a.mouseover(function(){l.css("display","block")});a.mouseout(function(){l.css("display","none")});T(a);Se(e.id,r)}this.addComment=Te;function Se(s,e){$("#calendar-popup-holder").append('<div class="calendar-mail-popup" id="popup-comment-'+s+'"></div>');$("#popup-comment-"+s).append('<div class="arrow"></div>');$("#popup-comment-"+s).append('<div class="calendar-mail-popup-header">'+t("calendar.common.comment")+"</div>");$("#popup-comment-"+s).append('<div class="calendar-mail-popup-content"><p class="comment-text-content">'+e+"</p></div>");$("#popup-comment-"+s).css("display","none");$("#popup-comment-"+s).css("word-wrap","break-word");$("#comment-"+s).mouseover(function(){var e=$("#popup-comment-"+s),t=$(this);var i=t.offset().top-$(window).scrollTop(),n=t.outerHeight(),r=e.outerHeight(),o=15,a=t.offset().top+n+o;if(r+o<i){a=t.offset().top-r-o;e.addClass("top");e.removeClass("bottom")}else{e.addClass("bottom");e.removeClass("top")}e.css({top:a,left:t.offset().left+t.outerWidth()/2-e.outerWidth()/2});e.css("z-index","1500");e.css("display","block")});$("#comment-"+s).mouseout(function(){$("#popup-comment-"+s).css("display","none")})}function De(e,t,i){var n=e.data("date");if(!v["day-"+n]&&!$(".js-calendar-toggle-all-comments").prop("checked")){t.hide()}e.append(t);Me(AGN.Lib.ReminderService.getReminder("comment-"+i,r));N();S()}function ke(e,i,t){var n=e.data("date");if(i.attr("sent")!="true"){var r=i.data("time");var o=it(n,r);if(o>=f){if(i.attr("planned")=="true"){var a=i.find("a");if(a.hasClass("calendar-mailing-status-planned-in-past")){var s="calendar-"+i.attr("workstatus").replace(/\./g,"-");a.addClass(s).removeClass("calendar-mailing-status-planned-in-past")}}var l=new Date(o);l.setHours(l.getHours()-3);if(l<f){r=null;i.data("time",null)}var u=e.find(".calendar-mail-label");var c=false;if(r){$(u.get().reverse()).each(function(){var e=$(this);var t=e.data("time");if(t&&t<r){e.after(i);c=true}})}if(!c){var d=u.filter("[data-mailing-id]").last();if(d.length){d.after(i);c=true}else{e.append(i)}}N();Ne(t,n)}}}function Oe(e,t,i){var n=e.data("date");switch(t.data("status")){case o:return;case a:if(it(n,"00:00")<h){return}break}var r=e.find(".calendar-mail-label").filter("[data-push-id]").last();if(r.length){r.after(t)}else{e.append(t)}Ie(i,n)}function Re(){$(".calendar-day-container").droppable({hoverClass:"calendar-day-hover",drop:function(e,t){var i=$(this);var n="UNKNOWN";var r=t.draggable.data("comment-id");if(r){n="COMMENT"}else{r=t.draggable.data("mailing-id");if(r){n="MAILING"}else{r=t.draggable.data("push-id");if(r){n="PUSH"}}}if(n=="UNKNOWN"){return}t.draggable.css({top:"",left:""});switch(n){case"COMMENT":De(i,t.draggable,r);break;case"MAILING":ke(i,t.draggable,r);break;case"PUSH":Oe(i,t.draggable,r);break}}})}function N(){var e=$("#calendar-table").height();$(".calendar-sidebar").css({"max-height":e+"px"})}this.adjustSidebarHeight=N;function Ne(e,t){return $.ajax({type:"POST",url:j,data:{mailingId:e,date:t}})}function Ie(e,t){return $.ajax({type:"POST",url:V,data:{pushId:e,date:t}})}function Pe(e){var t="comment-"+e.id;var i=$("#"+t);$("#deadline-"+t).val(e.isDeadline);$("#emm-user-type-"+t).val(e.isEmmUserType);$("#notify-admin-id-"+t).val(e.notifyAdminId);$("#recipients-"+t).val(e.recipients);var n=e.text.replace(/\n/g,"<br>");T(i);i.find(".comment-text-content").html(n);$("#popup-"+t+" .comment-text-content").html(n);$("#plannedSendDate-"+t).val(e.getPlannedSendDateAsString())}function Me(t){$.ajax({type:"POST",url:Y,data:{commentId:t.id,date:t.getDateAsString(),comment:t.text,deadline:t.isDeadline,sendNow:t.isSendNow,emmUserType:t.isEmmUserType,notifyAdminId:t.notifyAdminId,recipients:t.recipients,notified:t.isNotified,plannedSendDate:t.getPlannedSendDateAsString()},success:function(e){if(typeof e.commentId=="undefined"){AGN.Lib.Page.render(e)}else{t.isSendNow=false;if(t.id==0){t.id=e.commentId;Te(t);S()}else{Pe(t)}}}})}this.saveCommentDB=Me;function Le(e){$.ajax({type:"POST",url:q,data:{commentId:AGN.Lib.ReminderService.getReminderIdFromTag(e)}})}this.removeCommentDB=Le;function Fe(e,t){e=L(e);t=L(t);C();$.ajax({type:"GET",url:H,data:{startDate:e,endDate:t}}).done(function(e){$.each(e,function(e,t){Ge(t)});N()}).always(A)}function Ge(e){var t=$("#day-"+e.sendDate);var i=$("#"+e.mailingId);if(t.exists()&&!i.exists()){var n;var r=$e(e);if(e.plannedInPast){n="calendar-mailing-status-planned-in-past"}else{n="calendar-"+e.workstatus.replace(".","-")}var o={sent:e.sent,planned:e.planned,mailingId:e.mailingId,statusClass:n,mailingLink:r,workstatus:e.workstatus,shortname:e.shortname,sendTime:e.sendTime};i=AGN.Lib.Template.dom("calendar-mail-link",o);t.append(i);o.subject=e.subject;o.mailsSent=e.mailsSent;o.previewImage=We(e.preview_component,e.isOnlyPostType);o.popupClass=e.preview_component?"":"calendar-mail-popup-preview-missing";o.emptyWorkstatus=!e.workstatus.trim();o.openers=e.openers;o.clickers=e.clickers;o.workstatusIn=e.workstatusIn;var a=AGN.Lib.Template.dom("calendar-mail-popup",o);$("#calendar-popup-holder").append(a);AGN.Lib.CalendarService.addMailingDragging(i)}}function $e(e){var t;if(e.sent&&e.workstatus!="mailing.status.test"&&Q){t=K.replace(":mailingId:",e.mailingId)}else{t=X.replace(":mailingId:",e.mailingId)}return t}function We(e,t){var i;if(t){i=AGN.url("/assets/core/images/facelift/post_thumbnail.jpg")}else if(e){i=AGN.url("/sc?compID="+e)}else{i=AGN.url("/assets/core/images/facelift/no_preview.svg")}return i}function He(e){switch(e.status){case o:return e.sendDate;case a:return e.startDate;default:return L(tt(e.plannedFor))}}function je(e,t){C();$.ajax({type:"GET",url:B,data:{startDate:L(e),endDate:L(t)}}).done(function(e){var n=AGN.Lib.Template.prepare("calendar-planned-push-notification");$.each(e,function(e,t){var i=$(n(t));$("#day-"+He(t)).append(i);ce(i)});N()}).always(A)}function Be(e,t){C();$.ajax({type:"GET",url:z,data:{startDate:L(e),endDate:L(t)},success:function(e){var n=AGN.Lib.Template.prepare("calendar-auto-optimization");$.each(e,function(e,t){var i=$(n({optimizationId:t.campaignID,shortname:t.shortname,linkUrl:Ve(t),status:t.autoOptimizationStatus}));$("#day-"+t.sendDate).append(i)});N()}}).always(A)}function Ve(e){if(e.workflowId==0){return"optimization/"+e.id+"/view.action"}else{return"workflow/"+e.workflowId+"/view.action"}}function ze(e,t){$.ajax({type:"GET",url:U,data:{startDate:L(e),endDate:L(t)},success:function(e){$.each(e,function(e,t){Ue(t)});AGN.Lib.CalendarService.checkHideCommentIconsVisibility();F();N()}})}function Ue(e){var t=_.cloneDeep(AGN.Lib.ReminderService.reminder);var i=e.recipients.adminId;t.id=e.commentId;t.setDate(e.date);t.text=e.comment;t.notifyAdminId=i;t.isEmmUserType=i!=0;t.currentAdminName=e.adminName;t.isDeadline=e.deadline;t.isNotified=e.notified;t.setPlannedSendDate(e.plannedSendDates);t.recipients=e.recipients.value;AGN.Lib.CalendarService.addComment(t)}function Ye(){$.ajax({type:"GET",url:G,success:function(e){$(".calendar-sidebar-content").html(e);N();AGN.Lib.CoreInitializer.run(["tooltip","scrollable"],$(".calendar-wrapper"))}})}function qe(){$.ajax({type:"GET",url:W,success:function(e){$(".calendar-sidebar-content").html(e);N();AGN.Lib.CoreInitializer.run(["tooltip","scrollable"],$(".calendar-wrapper"))}})}function I(){var e=$("#month_list_year option");var t=$("#weeks_list_year option");var i=Number(e[e.length-1].value);for(var n=0;n<e.length;n++){var r=Number(e[n].value)+1;e[n].text=r;e[n].value=r;t[n].text=r;t[n].value=r}e[e.length]=new Option(i,i);t[t.length]=new Option(i,i)}function Xe(){var e=$("#month_list_year option");var t=$("#weeks_list_year option");var i=Number(e[e.length-1].value)-1;e[e.length]=new Option(i,i);t[t.length]=new Option(i,i)}function Ke(){var e;if(m=="MONTH"){var t=$("#month_list option:selected").val();var i=$("#month_list_year option:selected").val();var n=new Date(i,t,1);strDate=AGN.Lib.DateFormat.format(n,getDateFormat());e=$("#month_list_year option:selected").index()}if(m=="WEEK"){var r=$("#weeks_list option:selected").val();for(var o in y){if(!y.hasOwnProperty(o))continue;if(y[o].number==r){strDate=AGN.Lib.DateFormat.format(y[o].firstDay,getDateFormat());break}}e=$("#weeks_list_year option:selected").index()}if(e==0){I()}P(strDate)}this.showDate=Ke;function P(e){var t=AGN.Lib.DateFormat.parseFormat(e,getDateFormat());s=t.getMonth();u=t.getFullYear();c=t.getDate();k();if(g){E(s,u)}else{x(s,u,c)}}this.jumpToDate=P;function Qe(){var e=AGN.Lib.DateFormat.format(new Date,getDateFormat());P(e)}this.jumpToday=Qe;function Ze(e,t,i){var n=6048e5;var r=new Date(t,e,i);r.setDate(i-r.getDay()-1+p);var o=new Date(r.getFullYear(),r.getMonth(),r.getDate());o.setDate(o.getDate()+1);if(e==0&&i==1&&o.getWeek(p)!=1){o.setTime(o.getTime()+n)}var a=o.getWeek(p);if(a==1){var s=new Date(o.valueOf()+n);if(o.getFullYear()!=s.getFullYear()){t=s.getFullYear()}}$("#weeks_list_year")[0].selectedIndex=$("#weeks_list_year option[value = "+t+"]")[0].index;M($("#weeks_list_year")[0]);$("#weeks_list")[0].selectedIndex=$("#weeks_list option[value = "+a+"]")[0].index;$("#weeks_list_year").select2({minimumResultsForSearch:-1});$("#weeks_list").select2({minimumResultsForSearch:-1})}function Je(e,t){$("#month_list_year")[0].selectedIndex=$("#month_list_year option[value = "+t+"]")[0].index;$("#month_list")[0].selectedIndex=$("#month_list option[value = "+e+"]")[0].index;$("#month_list").select2({minimumResultsForSearch:-1});$("#month_list_year").select2({minimumResultsForSearch:-1})}function M(e){y=[];var t;var i=6048e5;var n=e.options[e.selectedIndex].value;var r=new Date(n,11,31);var o=new Date(n,0,1);o.setDate(1-o.getDay()-1+p);o.setDate(o.getDate()+1);var a=new Date(o.getFullYear(),o.getMonth(),o.getDate());a.setTime(o.getTime()+i-864e5);if(o.getWeek(p)!=1){o.setTime(o.getTime()+i);a.setTime(a.getTime()+i)}do{t=new Object;t.number=o.getWeek(p);t.firstDay=new Date(o.getFullYear(),o.getMonth(),o.getDate());t.lastDay=new Date(a.getFullYear(),a.getMonth(),a.getDate());y.push(t);o.setTime(o.getTime()+i);a.setTime(a.getTime()+i)}while(o.getWeek(p)!=1&&o.getFullYear()==n);$("#weeks_list option").remove();for(var s in y){if(!y.hasOwnProperty(s))continue;var l=document.createElement("option");var u=AGN.Lib.DateFormat.format(y[s].firstDay,d);var c=AGN.Lib.DateFormat.format(y[s].lastDay,d);l.value=y[s].number;l.innerHTML=y[s].number+" : "+u+" - "+c;$("#weeks_list").append(l)}}this.createWeeksList=M;function et(e,t){var i=e+"";while(i.length<t)i="0"+i;return i}function L(e){var t=et(e.getDate(),2);var i=et(e.getMonth()+1,2);var n=e.getFullYear();return t+"-"+i+"-"+n}function tt(e){if(e){var t=e[0];var i=e[1]-1;var n=e[2];return new Date(t,i,n)}return null}function it(e,t){var i=e.match(/^(\d\d)-(\d\d)-(\d{4})$/);if(i){var n=i[1];var r=i[2]-1;var o=i[3];if(t){i=t.match(/^(\d\d):(\d\d)$/);if(i){var a=i[1];var s=i[2];return new Date(o,r,n,a,s)}}return new Date(o,r,n)}return null}function F(){if($(".js-calendar-toggle-all-comments").prop("checked")){$(".calendar-table .calendar-comment").show()}}this.setAllCommentsCheckState=F;function nt(e){var t=encodeURI(e);if(t.indexOf("%")!=-1){var i=t.split("%").length-1;if(i==0)i++;var n=t.length-i*3;i=i+n}else{i=t.length}return i}};AGN.Lib.CalendarService=new e;var i={showDiv:function(e){$("div#calendar-dialog-modal div#"+e).css("display","block")},hideDiv:function(e){$("div#calendar-dialog-modal div#"+e).css("display","none")},updateVisibility:function(){this.onScheduleChanged();this.onDeadlineChanged()},onDeadlineChanged:function(){if($("#isDeadline:checked").val()){$("#remindDate").prop("disabled",false);$("#remindTime").prop("disabled",false);$(".js-open-datepicker").prop("disabled",false);$(".js-open-timepicker").prop("disabled",false)}else{$("#remindDate").prop("disabled",true);$("#remindTime").prop("disabled",true);$(".js-open-datepicker").prop("disabled",true);$(".js-open-timepicker").prop("disabled",true)}return false},onUserTypeChanged:function(e){if(e==this.reminder.recipientEmm){$("#emmUsers").show();$("#customRecipients").hide()}else{$("#customRecipients").show();$("#emmUsers").hide()}},onScheduleChanged:function(){if($("#scheduleReminder:checked").val()){$("#admin-for-notify").prop("disabled",false);this.showDiv("reminderDetails")}else{$("#admin-for-notify").prop("disabled",true);this.hideDiv("reminderDetails")}return false},reminder:{isDeadline:false,isSendNow:false,isEmmUserType:true,recipientEmm:1,recipientCustom:2,defaultDate:{date:"",hours:8,minutes:0},plannedSendDate:{date:"",hours:8,minutes:0},getDateAsString:function(){return $.datepicker.formatDate("dd-mm-yy",this.defaultDate.date)},setDate:function(e){this.defaultDate.date=$.datepicker.parseDate("dd-mm-yy",e);this.plannedSendDate.date=$.datepicker.parseDate("dd-mm-yy",e);this.plannedSendDate.hours=this.defaultDate.hours;this.plannedSendDate.minutes=this.defaultDate.minutes},getPlannedSendDateAsString:function(){return $.datepicker.formatDate("dd-mm-yy",this.plannedSendDate.date)+(this.plannedSendDate.hours<10?" 0":" ")+this.plannedSendDate.hours.toString()+(this.plannedSendDate.minutes<10?":0":":")+this.plannedSendDate.minutes.toString()},setPlannedSendDate:function(e){var t=e.split(" ");this.plannedSendDate.date=$.datepicker.parseDate("dd-mm-yy",t[0]);var i=t[1].split(":");this.plannedSendDate.hours=parseInt(i[0]);this.plannedSendDate.minutes=parseInt(i[1])},getScheduleReminder:function(){return this.isDeadline||this.isSendNow},getRemindCalendarDate:function(){if(this.defaultDate.date.toString()==this.plannedSendDate.date.toString()&&this.defaultDate.hours==this.plannedSendDate.hours&&this.defaultDate.minutes==this.plannedSendDate.minutes){return true}else{return false}},onSave:function(){i.saveReminder(i.reminder)}},getNewReminder:function(e,i){this.reminder.id=0;this.reminder.setDate(e);this.reminder.text="";this.reminder.isEmmUserType=true;this.reminder.notifyAdminId=i.adminId;this.reminder.recipients="";this.reminder.currentAdminName=i.adminName;this.reminder.isDeadline=false;this.reminder.isNotified=false;this.reminder.title=t("calendar.common.new_comment");this.reminder.recipientEmm=i.recipientEmm;this.reminder.recipientCustom=i.recipientCustom;return this.reminder},getReminder:function(e,i){var n=$("#"+e+" .comment-text-content").html()+"";this.reminder.id=this.getReminderIdFromTag(e);this.reminder.setDate(this.getDateFromTag($("#"+e).parent().attr("id")));this.reminder.text=n.replace(/<br>/gi,"\n");this.reminder.isEmmUserType=$("#emm-user-type-"+e).val()=="true";this.reminder.notifyAdminId=$("#notify-admin-id-"+e).val();this.reminder.recipients=$("#recipients-"+e).val();this.reminder.currentAdminName=i;this.reminder.isDeadline=$("#deadline-"+e).val()=="true";this.reminder.isNotified=$("#notified-"+e).val()=="true";this.reminder.setPlannedSendDate($("#plannedSendDate-"+e).val());this.reminder.title=t("calendar.common.edit_comment");return this.reminder},fillCommentDialog:function(e){var t=$("#calendar-dialog-modal");t.find(".modal-title").html(e.title);t.find("#comment-text").val(e.text);t.find('#reminderDetails input[name="userType"][value='+(e.isEmmUserType?e.recipientEmm:e.recipientCustom)+"]").prop("checked",true).trigger("change");t.find("#admin-for-notify").val(e.notifyAdminId);AGN.Lib.Select.get(t.find("#admin-for-notify")).selectValueOrSelectFirst(e.notifyAdminId);t.find("#recipients-text").val(e.recipients);t.find("#isDeadline").prop("checked",e.isDeadline);t.find("#isSendNow").prop("checked",e.isSendNow);t.find("#scheduleReminder").prop("checked",e.getScheduleReminder());t.find("#remindDate").pickadate("picker").set("select",e.plannedSendDate.date);t.find("#remindTime").val(e.plannedSendDate.hours+":"+e.plannedSendDate.minutes)},saveReminder:function(e){var t=$("#comment-text").val();if(AGN.Lib.CalendarService.validateComment(t)){var i=$("#isEmmUserType").prop("checked");var n=AGN.Lib.CalendarService.parseRecipients($("#recipients-text").val());if(i||AGN.Lib.CalendarService.validateEmails(n)){$("#calendar-dialog-modal").modal("hide");e.text=t;e.isEmmUserType=i;if(i){e.notifyAdminId=$("#admin-for-notify").val();e.recipients=""}else{e.notifyAdminId=0;e.recipients=n.join(",")}e.isSendNow=$("#isSendNow").prop("checked");e.isDeadline=$("#isDeadline").prop("checked");if($("#isDeadline").prop("checked")&&$("#scheduleReminder").prop("checked")){var r=$("#remindDate").pickadate("picker"),o=$("#remindTime");e.plannedSendDate.date=AGN.Lib.DateFormat.parseFormat(r.get("select","dd-mm-yyyy"),"dd-MM-yyyy");e.plannedSendDate.hours=o.val().substring(0,2);e.plannedSendDate.minutes=o.val().substring(3,5)}else{e.plannedSendDate.date=e.defaultDate.date;e.plannedSendDate.hours=e.defaultDate.hours;e.plannedSendDate.minutes=e.defaultDate.minutes}AGN.Lib.CalendarService.saveCommentDB(e)}}},getDateFromTag:function(e){return e.substr(e.indexOf("-")+1)},getReminderIdFromTag:function(e){return e.substr(e.indexOf("-")+1)}};AGN.Lib.ReminderService=i})();(function(){function r(e,t,i,n){var r=$(e).pickadate("picker").get("select",n);var o=$(t).val();var a="";if(r&&o){a=r+" "+o}$(i).val(a)}function e(e,t,i,n){$(e).pickadate("picker").on({set:function(){r(e,t,i,n)}});$(t).on("change",function(){r(e,t,i,n)})}AGN.Lib.DomInitializer.new("campaign-autooptimization-view",function(){$("form#optimizationForm").submit(false);e("#testMailingsSendDate","#testMailingsSendTime","input[name='testMailingsSendDateAsString']",this.config.datePattern);e("#resultSendDate","#resultSendTime","input[name='resultSendDateAsString']",this.config.datePattern)})})();AGN.Lib.CoreInitializer.new("colorpicker",function(e){if(!e){e=$(document)}e.find(".js-colorpicker").each(function(){$(this).colorpicker({format:"hex",container:true})})});(function(){var m={URL:undefined,reactorChartData:{bindto:"#reactor-type-chart",data:{columns:[],type:"donut",order:null},color:{pattern:["#008F00","#92D050","#CCCDCD","#F43536"]},legend:{position:"right"}},rebuyChartData:{bindto:"#rebuy-rate-chart",data:{columns:[],type:"gauge"},color:{pattern:["#0071B9"]}},revenueChartData:{bindto:"#revenue-chart",data:{columns:[],type:"bar",labels:{show:true,format:function(e,t,i,n){return e}},color:function(e,t){return e}},tooltip:{show:false},axis:{rotated:true,x:{show:false},y:{show:false,min:0,max:150}},legend:{show:false},bar:{width:{ratio:.7}}},progressChartData:{bindto:"#progress-of-used-devices-chart",onrendered:function(){d3.selectAll("#progress-of-used-devices-chart").selectAll(".c3-axis.c3-axis-x").selectAll(".tick text").style("text-anchor","start")},data:{columns:[],groups:[["windows","mac","android","ios","other"]],types:{reactions:"spline"},axes:{reactions:"y2"},names:{},type:"bar",x:"date",xFormat:"%m/%d/%Y",order:null},axis:{x:{type:"timeseries",tick:{culling:true,format:"%m/%d/%Y"}},y:{padding:{top:10},tick:{format:function(e){return e+" %"}}},y2:{show:true,min:0}},bar:{width:{ratio:.5}},tooltip:{format:{value:function(e,t,i){if(i==="reactions"){return e}return e+" %"}}},color:{pattern:["#0071B9","#4C9BCE","#99C6E3","#CCE3F1","#CCCDCD","#555555"]}},devicesChartData:{bindto:"#devices-reacted-on-chart",data:{columns:[],type:"donut",order:null,names:{}},legend:{position:"right"},color:{pattern:["#0071B9","#4C9BCE","#99C6E3","#CCE3F1","#CCCDCD"]}}};var r={reactorChartData:{size:{width:400,height:350}},rebuyChartData:{size:{width:400,height:250}},revenueChartData:{size:{width:350,height:275}},progressChartData:{size:{width:860,height:350}},devicesChartData:{size:{width:400,height:350}}};var o={reactorChartData:{size:{width:350,height:250}},rebuyChartData:{size:{width:250,height:200}},revenueChartData:{size:{width:300,height:250}},progressChartData:{size:{width:550,height:250}},devicesChartData:{size:{width:350,height:250}}};var a=[];var e=null;var t=false;AGN.Lib.RecipientStatsData=m;AGN.Lib.DomInitializer.new("company-insights",function(){i();n();$("input[type=radio][name=progressOfUsedPeriod]").change(function(){if(this.value=="dates"){$("#progressOfUsedDates").removeClass("hidden")}else{$("#progressOfUsedDates").addClass("hidden")}});$("#refreshProgressOfUsedDevices").on("click",function(){n()});t=g();$(window).resize(function(){if(e!=null)clearTimeout(e);e=setTimeout(function(){var e=g();if(t!=e){t=e;s()}},200)})});function i(){$.ajax({type:"GET",url:AGN.url("/recipient/chart/ajaxStatistic.action"),success:function(e){if(e){l(e["reactorType"],e["notAvailable"]);u(e["rebuyTitle"],e["rebuyRate"],e["notAvailable"]);c(e["revenue"],e["notAvailable"]);f(e);AGN.Lib.CoreInitializer.run("equalizer")}}})}function n(){var e={};var t=$("input[name=progressOfUsedPeriod]:checked").val();if(t=="month"){e["byMonth"]=true}else if(t=="dates"){e["from"]=$("#progressOfUsedFrom").val();e["till"]=$("#progressOfUsedTill").val()}$.ajax({type:"GET",url:AGN.url("/recipient/chart/progressOfUsedDevices.action"),data:e,success:function(e){d(e);AGN.Lib.CoreInitializer.run("equalizer")}})}function y(e){var t=m[e+"Data"];if(t==undefined){return}var i=g()?r:o;var n=i[e+"Data"];$.extend(true,t,n);$("#"+e).removeClass("hidden");c3.generate(t);if(a.indexOf(e)==-1){a.push(e)}}function s(){a.forEach(function(e){y(e)})}function l(e,t){if(e===undefined){return}var i=[];var n=false;for(var r in e){if(e.hasOwnProperty(r)){i.push([r,e[r]]);if(e[r]>0){n=true}}}if(!n){i=[[t,100]];m.reactorChartData.color.pattern=["#CCCDCD"]}else{if(i.length==4){m.reactorChartData.color.pattern=["#008F00","#92D050","#CCCDCD","#F43536"]}else{m.reactorChartData.color.pattern=["#92D050","#CCCDCD","#F43536"]}}m.reactorChartData.data.columns=i;y("reactorChart")}function u(e,t,i){if(t===undefined){return}if(t>0){m.rebuyChartData.data.columns=[[e,b(t)]]}else{m.rebuyChartData.gauge={};m.rebuyChartData.gauge.label={};m.rebuyChartData.gauge.label.format=function(e,t){return i};m.rebuyChartData.gauge.label.show=false;m.rebuyChartData.data.columns=[[i,0]]}y("rebuyChart")}function c(e,r){if(e===undefined){return}var i=["#0071B9","#4C9BCE","#99C6E3","#CCCDCD"];var o=[];var t=[""];var n=[];var a=[];var s=0;var l=0;var u=false;for(var c in e){if(e.hasOwnProperty(c)){var d=e[c];o.push(c);if(d>0){u=true;n.push(d);s+=d}else{n.push(0)}}}if(u){var f=g()?70:60;var p=false;for(var h=0;h<n.length;h++){a[h]=Math.round(n[h]/s*100);l+=a[h];if(a[h]>=70){p=true}}if(l!=100){a[a.length-1]+=100-l}for(h=0;h<a.length;h++){t.push(25+(p?a[h]*f/100:a[h]))}m.revenueChartData.data.labels.format=function(e,t,i,n){return a[i]+"% "+o[i]}}else{for(h=0;h<o.length;h++){t.push(50);a[h]=25}m.revenueChartData.data.labels.format=function(e,t,i,n){return r}}m.revenueChartData.data.columns=[t];m.revenueChartData.data.color=function(e,t){if(t.value!=undefined){return i[t.index]}return e};y("revenueChart")}function d(e){if(e===undefined||e["usedDevicesByPeriods"]===undefined||e["usedDevices"]===undefined){return}var t={windows:e["windowsTitle"],mac:e["macTitle"],android:e["androidTitle"],ios:e["iosTitle"],other:e["otherTitle"],reactions:e["numberOfReactions"]};var i=e["usedDevices"];var n=[];var r=[];r.push({name:"windows",count:i["windows"]});r.push({name:"mac",count:i["mac"]});r.push({name:"android",count:i["android"]});r.push({name:"ios",count:i["ios"]});r.sort(function(e,t){return t.count-e.count});for(var o=0;o<r.length;o++){n.push([t[r[o].name],r[o].count])}n.push([e["otherTitle"],i["other"]]);m.devicesChartData.data.columns=n;m.devicesChartData.data.names=t;y("devicesChart");var a=[];var s=[];for(var l=0;l<r.length;l++){s[r[l].name]=l;a.push([r[l].name])}a.push(["other"],["reactions"],["date"]);for(var u=0;u<e["usedDevicesByPeriods"].length;u++){var c=e["usedDevicesByPeriods"][u];var d=c["windows"];var f=c["mac"];var p=c["android"];var h=c["ios"];var g=c["other"];var v=d+f+p+h+g;a[s["windows"]].push(b(d/v));a[s["mac"]].push(b(f/v));a[s["android"]].push(b(p/v));a[s["ios"]].push(b(h/v));a[4].push(b(g/v));a[5].push(v);a[6].push(c["date"])}m.progressChartData.data.columns=a;m.progressChartData.data.names=t;m.progressChartData.data.xFormat=e["dateFormat"];m.progressChartData.axis.x.min=e["min"];m.progressChartData.axis.x.max=e["max"];m.progressChartData.axis.x.tick.format=e["dateFormat"];y("progressChart")}function b(e){return Math.round(1e3*e)/10}function g(){return $(window).width()>=1600}function f(e){C(e["favoriteOpeningDays"]);A(e["favoriteOpeningHours"]);p(e["ctr"]);h(e["conversion"]);v(e["pageImpressions"]);_(e["pageImpressionsPerVisit"]);w(e["pageImpressionsPerBuy"])}function p(e){$("#ctr-val").text(e.toString().replace(".",","))}function h(e){if(e!=0){$("#conversion-val").text(e.toString().replace(".",","))}else{$("#conversion-val").text("---");$("#conversion-val").parent().find(".l-stat-sign").text("")}}function v(e){if(e!=0){$("#pi-val").text(e.toString().replace(",","."))}else{$("#pi-val").text("---");$("#pi-val").parent().find(".l-stat-sign").text("")}}function _(e){if(e!=0){$("#pi-visit-val").text(e.toString().replace(",","."))}else{$("#pi-visit-val").text("---");$("#pi-visit-val").parent().find(".l-stat-sign").text("")}}function w(e){if(e!=0){$("#pi-buy-val").text(e.toString().replace(",","."))}else{$("#pi-buy-val").text("---");$("#pi-buy-val").parent().find(".l-stat-sign").text("")}}function C(e){var t=$("#favOpeningDays").find(".stat-fav-day");E(e,t)}function A(e){var t=$("#favOpeningHours").find(".stat-fav-time");E(e,t)}function E(e,n){var r=n.closest(".l-stat-content").find("hr");var o=0;var a=x(e);$.each(e,function(e,t){n.find(".l-stat-name").text(e);n.find(".l-stat-val").text(t);o++;if(o<a){var i=n.clone();i.insertAfter(r);n=i;if(o<a-1){r=r.clone();r.insertAfter(n)}}})}function x(e){var i=0;$.each(e,function(e,t){i++});return i}})();AGN.Lib.DomInitializer.new("connection-speed-test",function(){var r=this.config.SLOW_CONNECTION_THRESHOLD_KBPS;var n=this.config.SPEED_TEST_RESOURCE_SIZE;var o=300;var e=6e4;var a=false;var s=false;var l=false;var u;function c(e){return e.indexOf("/connectionSpeedTest")>=0||e.indexOf("/connectionSpeed")>=0}$(document).ajaxSend(function(e,t,i){if(!c(i.url)){if(l){a=true}s=true;if(i.url.indexOf("/lock.action")<0){f()}}else{l=true;a=false;u=Date.now()}});$(document).ajaxStop(function(){s=false});function i(){var i=true;$("img").each(function(e,t){if(!t.complete){i=false}});return i}function d(){if(s){setTimeout(d,2e3)}else{if(i()){p()}}}var f=_.throttle(function(){d()},e);function p(){AGN.Lib.Loader.prevent();$.ajax({type:"GET",url:AGN.url("/connectionSpeed/test.action")+"?cacheKiller="+Date.now(),timeout:1e4}).done(function(e){if(!a){h()}l=false}).fail(function(e,t){if(t==="timeout"){g(0);l=false}})}function h(){var e=(Date.now()-u)/1e3;var t=(n+o)*8/e;var i=v(t);g(i)}function g(e){var i=e>r;var n=$("#internet-indicator");n.data("tooltip",i?t("defaults.ok"):e+" Kbit/s");AGN.Lib.CoreInitializer.run("tooltip",n.parent());n.find("i").css("color",i?"#109e4d":"#ffa300")}function v(e){return(e/1e3).toFixed(2)}window.addEventListener("offline",function(){g(0)});return false});AGN.Lib.CoreInitializer.new("csrf",function(e){if(!e){e=$(document)}e.find('meta[name="_csrf_header"]').each(function(){window.csrfHeaderName=$(this).attr("content");window.csrfCookieName=window.csrfHeaderName});e.find('meta[name="_csrf_parameter"]').each(function(){window.csrfParameterName=$(this).attr("content")})});(function(){AGN.Lib.CoreInitializer.new("dark-theme",function(){if($("body").hasClass("dark-theme")){$("iframe").each(function(){var e=$(this);e.on("load.iframe",function(){e.contents().find("body").addClass("dark-theme")})})}})})();(function(){var l;l={data:{chartsColors:["#0071b9","#009999","#92d050","#41641a","#ffc000"],statChartData:{columnTitles:[],c3data:{bindto:".js-stat-chart",data:{columns:[],type:"bar",labels:true},axis:{x:{tick:{centered:true,fit:true,format:function(e){return l.data.statChartData.columnTitles[e]}}}},legend:{show:false},tooltip:{format:{title:function(){return null},name:function(e,t,i,n){return l.data.statChartData.columnTitles[n]},value:function(e,t,i,n){return e}}},padding:{right:25}},build:function(e,t){this.columnTitles=e;var i=t.slice(0);i.unshift("values");this.c3data.data.columns=[i];return this.c3data}},clickChartData:{c3data:{bindto:".js-click-chart",data:{rows:[],type:"donut"},size:{height:150},donut:{title:"",label:{show:false},width:15},legend:{position:"right"},tooltip:{show:false}},build:function(e,t,i){this.c3data.donut.title=e;this.c3data.data.rows=[t,i];var n={};for(var r=0;r<t.length;r++){n[t[r]]=l.data.chartsColors[r]}this.c3data.data.colors=n;return this.c3data}},viewChartData:{c3data:{bindto:".js-view-chart",data:{rows:[],type:"donut"},size:{height:150},donut:{title:"",label:{show:false},width:15},legend:{position:"right"},tooltip:{show:false}},build:function(e,t,i){this.c3data.donut.title=e;this.c3data.data.rows=[t,i];var n={};for(var r=0;r<t.length;r++){n[t[r]]=l.data.chartsColors[r]}this.c3data.data.colors=n;return this.c3data}}},updateCharts:function(e){jQuery.ajax({type:"GET",url:AGN.url("/dashboard/statistics.action"),data:{mailingId:e},success:function(e){var t;var i;var n;e=_.merge({common:[["no Data","0"]],clickers:[["no Data","0"]],clickersPercent:[0],openers:[["no Data","0"]],openersPercent:[0]},e);t=[];i=[];for(var r=0;r<e["common"].length;r++){var o=parseInt(e["common"][r][1]);t.push(e["common"][r][0]);i.push(o)}c3.generate(l.data.statChartData.build(t,i));t=[];i=[];n=0;for(var r=0;r<e["clickers"].length;r++){var o=l.roundTo(e["clickers"][r][1]*100,1);t.push(e["clickers"][r][0]);i.push(o);n+=o}if(!isNaN(n)&&n>0){for(var r=0;r<i.length;r++){t[r]+=" "+l.roundTo(100*i[r]/n,1)+"%"}}var a=l.roundTo(e["clickersPercent"][0]*100,1)+"%*";c3.generate(l.data.clickChartData.build(a,t,i));t=[];i=[];n=0;for(var r=0;r<e["openers"].length;r++){var o=l.roundTo(e["openers"][r][1]*100,1);t.push(e["openers"][r][0]);i.push(o);n+=o}if(!isNaN(n)&&n>0){for(var r=0;r<i.length;r++){t[r]+=" "+l.roundTo(100*i[r]/n,1)+"%"}}var s=l.roundTo(e["openersPercent"][0]*100,1)+"%*";c3.generate(l.data.viewChartData.build(s,t,i));AGN.Lib.CoreInitializer.run("equalizer")}})},roundTo:function(e,t){return parseFloat(e).toFixed(t)*1}};AGN.Lib.DashboardStatisticsService=l})();(function(){var a=AGN.Lib.Helpers;AGN.Lib.CoreInitializer.new("pickadate",function(e){if(!e){e=$(document)}_.each(e.find(".js-datepicker"),function(e){var t=$(e),i,n,r={editable:true,min:new Date(0,0,0),max:new Date(9999,11,31),maxFor:undefined,minFor:undefined,klass:{holder:"datepicker__holder picker__holder"+(t.hasClass("js-datepicker-right")?" datepicker__holder-right":"")}};n=_.merge({},r,a.objFromString(t.data("datepicker-options")));i=t.pickadate("picker");if(i&&i.get("start")){return}$(e).pickadate(n);i=t.pickadate("picker");i.on("open",function(){this.$node.parents(".input-group").find(".js-open-datepicker").addClass("is-active")});i.on("close",function(){this.$node.parents(".input-group").find(".js-open-datepicker").removeClass("is-active")});if(n.maxFor){t.on("change",function(){var e=$(this).val()||n.min;if(e){$(n.maxFor).pickadate("picker").set("max",e)}})}if(n.minFor){t.on("change",function(){var e=$(this).val()||n.max;if(e){$(n.minFor).pickadate("picker").set("min",e)}})}var o=true;t.on("change",function(){if(o){var e=$(this);var t=e.pickadate("picker");try{o=false;if(e.val()){t.set("select",e.val())}else{t.set("clear")}}finally{o=true}}})});_.each(e.find(".js-timepicker"),function(e){var t=$(e),i,n,r={mask:"h:halfs",oncomplete:function(){t.trigger("timepicker:complete")},onincomplete:function(){t.trigger("timepicker:incomplete")}};i=_.merge({},r,a.objFromString(t.data("timepicker-options")));n=i.mask;delete i.mask;t.inputmask(n,i);t.attr("placeholder",t.data("_inputmask").opts.placeholder)})})})();AGN.Lib.CoreInitializer.new("delegate",function(e){if(!e){e=$(document)}e.all("[data-delegate]").each(function(){var e=$(this),i=e.data("delegate"),t=e.data("delegate-events")||"click";e.on(t,function(e){var t=$(i);if(t.length>0){t.trigger($.Event(e))}})})});(function(){var o=AGN.Lib.Helpers;AGN.Lib.CoreInitializer.new("display-dimensions",function(e){if(!e){e=$(document)}_.each(e.find("[data-display-dimensions]"),function(i){var e=$(i),t=o.objFromString(e.data("display-dimensions"))["scope"],n=e.parents(t),r=n.find("[data-dimensions]");e.ensureLoad(function(){var e=i.naturalWidth,t=i.naturalHeight;r.html(e+" x "+t+" px")})})})})();AGN.Lib.CoreInitializer.new("dragster",function(e){if(!e){e=$(document)}e.find(".dropzone").each(function(){new Dragster(this)})});AGN.Lib.CoreInitializer.new("dropdown-expand",function(e){if(!e){e=$(document)}_.each(e.find("[data-dropdown-expand]"),function(e){var n,t,r=$(e),o=r.find(".dropdown-menu"),i=r.data("dropdown-expand"),a=$(i),s=[];r.removeClass("hidden");o.html("");n=a.parent().width();t=a.children().filter(r).outerWidth(true)+15;_.each(a.siblings(),function(e){var t=$(e);n=n-t.outerWidth(true)});r.addClass("hidden");_.reduce(a.children().not(r),function(e,t){var i=$(t);i.removeClass("hidden");e=e+i.outerWidth(true);if(e>=n){r.removeClass("hidden");o.append(i.clone());i.addClass("hidden")}return e},t)})});AGN.Lib.CoreInitializer.new("dropzone",function(){Dropzone.autoDiscover=false});AGN.Lib.CoreInitializer.new("emoji",function(e){if(!e){e=$(document)}e.all("[data-emoji]").each(function(){$(this).emojioneArea({placeholder:null})})});(function(){var t=AGN.Lib.Equalizer;AGN.Lib.CoreInitializer.new("equalizer",function(e){if(!e){e=$(document)}window.setTimeout(function(){e.find("[data-equalizer]").each(function(){t($(this))})},1)})})();(function(){var o=AGN.Lib.Form;AGN.Lib.CoreInitializer.new("form",["select"],function(e){if(!e){e=$(document)}e.find("form input[type=text], form input[type=password]").on("keyup keypress",function(e){var t=e.keyCode||e.which;if(t===13){e.preventDefault();return false}});var t=e.all("form[data-form-focus]").first();if(t.exists()){setTimeout(function(){var e=t.find('[name="'+t.data("form-focus")+'"]');if(e.exists()&&!e.is(":disabled")&&!e.is(":hidden")){i(e)}},10)}_.each(e.find("form"),function(e){o.get($(e))})});function i(e){var t;var i=25;var n=o.get(e).$form;var r=e.closest("[data-sizing=scroll], .modal").first();if(!r.length){r=$(document);t=e.offset().top-n.offset().top-i}else{t=e.offset().top-r.offset().top+r.scrollTop()-i}e.trigger("focus");r.scrollTop(t)}})();AGN.Lib.DomInitializer.new("formbuilder",function(e){var i=AGN.Lib.Tooltip;if(!e){e=$(document)}var r=this.config;var t=$("script#"+CSS.escape("config:formbuilderCommon")+'[type="application/json"]');if(t.length===1){r=$.extend(t.json(),r)}_.each(e.find(".js-form-builder"),function(t){AGN.Lib.FormBuilder.FormBuilder.get(t,r).promise().then(function(){var e=$(t);e.find(".form-actions button").each(function(){var e=$(this);i.create(e,{title:e.text()})})})});_.each(e.find(".modal-js-form-builder"),function(e){var t=$(e).attr("data-target-formbuilder");if(!t){return}var i=$(t);if(!i){return}var n=AGN.Lib.FormBuilder.FormBuilder.get(i);AGN.Lib.FormBuilder.FormBuilder.get(e,r).setJson(n.getJson())})});AGN.Lib.CoreInitializer.new("icons-defs",function(e){if(!e){e=$(document)}_.each(e.find("[data-icon]"),function(e){var t=$(e);var i=AGN.url("assets/icons-defs.svg#"+t.data("icon"),true);t.html('<svg viewBox="0 0 45 45"><use xlink:href="'+i+'"/></svg>')});svg4everybody()});AGN.Lib.CoreInitializer.new("iframe",function(e){if(!e){e=$(document)}e.find("iframe:not(.js-fixed-iframe)").each(function(){var o=this,a=$(this);if(a.hasClass("js-simple-iframe")){var e=a.parent(),t=e.parent(),s=parseInt(a.data("max-width")),l=parseInt(a.data("height-extra"))||10,u=a.data("media-query"),c=!!window.sidebar,i,d;i=function(){var e=o.contentDocument?o.contentDocument:o.contentWindow.document,t=e.body,i=e.documentElement,n,r;if(u){r=s}else{r=Math.max(t.scrollWidth,t.offsetWidth,i.clientWidth,i.scrollWidth,i.offsetWidth)}n=Math.min(t.scrollHeight,t.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight);a.height(n);n=Math.max(t.scrollHeight,t.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight);n+=l;a.height(n);if(a.data("max-width")!=="100%"){a.width(r)}if(u&&c){a.contents().find("body").css("overflow","hidden")}d()};d=function(){t.width("auto");if(a.data("max-width")!=="100%"){if(a.width()>s&&s>t.width()){e.width(a.width())}else{e.width(Math.min(s,t.width()))}}if(!u){e.doubleScroll();e.parent().doubleScroll();$(".doubleScroll-scroll-wrapper").css("margin","0 auto")}};a.off("load.iframe");a.on("load.iframe",function(){window.setTimeout(function(){i();var e=$(o.contentDocument.body);if(typeof e.imagesLoaded==="function"){e.imagesLoaded().progress(_.throttle(i,100)).always(i)}$(window).off("viewportChanged.iframe",d);$(window).on("viewportChanged.iframe",d)},50)})}else{a.on("load.iframe",function(){window.setTimeout(function(){a.iFrameResize({heightCalculationMethod:"grow",enablePublicMethods:true})},50)})}})});AGN.Lib.CoreInitializer.new("image-editor",function(e){if(!e){e=$(document)}_.each(e.find("#editor-canvas"),function(e){var o=e.getContext("2d");var a=new Image;a.src=$("#editor-img").attr("src");$("#editor-result").val("");a.onload=function(){var e=a.width;var t=a.height;o.canvas.width=e;o.canvas.height=t;o.drawImage(a,0,0,e,t);$("#l-editor-img-width").attr("value",e);$("#l-editor-img-height").attr("value",t);$("#l-editor-img-percent").attr("value",100);var i=e+$("#l-img-editor-tools").width()+10;$("#l-img-editor").css("min-width",i);var n=$("#editor-img").data("content-type");var r=o.canvas.toDataURL(n);$("#editor-result").attr("value",r)}})});(function(){var r=AGN.Lib.Helpers;AGN.Lib.CoreInitializer.new("input-mask",function(e){if(!e){e=$(document)}_.each(e.find(".js-inputmask"),function(e){var t=$(e);var i;var n;i=_.merge({},r.objFromString(t.data("inputmask-options")));n=i.mask;delete i.mask;t.inputmask(n,i)})})})();$.fn.queryBuilder.defaults({templates:{group:'<dl id="{{= it.group_id }}" class="rules-group-container">   <dt class="rules-group-header">     <div class="btn-group pull-right group-actions">       <button type="button" class="btn btn-xs btn-primary" data-add="rule">         <i class="{{= it.icons.add_rule }}"></i> {{= it.translate("add_rule") }}       </button>       {{? it.settings.allow_groups===-1 || it.settings.allow_groups>=it.level }}         <button type="button" class="btn btn-xs btn-primary" data-add="group">           <i class="{{= it.icons.add_group }}"></i> {{= it.translate("add_group") }}         </button>       {{?}}       {{? it.level>1 }}         <button type="button" class="btn btn-xs btn-alert" data-delete="group">           <i class="{{= it.icons.remove_group }}"></i> {{= it.translate("delete_group") }}         </button>       {{?}}     </div>     <div class="btn-group group-conditions">       {{~ it.conditions: condition }}         <label class="btn btn-xs btn-primary">           <input type="radio" name="{{= it.group_id }}_cond" value="{{= condition }}"> {{= it.translate("conditions", condition) }}         </label>       {{~}}     </div>     {{? it.settings.display_errors }}       <div class="error-container"><i class="{{= it.icons.error }}"></i></div>     {{?}}   </dt>   <dd class=rules-group-body>     <ul class=rules-list></ul>   </dd> </dl>'}});$.fn.queryBuilder.defaults({templates:{rule:'<li id="{{= it.rule_id }}" class="rule-container">   <div class="rule-header clearfix">     <div class="btn-group pull-right rule-actions">       <button type="button" class="btn btn-regular btn-alert" data-delete="rule">         <i class="{{= it.icons.remove_rule }}"></i>       </button>     </div>     <div class="rule-operator-conditions-container pull-right"></div>   </div>   {{? it.settings.display_errors }}     <div class="error-container"><i class="{{= it.icons.error }}"></i></div>   {{?}}   <div class="rule-filter-container"></div>   <div class="rule-operator-container"></div>   <div class="rule-value-container"></div> </li>'}});$.fn.queryBuilder.defaults({templates:{filterSelect:'{{ var optgroup = null; }} <select class="form-control js-select" name="{{= it.rule.id }}_filter">   {{? it.settings.display_empty_filter }}     <option value="-1">{{= it.settings.select_placeholder }}</option>   {{?}}   {{~ it.filters: filter }}     {{? optgroup !== filter.optgroup }}       {{? optgroup !== null }}</optgroup>{{?}}       {{? (optgroup = filter.optgroup) !== null }}         <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}">       {{?}}     {{?}}     <option value="{{= filter.id }}">{{= it.translate(filter.label) }}</option>   {{~}}   {{? optgroup !== null }}</optgroup>{{?}} </select>'}});$.fn.queryBuilder.defaults({templates:{ruleValueSelect:'{{ var optgroup = null; }} <select class="form-control js-select" name="{{= it.name }}" {{? it.rule.filter.multiple }}multiple{{?}}>   {{? it.rule.filter.placeholder }}     <option value="{{= it.rule.filter.placeholder_value }}" disabled selected>{{= it.rule.filter.placeholder }}</option>   {{?}}   {{~ it.rule.filter.values: entry }}     {{? optgroup !== entry.optgroup }}       {{? optgroup !== null }}</optgroup>{{?}}       {{? (optgroup = entry.optgroup) !== null }}         <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}">       {{?}}     {{?}}     <option value="{{= entry.value }}">{{= entry.label }}</option>   {{~}}   {{? optgroup !== null }}</optgroup>{{?}} </select>'}});$.fn.queryBuilder.defaults({icons:{add_group:"icon icon-plus-circle",add_rule:"icon icon-plus",remove_group:"icon icon-times",remove_rule:"icon icon-trash",error:"icon icon-exclamation-triangle"}});(function(){var t=AGN.Lib.Load;AGN.Lib.CoreInitializer.new("load",function(e){if(!e){e=$(document)}_.each(e.find("[data-load]"),function(e){window.setTimeout(function(){t.load($(e))},100)})})})();AGN.Lib.DomInitializer.new("logon-complete",function(e){var t=AGN.Lib.Form.get(e);var n={};window.adminId=this.config.adminId;if(this.config){$.each(this.config.webStorageBundleNames,function(e,t){try{var i=AGN.Lib.Storage.get("web-storage#"+t);if(i!=null){n[t]=i}}catch(e){console.error(e)}});var i=AGN.Lib.Storage.get("login-page")||{};i.isFrameShown=!!this.config.isFrameShown;AGN.Lib.Storage.set("login-page",i)}t.setValue("webStorageJson",JSON.stringify(n));t.submit()});(function(){var r=30;function o(){return AGN.Lib.Storage.get("login-page")||{}}function i(e){AGN.Lib.Storage.set("login-page",e)}function a(){var e=o();if(e){if(e.notificationDismissExpiration){return e.notificationDismissExpiration<=Date.now()}}var t=localStorage.getItem("closedDate");if(t){var i=new Date;var n=new Date(t);n.setDate(n.getDate()+r);return i-n>0}return true}function s(){var e=o();var t=new Date;t.setDate(t.getDate()+r);e.notificationDismissExpiration=t.getTime();i(e)}function l(){return o().isFrameShown==false}AGN.Lib.DomInitializer.new("logon",function(e){e.toggleClass("l-hide-frame",l());e.removeClass("hidden");if(a()&&this.config.SHOW_TAB_HINT===true){var i=t("defaults.info");var n=t("logon.info.multiple_tabs");AGN.Lib.Messages(i,n,"info",s,false)}})})();(function(){var s=45e3;var l=3*60*6e4;AGN.Opt.Components.MailingContentLock={manageLock:function(e,i,n){if(e>0&&i){var r=Date.now();var o;var a=function(){if(r+l>Date.now()){$.ajax({url:AGN.url("/mailing/ajax/"+e+"/lock.action"),type:"POST",success:function(e){if(e.success!==true){clearInterval(o)}},statusCode:{404:function(){clearInterval(o)}}})}else{clearInterval(o);$(document).trigger("ajax:unauthorized");$.ajax({url:AGN.url("/logout.action"),type:"POST",success:function(){$("body").append(AGN.Lib.Template.text("session-expired"))}})}};o=setInterval(a,s);return true}else{AGN.Lib.Modal.createFromTemplate({modalClass:"",title:t("defaults.warning"),content:t("error.mailing.exclusiveLockingFailed",n)},"modal");return false}}}})();AGN.Lib.DomInitializer.new("mailing-content-overview",function(e,t){var i=this.config;if(!t){var n=AGN.Lib.Storage.get("mailings-content-dynNameID");if(n){var r=$("tr[data-dyn-name-id='"+n.dynNameID+"']");if(r.exists()){var o=r.position().top;setTimeout(function(){$("body").scrollTop(o)},1);AGN.Lib.Storage.set("mailings-content-dynNameID",{dynNameID:0})}}}var a=$("#myDatePicker");if(a.exists()){a.pickadate("picker").on({set:function(e){if("select"in e){var t=new Date(e.select);$("#startDay").val(t.getDate());$("#startMonth").val(t.getMonth()+1);$("#startYear").val(t.getFullYear())}else{$("#startDay").val(0);$("#startMonth").val(0);$("#startYear").val(0)}}});var s=$("#myTimePicker");s.on("timepicker:complete",function(){var e=s.val();$("#startHour").val(e.substr(0,2));$("#startMinute").val(e.substring(3,5))});s.on("timepicker:incomplete",function(){$("#startHour").val(0);$("#startMinute").val(0)})}if(!i.isEditableMailing||!AGN.Opt.Components.MailingContentLock.manageLock(i.mailingId,i.isMailingExclusiveLockingAcquired,i.anotherLockingUserName)){var l=$('[data-controls-group="editing"]');l.prop("disabled",true);l.addClass("disabled")}});AGN.Lib.DomInitializer.new("mailing-content-view",function(e){AGN.Lib.Storage.set("mailings-content-dynNameID",{dynNameID:e.data("dyn-name-id")})});AGN.Lib.Controller.new("mailing-followup-options",function(){var t;var i="";var e=[];this.addDomInitializer("mailing-followup-options",function(){t=$("#followUpType");i=$("#lightWeightMailingList");e=this.config.additionalOptions;r();i.on("change",function(){r()})});var n=function(){return AGN.Lib.Template.text("followupAdvertisingOptions",{items:e})};var r=function(){var e=AGN.Lib.Select.get(i).getSelectedValue();t.children(".advertisingOption").remove();if(e){$.ajax({type:"POST",url:AGN.url("/mailing/ajax/"+e+"/isAdvertisingContentType.action")}).done(function(e){if(e&&e.success){t.append(n())}})}}});AGN.Lib.DomInitializer.new("mailing-overview-filters",function(){$("#filtersDescription").html(AGN.Lib.Template.text("mailing-overview-filters",this.config));$("#mailing").after($("#mailings-overviewPreview"))});AGN.Lib.DomInitializer.new("mailing-overview-table",function(e){e.removeClass("hidden")});AGN.Lib.DomInitializer.new("mediapool-image-pick",function(i){var e=i.find("#mediapool-image-pick-options");var n=i.find("#mediapool-browser-results");var r=i.find(".modal-body");var o=i.find("#mpFilterKeywords");var a=i.find("#mpFilterCategory");var s=i.find("#mpSortCriteria");var l=i.find("#mpIsAscendingSortOrder");var u=AGN.Lib.Template.prepare("mediapool-browser-results-template");var c=AGN.Lib.Select.get(a);function d(e){var t=e.data("image-id");if(t>0){var i=f.images.find(function(e){return e.id===t});return i||{id:t}}return null}var f=e.json();var p=null;if(f.images){n.html(u({results:f.images,fullListSize:f.fullListSize}))}if(i.is("[load-filters-on-init]")){g()}if(i.is("[load-images-on-init]")){h()}function h(){r.addClass("ui-modal-loading");$.ajax({type:"POST",url:f.urls.MEDIAPOOL_SEARCH,data:{categoryId:a.val(),keywords:o.val(),sortCriteria:s.val(),isAscendingSortOrder:l.val()}}).done(function(e){var t=e.fullListSize;var i=e.partialList;n.html(u({results:i,fullListSize:t}));f.images=i;p=null}).fail(function(){n.html(u({results:[],fullListSize:0}));f.images=[];p=null}).always(function(){r.removeClass("ui-modal-loading")})}function g(){$.ajax({type:"GET",url:f.urls.FILTERS_JSON}).done(function(e){_.each(e.categories,function(e){c.addFormattedOption('<option value="'+e.id+'" data-id="'+e.id+'" data-parent-id="'+e.parentId+'">'+e.shortname+"</option>")})})}this.addAction({click:"mpSearchImages",enterdown:"mpFilterKeywords"},h);this.addAction({dblclick:"mpSelectImage"},function(){var e=d(this.el);if(e){AGN.Lib.Confirm.get(i).positive(e)}});this.addAction({click:"mpSelectImage"},function(){if(p){p.removeClass("active")}p=this.el;p.addClass("active")});this.addAction({click:"mpAcceptImage"},function(){if(p){var e=d(p);if(e){AGN.Lib.Confirm.get(i).positive(e)}}else{AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}})});AGN.Lib.CoreInitializer.new("menu",function(){AGN.Lib.Menu.init()});(function(){var r={data:{chartsColors:["#26b98a"],statChartData:{columnTitles:[],c3data:{bindto:"#barchart-message-stats",data:{columns:[],type:"bar",labels:true},axis:{x:{tick:{centered:true,fit:true,format:function(e){return r.data.statChartData.columnTitles[e]}}},y:{show:false}},legend:{show:false},tooltip:{format:{title:function(){return null},name:function(e,t,i,n){return r.data.statChartData.columnTitles[n]},value:function(e,t,i,n){return e}}},padding:{right:25,left:25}},build:function(e){this.columnTitles.push(e.shift());e.unshift("values");this.c3data.data.columns=[e];return this.c3data}}},updateChart:function(e){$.ajax({type:"GET",url:e,success:function(e){c3.generate(r.data.statChartData.build(e));AGN.Lib.CoreInitializer.run("equalizer")}})}};AGN.Lib.MessageStatisticsService=r;AGN.Lib.DomInitializer.new("message-stat",function(e){var t=AGN.Lib.Helpers.objFromString(e.data("config"));if(t&&t.url){r.updateChart(t.url)}})})();(function(){AGN.Lib.DomInitializer.new("news-editor-period",function(e){t(e)});function t(e){if(!e){e=$(document)}var i=[];_.each(e.find(".js-datepicker"),function(e){var t=$(e);if(t.hasClass("js-datepicker-period-start")){if(!(t.attr("datepicker-period-id")in i)){i[t.attr("datepicker-period-id")]={startEl:null,endEl:null}}i[t.attr("datepicker-period-id")].startEl=t}if(t.hasClass("js-datepicker-period-end")){if(!(t.attr("datepicker-period-id")in i)){i[t.attr("datepicker-period-id")]={startEl:null,endEl:null}}i[t.attr("datepicker-period-id")].endEl=t}});for(var t=0;t<i.length;t++){n(i[t].startEl.pickadate("picker"),i[t].endEl.pickadate("picker"))}}function n(e,t){var i=e;var n=t;if(i.get("value")){n.set("min",i.get("select"))}if(n.get("value")){i.set("max",n.get("select"))}i.on("set",function(e){if(e.select){n.set("min",i.get("select"))}else if("clear"in e){n.set("min",false)}});n.on("set",function(e){if(e.select){i.set("max",n.get("select"))}else if("clear"in e){i.set("max",false)}})}})();(function(){var a={data:{chartsColors:["#0071b9","#009999","#92d050","#41641a","#ffc000"],browserChartData:{c3data:{bindto:"#notificationGlobalBrowserStat",data:{rows:[],type:"donut"},donut:{label:{show:true}},legend:{position:"right"},tooltip:{show:false}},build:function(e,t){this.c3data.data.rows=[e,t];var i={};for(var n=0;n<e.length;n++){i[e[n]]=a.data.chartsColors[n]}this.c3data.data.colors=i;return this.c3data}}},roundTo:function(e,t){return parseFloat(e).toFixed(t)*1},updateChart:function(e){$.ajax({type:"GET",url:e,success:function(e){if(e&&(e.warning&&e.warning.length>0)){AGN.Lib.JsonMessages(e,true)}else{var t=[];var i=[];var n=0;for(key in e){var r=a.roundTo(e[key]*100,1);t.push(key);i.push(r);n+=r}if(!isNaN(n)&&n>0){for(var o=0;o<i.length;o++){t[o]+=" "+a.roundTo(100*i[o]/n,1)+"%"}}c3.generate(a.data.browserChartData.build(t,i));AGN.Lib.CoreInitializer.run("equalizer")}}})}};AGN.Lib.GLobalNotificationBrowserStatService=a;AGN.Lib.DomInitializer.new("notification-global-browser-stat",function(e){var t=AGN.Lib.Helpers.objFromString(e.data("config"));if(t&&t.url){AGN.Lib.GLobalNotificationBrowserStatService.updateChart(t.url)}})})();(function(){var c={data:{chartColors:["#0071b9","#006600","#b30000"],globalProgressChartData:{columnTitles:[],c3data:{bindto:"#notificationGlobalProgressStat",data:{x:"x",columns:[]},axis:{x:{type:"category",tick:{centered:true,fit:false}}},padding:{right:25}},build:function(e,t,i,n){this.c3data.data.columns=[e,t,i,n];var r={};r[t[0]]=c.data.chartColors[0];r[i[0]]=c.data.chartColors[1];r[n[0]]=c.data.chartColors[2];this.c3data.data.colors=r;return this.c3data}}},updateChart:function(e){var n=["x"];var r=[];var o=[];var a=[];var t=$("#selectMode").val();var i=$("#selectMonth").val();var s=$("#selectYear").val();var l=$("#startDay").val();var u=$("#endDay").val();$.ajax({type:"GET",url:e,data:{dateMode:t,selectMonth:i,selectYear:s,startDay:l,endDay:u},success:function(e){if(e&&e.warning&&e.warning.length>0){AGN.Lib.JsonMessages(e,true)}else{for(objIndex in e){var t=e[objIndex];for(objKey in t){if(objIndex==0&&objKey!="time"){if(r.length==0){r.push(objKey)}else if(o.length==0){o.push(objKey)}else if(a.length==0){a.push(objKey)}}var i=t[objKey];if(objKey=="time"){n.push(i)}else if(objKey==r[0]){r.push(i)}else if(objKey==o[0]){o.push(i)}else if(objKey==a[0]){a.push(i)}}}c3.generate(c.data.globalProgressChartData.build(n,r,o,a));AGN.Lib.CoreInitializer.run("equalizer")}}})}};AGN.Lib.GLobalNotificationProgressStatService=c;AGN.Lib.DomInitializer.new("notification-global-progress-stat",function(e){var t=AGN.Lib.Helpers.objFromString(e.data("config"));if(t&&t.url){AGN.Lib.GLobalNotificationProgressStatService.updateChart(t.url)}})})();(function(){var r={data:{chartsColors:["#0071b9","#92D050","#41641A"],statusChartData:{columnTitles:[],c3data:{bindto:"#notificationGlobalStatusStat",data:{columns:[],type:"bar",labels:true,color:function(e,t){return r.data.chartsColors[t.index]}},axis:{x:{tick:{centered:true,fit:true,format:function(e){return r.data.statusChartData.columnTitles[e]}}},y:{show:false}},legend:{show:false},tooltip:{format:{title:function(){return null},name:function(e,t,i,n){return r.data.statusChartData.columnTitles[n]},value:function(e,t,i,n){return e}}},padding:{right:25,left:25}},build:function(e,t){this.columnTitles=e;var i=t.slice(0);i.unshift("values");this.c3data.data.columns=[i];return this.c3data}}},updateChart:function(e){$.ajax({type:"GET",url:e,success:function(e){if(e&&e.warning&&e.warning.length>0){AGN.Lib.JsonMessages(e,true)}else{var t=[];var i=[];for(key in e){t.push(key);i.push(e[key])}c3.generate(r.data.statusChartData.build(t,i));AGN.Lib.CoreInitializer.run("equalizer")}}})}};AGN.Lib.GLobalNotificationStatusStatService=r;AGN.Lib.DomInitializer.new("notification-global-status-stat",function(e){var t=AGN.Lib.Helpers.objFromString(e.data("config"));if(t&&t.url){AGN.Lib.GLobalNotificationStatusStatService.updateChart(t.url)}})})();AGN.Lib.CoreInitializer.new("push-notification-preview",function(e){if(!e){e=$(document)}_.each(e.find(".push-notification-preview-button"),function(e){function i(e){e.prop("disabled",true);e.parent().attr("data-tooltip",e.parent().attr("data-tooltip-if-disabled"))}var n=$(e);var d=n.data("notification-form");if(Notification.permission=="denied"){i(n)}else{n.on("click",function(){function t(){var e=$("#"+d);var t=e.find("#pushTitle");var i=e.find("#pushContent");var n=e.find("#pushIcon");var r=e.find("#pushLink");var o=t?t.val():"";var a=i?i.val():"";var s=n?n.val():"";var l=r?r.val():"";var u={body:a,icon:s};var c=new Notification(o,u);c.onclick=function(e){e.preventDefault();window.open(l,"_blank")}}if(Notification.permission!="granted"){Notification.requestPermission(function(e){if(e=="granted"){t()}else if(e=="denied"){i(n)}})}else{t()}})}})});(function(){var a={data:{chartsColors:["#0071b9"],statChartData:{columnTitles:[],c3data:{bindto:"#barchart-notification-stats",data:{columns:[],type:"bar",labels:true},axis:{x:{tick:{centered:true,fit:true,format:function(e){return a.data.statChartData.columnTitles[e]}}}},legend:{show:false},tooltip:{format:{title:function(){return null},name:function(e,t,i,n){return a.data.statChartData.columnTitles[n]},value:function(e,t,i,n){return e}}},padding:{right:25}},build:function(e,t){this.columnTitles=e;var i=t.slice(0);i.unshift("values");this.c3data.data.columns=[i];return this.c3data}},progressChartData:{c3data:{bindto:"#progresschart-notification-stats",data:{x:"x",columns:[]},axis:{x:{type:"category",tick:{fit:false}}},zoom:{enabled:true,rescale:true},subchart:{show:true},padding:{right:25}},build:function(e,t,i){this.c3data.data.columns=[e,t,i];return this.c3data}}},updateCharts:function(e,t){$.ajax({type:"GET",url:t,data:{pushID:e},success:function(e){i(e["common"]);n(e["viewsclicks"]);AGN.Lib.CoreInitializer.run("equalizer")}})}};AGN.Lib.NotificationStatService=a;AGN.Lib.DomInitializer.new("notification-stats",function(e){var t=AGN.Lib.Helpers.objFromString(e.data("config"));if(t&&t.pushId&&t.url){AGN.Lib.NotificationStatService.updateCharts(t.pushId,t.url)}});function i(e){var t=[];var i=[];for(var n in e){if(e.hasOwnProperty(n)){t.push(n);i.push(e[n])}}c3.generate(a.data.statChartData.build(t,i))}function n(e){var t=["x"];var i=[];var n=[];for(objIndex in e){var r=e[objIndex];for(var o in r){if(r.hasOwnProperty(o)){if(objIndex==0&&o!="time"){if(i.length==0){i.push(o)}else if(n.length==0){n.push(o)}}if(o=="time"){t.push(r[o])}else if(i[0]==o){i.push(r[o])}else if(n[0]==o){n.push(r[o])}}}}c3.generate(a.data.progressChartData.build(t,i,n))}})();AGN.Lib.CoreInitializer.new("polling-form",function(e){if(!e){e=$(document)}e.find('[data-form="polling"]').each(function(){AGN.Lib.Form.get($(this)).submit()})});AGN.Lib.CoreInitializer.new("popover-validate",function(){AGN.Lib.Popover.validate()});(function(){AGN.Lib.CoreInitializer.new("target-group-query-builder-extend",function(){if(window.queryBuilderIsExtended){return}window.queryBuilderIsExtended=true;var c=2;var l={};function o(e,t){if(Math.sign(e)===-1){t.push("sub")}else{t.push("add")}}function d(e,t,i){if(i){if(i==="sub"){t="-"+Math.abs(t)}else{t="+"+Math.abs(t)}}e.$el.find("#date-filter").val(t)}var e=$.fn.queryBuilder;var r=e.constructor;var i=r.prototype.init;var a=r.prototype.validate;var s=r.prototype.bindEvents;l=r.utils;var u=r.selectors;Object.assign(u,{rule_include_empty:".rule-include-empty[name*=_include_empty]",rule_operator_conditions_container:".rule-operator-conditions-container",rule_header_inputs:".rule-header :input"});l.defineModelProperties(r.Rule,["includeEmpty"]);e.extend({init:function(e){this.on("afterCreateRuleInput",function(e,t){var i=e.builder.optionsByType[t.filter.type];if(i){var n=i.postCreate;if(n&&typeof n==="function"){n.call(e.builder,t,i)}}});this.on("afterUpdateRuleOperator",function(e,t){var i=e.builder.optionsByType[t.filter.type];if(i){var n=i.postOperatorUpdate;if(n&&typeof n==="function"){n.call(e.builder,t,i)}}});this.setupInitialRule(e);return i.call(this,e)},isEmptyOrInitial:function(e){if(!e||!e.rules||!e.rules.length){return true}if(e.rules.length===1&&(e.rules[0].initialRule||e.rules[0].empty)){return true}return false},setupInitialRule:function(e){if(this.isEmptyOrInitial(e)){this.initialRule=true;e.rules=[{initialRule:true,empty:true}]}else{this.initialRule=false}},optionsByType:{date:{availableFormats:function(e){if(e&&e.type&&(e.type=="before"||e.type=="after")){return["YYYYMMDD"]}return["DD.MM.YYYY","YYYYMMDD","DDMMYYYY","MMDD","DDMM","DD","MM","YYYY"]},input:function(e,i){return $('<div class="qb-input-label">'+'<label class="checkbox-inline">'+'<input name="today" type="checkbox">'+'<span class="text">'+t("defaults.today")+"</span>"+"</label>"+"</div>"+'<div class="qb-input-element date-filter">'+'<input class="form-control" type="text" id="date-filter"/>'+"</div>"+'<div class="qb-input-label" id="date-offset-label" style="display: none;">'+'<div class="form-badge qb-input-inner">'+t("defaults.days")+"</div>"+"</div>"+'<div class="qb-input-label">'+'<div class="qb-input-inner">'+t("date.formats.label")+"</div>"+"</div>"+'<div class="qb-input-element">'+'<select class="form-control" id="date-format">'+n(i.availableFormats(i.operator))+"</select>"+"</div>"+'<div class="qb-input-label">'+'<div class="qb-input-inner">'+'<button type="button" class="icon icon-help" data-help="help_'+this.settings.helpLanguage+'/targets/DateFormat.xml"></button>'+"</div>"+"</div>")},postCreate:function(t){var i=t.$el.find("input[name=today]");var n=t.$el.find("#date-offset-label");var r=t.$el.find("#date-filter");var o=t.$el.find("#date-format");var e=function(){var e=i.prop("checked");n.toggle(e);r.off("change.offset keyup.offset");if(!t._updating_input){t._updating_value=true;if(e){r.val("+0")}else{r.val(f(new Date,o.val()))}t._updating_value=false}if(e){r.on("change.offset keyup.offset",function(e){var t=r.val();if(t){var i=parseInt(t);if(!isNaN(i)){var n=(i<0?"":"+")+i;if(n!=t){r.val(n)}}}else if(e.type==="change"){r.val("+0")}})}};i.on("change",e)},postOperatorUpdate:function(e,t){var i=e.$el.find("#date-format");i.html(n(t.availableFormats(e.operator)));i.change();i.trigger("change-date-format")},valueSetter:function(e,t){var i=t.slice(0);var n=e.$el.find("input[name=today]");var r=e.$el.find("#date-offset-label");var o=e.$el.find("#date-format");var a=false,s,l,u;if(t.length>c){if(i.shift()==="today"){a=true}u=i.shift();s=i.shift();l=i.shift()}else{u=i.shift();if(u==="today"){a=true;u="+0"}l=i.shift()}r.toggle(a);d(e,u,s);o.val(l);n.prop("checked",a).change()},valueGetter:function(e){var t=[],i=e.$el.find("#date-filter").val(),n=e.$el.find("#date-format").val(),r=e.$el.find("input[name=today]").is(":checked");if(r){t.push("today");t.push(i);o(i,t)}else{t.push(i)}t.push(n);return t},validate:function(e){if(e.length==2){var t=e[0];var i=e[1];if(t){if("today"!=t&&i){return p(t,i.toUpperCase())?true:["invalid_format"]}else{return true}}else{return["empty_date"]}}else if(e.length==4){var n=e[1];if(!n||n!=parseInt(n)){return["invalid_expression"]}}return true}}},clearInitialRuleSettings:function(){var e=this;e.initialRule=false;$(".initial-rule").removeClass("initial-rule")},isInitial:function(e){if(e.length===1&&e[0].$el.hasClass("initial-rule")){return true}if(this.initialRule&&e.length===1){e[0].$el.addClass("initial-rule");return true}return false},validate:function(e){var t=this;var i=t.model.root.rules;var n=_.clone(e);n=$.extend({skip_filter_validation:true,skip_empty:false},n);if(n.skip_filter_validation){n.skip_empty=true}if(this.isInitial(i)){t.clearErrors();return true}t.clearInitialRuleSettings();return a.call(this,n)},getRuleInput:function(e,t){var i=e.filter;var n=e.filter.validation||{};var r=e.id+"_value_"+t;var o=i.vertical?" class=block":"";var a="";if(typeof i.input==="function"){a=i.input.call(this,e,r)}else if(typeof e.operator.input==="function"){a=e.operator.input.call(this,e,r)}else if(this.optionsByType[e.filter.type]&&typeof this.optionsByType[e.filter.type].input==="function"){a=this.optionsByType[e.filter.type].input.call(this,e,this.optionsByType[e.filter.type],r)}else{switch(i.input){case"radio":case"checkbox":l.iterateOptions(i.values,function(e,t){a+="<label"+o+'><input type="'+i.input+'" name="'+r+'" value="'+e+'"> '+t+"</label> "});break;case"select":a=this.getRuleValueSelect(r,e);break;case"textarea":a+='<textarea class="form-control" name="'+r+'"';if(i.size)a+=' cols="'+i.size+'"';if(i.rows)a+=' rows="'+i.rows+'"';if(n.min!==undefined)a+=' minlength="'+n.min+'"';if(n.max!==undefined)a+=' maxlength="'+n.max+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';a+="></textarea>";break;case"number":a+='<input class="form-control" type="number" name="'+r+'"';if(n.step!==undefined)a+=' step="'+n.step+'"';if(n.min!==undefined)a+=' min="'+n.min+'"';if(n.max!==undefined)a+=' max="'+n.max+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';if(i.size)a+=' size="'+i.size+'"';a+=">";break;default:a+='<input class="form-control" type="text" name="'+r+'"';if(i.placeholder)a+=' placeholder="'+i.placeholder+'"';if(i.type==="string"&&n.min!==undefined)a+=' minlength="'+n.min+'"';if(i.type==="string"&&n.max!==undefined)a+=' maxlength="'+n.max+'"';if(i.size)a+=' size="'+i.size+'"';a+=">"}}return this.change("getRuleInput",a,e,r)},getRuleValueSelect:function(e,t){var i=this.templates.ruleValueSelect({builder:this,name:e,rule:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)});return this.change("getRuleValueSelect",i,e,t)},updateRuleOperator:function(e,t){var i=e.$el.find(u.value_container);if(!e.operator||e.operator.nb_inputs===0){i.hide();e.__.value=undefined}else{i.css("display","");if(i.is(":empty")||!t||typeof t.input==="function"||typeof e.operator.input==="function"||e.operator.nb_inputs!==t.nb_inputs||e.operator.optgroup!==t.optgroup){this.createRuleInput(e)}}if(e.operator){e.$el.find(u.rule_operator).val(e.operator.type);e.__.value=this.getRuleInputValue(e);this.createExtendedOperatorConditions(e)}this.trigger("afterUpdateRuleOperator",e,t);this.trigger("rulesChanged")},createExtendedOperatorConditions:function(e){var i=this;var n=e.$el.find(u.rule_operator_conditions_container);if(e.operator.type==="not_equal"){e.includeEmpty=true;var r=$('<div class="qb-input-label">'+'<label class="checkbox-inline">'+'<input type="checkbox" class="rule-include-empty" name="'+e.id+'_include_empty" checked="checked"/>'+'<span class="text">'+t("querybuilder.common.include_empty")+"</span>"+"</label>"+"</div>");n.html(r);var o=r.find(u.rule_include_empty);o.on("change",function(){e.includeEmpty=i.getRuleIncludeEmptyValue(e)});e.$el.find(u.rule_header_inputs).prop("disabled",e.flags.header_readonly)}else{e.includeEmpty=false;n.html("")}},createRuleOperators:function(e){var t=e.$el.find(u.operator_container).empty();if(!e.filter){return}var i=this.getOperators(e.filter);if(!e.filter.skipOperator){var n=$(this.getRuleOperatorSelect(e,i));t.html(n)}if(e.filter.default_operator){e.__.operator=this.getOperatorByType(e.filter.default_operator)}else{e.__.operator=i[0]}e.$el.find(u.rule_operator).val(e.operator.type);this.trigger("afterCreateRuleOperators",e,i);this.applyRuleFlags(e)},createRuleInput:function(e){var t=e.$el.find(u.value_container).empty();e.__.value=undefined;if(!e.filter||!e.operator||e.operator.nb_inputs===0){return}var i=this;var n=$();var r=e.filter;for(var o=0;o<e.operator.nb_inputs;o++){var a=$(this.getRuleInput(e,o));if(r.canBeNegated){var s=i.getNegateInput();t.prepend(s);n=n.add(s)}if(o>0)t.append(this.settings.inputs_separator);t.append(a);if(typeof r.values==="function"){r.values.call(this,a)}n=n.add(a)}t.css("display","");n.on("change "+(r.input_event||""),function(){if(!e._updating_input){e._updating_value=true;e.negated=i.getNegateValue(e);e.value=i.getRuleInputValue(e);e._updating_value=false}});if(r.plugin){n[r.plugin](r.plugin_config||{})}this.trigger("afterCreateRuleInput",e);if(r.default_value!==undefined){e.value=r.default_value}else{e._updating_value=true;e.negated=i.getNegateValue(e);e.value=i.getRuleInputValue(e);e._updating_value=false}this.applyRuleFlags(e)},setRuleInputValue:function(e,t){var i=e.filter;var n=e.operator;if(!i||!n){return}e._updating_input=true;if(i.valueSetter){i.valueSetter.call(this,e,t)}else if(typeof e.operator.valueSetter==="function"){e.operator.valueSetter.call(this,e,t)}else if(this.optionsByType[e.filter.type]&&typeof this.optionsByType[e.filter.type].valueSetter==="function"){this.optionsByType[e.filter.type].valueSetter.call(this,e,t)}else{var r=e.$el.find(u.value_container);if(n.nb_inputs===1){t=[t]}for(var o=0;o<n.nb_inputs;o++){var a=l.escapeElementId(e.id+"_value_"+o);switch(i.input){case"radio":r.find("[name="+a+'][value="'+t[o]+'"]').prop("checked",true).trigger("change");break;case"checkbox":if(!$.isArray(t[o])){t[o]=[t[o]]}t[o].forEach(function(e){r.find("[name="+a+'][value="'+e+'"]').prop("checked",true).trigger("change")});break;default:if(n.multiple&&i.value_separator&&$.isArray(t[o])){t[o]=t[o].join(i.value_separator)}r.find("[name="+a+"]").val(t[o]).trigger("change");break}}}this.setNegated(e);e._updating_input=false},getRuleInputValue:function(e){var t=e.filter;var i=e.operator;var n=[];if(t.valueGetter){n=t.valueGetter.call(this,e)}else if(typeof e.operator.valueGetter==="function"){n=e.operator.valueGetter.call(this,e)}else if(this.optionsByType[e.filter.type]&&typeof this.optionsByType[e.filter.type].valueGetter==="function"){n=this.optionsByType[e.filter.type].valueGetter.call(this,e)}else{var r=e.$el.find(u.value_container);for(var o=0;o<i.nb_inputs;o++){var a=l.escapeElementId(e.id+"_value_"+o);var s;switch(t.input){case"radio":n.push(r.find("[name="+a+"]:checked").val());break;case"checkbox":s=[];r.find("[name="+a+"]:checked").each(function(){s.push($(this).val())});n.push(s);break;case"select":if(t.multiple){s=[];r.find("[name="+a+"] option:selected").each(function(){s.push($(this).val())});n.push(s)}else{n.push(r.find("[name="+a+"] option:selected").val())}break;default:n.push(r.find("[name="+a+"]").val())}}n=n.map(function(e){if(i.multiple&&t.value_separator&&typeof e=="string"){e=e.split(t.value_separator)}if($.isArray(e)){return e.map(function(e){return l.changeType(e,t.type)})}else{return l.changeType(e,t.type)}});if(i.nb_inputs===1){n=n[0]}if(t.valueParser){n=t.valueParser.call(this,e,n)}}return this.change("getRuleValue",n,e)},getRuleIncludeEmptyValue:function(e){return e.$el.find(u.rule_include_empty).is(":checked")},validateValue:function(e,t){var i=e.filter.validation||{};var n=true;if(i.callback){n=i.callback.call(this,t,e)}else if(typeof e.operator.validate==="function"){n=e.operator.validate.call(this,t,e)}else if(this.optionsByType[e.filter.type]&&typeof this.optionsByType[e.filter.type].validate==="function"){n=this.optionsByType[e.filter.type].validate.call(this,t,e)}else{n=this._validateValue(e,t)}return this.change("validateValue",n,t,e)},getRules:function(o){o=$.extend({get_flags:false,allow_invalid:false,skip_empty:false},o);var e=this.validate(o);if(!e&&!o.allow_invalid){return null}var a=this;var t=function i(e){var r={condition:e.condition,rules:[]};if(e.data){r.data=$.extendext(true,"replace",{},e.data)}if(o.get_flags){var t=a.getGroupFlags(e.flags,o.get_flags==="all");if(!$.isEmptyObject(t)){r.flags=t}}e.each(function(e){if(!e.filter&&o.skip_empty){return}var t=null;if(!e.operator||e.operator.nb_inputs!==0){t=e.value}var i={id:e.filter?e.filter.id:null,field:e.filter?e.filter.field:null,type:e.filter?e.filter.type:null,input:e.filter?e.filter.input:null,operator:e.operator?e.operator.type:null,value:t,includeEmpty:e.includeEmpty};if(e.filter&&e.filter.data||e.data){i.data=$.extendext(true,"replace",{},e.filter.data,e.data)}if(e.filter&&e.filter.canBeNegated){i.negated=e.negated}if(o.get_flags){var n=a.getRuleFlags(e.flags,o.get_flags==="all");if(!$.isEmptyObject(n)){i.flags=n}}r.rules.push(a.change("ruleToJson",i,e))},function(e){var t=i(e);if(t.rules.length!==0||!o.skip_empty){r.rules.push(t)}},this);return a.change("groupToJson",r,e)}(this.model.root);t.valid=e;return this.change("getRules",t)},setRules:function(e,r){r=$.extend({allow_invalid:false},r);this.setupInitialRule(e);if($.isArray(e)){e={condition:this.settings.default_condition,rules:e}}if(!e||!e.rules||e.rules.length===0&&!this.settings.allow_empty){l.error("RulesParse","Incorrect data object passed")}this.clear();this.setRoot(false,e.data,this.parseGroupFlags(e));this.applyGroupFlags(this.model.root);e=this.change("setRules",e,r);var o=this;(function i(e,n){if(n===null){return}if(e.condition===undefined){e.condition=o.settings.default_condition}else if(o.settings.conditions.indexOf(e.condition)==-1){l.error(!r.allow_invalid,"UndefinedCondition",'Invalid condition "{0}"',e.condition);e.condition=o.settings.default_condition}n.condition=e.condition;e.rules.forEach(function(e){var t;if(e.rules!==undefined){if(o.settings.allow_groups!==-1&&o.settings.allow_groups<n.level){l.error(!r.allow_invalid,"RulesParse","No more than {0} groups are allowed",o.settings.allow_groups);o.reset()}else{t=o.addGroup(n,false,e.data,o.parseGroupFlags(e));if(t===null){return}o.applyGroupFlags(t);i(e,t)}}else{if(!e.empty){if(e.id===undefined){l.error(!r.allow_invalid,"RulesParse","Missing rule field id");e.empty=true}if(e.operator===undefined){e.operator="equal"}}t=o.addRule(n,e.data,o.parseRuleFlags(e));if(t===null){return}if(e.id){if(!e.empty){t.filter=o.getFilterById(e.id,!r.allow_invalid)}if(t.filter){t.operator=o.getOperatorByType(e.operator,!r.allow_invalid);if(!t.operator){t.operator=o.getOperators(t.filter)[0]}}t.negated=e.negated;if(t.operator&&t.operator.nb_inputs!==0){t.includeEmpty=!!e.includeEmpty;if(e.value!==undefined){t.value=e.value}else if(t.filter.default_value!==undefined){t.value=t.filter.default_value}}}if(o.change("jsonToRule",t,e)!=t){l.error("RulesParse","Plugin tried to change rule reference")}}});if(o.change("jsonToGroup",n,e)!=n){l.error("RulesParse","Plugin tried to change group reference")}})(e,this.model.root);this.validate();this.trigger("afterSetRules")},getNegateValue:function(e){var t=e.$el.find("select.negate"),i;if(t.length!==0){i=t.val()==="true"}return i},getNegateInput:function(){var e='<div class="qb-input-negate">'+'<select class="form-control negate">'+'<option value="false">'+t("defaults.yes")+"</option>"+'<option value="true">'+t("defaults.no")+"</option>"+"</select>"+"</div>";return $(e)},setNegated:function(e){var t=e.$el.find("select.negate");if(t.length!==0){t.val(""+e.negated)}},displayError:function(e){if(this.settings.display_errors){if(e.error===null){e.$el.removeClass("has-error")}else{var t=this.translate("errors",e.error[0]);t=this.constructor.utils.fmt(t,e.error.slice(1));t=this.change("displayError",t,e.error,e);e.$el.addClass("has-error").find(this.constructor.selectors.error_container).eq(0).attr("data-tooltip",t);AGN.Lib.CoreInitializer.run("tooltip",e.$el)}}},bindEvents:function(){s.call(this);var n=this;this.model.on("update",function(e,t,i){if(t instanceof r.Rule&&i==="includeEmpty"){n.updateRuleIncludeEmpty(t)}})},findRuleByField:function(e,t,i){var n=function(e){return e.hasOwnProperty("rules")};if(n(e)){var r=this;return e.rules.find(function(e){if(n(e)){return i?r.findRuleByField(e,i):false}else{return e.field&&e.field===t}})}else{return e.field&&e.field===t}},deleteRuleByField:function(e,t,i){var n=this;if(!e){e=n.model.root;if(!e){return}}var r=false;e.each("reverse",function(e){if(e&&e.filter&&e.filter.id==t){r&=n.deleteRule(n.getModel(e.$el))}},function(e){r&=n.deleteRuleByField(e,t,i)},n);return!!r},setOrReplaceRule:function(e,t,i){if(!e){e=this.getRules({allow_invalid:true,skip_empty:true})}if(t&&t.id){var n=this.findRuleByField(e,t.id,i);if(n){$.extend(n,t)}else{e.rules.push(t)}this.setRules(e);return true}else{return false}},containsNotEmptyRule:function(e){var t=this;var i=t.getModel(e);if(i.rules&&i.rules.length){return i.rules.every(function(e){if(e.hasOwnProperty("rules")){return t.containsNotEmptyRule(e)}else{return!!e.filter}})}else{return!!i.filter}}});r.prototype.updateRuleIncludeEmpty=function(e){var t=e.$el.find(u.rule_include_empty);t.prop("checked",e.includeEmpty);this.trigger("rulesChanged")}});function n(e){var n=[];e.forEach(function(e){var i=$("<option />");i.text(t("date.formats."+e));i.val(e);n.push($("<div/>").append(i).html())});return n.join("")}function f(e,t){return t.replace("DD",AGN.Lib.Helpers.pad(e.getDate(),2)).replace("MM",AGN.Lib.Helpers.pad(e.getMonth()+1,2)).replace("YYYY",AGN.Lib.Helpers.pad(e.getFullYear(),4))}function p(e,t){if(!e){return false}var i=a(t);if(i){for(var n=0;n<i.length;n++){var r=i[n];if(r.isDigitFragment){if(r.isLenient){var o=e.match("^\\d{1,"+r.lexeme.length+"}");if(o){e=e.substring(o[0].length)}else{return false}}else{if(e.length<r.lexeme.length){return false}if(!e.substr(0,r.lexeme.length).match(/^\d+$/)){return false}e=e.substring(r.lexeme.length)}}else{if(e.startsWith(r.lexeme)){e=e.substring(r.lexeme.length)}else{return false}}}return!e}return false}function s(e){var t=["DD","MM","YYYY",".","-","_"];if(e){for(var i=0;i<t.length;i++){if(e.startsWith(t[i])){return t[i]}}}return false}function a(e){var t=["DD","MM","YYYY"];var i=[];while(e){var n=s(e);if(n){var r=false;var o=false;if(t.includes(n)){r=true;o=true;if(i.length){var a=i[i.length-1];if(a.isDigitFragment){a.isLenient=false;o=false}}}i.push({lexeme:n,isDigitFragment:r,isLenient:o})}else{return false}e=e.substring(n.length)}return i.length?i:false}})();(function(){var o="---";var a=.01;var s="< 1";var i=.001;var n={HIGH_PERFORMER:"#008F00",OPPORTUNITY:"#92D050",LEAD:"#CCCDCD",SLEEPER:"#F43536"};var r=500;var l=150;var u="poor-dog";var c="question-mark";var d="rising-star";var f="cash-cow";AGN.Lib.DomInitializer.new("recipient-insights",function(){var r=this.config;var e=this.config.insightsData;$.i18n.load(r.translations);h(e.weekdayReactionRankData);g(e.hourReactionRankData);y(e.mailingsRevenueRatingData,r.mailingUriPattern,r.localeLanguage);b(e.reactionsInProgressData);_(e.reactionDeviceRankData);C(e.mailingReactionPercentageData);A(e.customerRevenueData);E(e.customerPerformanceData);x(e.pageImpressionsData);this.addAction({change:"selectReactionProgressPeriodType"},function(){$("#reactionProgressPeriodDates").toggleClass("hidden","CUSTOM"!==this.el.val())});this.addAction({click:"selectReactionProgressPeriod"},function(){var e=$('input[name="reactionProgressPeriod"]:checked');var i,n;switch(e.val()){case"YEAR":case"MONTH":i=e.data("min");n=e.data("max");break;case"CUSTOM":i=$("#reactionProgressMinDate").val();n=$("#reactionProgressMaxDate").val();break;default:console.error("Unexpected period type: `"+e.val()+"`");return}if(i&&n){$.ajax(r.urls.reactionsInProgress,{type:"GET",data:{customerId:r.customerId,min:i,max:n}}).done(function(e){b(e)})}else{AGN.Lib.Messages(t("defaults.error"),t("defaults.error"),"alert")}})});function p(i){var n=["data1"];var r=[];var o=0;$.each(i.values,function(e,t){if(t>o){o=t}n.push(t);r.push(i.percentages[e])});return{values:n,percentages:r,maxValue:o}}function m(e,i){$(e.axes.x[0]).find(".tick text").attr("y",function(e,t){return parseInt(t||0)+i})}function h(n){n=p(n);var e=t("recipient.reaction.day");var i=t("date.weekdaysShort");c3.generate({bindto:"#reaction-weekday-chart",onrendered:function(){m(this,10)},size:{height:200},data:{type:"bar",columns:[n.values],labels:{format:{data1:function(e,t,i){return n.percentages[i]+"%"}}},color:function(e,t){return t.value===n.maxValue?"#0071b9":"#eaeaea"}},bar:{width:{ratio:.88}},legend:{show:false},tooltip:{format:{name:function(){return e}}},axis:{x:{type:"category",categories:i,tick:{outer:false}},y:{show:false,padding:{top:20,bottom:20}}}})}function g(n){n=p(n);var e=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24];c3.generate({bindto:"#reaction-hour-chart",onrendered:function(){m(this,10)},size:{height:200},data:{type:"bar",columns:[n.values],labels:{format:{data1:function(e,t,i){return n.percentages[i]+"%"}}},color:function(e,t){return t.value===n.maxValue?"#0071b9":"#eaeaea"},onmouseover:function(t){this.internal.mainText.style("visibility",function(e){return t.index===e.index?"visible":"hidden"})},onmouseout:function(t){this.internal.mainText.filter(function(e){return t.index===e.index}).style("visibility","hidden")}},bar:{width:{ratio:.7}},legend:{show:false},tooltip:{show:false},axis:{x:{type:"category",categories:e,tick:{multiline:false,centered:true,outer:false}},y:{show:false,padding:{top:20,bottom:20}}}})}function v(e){var t;if(e==="de"){var i=d3.locale({decimal:",",thousands:".",grouping:[3],currency:[""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});t=i.numberFormat}else{t=d3.format}return function(e){return[{text:e.date,classes:"l-revenue-date"},{text:t(",.2f")(e.revenue),classes:"l-revenue-value"},{text:e.name,mailingId:e.mailingId,classes:"l-revenue-name"}]}}function y(e,i,n){var r=[{title:t("mailing.senddate"),criterion:"timestamp",sorting:false},{title:t("statistic.revenue"),criterion:"revenue",sorting:false},{title:t("Mailing"),criterion:"name",sorting:false}];var o=v(n);var a=function(e){if(e.sorting==="asc"){return"icon icon-arrow-down"}else if(e.sorting==="desc"){return"icon icon-arrow-up"}return"hidden"};var s=$.noop;var l=d3.select("#mailings-revenue-rating-table").append("table");var u=l.append("thead").append("tr").selectAll("th").data(r).enter().append("th");u.append("span").on("click",function(e){s(e)}).attr("class","clickable unselectable").html(function(e){return e.title+"&nbsp;"});var c=u.append("i").attr("class",a);if(e.length){var d=l.append("tbody").selectAll("tr").data(e).enter().append("tr");var f=d.selectAll("td").data(o).enter().append("td").attr("class",function(e){return e.classes});f.filter(function(e){return!e.mailingId}).text(function(e){return e.text});f.filter(function(e){return e.mailingId>0}).append("a").attr("href",function(e){return i.replace(":mailing-id:",e.mailingId)}).attr("title",function(e){return e.text}).text(function(e){return e.text});s=function(i){c.attr("class",function(e){if(e===i){e.sorting=e.sorting==="asc"?"desc":"asc"}else{e.sorting=false}return a(e)});var n=i.sorting==="desc"?d3.descending:d3.ascending;d.sort(function(e,t){return n(e[i.criterion],t[i.criterion])})}}else{d=l.append("tbody").append("tr").append("td").attr("colspan",3).attr("class","l-revenue-unavailable").text(t("recipient.chart.not_available"))}}function b(n){var e=t("statistic.reactions");var i=t("statistic.impressions");var r=t("statistic.revenue");var o={};o[e]="#99c6e3";o[i]="#f43536";o[r]="#0071b9";var a=[];var s=[e];var l=[i];var u=[r];var c=false;var d=false;$.each(n.values,function(e,t){a.push(e);s.push(t.reactions);l.push(t.impressions);u.push(t.revenues);if(t.impressions>0){c=true}if(t.revenues>0){d=true}});var f=[s];var p={reactions:"area"};if(c){f.push(l);p.impressions="area"}if(d){f.push(u);p.revenues="bar"}var h=n.mailingNames;var g=a.length;var v=3;if(g<60){v=5}else if(g<100){v=4}c3.generate({bindto:"#reaction-progress-chart",onrendered:function(){m(this,10)},size:{height:200},data:{columns:f,types:p,color:function(e,t){return o[t.id?t.id:t]||e}},tooltip:{format:{title:function(e){var t=a[e];var i=n.values[t].mailingIds;if(i.length){return h[i[0]]}else{return t}}}},bar:{width:10},point:{r:v},axis:{x:{type:"category",categories:a,height:40,tick:{multiline:false,centered:true,outer:false,culling:true}},y:{show:false}}})}function _(e){var r=["#0071B9","#009BFF","#64C3FF","#00558A","#92D050"];var o=[];var a={};var s={};var l={};$.each(e,function(e,i){var n="data"+e;o.push([n,i.value]);a[n]=t(i.deviceClass);s[n]=i.percentage;l[n]=r[e]});c3.generate({bindto:"#reaction-device-chart",size:{height:200},data:{columns:o,type:"donut",names:a,color:function(e,t){return l[t.id?t.id:t]||e}},donut:{label:{format:function(e,t,i){return s[i]+"%"}}},legend:{position:"right"},tooltip:{format:{value:function(e,t,i){return e+" ("+s[i]+"%)"}}}})}function w(e,t){var i=$(e);var n=i.find(".l-kpi-value");var r=i.find(".l-kpi-sign");if(t>0){if(t<a){n.text(s)}else{n.text(d3.round(t,2))}}else{n.text(o)}r.toggle(t>0)}function C(e){w("#reactionTypeKpi",e.percentage.percentage);$("#reactionGradeIcon").css("color",T(e.grade))}function A(e){w("#revenueSumKpi",e.value);w("#revenueAvgKpi",e.average);$("#revenueIcon").addClass(S(e.value))}function E(e){if(e.clicks.percentage>0){w("#performanceClicksKpi",e.clicks.percentage)}else{w("#performanceClicksKpi",e.clicks.value>0?i:0)}w("#performanceRevenueKpi",e.revenue)}function x(e){w("#impressionsByClickKpi",e.perClick);w("#impressionsByVisitKpi",e.perVisit);w("#impressionsByBuyKpi",e.perBuy)}function T(e){return n[e]||"inherit"}function S(e){if(e>=r){return f}else{if(e>=l){return d}else{if(e>0){return c}else{return u}}}}})();(function(){AGN.Lib.DomInitializer.new("recipient-report-initializer",function(e){t(e)});function t(e){if(!$("body").hasClass("dark-theme")){return}var t=e.find("iframe");t.on("load.iframe",function(){i(t)});t.ready(function(){i(t)})}function i(e){var t=e.contents().find("body");var i=t.find("center");if(i.length){t.css("background","#303030");i.css("background","#303030")}else{e.contents().find("body").css("color","#ffffff")}}})();AGN.Lib.CoreInitializer.new("relative-href",function(e){if(!e){e=$(document)}e.find("a[data-relative]").each(function(){var e=$(this);e.attr("href",AGN.url(e.attr("href")));e.removeAttr("data-relative")})});(function(){AGN.Lib.CoreInitializer.new("scrollable",function(e){if(!e){e=$(document)}_.each(e.find(".js-scrollable"),function(e){var t=$(e);t.perfectScrollbar("destroy");t.perfectScrollbar({wheelSpeed:5,scrollXMarginOffset:1})})})})();(function(){var u=AGN.Lib.Popover,c=AGN.Lib.Template,d=AGN.Lib.Page;AGN.Lib.CoreInitializer.new("select",["template"],function(e){if(!e){e=$(document)}_.each(e.all("select"),function(e){var n=$(e);var t=n.data("result-template");if(n.data("select2")){n.select2("destroy")}var i={placeholder:n.attr("placeholder"),minimumResultsForSearch:10};if(!n.hasClass("js-select")&&!n.hasClass("js-select-tags")){i.minimumResultsForSearch=-1}if(n.hasClass("js-select-tags")){i.inlineTags=true}if(n.is("[data-sort]")){if(n.data("sort")==="alphabetic"){i.sortResults=function(e,t,i){return e.sort(function(e,t){if($(e.element).is("[data-fix-position]")){return-1}else if($(t.element).is("[data-fix-position]")){return 1}return e.text.toLowerCase().localeCompare(t.text.toLowerCase())})}}}if(n.prop("multiple")){var r=n.data("selection-template");i.minimumResultsForSearch=1;if(r){var o=c.prepare(r);i.formatSelection=function(e){return o({element:e.element[0],isLocked:e.locked,isDisabled:e.disabled,text:e.text,value:e.id})}}else{i.formatSelection=function(e){if(e.element&&e.element.length===1){var t=$(e.element).data("url");if(t){return $("<a></a>",{href:t,text:e.text,click:function(){d.reload(t)}})}}return e.text}}}if(t){var a=c.prepare(t);i.formatResult=function(e){return a({element:e.element[0],isLocked:e.locked,isDisabled:e.disabled,text:e.text,value:e.id})}}else if(n.hasClass("js-option-popovers")){i.formatResult=function(e,t,i,n){var r='<span style="white-space: nowrap;">'+n(e.text)+"</span>";u.new(t,{trigger:"hover",delay:{show:300,hide:100},html:true,template:'<div class="popover popover-wide" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',content:r});return r};n.on("select2-close",function(){u.validate()})}var s=i.formatSelection;i.formatSelection=function(e){var t=e.text;if(t){e.text=t.trim()}if(s instanceof Function){return s.apply(this,arguments)}return $.fn.select2.defaults.formatSelection.apply(this,arguments)};n.select2(i);var l=n.find("option[data-exclusive]");if(l.length>0){n.on("select2-selecting",function(e){var t=n.find("option[value='"+e.val+"'][data-exclusive]").length>0;if(t){var i=false;n.find("option:selected:not([data-exclusive])").each(function(){i=true;$(this).removeAttr("selected")});if(i){n.trigger("change")}}else{i=false;n.find("option:selected[data-exclusive]").each(function(){i=true;$(this).removeAttr("selected")});if(i){n.trigger("change")}}})}})})})();AGN.Lib.DomInitializer.new("session-timer",function(){var i=10*60*1e3;var n=5*1e3;var r=401;var o=501;var e=this.config;var t=this.config.sessionInfoUrl;var a=this.config.creationTime;var s=this.config.lastAccessedTime;var l=this.config.maxInactiveInterval;var u;var c=false;var d=true;var f=false;var p;if(e&&a&&s&&l){u=l*1e3+Date.now();h()}function h(){setInterval(function(){var e=Date.now();var t=u>e?u-e:0;if(!p){p=new _}if((!d||t<=i)&&!c&&!f){p.showTimerBlock(t)}if(!f&&!c&&u+n>e&&u<e){p.showLoading()}if(!c&&!f&&u+n<e){g()}},1e3)}function g(){$.ajax({url:t,global:false,beforeSend:v,success:m,error:y,complete:b})}function v(){f=true}function m(e){if(!!e){l=e.maxInactiveInterval;u=Date.now()+e.maxInactiveInterval*1e3;c=false}else{c=true;p.showSessionExpired()}}function y(e){if(e.status===r){c=true;p.showSessionExpired()}}function b(){f=false;d=false}$(document).ajaxComplete(function(e,t){if(!e.preventSessionTimer&&!c&&!f&&(t.status!==r&&t.status<o)){u=l*1e3+Date.now()}e.preventSessionTimer=true});var _=function(){var e=this;e.timerLayout=$("#session-time-layout");e.timeField=$("#session-time-field");e.isSessionExpiredNotification=false;e.refreshIconClass="icon icon-refresh icon-spin"};_.prototype.showTimerBlock=function(e){var t=this;t.timerLayout.show();t.printTimerText(e)};_.prototype.showSessionExpired=function(){var e=this;e.printTimerText(0);if(!e.isSessionExpiredNotification){$("body").append(AGN.Lib.Template.text("session-expired"));e.isSessionExpiredNotification=true}};_.prototype.showLoading=function(){var e=this;var t='<i class="'+e.refreshIconClass+'"></i>';e.changeTimeFieldContent(t)};_.prototype.printTimerText=function(e){var t=this;var i="00:00";if(e>0){var n=new Date(e);i=n.getMinutes()>0?d3.format("02")(n.getUTCMinutes())+":":"00:";i+=n.getSeconds()>0?d3.format("02")(n.getUTCSeconds()):"00"}t.changeTimeFieldContent(i)};_.prototype.changeTimeFieldContent=function(e){this.timeField.html(e)};return false});AGN.Lib.CoreInitializer.new("sizing",function(e){if(!e){e=$(document)}var c=$(window).height();_.each(e.find('[data-sizing="container"]'),function(e){var t=$(e),i=t.find('[data-sizing="top"]'),n=t.find('[data-sizing="bottom"]'),r=t.find('[data-sizing="scroll"]'),o,a,s,l,u;o=t.offset().top;a=_.reduce(_.map(i,function(e){return $(e).outerHeight()}),function(e,t){return e+t})||0;s=_.reduce(_.map(n,function(e){return $(e).outerHeight()}),function(e,t){return e+t})||0;u=t.data("sizing-offset")||20;l=c-o-a-s-u;_.each(r,function(e){var t=$(e),i;i=t.data("sizing-offset")||0;t.css({height:l-i,"overflow-y":"auto"});t.trigger("scrollTo")})})});(function(){var r=AGN.Lib.Helpers;AGN.Lib.CoreInitializer.new("slider",function(e){if(!e){e=$(document)}_.each(e.find(".js-slider"),function(e){var t=$(e),i,n;i={handle:"round",min:0,max:101};n=_.merge({},i,r.objFromString(t.data("slider-options")));t.slider(n)})})})();AGN.Lib.CoreInitializer.new("sync",["ace"],function(e){if(!e){e=$(document)}_.each(e.find("[data-sync]"),function(e){var t=$(e),i=$(t.data("sync")),n=t.data("_editor");if(n){n.val(i.val())}else{t.val(i.val())}})});(function(){var t=AGN.Lib.Tab;AGN.Lib.CoreInitializer.new("tab-toggle",function(e){if(!e){e=$(document)}_.each(e.find("[data-toggle-tab]"),function(e){t.init($(e))})})})();AGN.Lib.CoreInitializer.new("table-responsive-wrap",function(e){if(!e){e=$(document)}e.find(".table-wrapper:not(.table-overflow-visible) table").wrap('<div class="table-responsive" />');e.find(".table-wrapper.table-overflow-visible table").wrap('<div class="table-responsive" style="overflow: visible;" />')});(function(){var t=AGN.Lib.Popover;function i(e){var i=e.find(".js-row-show");if(i.length!==1){return}e.data("link",i.attr("href"));i.remove();_.each(e.prop("cells"),function(e){var t=$(e);if(t.find("a,input,select,textarea,button").length!==0){return}t.addClass("table-link");if(t.contents().length===0){t.html('<a href="'+i.attr("href")+'">&nbsp;</a>')}else{t.contents().wrapAll('<a href="'+i.attr("href")+'"></a>')}})}function n(o){var a=o.find(".js-row-popover");if(a.length!==1){return}var s=false;var l=null;var e=function(){if(s===false){s=$.Deferred();var e=a.children();if(e.length==0){var t=$("<div></div>");t.css({position:"fixed",visibility:"hidden"});t.html(a.html());e=t.children();$(document.body).append(t);s.done(function(){e.detach();t.remove()})}s.done(function(){l=e});var n=e.find("img").add(e.filter("img")).filter(function(){return this.complete?null:this});if(n.length>0){s.done(function(){var e=o.data("bs.popover");if(e){e.setContent();if(o.is(":hover")){o.popover("show")}}});var i=function(){var e=true;for(var t=0;t<n.length;t++){var i=n[t];if(i){if(i.complete){$(i).off("load error");n[t]=null}else{e=false}}}return e};for(var r=0;r<n.length;r++){$(n[r]).on("load error",function(){if(i()){s.resolve()}})}}else{s.resolve()}}return l};t.new(o,{trigger:"hover",delay:{show:300,hide:100},html:true,content:e})}AGN.Lib.CoreInitializer.new("table-row-actions",function(e){if(!e){e=$(document)}e.find(".js-table").each(function(){_.each(this.rows,function(e){var t=$(e);i(t);n(t)})})})})();(function(){var a=AGN.Lib.Table;AGN.Lib.CoreInitializer.new("table",function(e){if(!e){e=$(document)}e.all(".js-data-table").each(function(){var e=$(this);var t=e.find(".js-data-table-body");var i=e.data("table");if(t.exists()&&i){var n=$("script#"+CSS.escape(i)),r,o;if(n.exists()){r=n.json();if(t.data("web-storage")){o=_.merge(AGN.Lib.WebStorage.get(t.data("web-storage"))||{},r.options||{})}else{o=r.options||{}}new a(t,r.columns,r.data,o)}}})})})();AGN.Lib.DomInitializer.new("targetgroup-overview-filters",function(){$("#filtersDescription").html(AGN.Lib.Template.text("targetgroup-overview-filters",this.config))});(function(){var A={header_readonly:true,filter_readonly:true,condition_readonly:true,operator_readonly:true,value_readonly:true,no_delete:true,no_add_rule:true,no_sortable:true,no_add_group:true};AGN.Lib.DomInitializer.new("target-group-query-builder",function(e){var i=AGN.Lib.Form.getWrapper(e);var d="#targetgroup-querybuilder";var n=$(d);var o=this.config.mailTrackingAvailable;var a=this.config.isTargetGroupLocked;var s=this.config.helpLanguage;var l=navigator.userAgent.match("MSIE 10.0;");var u=this;_.each(n,function(e){var t=$(e);var i=C();var n=p(u.config.queryBuilderFilters,{mail_tracking_available:o});var r=w(JSON.parse(u.config.queryBuilderRules),a);t.queryBuilder({filters:n,allow_empty:true,operators:i,helpLanguage:s,readonly:a,plugins:{sortable:{inherit_no_drop:true,inherit_no_sortable:true,icon:"icon icon-arrows-alt"}},rules:r});if(!l){AGN.Lib.CoreInitializer.run("select",t)}t.on("afterSetRules.queryBuilder afterUpdateRuleFilter.queryBuilder afterCreateRuleFilters.queryBuilder afterAddRule.querybuilder",function(e){if(!l){AGN.Lib.CoreInitializer.run("select",$(this))}});t.on("link-values-set",function(e){if(!l){AGN.Lib.CoreInitializer.run("select",$(e.target))}});t.on("mailing-values-set values-set ",function(e){if(!l){AGN.Lib.CoreInitializer.run("select",$(e.target))}});t.on("change-date-format",function(e){if(!l){AGN.Lib.CoreInitializer.run("select",$(e.target))}});t.on("enterdown","input",function(e){return false})});i.off().on("validation",function(n,r){r=$.extend({ignore_qb_validation:false,skip_empty:false},r);_.each($(d),function(e){var t=$(e);var i=t.prop("queryBuilder");if(!c(n,i,r,t)){return false}})});function c(e,t,i,n){t.clearInitialRuleSettings();if(i.ignore_qb_validation){return true}else if(t.validate({skip_filter_validation:false,skip_empty:i.skip_empty})){n.find("#queryBuilderRules").val(r(t,i.skip_empty));return true}else{n.trigger("qb:invalidrules");e.preventDefault();return false}}function r(e,t){return JSON.stringify(e.getRules({allow_invalid:true,skip_empty:t}))}function f(e,t){if(!l&&e.is("select")){AGN.Lib.Select.get(e).selectValueOrSelectFirst(t)}else{e.val(t)}}function p(e,t){if(e===null){e=[{id:"?",label:"?",type:"string"}]}else{var i={};e=e.filter(function(e){if(i[e.id]){return false}i[e.id]=true;return true})}g(e,t);return $.extend([],e)}function h(e){if(e){e.flags=A;_.each(e.rules,function(e){e.flags=A;if(e.hasOwnProperty("condition")){h(e)}})}return e}function g(e,i){i=$.extend({mail_tracking_available:false},i);var n=function(e){var t=$('<select class="form-control qb-input-element-select mailings js-select"></select>');t.attr("id",e.id);return t};var r=function(e){var t=$('<select class="form-control qb-input-element-select auto-imports js-select"></select>');t.attr("id",e.id);return t};var o=function(e){return e.$el.find(".mailings :selected").val()};var a=function(e){return e.$el.find(".auto-imports :selected").val()};var s=function(r){var o={},a={},s=-1;$(d).on("values-set",r,function(e){if($.isEmptyObject(a)){f($(e.target),s)}else{var t=$(e.target).attr("id"),i=a[t],n=i?i.$el.find(r):$(e.target);f(n,o[t]||s)}});return function(e,t){var i=e.$el.find(r);o[e.id]=t;a[e.id]=e;f(i,t)}};var l=s("select.mailings");var u=s("select.auto-imports");var c={"finished auto-import":{type:"string",input_event:"values-setup-finished",input:r,values:function(e){m(e).done(function(){e.trigger("values-setup-finished")})},valueSetter:u,valueGetter:a,canBeNegated:true,skipOperator:true},"received mailing":{type:"string",input_event:"values-setup-finished",input:n,values:function(e){v(e).done(function(){e.trigger("values-setup-finished")})},valueSetter:l,valueGetter:o,canBeNegated:true,skipOperator:true},"opened mailing":{type:"string",input_event:"values-setup-finished",input:n,values:function(e){v(e).done(function(){e.trigger("values-setup-finished")})},valueSetter:l,valueGetter:o,canBeNegated:i.mail_tracking_available,skipOperator:true},"clicked in mailing":{type:"string",input_event:"values-setup-finished",valueSelector:function(e,t){var i=["mailingID","linkID"];return e+"_"+i[t]},input:function(e){return $('<div class="qb-input-element-select">'+'<select class="form-control js-select mailings" data-rule-id="'+e.id+'" id="'+e.filter.valueSelector(e.id,0)+'" ></select>'+"</div>"+'<div class="qb-input-label">'+'<div class="qb-input-inner">Links</div>'+"</div>"+'<div class="qb-input-element-select">'+'<select class="form-control js-select links" data-rule-id="'+e.id+'" id="'+e.filter.valueSelector(e.id,1)+'" ></select>'+"</div>")},values:function(o){var i=o.find(".mailings");var n=AGN.Lib.Select.get(i);i.change(function(){var e=n.getSelectedValue();b(e,function(e){var i=o.find(".links");var n=AGN.Lib.Select.get(i);var r=[{id:-1,text:t("querybuilder.common.anyLink")}];$.each(e,function(e,t){r.push({id:t.id,text:t.url})});n.setOptions(r);i.trigger("link-values-set")})});v(i,function(e){var t=[];e.forEach(function(e){t.push({id:e.mailingID,text:e.shortname})});n.setOptions(t);i.trigger("mailing-values-set")})},valueGetter:function(e){var t=0,i=1,n=[];n[t]=e.$el.find("#"+e.filter.valueSelector(e.id,t)).val();n[i]=e.$el.find("#"+e.filter.valueSelector(e.id,i)).val();return n},valueSetter:function(){var o=0,r=1,a={},s={};var e=function(e,t){a[e.id]=t;s[e.id]=e};$(d).on("mailing-values-set",function(e){var t=$(e.target),i=t.data("rule-id"),n=s[i],r;if(n){r=n.$el.find(".mailings");f(r,a[i][o]);r.trigger("change")}else{f(t);t.trigger("change")}});$(d).on("link-values-set",function(e){var t=$(e.target).data("rule-id"),i=s[t],n;if(i){n=i.$el.find(".links");f(n,a[t][r]||-1)}else{n=$(e.target);f(n)}n.trigger("values-setup-finished")});return e}(),validation:{callback:function(e){return e.every(function(e){return e})||["string_empty"]}},canBeNegated:i.mail_tracking_available,skipOperator:true},"revenue by mailing":{type:"string",input_event:"values-setup-finished",input:n,values:function(e){v(e).done(function(){e.trigger("values-setup-finished")})},valueSetter:l,valueGetter:o,canBeNegated:i.mail_tracking_available,skipOperator:true}};if(!i.mail_tracking_available){delete c["received mailing"]}e.forEach(function(e){var t=c[e.id];if(t){$.extend(e,t)}})}function v(n,e){var t=e||function(e){var t=AGN.Lib.Select.get(n);var i=[];e.forEach(function(e){i.push({id:e.mailingID,text:e.shortname})});t.setOptions(i);n.trigger("values-set")};return $.ajax({type:"GET",url:AGN.url("/workflow/getAllMailingSorted.action"),data:{sortField:"date",sortDirection:"desc"},success:t})}function m(t,e){var i=e||function(e){e.forEach(function(e){t.append($("<option>",{text:e.shortname,value:e.autoImportId}))});t.trigger("values-set")};return $.ajax({type:"POST",url:AGN.url("/autoimport.do"),data:{method:"listJson"},success:i})}function y(e,i){e.forEach(function(e){var t=$("<option>");t.text(e.shortname);t.val(e.mailingID);i.append(t)})}function b(e,t){$.ajax({type:"POST",url:AGN.url("/workflow/getMailingLinks.action"),data:{mailingId:e},success:t})}function w(e,t){if(t){e=h(e)}return $.extend({},e)}function C(){return[{type:"equal",apply_to:["string","number","datetime"]},{type:"not_equal",apply_to:["string","number","datetime"]},{type:"less",apply_to:["string","number"]},{type:"less_or_equal",apply_to:["string","number"]},{type:"greater",apply_to:["string","number"]},{type:"greater_or_equal",apply_to:["string","number"]},{type:"like",nb_inputs:1,apply_to:["string"]},{type:"not_like",nb_inputs:1,apply_to:["string"]},{type:"contains",nb_inputs:1,apply_to:["string"]},{type:"not_contains",nb_inputs:1,apply_to:["string"]},{type:"begins_with",nb_inputs:1,apply_to:["string"]},{type:"not_begins_with",nb_inputs:1,apply_to:["string"]},{type:"mod",nb_inputs:1,apply_to:["number"],valueSelectors:["#first","#operator select","#second"],valueGetter:function(t){var i=[];t.operator.valueSelectors.forEach(function(e){i.push(t.$el.find(e).val())});return i},valueSetter:function(i,n){i.operator.valueSelectors.forEach(function(e,t){i.$el.find(e).val(n[t])})},input:function(e){var t=this.operators.filter(function(e){return e.type!=="mod"&&e.apply_to.includes("number")});var i=this.getRuleOperatorSelect(e,t);return""+"<div class='qb-input-element'>"+"<input class='form-control' id='first' type='number'/>"+"</div>"+"<div class='qb-input-element' id='operator'>"+i+"</div>"+"<div class='qb-input-element'>"+"<input class='form-control' id='second' type='number'/>"+"</div>"},validate:function(e){return e.every(function(e){return e})||["string_empty"]}},{type:"is_empty",nb_inputs:0,apply_to:["string","number","datetime"]},{type:"is_not_empty",nb_inputs:0,apply_to:["string","number","datetime"]},{type:"before",nb_inputs:1,apply_to:["datetime"]},{type:"after",nb_inputs:1,apply_to:["datetime"]}]}})})();AGN.Lib.Controller.new("targets-list",function(){this.addAction({change:"check-favorites"},function(){AGN.Lib.Loader.prevent();$.ajax({type:"GET",url:AGN.url(e(this.el))})});function e(e){var t=e.data("target-id");var i=e.is(":checked");return"/target/"+t+"/"+(i?"addToFavorites":"removeFromFavorites")+".action"}this.addAction({change:"check-admin-favorites"},function(){AGN.Lib.Loader.prevent();const e=this.el.data("target-id");const t=this.el.is(":checked");$.ajax({type:t?"POST":"DELETE",url:AGN.url("/target/"+e+"/favorite.action")})})});AGN.Lib.CoreInitializer.new("template",function(e){if(!e){e=$(document)}e.find('script[type="text/x-mustache-template"]').each(function(){var e=$(this);var t=e.attr("id");if(t){AGN.Opt.Templates[t]=e.html()}})});(function(){var t=AGN.Lib.Tile;AGN.Lib.CoreInitializer.new("tile-toggle",function(e){if(!e){e=$(document)}_.each(e.find("[data-toggle-tile]"),function(e){t.init($(e))})})})();(function(){var t=AGN.Lib.Tooltip;AGN.Lib.CoreInitializer.new("tooltip",function(e){if(!e){e=$(document)}$(".tooltip").remove();e.find("[data-tooltip], [data-tooltip-help]").each(function(){var e=$(this);t.create(e,t.options(e))})})})();(function(){var i=AGN.Lib.Truncate.run;var n=AGN.Lib.Breadcrumbs.truncate;AGN.Lib.CoreInitializer.new("truncate",function(e){if(!e){e=$(document)}setTimeout(function(){_.each(e.find(".l-header"),function(e){var t=$(e);i(t,".header-nav");n(t.find(".header-nav"))})},50)})})();AGN.Lib.DomInitializer.new("upload",function(n){var e=AGN.Lib.Template,t=AGN.Lib.Form;var i=n.find("[data-upload-dropzone]").first();var r=(i.exists()?i:n).find("[data-upload]");var o=n.find("[data-upload-add]");var a=o.find("[data-upload-add-template]");var s=n.find("[data-upload-progress]");var l=s.find("[data-upload-progress-template]");var u;var c;var d=r.prop("name")||"";var f=d.includes("[]");var p=!r.exists()||r.is("[multiple]");var h;var g=[];if(r.exists()||i.exists()){x();u=e.prepare(a.data("upload-add-template"));c=e.prepare(l.data("upload-progress-template"));r.prop("name","");h=t.get(r.exists()?r:i);if(i.exists()){new Dropzone(i,{classDragOver:"drag-over",onSelectFiles:function(e){y(e)}})}else{r.on("change",function(){y(r.prop("files"))})}var v=h.get$();v.on("form:loadershow",function(){l.html(c({currentProgress:true}));s.removeClass("hidden")});v.on("form:loaderhide",function(){s.addClass("hidden");o.removeClass("hidden")});v.on("form:submit",function(){o.addClass("hidden")});v.on("form:abort",function(){if(g.length){o.removeClass("hidden");_()}});v.on("form:progress",function(e,t){l.html(c({currentProgress:t.progress}))});v.on("submitted",function(){E();m()});n.on("upload:reset",function(){E();m();n.trigger("reset-upload",v)});n.on("click","a[data-upload-reset], button[data-upload-reset]",function(){E();m();n.trigger("reset-upload",v)})}function m(){w();g=[];x()}function y(e){if(e&&e.length>0){var t=false;var i;if(p){for(var n=0;n<e.length;n++){i=e[n];if(C(i,g.length)){g.push(i);A(i);t=true}}}else{i=e[0];if(C(i,0)){E();m();g=[i];A(i);t=true}}if(t){x();_()}}}function b(e){return d.replace("[]","["+e+"]")}function _(){if(f){g.forEach(function(e,t){h.setValueOnce(b(t+1),e)})}else{h.setValueOnce(d,g.slice(0))}}function w(){if(f){g.forEach(function(e,t){h.setValueOnce(b(t+1),undefined)})}else{h.setValueOnce(d,undefined)}}function C(e,t){var i=$.Event("upload:add");n.trigger(i,{file:e,index:t});return!i.isDefaultPrevented()}function A(e){var t=!e.id?"hidden":"";var i={file:e,count:g.length,filename:e.name,size:e.size,id:e.id?e.id:0,duplicationErrorHidden:t,preview:undefined};if(/^image/.test(e.type)){var n=new FileReader;n.onloadend=function(){i.preview=this.result;o.removeClass("hidden");AGN.runAll($(u(i)).appendTo(a));h.initFields()};n.readAsDataURL(e)}else{i.preview=undefined;o.removeClass("hidden");AGN.runAll($(u(i)).appendTo(a));h.initFields()}}function E(){o.addClass("hidden");a.empty();h.initFields()}function x(){n.data("upload-selection",g.slice(0))}});(function(){AGN.Lib.DomInitializer.new("user-activity-log-period",function(e){t(e)});function t(e){if(!e){e=$(document)}var i=[];_.each(e.find(".js-datepicker"),function(e){var t=$(e);if(t.hasClass("js-datepicker-period-start")){if(!(t.attr("datepicker-period-id")in i)){i[t.attr("datepicker-period-id")]={startEl:null,endEl:null}}i[t.attr("datepicker-period-id")].startEl=t}if(t.hasClass("js-datepicker-period-end")){if(!(t.attr("datepicker-period-id")in i)){i[t.attr("datepicker-period-id")]={startEl:null,endEl:null}}i[t.attr("datepicker-period-id")].endEl=t}});for(var t=0;t<i.length;t++){n(i[t].startEl.pickadate("picker"),i[t].endEl.pickadate("picker"))}}function n(e,t){var i=e;var n=t;if(i.get("value")){n.set("min",i.get("select"))}if(n.get("value")){i.set("max",n.get("select"))}i.on("set",function(e){if(e.select){n.set("min",i.get("select"))}else if("clear"in e){n.set("min",false)}});n.on("set",function(e){if(e.select){i.set("max",n.get("select"))}else if("clear"in e){i.set("max",false)}})}})();AGN.Lib.CoreInitializer.new("view",function(){AGN.Lib.View.init()});AGN.Lib.DomInitializer.new("web-storage-persist",function(){if(this.config){$.each(this.config,function(e,t){var i="web-storage#"+$.trim(e);var n=null;try{n=AGN.Lib.Storage.get(i)}catch(e){console.error(e)}if(n!=null){AGN.Lib.Storage.set(i,$.extend(n,t))}else{AGN.Lib.Storage.set(i,t)}})}});AGN.Lib.DomInitializer.new("workflow-pause-timer",function(){const i=this.config.workflowId;const e=this.config.pauseTime;const n=this.config.defaultExpirationHours;const r=this.config.expirationHours>0?this.config.expirationHours:n;const o=r*60*60*1e3;const a=$("#workflow-pause-timer-text");const s=setInterval(function(){l()},1e3);l();function l(){a.html(c())}function u(){return o-(Date.now()-e)}function c(){const e=u();if(e<=0){if(s){clearInterval(s)}d();return'<i class="icon icon-refresh icon-spin"></i> '+t("workflow.activating.auto")}const i=new Date(e);return(i.getHours()>0?d3.format("01")(i.getUTCHours())+":":"")+(i.getMinutes()>0?d3.format("02")(i.getUTCMinutes())+":":"00:")+(i.getSeconds()>0?d3.format("02")(i.getUTCSeconds()):"00")}function d(){return $.post(AGN.url("/workflow/"+i+"/autoUnpause.action")).done(function(e){if(e.success===true){AGN.Lib.Page.reload(AGN.url("/workflow/"+i+"/view.action"))}else{AGN.Lib.JsonMessages(e.popups)}}).fail(function(){AGN.Lib.Messages(t("Error"),t("defaults.error"),"alert")})}return false});(function(){var i=AGN.Lib.Loader,h=AGN.Lib.Template,g=AGN.Lib.Page,n=AGN.Lib.CSRF;var v={initialize:function(e){if(e.loader===true||e.loader===undefined){e.loader={show:function(){i.show()},hide:function(){i.hide()}}}},show:function(e){var t=e.loader;if(t&&t.show){try{t.show()}catch(e){console.error(e)}}},hide:function(e){var t=e.loader;if(t&&t.hide){try{t.hide()}catch(e){console.error(e)}}}};$.ajaxPrefilter(function(e){v.initialize(e)});$(document).ajaxSend(function(e,t,i){v.show(i);n.setTokenToReqHeader(t,i.type)});$(document).ajaxComplete(function(e,t,i){v.hide(i);n.updateTokenInDOM()});$(document).ajaxError(function(e,i,n){v.hide(n);if(i.readyState==0||i.status==0){return}if(n.statusCode&&i.status in n.statusCode){return}var r;if(i.status==401){var o=$.Event("ajax:unauthorized");$(document).trigger(o);if(!o.isDefaultPrevented()&&i.responseText){g.render(i.responseText)}}else if(i.status==403){if(i.responseText){if(/<\s*\/\s*body\s*>/i.test(i.responseText)){var a=new DOMParser;var s=a.parseFromString(i.responseText,"text/html").querySelector("#csrf-error-page");if($(s).length){var l=h.text("csrf-error",{headline:t("messages.permission.denied.title"),content:t("messages.error.csrf"),reload:t("messages.error.reload")});$("body").append(l);return}}}r=h.text("permission-denied",{title:t("messages.permission.denied.title"),text:t("messages.permission.denied.text"),btn:t("defaults.ok")});$("body").append(r)}else{var u=true;if(i.responseText){try{var c=$(i.responseText);var d=c.filter("#error-message");var f=c.filter("#error-page");var p=c.all("[data-message]");if(f.exists()){}else if(d.exists()){if(d.is('script[type="text/x-mustache-template"]')){$("body").append(_.template(d.html()))}else{$("body").append(d)}u=false}else if(p.exists()){g.render(i.responseText);u=false}}catch(e){console.debug(e)}}if(u){r=h.text("error",{headline:t("messages.error.headline"),text:t("messages.error.text"),reload:t("messages.error.reload")});$("body").append(r)}}});$(document).on("click","a[data-ajax], a.js-ajax",function(e){var t=$(this);e.preventDefault();g.reload(t.attr("href"),true,t.data("ajax"))});$(document).on("click","[data-prevent-load]",function(){i.prevent()});window.onbeforeunload=function(){i.show()}})();(function(){$(document).on("click","[data-toggle-checkboxes]",function(e){const t=$(this);const i=t.data("toggle-checkboxes");const n=t.closest(".tile-header").find("[data-toggle-tile]").data("toggle-tile");_.each($(n+" [type=checkbox]:enabled"),function(e){const t=i=="on"?true:false;$(e).prop("checked",t)});e.preventDefault()});$(document).on("click","[data-toggle-checkboxes-all]",function(e){const i=$(this).data("toggle-checkboxes-all");_.each($(".checkboxes-content [type=checkbox]:enabled"),function(e){const t=i=="on"?true:false;$(e).prop("checked",t)});e.preventDefault()})})();(function(){var e=AGN.Lib.Action;e.new({click:"[data-clone]"},function(){var e=this.el.data("clone"),t=this.el.data("clone-target"),i=parseInt(this.el.data("clone-count")),n,r;i+=1;this.el.data("clone-count",i);n=AGN.Lib.Template.text(e,{count:i});r=$(t).append(n);AGN.runAll(r)});$(document).on("click","a[data-clone]",function(e){e.preventDefault()})})();(function(){var o=AGN.Lib.Form,a=AGN.Lib.Confirm,e=AGN.Lib.Action,n=AGN.Lib.Page;e.new({click:"[data-confirm], .js-confirm"},function(){var e;e=$.get(this.el.attr("href"));e.done(function(e){var t=$(e),i;i=t.filter(".modal").add(t.find(".modal"));if(i.length!=1){n.render(e);return}a.create(e).done(function(e){n.render(e)})});this.event.preventDefault()});$(document).on("click","[data-confirm-positive], .js-confirm-positive",function(){var e=$(this),t=a.get(e),i=o.getWrapper(e);if(t){var n=t.$modal.find('[name="confirm-save-choice"]');if(i.exists()){const r=o.get(i);if(e.is("[data-url]")){r.setActionOnce(e.data("url"))}r.jqxhr().done(function(e){t.positive(e)})}else{if(n.exists()){t.positive({code:e.data("confirm-positive"),saveChoice:n[0].checked})}else{t.positive(e.data("confirm-positive"))}}}});$(document).on("click","[data-confirm-negative], .js-confirm-negative",function(){var e=$(this),t=a.get(e);if(t){var i=t.$modal.find('[name="confirm-save-choice"]');if(i.exists()){t.negative({code:e.data("confirm-negative"),saveChoice:i[0].checked})}else{t.negative(e.data("confirm-negative"))}}})})();(function(){var e=AGN.Lib.Action,r=AGN.Lib.Clipboard,a=AGN.Lib.Tooltip;e.new({click:"[data-copyable]"},function(){var e=undefined;if(this.el.is("[data-copyable-value]")){e=this.el.data("copyable-value")}else{var i=this.el.data("copyable-target");var n;if(i){n=$(i)}else{n=this.el}if(n.exists()){e=n.val()}}if(e!==undefined){var o=this.el;r.set(e,function(e,i){if(i){a.create(o,{title:t("clipboard.copied.tooltip"),trigger:"manual"});a.setShown(o);var n=o.data("tooltip-timeout-id");if(n){clearTimeout(n)}var r=setTimeout(function(){a.remove(o);o.removeData("tooltip-timeout-id")},2500);o.data("tooltip-timeout-id",r)}})}})})();(function(){var s=AGN.Lib.Table,o=AGN.Lib.WebStorage;$(document).on("click",".js-data-table-first-page",function(e){s.get($(this)).api.paginationGoToFirstPage()});$(document).on("click",".js-data-table-prev-page",function(e){s.get($(this)).api.paginationGoToPreviousPage()});$(document).on("click",".js-data-table-page",function(e){s.get($(this)).api.paginationGoToPage($(this).data("page"))});$(document).on("click",".js-data-table-next-page",function(e){s.get($(this)).api.paginationGoToNextPage()});$(document).on("click",".js-data-table-last-page",function(e){s.get($(this)).api.paginationGoToLastPage()});$(document).on("click",".js-data-table-paginate",function(e){var t=$(this);var i=t.data("page-size");var n=s.get(t).api;n.paginationSetPageSize(i);t.closest(".dropdown-menu").trigger("click");var r=t.data("web-storage");if(r){o.extend(r,{paginationPageSize:parseInt(i)})}});$(window).on("viewportChanged",function(e){$(document).all(".js-data-table-body").each(function(){AGN.Lib.Table.get($(this)).redraw()})});$(document).on("click",".js-data-table-bulk-delete",function(e){var t=$(this);i(t,false)});function i(e){var t=e.data("bulk-field")||"id";var i=e.data("bulk-request-field")||"bulkIds";var n=s.get(e).api;var r=n.getSelectedRows();var o=r.map(function(e){return e[t]});var a={};a[i]=o;l(o,e.data("bulk-url"),a).done(function(){n.updateRowData({remove:r})})}function l(e,i,n){var r=$.Deferred();if(e&&e.length){var o=$.ajax(i,{method:"POST",traditional:false,data:n}).fail(function(){r.reject()});AGN.Lib.Confirm.request(o).then(r.resolve,r.reject)}else{r.reject();AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}return r.promise()}})();$(document).ready(function(){window.AGN.Lib.Controller.init();window.AGN.runAll()});(function(){$(document).on("dragster:enter",function(e){var t=$(e.target);if(!t.is("[data-upload-dropzone]")){t.addClass("drag-over")}});$(document).on("dragster:leave",function(e){var t=$(e.target);if(!t.is("[data-upload-dropzone]")){t.removeClass("drag-over")}})})();(function(){$(document).on("click",".dropdown-menu *",function(e){$target=$(e.target);if($target.hasClass("js-dropdown-open")){e.preventDropdownClose=true}if($target.parent(".js-dropdown-open").length==1){e.preventDropdownClose=true}if($target.is("button"))return;if($target.is("a"))return;if($target.parent("a").length==1)return;if($target.parent("button").length==1)return;if($target.hasClass("js-dropdown-close"))return;if($target.parent(".js-dropdown-close").length==1)return;e.preventDropdownClose=true})})();$(document).on("click",".js-close-error",function(e){if(!$(e.target).hasClass("js-close-error")){return}$(this).closest(".backdrop").remove()});(function(){var e=AGN.Lib.Action,r=AGN.Lib.Form,o=AGN.Lib.Confirm,t=AGN.Lib.Helpers;e.new({click:"[data-form-change]"},function(){r.get(this.el).setValueOnce("numberOfRowsChanged",true)});e.new({click:"[data-form-bulk]"},function(){var e=this.el.data("form-bulk"),t=this.el.prop("checked");r.get(this.el).bulkUpdate(e,t)});e.new({click:"a[data-form-set], button[data-form-set]",change:"select[data-form-set], input[data-form-set]"},function(){var e=t.objFromString(this.el.data("form-set")),i=r.get(this.el);_.forEach(e,function(e,t){i.setValueOnce(t,e)})});e.new({click:"a[data-form-url], button[data-form-url]",change:"select[data-form-url], input[data-form-url]"},function(){r.get(this.el).setActionOnce(this.el.data("form-url"))});e.new({click:"a[data-form-resource], button[data-form-resource]",change:"select[data-form-resource], input[data-form-resource]"},function(){var e=r.get(this.el);if(e instanceof AGN.Lib.ResourceForm){e.setResourceSelectorOnce(this.el.data("form-resource"))}});e.new({click:"a[data-form-persist], button[data-form-persist]",change:"select[data-form-persist], input[data-form-persist]"},function(){var e=t.objFromString(this.el.data("form-persist")),i=r.get(this.el);_.forEach(e,function(e,t){i.setValue(t,e)})});e.new({click:"a[data-form-reset], button[data-form-reset]"},function(){r.get(this.el).reset()});e.new({click:"a[data-form-abort], button[data-form-abort]"},function(){r.get(this.el).abort()});e.new({click:"[data-form-confirm]"},function(){var e=this.el.data("form-confirm"),n=r.get(this.el),t;t=n.submit("confirm",e);t.done(function(e){var t=$(e),i;i=t.filter(".modal").add(t.find(".modal"));if(i.length!=1){n.updateHtml(e);return}o.create(e).done(function(e){n.updateHtml(e)}).fail(n.revertAction)})});e.new({click:"a[data-form-action], button[data-form-action]",change:"select[data-form-action], input[data-form-action]"},function(){var e=this.el.data("form-action"),t=r.get(this.el),i;setTimeout(function(){i=t.submit("action",e)},5)});e.new({click:"a[data-form-submit], button[data-form-submit]",change:"select[data-form-submit], input[data-form-submit]"},function(){var e=this;setTimeout(function(){r.get(e.el).submit()},5)});e.new({click:"a[data-form-submit-static], button[data-form-submit-static]",change:"select[data-form-submit-static], input[data-form-submit-static]"},function(){var e=this;setTimeout(function(){r.get(e.el).submit("static")},5)});e.new({click:"a[data-form-submit-event], button[data-form-submit-event]",change:"select[data-form-submit-event], input[data-form-submit-event]"},function(){var e=this;setTimeout(function(){r.get(e.el).submit("event")},5)});e.new({submit:"[data-form]"},function(){var e=this;if(this.el.data("form")!="static"){this.event.preventDefault();setTimeout(function(){r.get(e.el).submit()},5)}});function n(e){var t=e.keyCode||e.which;if(t===13){return true}if(t===229&&e.originalEvent){var i=e.originalEvent.code;if(i==="Enter"||i==="NumpadEnter"){return true}}return false}e.new({keydown:'input[type="text"], input[type="password"], input[type="number"]'},function(){if(n(this.event)){var e=$.Event("enterdown");this.el.trigger(e);if(e.isDefaultPrevented()){return}var t=this.el.parents("form");if(t.exists()){if(t.is("[data-form]")){var i=r.get(t);if(t.is("[data-action]")){i.submit("event")}else{i.submit()}}else{t.submit()}}}})})();(function(){var t=AGN.Lib.Help;$(document).on("click","[data-help]",function(e){t.show($(this));e.preventDefault()})})();(function(){$(document).on("click","label",function(e){var t=$(this),i,n;i=$("#"+t.attr("for"));n=i.data("select2");if(i.length==1&&n){setTimeout(function(){if(!n.opened()){n.open()}},0)}})})();(function(){var n=window.history;$(document).on("click",'a[href^="#"]',function(e){if(e.isDefaultPrevented()){return}e.preventDefault();t($(this).attr("href"))});$(document).on("click","[data-one-time]",function(){var e=$(this);setTimeout(function(){e.attr("disabled","disabled");if(e.is("a")){e.removeAttr("href")}},1)});function t(e){if(e==="#"){return}var t=window.location.href;var i=t.indexOf("#");if(i>=0){t=t.substring(0,i)}n.replaceState(n.state||{},document.title,t+e)}})();(function(){var e=AGN.Lib.Action,t=AGN.Lib.Menu;e.new({click:".menu-close"},function(){t.close()});e.new({click:".menu-open"},function(){t.open()});e.new({click:".menu-open"},function(){t.open()});$(document).on("click","main",function(){if(t.isOpen()){t.close()}});$(document).on("")})();(function(){var e=AGN.Lib.Action,r=AGN.Lib.Messages;e.new({click:"[data-msg]"},function(){var e=this.el.data("msg"),t=this.el.data("msg-content"),i=this.el.data("msg-type");if(this.el.data("msg-system")==="system"){var n=$(document);if(n.find(".notification-info").is(":visible")){return false}else{r(e,t,i)}}else{r(e,t,i)}});$(document).on("click","a[data-msg]",function(e){e.preventDefault()})})();(function(){var e=AGN.Lib.Action,i=AGN.Lib.Modal,n=AGN.Lib.Helpers;e.new({click:"[data-modal]"},function(){var e=this.el.data("modal"),t=n.objFromString(this.el.data("modal-set"));i.createFromTemplate(t,e)});$(document).on("hidden.bs.modal",".modal",function(){var e=$(this);e.trigger("modal:close");setTimeout(function(){e.remove()},100)});$.fn.modal.Constructor.prototype.enforceFocus=function(){var t=this;$(document).on("focusin.modal",function(e){if(t.$element[0]!==e.target&&!t.$element.has(e.target).length&&$(e.target.parentNode).hasClass("cke_contents cke_reset")){t.$element.focus()}})}})();(function(){var e=AGN.Lib.Action;e.new({click:"[data-password]"},function(){var e=this.el.data("password"),t=this.el.data("password-toggle"),i=$(e);this.el.data("password-toggle",this.el.text());this.el.text(t);if(i.prop("type")==="password"){i.prop("type","text")}else{i.prop("type","password")}this.event.preventDefault()})})();(function(){$(document).on("click",".js-open-datepicker",function(e){var t=$(this),i=t.parents(".input-group").find(".js-datepicker"),n=i.pickadate("picker");n.open()});$(document).on("click",".js-datepicker",function(e){var t=$(this),i=t.pickadate("picker");i.open();t.focus()})})();(function(){$(document).on("click",'[data-dismiss="popover"]',function(){var e=AGN.Lib.Popover.get($(this));if(e){e.hide()}})})();(function(){var e=AGN.Lib.Action,t=AGN.Lib.Modal,i=AGN.Lib.Helpers;e.new({click:"[data-popup]"},function(){var e=this.el.data("popup"),t=window.location.href,i=t.substring(0,t.lastIndexOf("/"));if(!e||e.indexOf("://")<=0){e=i+"/"+e}window.open(e,"help","width=800,height=600,left=0,top=0,scrollbars=yes")});$(document).on("click","a[data-modal]",function(e){e.preventDefault()});$(document).on("hidden.bs.modal",".modal",function(){var e=$(this);e.trigger("modal:close");setTimeout(function(){e.remove()},100)})})();(function(){var e,t;e=function(){if(t){clearTimeout(t)}t=setTimeout(function(){AGN.Lib.CoreInitializer.run(["equalizer","truncate","sizing","scrollable","dropdown-expand"]);_.each(AGN.Lib.Editor.all(),function(e){e.resize()});$(window).trigger("viewportChanged")},500)};$(window).on("resize",e)})();(function(){var e=AGN.Lib.Action,s=AGN.Lib.Popover,l=AGN.Lib.Template,u=AGN.Lib.Helpers;var c='<div class="modal-backdrop in" style="opacity: 0.2;"></div>';var d='<div class="popover bottom support-popover" style="width: 600px; margin-top: 16px;"><div class="popover-content popover-tile"></div></div>';function f(){var e=window.location;var t=[".action",".do"];var i,n,r;if(e.origin&&e.pathname){var o=(e.pathname+"").replace(/;jsessionid=[a-z0-9]+/i,"");for(i=0;i<t.length;i++){n=t[i];r=o.indexOf(n);if(r>0){o=o.substring(0,r+n.length)}}return e.origin+o+e.search+e.hash}else{var a=(e.href+"").replace(/;jsessionid=[a-z0-9]+/i,"");for(i=0;i<t.length;i++){n=t[i];r=a.indexOf(n);if(r>0){var s=r+n.length;var l=a.indexOf("?",s);if(l<0){l=a.indexOf("#",s)}if(l>0){return a.substring(0,s)+a.substring(l)}else{return a.substring(0,s)}}}}return a}e.new({click:"[data-support-type]"},function(){var e=this;var t=e.el.data("support-type");var i={supportType:t,subject:"",subjectChangeable:true,page:f()};var n=_.merge({},i,u.objFromString(e.el.data("support-options")));if(t=="PROBLEM"||t=="FEATURE"||t=="ERROR"){var r=$("#support-select-button");s.remove(r);var o=$(c);o.appendTo("body");var a=s.new(r,{trigger:"manual",template:d,html:true,sanitize:false,enableAgnRunAll:true,content:l.text("support-popover-template",n)});a.show();o.on("click",function(){a.hide()});r.on("hidden.bs.popover",function(){o.remove()})}})})();(function(){var e=AGN.Lib.Action;var u=AGN.Lib.FormBuilder.FormBuilder;e.new({"click change":"[data-sync-from]"},function(){var e=this.el.data("sync-from").split(/,\s?/),l=this.el.data("sync-to").split(/,\s?/);_.each(e,function(e,t){var i=$(e),n=$(l[t]),r=i.val(),o=n.attr("id"),a=n.data("_editor"),s=n.data("select2");if(window.CKEDITOR&&CKEDITOR.instances[o]){CKEDITOR.instances[o].setData(r)}else if(a){a.val(r)}else if(s){n.select2("val",r)}else if(u.isCreated("#"+o)){u.get("#"+o).setJson(u.get(e).getJson())}else{n.val(r)}})});$(document).on("click","a[data-sync-from]",function(e){e.preventDefault()})})();(function(){var o=AGN.Lib.Tile,a=AGN.Lib.Tab,s=AGN.Lib.Form;$(document).on("click","[data-toggle-tab]",function(e){var t=$(this),i=o.trigger(t),n=t.data("toggle-tab-method")||"show";if(t.is("[data-form-submit]")){var r=s.getWrapper(t);if(r.exists()&&!s.get(r).valid()){e.preventDefault();return false}}o.show(i);a[n](t);e.preventDefault();return false})})();(function(){var s=AGN.Lib.Form,o=AGN.Lib.Confirm,l=AGN.Lib.Helpers,u=AGN.Lib.Page;$(document).on("click",".js-table a, .js-table input, .js-table select, .js-table button, .js-table .js-checkable, .js-table .disabled",function(e){e.preventViewLoad=true});$(document).on("click",".js-table-sort",function(e){var t=$(this),i=t.children("a"),n=$(e.target),r=i.attr("href");if(n[0]!=i[0]){return}if(s.getWrapper(t).exists()){var o=s.get(t);var a=l.paramsFromUrl(r);_.each(a,function(e,t){o.setValue(t,e)});o.submit()}else{$.get(r).done(function(e){u.render(e,false)})}e.preventDefault()});$(document).on("click",".js-table-paginate",function(e){var t=$(this),i=t.attr("href"),n=s.get(t),r=l.paramsFromUrl(i);_.each(r,function(e,t){n.setValue(t,e)});n.submit();e.preventDefault();var o=t.closest(".tile");if(o.exists()){var a=o.offset().top;if(window.scrollY>a){window.scrollTo(0,a-150)}}else{window.scrollTo(0,0)}});$(document).on("click",".js-row-delete",function(e){var n=$(this),t=n.is("button")?n.data("url"):n.attr("href"),r=s.get(n),i;if(t){i=$.get(t);i.done(function(e){var t=$(e),i;i=t.filter(".modal").add(t.find(".modal"));if(i.length!=1){r.updateHtml(e);return}o.create(e).done(function(e){n.closest("tr").remove();r.updateHtml(e)})})}e.preventDefault()});$(document).on("click",".js-table tr",function(e){var t=$(this),i;if(e.preventViewLoad){return}i=t.data("link");if(typeof i!=="undefined"){window.location.href=i}});$(document).on("click",'.js-checkable label, .js-checkable input[type="checkbox"], .js-checkable input[type="radio"]',function(e){e.stopPropagation()});$(document).on("click",".js-checkable",function(e){var t=$(this),i,n;i=t.find('input[type="checkbox"], input[type="radio"]');if(i.length){_.each(i,function(e){n=$(e);if(!n.prop("disabled")){n.prop("checked",!n.prop("checked"));n.trigger("change")}})}});$(document).on("click",".disabled",function(e){e.preventDefault()})})();(function(){var r=AGN.Lib.Tile;$(document).on("click","[data-toggle-tile]",function(e){r.toggle($(this));e.preventDefault()});$(document).on("click","[data-toggle-tile-all]",function(i){var n=$(this).data("toggle-tile-all");_.each($("[data-toggle-tile]"),function(e){var t=$(e);if(n=="expand"){r.show(t)}else{r.hide(t)}i.preventDefault()})})})();(function(){$(document).on("change","[data-toggle-usability]",function(){var e=$(this),t=e.data("toggle-usability"),i=$(document).find(t);_.each(i,function(e){var t=$(e);if(t.prop("disabled")){t.prop("disabled",false)}else{t.prop("disabled",true)}})})})();(function(){var i=AGN.Lib.Tooltip;$(window).on("load",function(){var e=$("body");if(AGN.isIE){e.on("DOMNodeInserted","[data-tooltip], [data-tooltip-help]",function(e){var t=$(e.target);i.create(t,i.options(t))})}else{e.on("DOMNodeInserted",function(e){$(e.target).all("[data-tooltip], [data-tooltip-help]").each(function(){var e=$(this);i.create(e,i.options(e))})})}})})();(function(){var e=AGN.Lib.Action,t=AGN.Lib.View;e.new({change:"[data-view]"},function(){t.trigger(this.el);this.el.trigger("click.bs.dropdown.data-api")})})();(function(){var o=AGN.Lib.Form,t=AGN.Lib.Editor;$(document).on("tile:show",function(e){var t=$(e.target);var i=t.find(".js-wysiwyg");var n=i.attr("id");if(i.length===1){var r=l(i);window.createEditorExt(n,r.width,r.height,r.browseMailingId,r.isFullHtml,r.isFullHeight,r.allowExternalScript);if(r.isFullHeight){CKEDITOR.instances[n].on("instanceReady",a(i))}}});$(document).on("tile:hide modal:close",function(e){$(e.target).find(".js-wysiwyg").each(function(){if(CKEDITOR.instances[$(this).attr("id")]){CKEDITOR.instances[$(this).attr("id")].updateElement()}if(n($(this))){$(window).off("resize."+s($(this)))}t.get($(this)).val($(this).val());window.removeEditor($(this).attr("id"))})});$(document).on("form:submit",function(e){var t=$(e.target).find(".js-wysiwyg");if(t.length>0&&window.removeAllEditors){window.removeAllEditors()}});function i(e){var t=e.data("browse-mailing-id");if(!!t){return t}var i=e.data("form-target");var n=!!i?$(i):null;if(!n||n.length===0){return null}var r=o.get(n);t=r.getValue("mailingID");if(!t){t=r.getValue("mailingId")}return t}function a(n){return function(e){var t=n.parent().width();var i=n.parent().height();e.editor.resize(t,i);e.editor.resresize_enabledze=false;$(window).on("resize."+s(n),r(n))}}var r=function(t){return function(){var e=t.parent();CKEDITOR.instances[t.attr("id")].resize(e.width(),e.height())}};var s=function(e){return"ck-editor-"+e.attr("id")};var n=function(e){return!!e.data("full-height-editor")};var l=function(e){var t={};t.isFullHtml=!!e.data("full-tags");t.isFullHeight=n(e);t.browseMailingId=i(e);t.height=t.isFullHeight?0:e.height();t.width=t.isFullHeight?e.parent().width():"100%";t.allowExternalScript=false;return _.extend(t,AGN.Lib.Helpers.objFromString(e.data("editor-options")))}})();AGN.Lib.Validator.new("action",{valid:function(e,t,i){return i&&!this.errors(e,t).length},errors:function(e,t){var i=[];if($("#serviceMailOperation").length)this.validateSendServiceOperation(i);return i},validateSendServiceOperation:function(e){validateEmailList($("input[id$=toAddress]"),e,"triggerManager.operation.serviceMail.error.recipientAddress");validateEmail($("input[id$=fromAddress]"),e,"triggerManager.operation.serviceMail.error.senderAddress");validateEmail($("input[id$=replyAddress]"),e,"triggerManager.operation.serviceMail.error.replyAddress");validateSubject($("input[id$=subjectLine]"),e)}});function validateEmailList(e,o,a){e.each(function(e,i){var n=$(i);var r=getEmailsFromField(n);if(!r||!isValidEmailList(r)){o.push({field:n,msg:t(a)})}else{n.val(r.join(","))}})}function validateEmail(e,o,a){e.each(function(e,i){var n=$(i);var r=n.val().trim();if(!isValidEmail(r)){o.push({field:n,msg:t(a)})}else{n.val(r)}})}function validateSubject(e,o){e.each(function(e,i){var n=$(i);var r=n.val().trim();if(!r||r.length<3){o.push({field:n,msg:t("triggerManager.operation.serviceMail.error.subjectToShort")})}else if(r&&r.length>200){o.push({field:n,msg:t("triggerManager.operation.serviceMail.error.subjectToLong")})}else{n.val(r)}})}function getEmailsFromField(e){var t=e.val();var i=t.trim()&&t.trim().split(/[ ,|]+/);_.map(i,_.trim);return i}function isValidEmailList(e){for(var t=0;t<e.length;t++){if(!isValidEmail(e[t])){return false}}return true}function isValidEmail(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(String(e).toLowerCase())}(function(){AGN.Lib.Validator.new("export/form",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,t){var i=[];n(i);return i}});function n(r){var o=[];_.each($("#columnMappings tbody").find("[data-column-mapping-row]"),function(e){var t=$(e);var i=t.find("[data-column-name]");var n=l(i);a(i,r);s(n,o,r,i);o.push(n.toLowerCase())})}function a(e,i){var n=l(e);if(!e.is(":last-child")&&n.length<3||e.is(":last-child")&&n&&n.length<3){i.push({field:e,msg:t("export.columnMapping.error.nameToShort")});return}if(!e.is(":last-child")&&!/^[a-zA-Z0-9_]{3,}$/.test(n)||e.is(":last-child")&&n&&!/^[a-zA-Z0-9_]{3,}$/.test(n)){i.push({field:e,msg:t("export.columnMapping.error.invalidColName")})}}function s(e,i,n,r){if(e&&i.indexOf(e.toLowerCase())>=0){n.push({field:r,msg:t("export.columnMapping.error.duplicate")})}if(o().indexOf(e.toLowerCase())>=0){n.push({field:r,msg:t("export.columnMapping.error.exist")})}}function l(e){return e.val().trim()}function o(){return $.map($('select[name="columns"] option'),function(e){return e.value.toLowerCase()})}})();AGN.Lib.CoreInitializer.new("import-profile-mappings-validator",function(){const o="dd.mm.yyyy";const a="do-not-import-column";var i;AGN.Lib.Validator.new("import-profile-mappings/form",{init:function(){const e=$("#config\\:import-profile-mappings-validator");i=e.exists()?e.json():{}},valid:function(e,t){return!this.errors(e,t).length},errors:function(e,t){const i=[];if($("#columnMappings").length){r(i)}return i}});function s(e,t){return t.length<=e.maxDataSize}function l(e){var t=e.val();if(t[0]=="'"&&t[t.length-1]=="'"){t=t.substring(1,t.length-1)}return t}function n(e,i){const n=l(e);if(n&&d(e)!==a){const r=c(e);const o=r.dataType.toLowerCase();if(r.column==="email"&&!AGN.Lib.Helpers.isValidEmail(n)){i.push({field:e,msg:t("import.columnMapping.error.invalidEmail")})}else if(o==="date"||o==="datetime"){if(p(e.val().trim())){return}u(o,n,i,e)}else if(!f(o,n)){i.push({field:e,msg:t("import.columnMapping.error.type",o)})}else if(!s(r,n)){i.push({field:e,msg:t("import.columnMapping.error.length",r.maxDataSize)})}}}function u(e,i,n,r){if(!i||!f(e,i)){n.push({field:r,msg:t("import.columnMapping.error.dateFormat",e==="datetime"?o+" hh:mm":o)})}}function e(e){const t=$("[name=default-value-new]");if(d(t)!==a&&!y()){n(t,e)}}function r(t){_.each($("#columnMappings tbody").find("[data-mapping-defaultValue]"),function(e){n($(e),t)});e(t)}function c(e){return i.columns[d(e)]}function d(e){return e.attr("name")==="default-value-new"?$("#database-column-new").val():e.closest("tr").find("[data-mapping-db-column]").first().val()}function f(e,t){switch(e){case"numeric":case"float":case"double":return v(t);case"integer":return m(t);case"date":return h(t);case"datetime":return g(t);default:return true}}function p(e){return/^(now|now\(\)|sysdate|sysdate\(\)|current_timestamp|current_timestamp\(\)|today)\s*([+\-]\s*\d+\s*)?$/im.test(e)}function h(e){return moment(e,o.toUpperCase(),true).isValid()}function g(e){const t=e.split(" ");return h(t[0])&&/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(t[1])}function v(e){return!isNaN(parseFloat(e))&&isFinite(e)}function m(e){return/^-?\d+$/.test(e)}function y(){const e=$("[data-action=change-date-input]");return e.length&&e.is(":checked")}});AGN.Lib.Validator.new("length",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=e.val();var r=[];if(n){if(i.min>=0&&n.length<i.min){r.push({field:e,msg:t("fields.errors.string_exceed_min_length",i.min)})}else if(i.max>=0&&n.length>i.max){r.push({field:e,msg:t("fields.errors.string_exceed_max_length",i.max)})}}else if(i.min>0||i.required===true){r.push({field:e,msg:t("fields.required.errors.missing")})}return r}});AGN.Lib.Validator.new("logon-new-password/form",{valid:function(){return!this.errors().length},errors:function(){var e=[];var i=$("#password");var n=$("#password-repeat");var r=i.val();if(!$.trim(r)){e.push({field:i,msg:t("fields.required.errors.missing")})}else if(r!=n.val()){e.push({field:n,msg:t("fields.password.errors.notMatching")})}return e}});AGN.Lib.Validator.new("mailing-priorities/form",{valid:function(){if($("#priorityCount").val()>0){return true}AGN.Lib.Messages(t("defaults.error"),t("error.mailing.invalidPriorityCount"),"alert");return false},errors:function(){return[]}});AGN.Lib.Validator.new("mailinglist-exist",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=e.val();var r=AGN.Lib.Validator.get("required-id").errors(e,i);if(r&&r.length<=0&&i&&n&&i.removedMailinglistId==n.trim()){r.push({field:e,msg:t("fields.mailinglist.errors.removed")})}return r}});AGN.Lib.Validator.new("max-length-validator",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=e.val();var r=[];if(e.hasClass("js-wysiwyg")&&!n){n=$("#cke_"+e.attr("id")).find("iframe").contents().find("body").text()}if(n){if(n.length>i.max){r.push({field:e,msg:t("fields.errors.contentLengthExceedsLimit",i.max)})}}else if(i.required===true){r.push({field:e,msg:t("fields.required.errors.missing")})}return r}});(function(){AGN.Lib.Validator.new("number",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=[];if(i.excludeHidden&&e.is(":hidden")){return[]}var r=e.val();if(r){var o=i.float===true?parseFloat(r):parseInt(r);if(isNaN(o)){n.push({field:e,msg:t("fields.errors.number_nan")})}else{if(o<i.min){n.push({field:e,msg:t("fields.errors.number_exceed_min",i.min-1)})}else if(o>i.max){n.push({field:e,msg:t("fields.errors.number_exceed_max",i.max)})}else if(i.strict===true){if($.trim(r)!==o.toString()){if(i.float===true){n.push({field:e,msg:t("fields.errors.number_not_double")})}else{n.push({field:e,msg:t("fields.errors.number_not_integer")})}}}}}else if(i.required===true){n.push({field:e,msg:t("fields.required.errors.missing")})}return n}})})();AGN.Lib.Validator.new("phone-number",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=$.trim(e.val());var r=[];var o=0;var a=1;var s=3;var l=4;var u=5;var c=6;if(n){var d=o;var f=false;var p=false;var h=0;for(var g=0;g<n.length;g++){var v=n.charAt(g);if(v>="0"&&v<="9"){h++;d=s}else if(v=="."||v=="-"||v=="/"){if(d==s||d==c){d=l}else{f=true;break}}else if(v=="("){if(p){f=true;break}d=u;p=true}else if(v==")"){if(d==s&&p){d=c;p=false}else{f=true;break}}else if(v=="+"){if(d==o){d=a}else{f=true;break}}else if(!/\s/.test(v)){f=true;break}}if(f||p||h<3||h>20){r.push({field:e,msg:t("fields.errors.phone_number_invalid")})}}else if(i.required===true){r.push({field:e,msg:t("fields.required.errors.missing")})}return r}});(function(){AGN.Lib.Validator.new("reference-table/form",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,t){var i=[];var n=$('[name="shortname"]');var r=$('[name="keyColumn"]');if(n.length)o(n,i,5,t.isVoucher?27:29,new RegExp("^[a-z]*$","i"),"referenceTables.table.error.name");if(r.length)o(r,i,3,30,/^(?![0-9_])[a-z0-9_]*$/,"referenceTables.table.error.keyColumn");return i}});function o(e,t,i,n,r,o){if(!a(e,t,i,n)){return}s(e,t,r,o)}function a(e,t,i,n){var r=AGN.Lib.Validator.get("length").errors(e,{min:i,max:n,required:true});if(r.length){r.forEach(function(e){t.push(e)});return false}return true}function s(e,i,n,r){if(!e.val().match(n)){i.push({field:e,msg:t(r)})}}})();AGN.Lib.Validator.new("reject-script-element",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=[];var r=(new DOMParser).parseFromString(e.val(),"text/html").querySelector("script");if(r){n.push({field:e,msg:t("fields.errors.illegal_script_element")})}return n}});AGN.Lib.Validator.new("required-id",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){if(e.data("select2")&&!e.parent().find(".select2-container").is(":visible")){return[]}var n=e.val();var r=parseInt(n);var o=[];if(isNaN(r)||r.toString()!==n.toString().trim()||r<=0&&i.positive!==false){o.push({field:e,msg:t("fields.required.errors.missing")})}return o}});AGN.Lib.Validator.new("unique-mobile-base",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=AGN.Lib.Select.get(e).getSelectedValue();var r=e.attr("id");var o=[];if(!this.isUniqueMobileBase(n,r)){o.push({field:e,msg:t("fields.mediapool.errors.mobile_base_duplicate")})}return o},isUniqueMobileBase:function(t,e){if(t==""){return true}var i=$("[id^=image-mobile-base]:not(#"+e+")").filter(function(){var e=$(this);return AGN.Lib.Select.get(e).getSelectedValue()===t});return i.length===0}});AGN.Lib.Validator.new("upload-file/form",{valid:function(e,i){var n=true;var r=$('[data-initializer="upload"]');if(r.exists()&&r.data("upload-selection").length<1){AGN.Lib.Messages(t("defaults.error"),t("error.upload.file"),"alert");n=false}return n&&!this.errors(e,i).length},errors:function(e,i){const n="error.workflow.shortName";const a="fields.required.errors.missing";var r=[{field:$("#name"),minLength:{val:3,msgKey:n},maxLength:99},{field:$("#firstName"),minLength:{val:3,msgKey:n},maxLength:99},{field:$("#phone"),minLength:{val:3,msgKey:a},maxLength:99},{field:$("#email"),maxLength:99,regexpRules:[{regexp:/\S+@\S+\.\S{2,}/,message:t("error.upload.email")}]}];var s=[];r.forEach(function(e){var i=e.field;var n=i.val();if(!n||n.length<1){s.push({field:i,msg:t(a)});return}if(e.minLength&&n.length<e.minLength.val){s.push({field:i,msg:t(e.minLength.msgKey)});return}if(e.maxLength&&n.length>e.maxLength){s.push({field:i,msg:t("fields.errors.contentLengthExceedsLimit",e.maxLength)});return}if(e.regexpRules&&e.regexpRules.length>0){for(var r=0;r<e.regexpRules.length;++r){var o=e.regexpRules[r];if(!n.match(o.regexp)){s.push({field:i,msg:o.message});return}}}});return s}});AGN.Lib.Validator.new("userform-edit/form",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=[];var r=$('[name="formName"]');if(!r.val().match(/^[a-zA-Z0-9-_]+$/gi)){n.push({field:r,msg:t("userform.error.invalid_name")})}this.validateTemplateField(n,$("#successTemplate"),"SUCCESS");this.validateTemplateField(n,$("#errorTemplate"),"ERROR");return n},validateTemplateField:function(e,t,i){if(!this.validateDirectives(e,t)){return false}if(!this.validateHrefPattern(e,t,i)){return false}},validateDirectives:function(e,i){var n=i.val().match(/#(?:include|parse)/gi);if(n){e.push({field:i,msg:t("userform.error.illegal_directive",n.join(", "))});return false}return true},validateHrefPattern:function(e,i,n){var r=i.val();var o=r.search(/\shref\s*=\s*(["'])\s/gi);if(o!=-1){var a=r.slice(0,o).match(/\r?\n/g).length+1;e.push({field:i,msg:t("userform.error.invalid_link",n,a)});return false}return true}});AGN.Lib.Controller.new("action-view",function(){var o=[];var a;var r={};const s=AGN.Lib.Select;function l(){var i=this;i.$container=$("#module-list");i.$container.on("remove-module",function(){var e=i.$container.find("[data-action-module] .headline span.module-count");$.each(e,function(e,t){$(t).html(e+1+".")})});i.$container.on("add-new-module",function(){var e=i.$container.find("[data-action-module]");var t=e.last();t.find(".headline span.module-count").html(e.length+".")})}l.prototype.clean=function(){this.$container.empty()};l.prototype.getNextIndex=function(){var e=this.$container.find("[data-module-content");var t=0;if(e.length>0){var i=e.last().data("module-content");t=i+1}return t};l.prototype.addModule=function(e){if(e&&e.type){var i=this;e.index=i.getNextIndex();var n=AGN.Lib.Template.dom("common-module-data",{moduleName:t("triggerManager.operation."+e.type)});var r=AGN.Lib.Template.text("module-"+e.type,e.getParameters());n.filter(".inline-tile").append(r);i.$container.append(n);AGN.runAll(n);i.$container.trigger("add-new-module")}};l.prototype.deleteModule=function(t){if(t>=0){var e=this.$container.find("[data-module-content="+t+"]");var i=e.parent("[data-action-module]");var n=i.next(".tile-separator");i.remove();n.remove();this.$container.trigger("remove-module");o=o.filter(function(e){return e.index!==t})}};l.prototype.toJson=function(){var i=[];this.$container.find("[data-module-content]").each(function(e,t){i.push(u.toJson($(t),e))});return i};l.prototype.getSubmissionJson=function(){var e=this;return JSON.stringify(e.toJson())};function u(e,t,i){this.type=e;this.index=i||0;this.id=t.id||0;this.data=$.extend(u.defaults(e),t)}u.defaults=function(e){var t={};switch(e){case"ActivateDoubleOptIn":t.forAllLists=false;t.mediaTypeCode=0;break;case"ContentView":t.tagName="";break;case"ExecuteScript":t.script="";break;case"GetArchiveList":t.campaignID=0;break;case"GetArchiveMailing":t.expireDate=null;break;case"GetCustomer":t.loadAlways=false;break;case"IdentifyCustomer":t.keyColumn="";t.passColumn="";break;case"SendMailing":t.mailingID=0;t.delayMinutes=0;t.bcc="";t.userStatusesOption=1;break;case"ServiceMail":t.toAddress="";t.fromAddress="";t.replyAddress="";t.subjectLine="";t.mailtype=0;t.textMail="";t.htmlMail="";break;case"SubscribeCustomer":t.doubleCheck=false;t.keyColumn="";t.doubleOptIn=false;break;case"UnsubscribeCustomer":t.mailinglistIds=[];t.allMailinglistsSelected=false;t.additionalMailinglists=false;break;case"UpdateCustomer":t.useTrack=false;t.columnName="";t.updateValue="";t.updateType=1;t.trackingPointId=-1;break}t.readonly=false;return t};u.toJson=function(e,t){var a={};a.index=t;e.find('[name^="modules[]"]').each(function(e,t){var i=$(t);var n=i.prop("name")||"";var r=n.replace("modules[].","");var o="";if(i.is("select")){o=s.get(i).getSelectedValue()}else if(i.is("input")&&i.prop("type")==="checkbox"){o=i.prop("checked")}else{o=i.val()}a[r]=o});return $.extend(u.defaults(a.type),a)};u.prototype.getParameters=function(){var e={type:this.type,index:this.index,id:this.id};return _.merge({},this.data,e)};u.create=function(e){return new u(e,{})};u.deserialize=function(e,t){var i=r[e.operationType];return new u(i,e,t)};this.addDomInitializer("action-view",function(){var e=$(this.el);var t=AGN.Lib.Form.get(e);t.loader().show();var i=this.config;r=this.config.operationTypes;a=new l;a.clean();var n=[];if(i.modules){n=JSON.parse(i.modules).map(function(e,t){return u.deserialize(e,t)})}n.forEach(function(e){a.addModule(e)});t.initFields();e.removeClass("hidden");t.loader().hide()});function c(t){return o.filter(function(e){return e.type===t})}this.addAction({click:"add-new-module"},function(){var e=$(this.el);var t=_.merge({},{},AGN.Lib.Helpers.objFromString(e.data("config")));var i=$(t.moduleTypeSelector);var n=u.create(i.val());if(n.type==="SendMailing"){if(c("ActivateDoubleOptIn").length>0){n.data.userStatusesOption=0}}a.addModule(n);o.push(n);AGN.Lib.Form.get(e).initFields();if(n.type==="ActivateDoubleOptIn"){const r=c("SendMailing");r.forEach(function(e){const t="#module-"+e.index+"-userStatusesOption";const i=$(t);s.get(i).selectFirstValue()})}});this.addAction({click:"action-delete-module"},function(){var e=$(this.el);a.deleteModule(e.data("property-id"))});this.addAction({submission:"save-action-data"},function(){var e=AGN.Lib.Form.get($(this.el));e.setValueOnce("modulesSchema",a.getSubmissionJson());e.submit()});this.addDomInitializer("update-customer-module",function(){var e=$(this.el);var t=e.find('[data-action="toggle-if-first"]:checked');i(e,t.exists())});this.addAction({click:"toggle-if-first"},function(){var e=$(this.el);i(e,e.prop("checked"))});function i(e,t){var i=$(e.closest("[data-action-module]"));var n=i.find("[data-useTrack-trackingPointId]");var r=i.find("[data-useTrack-updateValue]");if(!n.exists()){r.show();return}if(i.index()===0){if(t){n.show();r.hide()}else{n.hide();r.show()}}}});AGN.Lib.Controller.new("admin-enabling",function(){this.addAction({click:"save-approved-mailing-lists"},function(){var t=this.el;var e=AGN.Lib.Form.getWrapper(t);n(e);var i=AGN.Lib.Form.get(e);i.submit().done(function(e){if(e.success===true){AGN.Lib.JsonMessages(e.popups,true);AGN.Lib.Modal.getWrapper(t).modal("hide")}else{AGN.Lib.JsonMessages(e.popups,true)}})});function n(e){$("input[name*='disabledMailinglistsIds']").remove();t("mailinglist").each(function(){$("<input>").attr({type:"hidden",name:"disabledMailinglistsIds",value:$(this).data("mailinglist")}).appendTo(e)})}function t(e){if(e){return $("input:checkbox:not(:checked)[data-enabling="+e+"]")}else{return $("input:checkbox:not(:checked)[data-enabling]")}}});AGN.Lib.Controller.new("ai-text-generation",function(){const r=AGN.Lib.Form;const i=AGN.Lib.Select;var o;var a;this.addDomInitializer("ai-text-generation",function(){o=this.el.closest(".modal");n();const e=i.get($("#ai-language"));if(e.hasOption(window.adminLocale)){e.selectValue(window.adminLocale)}});function n(){o.on("modal:enlarged",function(e,t){c(o,t)});o.on("modal:enlarged:apply",function(e,t){c(t,o)});o.on("saveDynTag",function(e,t){const i=$("#tab-content-ai-text-generation");if(i.is(":visible")){if(a){const n=AGN.Lib.Confirm.createFromTemplate({dynTagName:t.name},"mailing-ai-text-generation-apply-question");n.done(function(){const e=$.Event("saveDynTagContent");o.trigger(e,[a]);a=null})}else{o.modal("toggle")}e.preventDefault()}})}this.addAction({enterdown:"skip-form-submit"},function(){this.event.preventDefault()});this.addAction({click:"generateText"},function(){const e=r.get(this.el);const i=this.el.closest(".tile");if(s(e,i)){const n=d(i);$.post(AGN.url("/mailing/content/generateText.action"),n).done(function(e){a=e.data;f(e.data,i)}).fail(function(){AGN.Lib.Messages(t("Error"),t("defaults.error"),"alert")})}});function s(i,e){var n=true;var r=e.find("[id^='ai-numberOfWords']");var o=e.find("[id^='ai-content-description']");const a=AGN.Lib.Validator.get("number").errors(r,{min:1,required:true});if(a.length>0){n=false;a.forEach(function(e,t){i.showFieldError(r.attr("name"),e.msg)})}else{i.cleanFieldError(r.attr("name"))}if(!$.trim(o.val())){n=false;i.showFieldError(o.attr("name"),t("fields.required.errors.missing"))}else{i.cleanFieldError(o.attr("name"))}return n}this.addAction({click:"assumeGeneratedText"},function(){const e=this.el.closest(".tile");const t=e.data("tab-id");const i=e.find(".ai-generated-text").val();l(t);u(i,e,t)});function l(e){const t=$('[data-toggle-tab*="wysiwyg'+e+'"]');if(t.exists()){t.trigger("click");return}const i=$('[data-toggle-tab*="html'+e+'"]');if(i.exists()){i.trigger("click")}}function u(t,e,i){const n=e.parent().parent().find(".js-wysiwyg");if($("#tab-content-wysiwyg").is(":visible")||$("[id^='tab-grid-wysiwyg"+i+"']").is(":visible")){var r=CKEDITOR.instances[n.attr("id")];if(r.status==="ready"){r.setData(t)}else{r.on("instanceReady",function(e){e.editor.setData(t)})}}if($("#contentEditor").is(":visible")||$("[id^='tab-grid-html"+i+"']").is(":visible")){ace.edit(n.attr("name")+"Editor").setValue(t)}}function c(e,t){const i=d(e);p(t,i);const n=e.find(".ai-generated-text").val();if(n){f(n,t)}}function d(e){return{language:e.find('[id^="ai-language"]').val(),numberOfWords:e.find('[id^="ai-numberOfWords"]').val(),tonality:e.find('[id^="ai-tonality"]').val(),contentDescription:e.find('[id^="ai-content-description"]').val()}}function f(e,t){t.find(".ai-generated-text").val(e);t.find("#ai-assume-generated-text").removeClass("hidden")}function p(e,t){if(t){i.get(e.find("#ai-language")).selectValue(t.language);e.find("#ai-numberOfWords").val(t.numberOfWords);i.get(e.find("#ai-tonality")).selectValue(t.tonality);e.find("#ai-content-description").val(t.contentDescription)}}});AGN.Lib.Controller.new("allowed-profile-field-values",function(){var i=this;this.addInitializer("allowed-values",function(e){if(!e){e=$(document)}var t=e.find('[data-controller="allowed-profile-field-values"]');if(t.length==0){return}i.container=t.find("table .js-allowed-value").first().parent()});this.addAction({click:"addNewValue"},function(){var e=i.getRow(this.el);var t=i.getField(e).val();e.remove();i.appendRow(false,t);i.appendRow(true)});this.addAction({click:"deleteValue"},function(){i.getRow(this.el).remove()});this.appendRow=function(e,t){var i=AGN.Lib.Template.dom("allowed-value-new-row",{isLastRow:e});if(t){this.getField(i).val(t)}this.container.append(i)};this.getRow=function(e){return e.closest("tr.js-allowed-value")};this.getField=function(e){return e.find('input[name="allowedValues"]')}});AGN.Lib.Controller.new("auto-import-export",function(){var i;var a;this.addDomInitializer("auto-export",function(){i=this.config.urls.checkConnection;e()});function e(){const e=$("#edit-profile-btn");const t=$("#add-profile-btn");const i=$("#export-profile").val();const n=parseInt(i)>0;t.toggle(!n);e.toggle(n).attr("href",AGN.url("/export/"+i+"/view.action"))}this.addDomInitializer("auto-import",function(){i=this.config.urls.checkConnection;a=this.config.isWorkflowDriven;if(h()){n(this.config.contentSourceIdentifier)}});function n(e){const t=AGN.Lib.Select.get($("#contentSourceId"));if(t.hasOption(e)){t.selectValue(e)}}this.addInitializer("optionsChangeable",function(){if($("#recipient-autoimport-csvdescription").length){$('[data-action="options-availability"][value="ReferenceTable"]').prop("disabled",false)}});this.addAction({click:"select-customer-fields"},function(){AGN.Lib.Modal.createFromTemplate({},"modal-select-customer-fields");$("#modalSelectedProfileFields").select2("val",$("#selectedProfileFields").val())});this.addAction({click:"save-selected-customer-fields"},function(){$("#selectedProfileFields").select2("val",$("#modalSelectedProfileFields").val())});this.addAction({change:"select-export-profile"},function(){e()});this.addAction({click:"check-connection"},function(){const e=AGN.Lib.Form.get(this.el);$.ajax(i,{type:"POST",dataType:"html",enctype:"multipart/form-data",processData:false,contentType:false,data:e.data()}).done(function(e){AGN.Lib.Page.render(e)})});var r={},o=false;this.addDomInitializer("import-profile-mailing-lists",function(){const e=this.config;o=e.isAutoImportNew;r=e.profileMailinglists;const t=$('[name="importProfileId"]').val();s(t,o)});this.addAction({change:"change-import-profile"},function(){const e=AGN.Lib.Select.get($(this.el)).getSelectedValue();s(e,o)});const s=function(e,t){if(t){const i=r[e];$('input[type=checkbox][name^="mailinglists"]').prop("checked",false);_.each(i,function(e){$('input[type=checkbox][name="mailinglists['+e+']"]').prop("checked",true)})}};const l=AGN.Lib.ScheduleTimeTable,u=AGN.Lib.ScheduleTimeTable.DayRow;function c(e){const t=e.closest("[data-controller]");return t.data("_schedule_table")}function d(e,t){const i=e.closest("[data-controller]");i.data("_schedule_table",t)}this.addDomInitializer("auto-import-export-scheduler",function(){const e=$(this.el);const t=this.config;const i=t.intervalAsJson||[];const n=$("#tile-importexport-schedule-time");const r=new l(n);d(e,r);var o=[];if(!_.isEmpty(i)){o=JSON.parse(i).map(function(e){return u.deserialize(e)})}o.forEach(function(e){r.addRow(e)});if(o.length===0){r.addEmptyDayRow()}const a=AGN.Lib.Form.get(e);a.initFields();if(!a.editable){n.find(":input, button").prop("disabled",true);n.find("a").attr("disabled","disabled")}});this.addAction({click:"add-day"},function(){c($(this.el)).addEmptyDayRow()});this.addAction({click:"remove-day"},function(){const e=$(this.el);c(e).deleteRow(u.get($(this.el)))});this.addAction({click:"add-schedule"},function(){u.get($(this.el)).addSchedule()});this.addAction({click:"remove-schedule"},function(){u.get($(this.el)).removeSchedule($(this.el))});this.addAction({click:"time-checkbox-toggle"},function(){const e=$(this.el);const t=u.get(e);t.timeCheckboxToggle(e)});this.addAction({click:"hour-checkbox-toggle"},function(){const e=$(this.el);const t=u.get(e);t.hourCheckboxToggle(e)});this.addAction({change:"validate-changes"},function(){const e=$(this.el);const t=u.get(e);f(t)});function f(e){if(e.isValidTimeIntervals()){e.hideTimeScheduleErrors();return true}else{e.showTimeScheduleErrors(t("error.delay.60"));return false}}this.addAction({submission:"save-scheduler-data"},function(){const e=$(this.el);const t=c(e);const i=t.getAllDayRows().every(function(e){return f(e)});if(i){const n=AGN.Lib.Form.get($(this.el));n.setValueOnce("intervalAsJson",t.getSubmissionJson("day"));n.submit()}});this.addAction({click:"save-auto-import"},function(){const e=$("#recipient-autoimport-form");const t=c(e);const i=t.getAllDayRows().every(function(e){return f(e)});if(i){const r=AGN.Lib.Form.get(e);const o=t.getSubmissionJson("day");var n=p();if(a){r.setValue("intervalAsJson",o);if(n.length){r.setValue("contentSourceID",n[0]);r.setValue("contentSourceType",n[1])}}else{r.setValueOnce("intervalAsJson",o);if(n.length){r.setValueOnce("contentSourceID",n[0]);r.setValueOnce("contentSourceType",n[1])}}r.submit()}});function p(){if(h()){return $("#contentSourceId").val().split("/")}return[]}function h(){const e=$("#contentSourceId");return e.exists()}function g(e){const t=e.closest("[data-controller]");return t.data("_export_type_handler")}function v(e,t){const i=e.closest("[data-controller]");i.data("_export_type_handler",t)}this.addDomInitializer("mailing-options-attribute-resolver",function(){const e=$(this.el);v(e,new m(e,this.config))});function m(e,t){if(!e.exists()){console.error("ExportTypeHandler could not instantiate, element is not defined");return false}this.$element=e;this.exportType=t.exportType||"";this.mailingType=t.mailingType||-1;const i=$('input[name="'+t.oneTimeOption+'"]');this.$oneTimeCheckbox=i;this.initialOneTimeValues={checked:i.is(":checked"),disabled:i.is(":disabled")};this.toggleOneTimeCheckbox()}m.prototype.isAfterMailingDeliveryType=function(){return this.exportType=="Mailing"&&this.mailingType==0};m.prototype.resolve=function(e,t){this.exportType=e||"";this.mailingType=t||-1;this.toggleOneTimeCheckbox()};m.prototype.toggleOneTimeCheckbox=function(){const e=this.isAfterMailingDeliveryType();const t=this.initialOneTimeValues.checked;const i=this.initialOneTimeValues.disabled;this.$oneTimeCheckbox.prop("checked",e||t);this.$oneTimeCheckbox.prop("disabled",e||i)};this.addAction({change:"change-mailing-type"},function(){const e=$(this.el);const t=AGN.Lib.Select.get(e).getSelectedValue();var i;if($("#exportType").is("select")){i=AGN.Lib.Select.get($("#exportType select")).getSelectedValue()}else{i=$("#exportType [type=radio]:checked").val()}g(e).resolve(i,t)});this.addAction({change:"export-type-resolver"},function(){const e=$(this.el);var t;if($("#exportType").is("select")){t=AGN.Lib.Select.get($("#exportType select")).getSelectedValue()}else{t=e.find("[type=radio]:checked").val()}const i=AGN.Lib.Select.get($("#exportMailing select")).getSelectedValue();g(e).resolve(t,i)})});AGN.Lib.Controller.new("available-building-blocks",function(){var n;var r;var t;function i(){n={};r={}}this.addDomInitializer("available-building-blocks",function(){i();var e=this.el;t=AGN.Lib.Form.get(e);if(this.config.changedBlockStatus){n=JSON.parse(this.config.changedBlockStatus)}});this.addDomInitializer("available-building-blocks-table",function(){var e=this.config.divContainerList;_.each(e,function(e){var t=e.id;var i=e.active;if(t in r){if(t in n){$("input:checkbox[data-block-id="+t+"]").prop("checked",!!n[t])}}else{r[t]=i}});o()});this.addAction({click:"update-changed-data"},function(){var e=this.el;o();a();t.setActionOnce(e.data("form-url"));t.setResourceSelectorOnce(e.data("form-resource"));t.submit()});this.addAction({change:"change-activation"},function(){var e=this.el;var t=e.data("block-id");var i=e.is(":checked");if(i==r[t]){if(t in n){delete n[t]}}else{n[t]=i}});this.addAction({change:"activate-all"},function(){var e=this.el;var t=$("input:checkbox[data-block-id]");t.prop("checked",e.is(":checked"));t.change()});function o(){var e=$(t.form).find(".table-controls .well");e.first().html(e.last().html())}this.updateTableControls=o;function a(){if(!!t){t.setValue("changedBlockStatusJson",JSON.stringify(n,function(e,t){if(t!=null){return t}}))}}this.updateFormData=a});AGN.Lib.Controller.new("birt-reports",function(){var a={},i=0,s=[],l=[],u=[],n,r,c;this.addDomInitializer("birt-reports",function(){a=this.config;r=a.constant.MAILING_ID;n=a.constant.AFTER_MAILING_TYPE_ID;s=a.filtered.FILTER_ARCHIVE;l=a.filtered.FILTER_MAILINGLIST;u=a.filtered.FILTER_TARGET;i=a.reportType;c=this.el});function o(){_.each($(a.reportSettingsId).find("[data-toggle-tab]"),function(e){var t=$(e);var i=t.data("toggle-tab");if(i.endsWith(r)){t.trigger("click");return}t.parent("li").addClass("disabled");AGN.Lib.Tab.hide($(i))})}function d(){_.each($(a.reportSettingsId).find("[data-toggle-tab]"),function(e){$(e).parent("li").removeClass("disabled")})}AGN.Lib.Action.new({change:"input[type=radio][name=type]"},function(){var e=$(this.el).val();var t=e==n;if(t){o()}else if(i==n){d()}i=e;return false});this.addDomInitializer("report-settings",function(){var e=this.el;var t=this.config;new f(e,t)});var f=function(e,t){var i=this;this.container=e;this.config=t;this.settingsType=t.settingsType;this.select=AGN.Lib.Select.get(e.find(t.selectors.filterBlockId));this.mailingSelect=AGN.Lib.Select.get(e.find(t.selectors.normalMailing));i.init(t);e.find(t.selectors.mailingType).on("change",function(e){i.handleMailingTypeChanges($(e.target))});e.find(t.selectors.mailingFilter).on("change",function(e){i.handleMailingFilterChanges($(e.target))});e.find(t.selectors.filterBlockId).on("change",function(e){i.handleMailingFilterValueChanges($(e.target))})};f.prototype.init=function(e){var t=e.data.mailingType;var i=e.data.mailingFilter;var n=e.data.predefineMailing;var r=e.data.selectedMailings;const o=this.updateAllComparisonDependentFields(t,i,n,r);o.done(function(){c.dirty("setAsClean")})};f.prototype.handleMailingTypeChanges=function(e){var t=this;var i=t.getMailingFilter();var n=t.getMailingFilterValue();t.updateNormalMailingField(e.val(),i,n)};f.prototype.handleMailingFilterChanges=function(e){var t=this;var i=t.getMailingType();t.updateAllComparisonDependentFields(i,e.val())};f.prototype.handleMailingFilterValueChanges=function(e){var t=this;var i=t.getMailingFilter();var n=t.getMailingType();t.updateNormalMailingField(n,i,e.val())};f.prototype.updateAllComparisonDependentFields=function(e,t,i,n){var r=this;r.select.resetOptions();if(t>0){var o=[];if(t==1){o=s}else if(t==2){o=l}else if(t==4){o=u}_.each(o,function(e){r.select.addFormattedOption('<option value="'+e.id+'">'+e.shortname+"</option>")});r.select.selectValueOrSelectFirst(i);i=r.select.getSelectedValue()}return r.updateNormalMailingField(e,t,i,n)};f.prototype.updateNormalMailingField=function(e,t,i,n){const r=$.Deferred();var o=this;o.mailingSelect.resetOptions();if(o.settingsType==a.constant.COMPARISON_SETTINGS&&e==2||o.settingsType==a.constant.MAILING_SETTINGS&&e==3){$.ajax({type:"GET",url:a.urls.FILTERED_MAILING_URL,data:{type:t,value:i?i:0,mailingType:a.constant.NORMAL_MAILING_TYPE}}).done(function(e){_.each(e,function(e){o.mailingSelect.addFormattedOption('<option value="'+e.id+'">'+e.shortname+"</option>")});o.mailingSelect.selectValue(n?n:"");r.resolve()})}return r.promise()};f.prototype.getMailingFilter=function(){var e=this.container.find(this.config.selectors.mailingFilter);return parseInt(e.val())|0};f.prototype.getMailingFilterValue=function(){var e=this.select.getSelectedValue();return parseInt(e)|0};f.prototype.getMailingType=function(){var e=this.container.find(this.config.selectors.mailingType+":checked");return parseInt(e.val())|0};this.addAction({click:"confirm-deactivate-deliveries"},function(){AGN.Lib.Confirm.createFromTemplate({action:AGN.url("/statistics/report/"+a.reportId+"/deactivateAllDeliveries.action"),method:"POST",title:t("birtreport.deactivateAll"),content:t("birtreport.deactivateAllQuestion")},"modal-yes-no-cancel").done(function(e){AGN.Lib.Form.get($("#birtreportForm")).updateHtml(e)})})});AGN.Lib.Controller.new("blacklist-list",function(){var n;this.addDomInitializer("blacklist-list-init",function(){n=this.el});this.addAction({click:"saveBlacklist"},function(){var e=this.el;var t=AGN.Lib.Form.get(e);var i=e.data("url");$.ajax(i,{type:"POST",data:{email:n.find("#new-entry-email").val(),reason:n.find("#new-entry-reason").val()},success:function(e){if(e.success===true){t.submit().done(function(){AGN.Lib.JsonMessages(e.popups,true)})}else if(e.popups){AGN.Lib.JsonMessages(e.popups,true)}else{AGN.Lib.RenderMessages($(e))}}})})});AGN.Lib.Controller.new("edit-modal-blacklist-list",function(){this.addAction({click:"saveChanges"},function(){var t=this.el;var e=AGN.Lib.Form.get(t);e.submit().done(function(e){if(e.success===true){AGN.Lib.Form.get($("#blacklistListView")).submit().done(function(){AGN.Lib.JsonMessages(e.popups,true)});AGN.Lib.Modal.getWrapper(t).modal("hide")}else if(e.popups){AGN.Lib.JsonMessages(e.popups,true)}else{AGN.Lib.RenderMessages($(e))}})})});AGN.Lib.Controller.new("email-list-controller",function(){var i="";var n=" ";var t;var r=function(){var e=[""];var t=$('input[name="'+i+'"]').val();if(t){e=t.split(n)}return e};var e=function(){var e=t.getJsonData();$('input[name="'+i+'"]').val(e.join(n))};this.addDomInitializer("email-list-initializer",function(){var e=$(this.el);i=e.data("target-field")||"";n=e.data("data-emails-separator")||n;t=AGN.Lib.EmailsListManager.initialize(e,r())});this.addAction({click:"delete-email"},function(){t.deleteRow($(this.el));e()});this.addAction({click:"create-email"},function(){t.createRowAfter($(this.el));e()});this.addAction({change:"change-trigger"},function(){e()})});AGN.Lib.Controller.new("company-view",function(){this.addAction({click:"create-postal-field"},function(){const t=this.el.attr("href");const e=AGN.Lib.Form.get(this.el);e.jqxhr().done(function(e){AGN.Lib.Page.reload(t)})})});AGN.Lib.Controller.new("content-source-view",function(){var i=AGN.Lib.Select;var o=AGN.Lib.Template;var r;var a;var s=[];var l;var n;var u=[];var c;function d(e,t){this.address=t;this.contentBlockName="";this.targetGroup=0;this.index=e}d.create=function(e,t){return new d(e,t)};this.addDomInitializer("content-source-view",function(){a=$("#urlsContainer");r=AGN.Lib.Form.get($("#content-source-form"));c=$("#resource-type").val();s=[];e();if(this.config.urlResources){f(this.config.urlResources)}l=this.config.urls.linkForSettings;n=this.config.htmlSourcesAllowed});function e(){var e=$("#dynamic-container");a.empty();e.empty();if(c==="HTML"&&n){var t=$(o.text("add-url-btn",{}));e.append(t)}else if(c==="XML"){var i=$(o.text("xml-source-url"));e.append(i)}}this.addAction({change:"change-resource-type"},function(){c=this.el.val();e();s=[]});function f(e){if(c==="XML"){if(e.length>0){$("#xml-url-address").val(e[0].url)}}else if(c==="HTML"){_.each(e,function(e){var t=p(e);var i=$(o.text("html-source-url",{index:t.index,address:t.address}));var n=i.find("button[data-action='configure-url']");var r=i.find("input[data-source-url]");A(i,".content-block-info",e.contentBlockName,".content-name-value",e.contentBlockName);A(i,".target-group-info",e.targetGroupName,".target-group-value",e.targetGroupName);a.append(i);m(r,n)})}}function p(e){var t=d.create(s.length);t.address=e.url;t.contentBlockName=e.contentBlockName;t.targetGroup=e.targetGroup;s.push(t);return t}this.addDomInitializer("content-sources-mailings",function(){u=this.config;var e=$("#mailing-name");h(e);g(e)});function h(i){u.forEach(function(e){var t=$("<option>",{value:e.name,text:e.name});i.append(t)})}function g(e){var t=$("#content-block-name");e.on("change",function(){t.empty();v($(this).val(),t);i.get(t).selectFirstValue()})}function v(t,i){var e=u.find(function(e){return e.name===t});e.blocks.forEach(function(e){var t=$("<option>",{value:e,text:e});i.append(t)})}this.addAction({click:"add-url-resource"},function(){var e=s.length;var t=$(o.text("html-source-url",{index:e,address:""}));var i=t.find("button[data-action='configure-url']");var n=t.find("input[data-source-url]");a.append(t);i.hide();m(n,i);s.push(d.create(e))});function m(e,t){if(e&&t){e.on("change keyup paste",function(){if($(this).val()){t.show()}else{t.hide()}})}}this.addAction({click:"configure-url"},function(){var e=this.el.closest(".form-group");var t=e.find(".form-control");var i=e.data("url-index");var n={url:t.val(),index:i};var r=s.find(function(e){return e.index===i});y(n,r)});this.addAction({click:"remove-url"},function(){var e=this.el.closest(".form-group");var t=e.data("url-index");e.remove();s=s.filter(function(e){return e.index!==t})});function y(i,n){var e=$.get(l);e.done(function(e){var t=_.template(e)(i);r.updateHtml(t);b(n);w()})}function b(e){var t=$('div[data-modal-index="'+e.index+'"]');if(e.contentBlockName){var i=t.find("#content-block-name");var n=i.find("option:first-child");n.val(e.contentBlockName);n.text(e.contentBlockName);i.change()}if(e.targetGroup>0){var r=t.find("#target-group-select");r.find("option[value="+e.targetGroup+"]").attr("selected","selected");r.change()}}function w(){$("[data-confirm-positive]").on("click",function(){var e=$(this).closest(".modal");var t=e.data("modal-index");var i=s.find(function(e){return e.index===t});var n=e.find("#target-group-select");i.targetGroup=n.val();i.contentBlockName=e.find("#content-block-name").val();C(i,n);r.handleErrors()})}function C(e,t){var i=$("div[data-url-index='"+e.index+"']");var n=t.find("option:selected").text();A(i,".content-block-info",e.contentBlockName,".content-name-value",e.contentBlockName);A(i,".target-group-info",e.targetGroup,".target-group-value",n)}function A(e,t,i,n,r){var o=e.find(t);if(i){o.find(n).text(r);o.show()}else{o.hide()}}this.addAction({submission:"content-source-save"},function(){r.initFields();E();if(r.valid()){_.each(s,function(e,t){var i=e.targetGroup?e.targetGroup:0;r.setValue("urls["+t+"].url",e.address);r.setValue("urls["+t+"].contentBlockName",e.contentBlockName);r.setValue("urls["+t+"].targetGroup",i)})}r.submit()});function E(){if(c==="XML"){var e=d.create(0,$("#xml-url-address").val());s=[];s.push(e)}else if(c==="HTML"){x()}}function x(){_.each(a.find("[data-source-url]"),function(e){var t=$(e);var i=t.closest(".form-group").data("url-index");var n=s.find(function(e){return e.index===i});n.address=t.val()})}AGN.Lib.Validator.new("mailing-content-block",{valid:function(e,t){return!this.errors(e,t).length},errors:function(e,i){var n=[];var r=e.closest(".form-group").data("url-index");var o=s.find(function(e){return e.index===r});if(!o.contentBlockName){n.push({field:e,msg:t("contentSource.error.block_not_set")})}return n}})});AGN.Lib.Controller.new("custom-thumbnail-view",function(){this.addAction({change:"use-custom-thumbnail"},function(){var e=$("#customThumbnailFile");e.prop("name",this.el.is(":checked")?"customThumbnailFile":"")});this.addAction({change:"custom-thumbnail-image"},function(){var t=this.el;var e=t.prop("files");if(e&&e.length){var i=e[0];if(i.type=="image"||i.type.match("image/.*")){var n=new FileReader;n.onload=function(e){r(t,i.name,e.target.result)};n.readAsDataURL(i)}else{AGN.Lib.Helpers.clearFormField(t);r(t,"","")}}else{r(t,"","")}});function r(e,t,i){var n;n=e.data("preview-name");if(n){$(n).text(t)}n=e.data("preview-image");if(n){if(i){$(n).prop("src",i)}else{$(n).each(function(){var e=$(this);e.prop("src",e.data("no-preview-src")||"")})}}}});AGN.Lib.Controller.new("device-statistic",function(){var i,n,r,o;this.addDomInitializer("device-statistic-initializer",function(){var e=this.config;var t=e.activeStatisticId;i=e.HTML_URL;n=e.htmlBlockSelector;r=e.exportBlockSelector;o=e.typeFieldName;_.each($('[data-action="switch-device-tab"]'),function(e){if($(e).data("type")===t){$(e).trigger("click")}})});this.addAction({click:"switch-device-tab"},function(){var e=$(this.el).data("type");$(n).find("iframe").attr("src",a(e));$(r).html(t(e));$('[name="'+o+'"]').val(e)});function t(e){return AGN.Lib.Template.text("statistic-csv-view",{type:e})}function a(e){return i.replace("{stat-type}",e)}});AGN.Lib.Controller.new("emc-template-preview-controller",function(){this.addDomInitializer("emc-template-preview-initializer",function(){if($('[name="view-state"]').length){e()}});function e(){$("#preview").find(".tile-header").removeAttr("data-sizing");$("#content_wrapper").removeAttr("data-sizing");$("#previewTabsMenu").replaceWith('<h2 class="headline">'+t("defaults.previewMode")+"</h2>")}});AGN.Lib.Controller.new("emm-activeness",function(){function o(e,t,i){e[t]=i;n(e)}function a(e,t){delete e[t];n(e)}function l(e){for(var t in e){delete e[t]}n(e)}function n(e){var t=$('[data-action="save"]');var i=0;for(var n in e){if(e.hasOwnProperty(n)){i++;break}}if(i>0){t.removeClass("disabled")}else{t.addClass("disabled")}}this.addAction({click:"save"},function(){var e=$(this.el);var i=AGN.Lib.Form.get(e);var n=e.closest("[data-controller]");var r=n.data("_states")||{};if(i&&i.form){for(var o in r){if(r.hasOwnProperty(o)){i.setValueOnce("activeness["+o+"]",r[o])}}i.submit()}else{var a=AGN.Lib.Table.get(e);if(a){var s=[];$.ajax(e.data("form-url"),{method:"POST",traditional:false,data:{activeness:r}}).done(function(e){if(e&&e.success===true){s=u(a,r)}else{s=c(a,r)}AGN.Lib.JsonMessages(e.popups)}).fail(function(){s=c(a,r);AGN.Lib.Messages(t("Error"),t("defaults.error"),"alert")}).always(function(){a.api.updateRowData({update:s});l(r)})}}});function u(e,t){i(e,t,false)}function c(e,t){i(e,t,true)}function i(e,r,o){var a=[];e.api.forEachNodeAfterFilterAndSort(function(e,t){var i=e.data.id;if(r.hasOwnProperty(i)){var n=o?!r[i]:r[i];e.data.activeStatus=n?"ACTIVE":"INACTIVE";a.push(e.data)}});return a}this.addAction({change:"toggle-active"},function(){var e=$(this.el);var t=e.closest("[data-controller]");var i=t.data("_states")||{};var n=e.data("item-id");var r=e.is(":checked");if(r==e.data("initial-state")){a(i,n)}else{o(i,n,r)}t.data("_states",i)})});AGN.Lib.Controller.new("enlarged-content-editor-controller",function(){var i=AGN.Lib.Modal;var n=AGN.Lib.Confirm;var r;this.addDomInitializer("enlarged-content-editor-initializer",function(e){var t=i.get(e);r=t.content;l(t.editorType);o()});function o(){if(s()==="html"){c()}else{d()}}this.addAction({click:"updateContent"},function(){var e=$(this.el);var t=n.get(e);t.positive(a());$("#enlarged_content_modal").modal("toggle")});var a=function(){return{content:e(),editorType:s()}};var e=function(){var e=$("#tab-enlargedContent-wysiwyg");var t=$("#enlargedContentEditor");if(e.is(":visible")){var i=CKEDITOR.instances["enlargedContent"];return i.getData()}if(t.is(":visible")){var n=ace.edit("enlargedContentEditor");return n.getValue()}};var s=function(){var e=$("#tab-enlargedContent-wysiwyg");if(e.is(":visible")){return"wysiwyg"}var t=$("#enlargedContentEditor");if(t.is(":visible")){return"html"}return""};var l=function(e){if(!e||e===""){return}var t=$('[data-toggle-tab$="'+e+'"]');if(t){t.trigger("click")}};const u=function(e){const i=e.val().length;$('[data-enlarged-char-counter-for="'+e.attr("id")+'"]').find("span:first").text(t("fields.content.charactersEntered",i))};this.addAction({"editor:create":"count-enlarged-textarea-chars","editor:change":"count-enlarged-textarea-chars"},function(){u(this.el)});this.addAction({click:"hide-enlarged-char-counter"},function(){d()});this.addAction({click:"show-enlarged-char-counter"},function(){c()});function c(){$("[data-enlarged-char-counter-for]").first().show()}function d(){$("[data-enlarged-char-counter-for]").first().hide()}});AGN.Lib.Controller.new("export-view",function(){var e;var i;var o;var r;this.addDomInitializer("export-view",function(){e=this.config.adminHasOwnColumnPermission;o=this.config.bounceUserStatusCode;p();if(e){t(f(this.config.customColumns))}});this.addAction({click:"save"},function(){h()});this.addAction({click:"evaluate"},function(){h()});this.addAction({change:"add-bounce-col-to-choose"},p);this.addAction({click:"add-column-mapping",enterdown:"mapping-enterdown"},function(){var e=AGN.Lib.Form.get($("#exportForm"));var t=u().find("[data-column-name]");this.event.preventDefault();if(e.valid({})){if(t.val()){e.cleanErrors();l();n("","");u().find("[data-column-name]").focus()}else{t.focus()}}else{e.handleErrors()}});this.addAction({click:"delete-column-mapping"},function(){this.el.closest("tr").remove()});function t(e){r=$("#columnMappings tbody");i=AGN.Lib.Template.prepare("column-mapping-table-row");_.each(e,function(e){n(e.dbColumn,e.defaultValue)});n("","");if(!AGN.Lib.Form.get($("#exportForm")).editable){r.find(":input, button").prop("disabled",true);r.find("a").attr("disabled","disabled")}}function a(e){return e.find("[data-column-name]").val().trim()}function s(e){return e.find("[data-column-value]").val().trim()}function n(e,t){r.append(i({name:e,value:t}))}function l(){var e=r.find('[data-action="add-column-mapping"]');e.after("<a href='#' class='btn btn-regular btn-alert' data-action='delete-column-mapping'>"+"<i class='icon icon-trash-o'></i></a>");e.remove()}function u(){return r.find("[data-column-mapping-row]:last-child")}function c(){var n=[];_.each(r.find("[data-column-mapping-row]"),function(e){var t=$(e);var i=a(t);if(i){n.push([i,s(t)])}});return n}function d(i){_.each(c(),function(e,t){i.setValue("customColumns["+t+"].dbColumn",e[0]);i.setValue("customColumns["+t+"].defaultValue",e[1])})}function f(e){return e.sort(function(e,t){if(e.dbColumn<t.dbColumn){return-1}if(e.dbColumn>t.dbColumn){return 1}return 0})}function p(){var e=$("#mailing-bounce-column-option");var t=$("#recipient-export-recipientstatus").find(":selected").val();if(t==o){e.removeAttr("disabled")}else{var i=$('[name="userColumns"]');var n=i.val();var r=n.filter(function(e){return e!="mailing_bounce"});i.val(r);i.trigger("change");e.attr("disabled","disabled")}}function h(){var e=AGN.Lib.Form.get($("#exportForm"));if(e.valid({})){d(e);e.submit()}else{e.handleErrors()}}});AGN.Lib.Controller.new("facebook-leadads",function(){var i=AGN_FACEBOOK.Login,a=AGN_FACEBOOK.LeadAds,e=AGN_FACEBOOK.SDK,s=AGN.Lib.Select;var l={};this.addDomInitializer("facebook-leadads",function(){l=this.config;AGN.Lib.Storage.delete("fblst_"+l.FACEBOOK_LEADADS_APP_ID);e.load_sdk(l.FACEBOOK_LEADADS_APP_ID,d)});var n=function(e){$("#mailinglistId").prop("disabled",!e)};var r=function(e){$("#doiMailingId").prop("disabled",!e)};var o=function(e){$('[data-action="connect-page"]').prop("disabled",!e)};var u=function(){$('[data-action="authorized-info"]:not(.hidden)').addClass("hidden")};var c=function(){$('[data-action="authorized-info"].hidden').removeClass("hidden")};var d=function(){var e=function(e){var i=function(){AGN.Lib.Messages(t("defaults.error"),t("messages.error.reload"),"alert")};f();a.list_manageable_pages(e,l.URL.LIST_FACEBOOK_PAGE_BINDINGS_AJAX_URL,"#facebook-pages-table",i)};i.attach_login_function(".facebook-login-btn",e,"pages_read_engagement, leads_retrieval");f()};var f=function(){i.doByLoginStatus(null,function(){$(".facebook-login-btn").show()});i.doByLoginStatus(h,p)};var p=function(){s.get($("#mailinglistId")).selectFirstValue();n(false);r(false);o(false);u()};var h=function(e){c();n(true);a.list_manageable_pages(e,l.URL.LIST_FACEBOOK_PAGE_BINDINGS_AJAX_URL,"#facebook-pages-table");$('[data-action="connect-page"]').data("fbAccessToken",e);a.renew_page_access_tokens(e,l.URL.RENEW_FACEBOOK_PAGE_ACCESS_TOKENS_AJAX_URL,function(e){var i=JSON.parse(e);if(i.count>0){AGN.Lib.Messages(t("defaults.success"),t("facebook.leadAds.renewedPageAccessTokens",i.count),"success")}})};this.addAction({change:"mailinglist-change"},function(){o(false);r(false);var e=$(this.el);var t=s.get(e).getSelectedValue();g(t);r(t!==0)});var g=function(e){var i=s.get($('[data-action="doi-mailing-change"]'));i.resetOptions();i.setOptions([{id:0,text:"---"}]);i.selectFirstValue();if(e!==0){r(false);$.ajax({url:l.URL.LIST_ACTIONBASED_AJAX_URL,type:"GET",data:{mailinglist:e},success:function(e){if(e){var t=_.map(e.mailings,function(e){console.log("mailing "+e.id+": "+e.shortname);return{id:e.id,text:e.shortname}});t.unshift({id:0,text:"---"});i.setOptions(t);i.selectFirstValue()}},error:function(e,i,n){console.log("status = "+i+", error = "+n);AGN.Lib.Messages(t("defaults.error"),t("messages.error.reload"),"alert")},statusCode:{500:function(){if(!!onError){onError()}}}})}};this.addAction({change:"doi-mailing-change"},function(){var e=$(this.el);var t=s.get(e).getSelectedValue();o(t!==0)});this.addAction({click:"connect-page"},function(){var e=$(this.el);var i=e.data("fbAccessToken");var n=function(){a.list_manageable_pages(i,l.URL.LIST_FACEBOOK_PAGE_BINDINGS_AJAX_URL,"#facebook-pages-table");AGN.Lib.Messages(t("defaults.success"),t("defaults.saved"),"success")};var r=s.get($('[data-action="mailinglist-change"]')).getSelectedValue();var o=s.get($('[data-action="doi-mailing-change"]')).getSelectedValue();a.connect_pages(i,l.URL.CONNECT_FACEBOOK_PAGE_BINDINGS_AJAX_URL,"#facebook-pages-table",r,o,n,null,function(e){if(!!e){e.page_names.forEach(function(e){AGN.Lib.Messages(t("facebook.leadAds.error.already_bound_to_other_company"),e,"alert")})}})})});AGN.Lib.Controller.new("form-trackable-link",function(){var r;AGN.Opt.DefaultExtensions={};this.addDomInitializer("trackable-link-extensions",function(){var e=this.config;AGN.Opt.DefaultExtensions=e.defaultExtensions;r=AGN.Lib.Template.prepare("extensions-table-row");l(e.extensions)});this.addAction({submission:"bulk-save"},function(){var e=$("#userFormTrackableLinksForm");var t=AGN.Lib.Form.get(e);u(t,"commonExtensions");t.submit()});this.addAction({submission:"save"},function(){var e=$("#userFormTrackableLinkForm");var t=AGN.Lib.Form.get(e);u(t,"extensions");t.submit()});this.addAction({click:"add-default-extensions"},function(){_.each(AGN.Opt.DefaultExtensions,function(e){i(e.name,e.value,true)})});this.addAction({click:"add-extension"},function(){i("","")});this.addAction({click:"delete-extension"},function(){var e=$(this.el).data("property-id");t(e)});this.addAction({click:"delete-all-extensions"},function(){e()});function o(e){return e.find("[data-extension-name]").val()}function a(e){return e.find("[data-extension-value]").val()}function s(i,n){var r=true;_.each($("[data-extension-row]"),function(e){var t=$(e);if(r){if(o(t)==i&&a(t)==n){r=false}}});return r}function n(e,t,i){var n=$("#extensions-table tbody");if(s(t,i)){n.append(r({index:e,name:t,value:i}))}}function t(e){$('[data-extension-row="'+e+'"]').remove()}function e(){$("[data-extension-row]").remove()}function i(e,t){var i=$("#extensions-table tbody [data-extension-row]:last-child").data("extension-row")||0;n(++i,e,t)}function l(e){$("#extensions-table tbody").html("");_.each(e,function(e,t){n(t,e.name,e.value)})}function u(n,r){_.each($("[data-extension-row]"),function(e,t){var i=$(e);n.setValueOnce(r+"["+t+"].name",o(i));n.setValueOnce(r+"["+t+"].value",a(i))})}});AGN.Lib.Controller.new("grid-building-block-defaults",function(){var i=AGN.Lib.Confirm,r=AGN.Lib.Form,n=AGN.Lib.Page,u=AGN.Lib.Helpers;var c;this.addDomInitializer("grid-building-block-defaults",function(){c=this.config;$("img[id^=preview]").each(function(){var e=$(this);var t=e.attr("src");if(t){var i=p(t);if(i!==t){e.attr("src",$.trim(i))}}e.style("display","")});e()});function e(){c.placeholders.filter(function(e){return e.placeholderType===c.CHECK_PLACEHOLDER_TYPE}).forEach(function(e){const t=$('<div id="'+e.id+'-children" class="col-sm-offset-1 col-sm-11" data-show-by-checkbox="#content-'+e.id+'"></div>');t.insertAfter($("#content-"+e.id).closest(".form-group"));e.options.split(",").forEach(function(e){t.append($(".ph-"+e))})});AGN.Lib.CoreInitializer.run("checkbox-hider",$("#defaultsForm"))}function d(e){var t=e.closest("[data-placeholder-id]");if(t.exists()){return parseInt(t.data("placeholder-id"))}else{return 0}}function o(e){var t=$("#file-"+e);if(t.exists()){return!!t.val()}else{return false}}function a(e,t){var i=e.prop("files");var n=$("#content-"+t);var r=$("#image-category-"+t).closest(".form-group");if(i&&i.length){var o=i[0];if(o.type==="image"||o.type.match("image/.*")){var a=new FileReader;a.onload=function(e){r.removeClass("hidden");f(t,e.target.result,o.name,o.name)};a.readAsDataURL(o)}else{r.addClass("hidden");u.clearFormField(e);f(t)}}else{r.addClass("hidden");f(t)}n.val("")}function s(t){i.request(c.urls.MEDIAPOOL_IMAGE_PICK).done(function(e){$("#content-"+t).val(e.id);u.clearFormField($("#file-"+t));f(t,e.src,e.name,e.title)})}function l(e){var t=$("#file-"+e);var i=$("#file-name-"+e);var n=$("#content-"+e);var r=$("#preview-"+e);u.clearFormField(t);i.text("");n.val("");r.attr("src",c.noPreviewImageLink)}function f(e,t,i,n){var r=$("#preview-"+e);var o=$("#file-name-"+e);if(r.attr("src")!==t){r.attr("src",t||c.noPreviewImageLink)}r.attr("title",n||"");o.text(i||"")}function p(e){return u.replaceAgnTags(e,function(e,t){if(e.name==="agnIMAGE"&&e.attributes["name"]){if(!e.attributes["source"]||e.attributes["source"]==="mediapool"||e.attributes["source"]==="mediapoolbg"){return c.imageByFilenameSrcPattern.replace(":filename:",encodeURIComponent(e.attributes["name"]))}}return t})}var h=_.throttle(function(e,t){var i=$("#preview-"+e);if(i.attr("src")!==t){if(t){i.attr("src",$.trim(p(t)))}else{i.attr("src",t||c.noPreviewImageLink)}}},300);function g(){var i=$.Deferred();var a=[];var e=$("#defaultsForm");var s=r.get(e);var l=true;e.find("input[type=file]").each(function(){var e=$(this);var i=d(e);var n=$("#image-category-"+i);var r=e.prop("files");if(r&&r.length){var o=n.val();if(o>0){a.push({placeholderId:i,image:r[0],categoryId:o});s.cleanFieldError$(n)}else{l=false;s.showFieldError$(n,t("error.grid.noCategorySelected"))}}else{s.cleanFieldError$(n)}});if(l){if(a.length){var n=new FormData;a.forEach(function(e,t){n.append("images["+t+"].file",e.image);n.append("images["+t+"].fileName",e.image.name);n.append("images["+t+"].title",e.image.name);n.append("images["+t+"].categoryId",e.categoryId)});$.ajax(c.urls.MEDIAPOOL_IMAGE,{type:"POST",dataType:"json",accepts:["application/json"],enctype:"multipart/form-data",processData:false,contentType:false,data:n}).done(function(e){if(e.success===true){e.data.forEach(function(e,t){var i=a[t].placeholderId;$("#content-"+i).val(e);u.clearFormField($("#file-"+i))});i.resolve()}else{AGN.Lib.JsonMessages(e.popups);i.reject()}}).fail(function(){i.reject()})}else{i.resolve()}}else{i.reject()}return i.promise()}this.addAction({click:"delete"},function(){var e=$.post(c.urls.CONFIRM_DELETE);return i.request(e).done(function(e){if(e.success===true){n.reload(c.urls.BACK,true).done(function(){AGN.Lib.JsonMessages(e.popups)})}else{AGN.Lib.JsonMessages(e.popups)}})});this.addAction({click:"chooseImage"},function(){var e=d(this.el);if(e>0){if(o(e)){$("#file-"+e).trigger("click")}else{s(e)}}});this.addAction({click:"showMediapoolDialog"},function(){var e=d(this.el);if(e>0){s(e)}});this.addAction({change:"chooseImageFile"},function(){var e=d(this.el);if(e>0){a(this.el,e)}});this.addAction({click:"deleteImage"},function(){var e=d(this.el);if(e>0){l(e)}});this.addAction({change:"previewImageLink",keyup:"previewImageLink",mouseup:"previewImageLink"},function(){var e=d(this.el);if(e>0){h(e,$.trim(this.el.val()))}});this.addAction({click:"chooseImageLink"},function(){var e=d(this.el);if(e>0){$("#content-"+e).trigger("focus")}});this.addAction({click:"save"},function(){g().done(function(){$("#defaultsForm").submit()})})});AGN.Lib.Controller.new("grid-building-block",function(){var t=AGN.Lib.Confirm,i=AGN.Lib.Page;var n;this.addDomInitializer("grid-building-block",function(){n=this.config});this.addAction({click:"delete"},function(){var e=$.post(n.urls.CONFIRM_DELETE);return t.request(e).done(function(e){if(e.success===true){i.reload(n.urls.BACK,true).done(function(){AGN.Lib.JsonMessages(e.popups)})}else{AGN.Lib.JsonMessages(e.popups)}})})});AGN.Lib.Controller.new("grid-building-blocks-new",function(){var i=AGN.Lib.Confirm,n=AGN.Lib.Form;var a;var s={setSaveButtonEnabled:function(e){var t=$("#save-button");if(e){t.removeClass("disabled")}else{t.addClass("disabled")}},getActivenessToggles:function(){return $("#containers").find("input.js-activeness-toggle")},getActivenessTogglesMap:function(){var t={};s.getActivenessToggles().each(function(){var e=$(this);t[e.data("container-id")]=e});return t},getActivenessTogglesStateMap:function(){var t={};s.getActivenessToggles().each(function(){var e=$(this);t[e.data("container-id")]=e.prop("checked")});return t},getBulkIds:function(){var t=[];$("#containers").find(".js-bulk-ids:checked").each(function(){var e=parseInt($(this).val());if(e>0){t.push(e)}});return t.length?t:null},resetBulkIds:function(){$("#containers").find(".js-bulk-ids").prop("checked",false)}};function r(){this.map={}}r.prototype.include=function(e,t){this.map[e]=t};r.prototype.exclude=function(e){delete this.map[e]};r.prototype.excludeAll=function(e){for(var t=0;t<e.length;t++){delete this.map[e[t]]}};r.prototype.clear=function(){this.map={}};r.prototype.size=function(){return Object.keys(this.map).length};r.prototype.get=function(){return _.clone(this.map)};function o(r,o){var e={};if(arguments.length<2){o=true}else{o=!!o}for(var t=0;t<r.length;t++){e[r[t]]=o}return l(e).done(function(e){if(e.success===true){var t=s.getActivenessTogglesMap();for(var i=0;i<r.length;i++){var n=r[i];t[n].prop("checked",o);a.activenessInitialStateMap[n]=o}a.activenessChangeMap.excludeAll(r);s.resetBulkIds();s.setSaveButtonEnabled(a.activenessChangeMap.size()>0)}})}function l(e){return $.post(a.urls.SET_ACTIVENESS,{activeness:e}).done(function(e){AGN.Lib.JsonMessages(e.popups)})}function u(e){var t=$.post(a.urls.CONFIRM_DELETE.replace(":containerId:",e));return i.request(t).done(function(e){AGN.Lib.JsonMessages(e.popups)})}function c(e){var t=$.ajax(a.urls.CONFIRM_BULK_DELETE,{method:"POST",traditional:true,data:{bulkIds:e}});return i.request(t).done(function(e){AGN.Lib.JsonMessages(e.popups)})}this.addDomInitializer("grid-building-blocks-new",function(){a=this.config;if(location.hash){var e=parseInt(location.hash.substr(1));if(e>0){var t=$("#containers");var i=t.find('[data-container-id="'+e+'"]').closest("tr");if(i.exists()){var n=i.position().top;t.scrollTop(n-10)}}}a.activenessChangeMap=new r;a.activenessInitialStateMap=s.getActivenessTogglesStateMap()});this.addAction({click:"save"},function(){var t=n.get(this.el);l(a.activenessChangeMap.get()).done(function(e){if(e.success===true){a.activenessChangeMap.clear();a.activenessInitialStateMap=s.getActivenessTogglesStateMap();s.setSaveButtonEnabled(false);t.submit()}})});this.addAction({change:"toggle-activated"},function(){var e=$(this.el);var t=e.data("container-id");var i=e.is(":checked");if(a.activenessInitialStateMap[t]==i){a.activenessChangeMap.exclude(t)}else{a.activenessChangeMap.include(t,i)}s.setSaveButtonEnabled(a.activenessChangeMap.size()>0)});this.addAction({click:"delete-building-block"},function(){var e=this.el.data("container-id");var t=n.get(this.el);if(e>0){u(e).done(function(e){if(e.success===true){t.submit()}})}});this.addAction({click:"bulk-delete"},function(){var e=s.getBulkIds();var i=n.get(this.el);if(e){c(e).done(function(e){if(e.success===true){i.submit()}})}else{AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}});this.addAction({click:"bulk-export"},function(){const e=s.getBulkIds();const i=n.get(this.el);if(e){i.setActionOnce(a.urls.BULK_EXPORT);i.setValueOnce("bulkIds",e);i.submit("static")}else{AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}});this.addAction({click:"bulk-activate"},function(){var e=s.getBulkIds();var i=n.get(this.el);if(e){o(e,true).done(function(e){if(e.success===true){i.submit()}})}else{AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}});this.addAction({click:"bulk-deactivate"},function(){var e=s.getBulkIds();var i=n.get(this.el);if(e){o(e,false).done(function(e){if(e.success===true){i.submit()}})}else{AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}});this.addAction({click:"back"},function(){history.back()})});AGN.Lib.Controller.new("grid-edit",function(){const t=this,i=AGN.Lib.Form;this.addDomInitializer("grid-edit",function(){t.isGridInUse=this.config.isGridInUse;t.maxColumnsCount=this.config.maxColumnsCount;t.gridView=new AGN.Lib.GridView($("[data-grid-view]"));t.gridColumnView=new AGN.Lib.GridColumnView($("[data-column-view]"));t.updateViews()});this.addAction({submission:"createTemplate"},function(){$("#templateCreationForm").submit()});this.addAction({submission:"saveGrid"},function(){const e=$("#gridForm");i.get(e).submit()});this.addAction({change:"updateColnum"},function(){t.validateRequiredNumber(this.el,1,t.maxColumnsCount);$('[name="columnWidth"]').val(t.calculateColumnWidth());t.updateViews()});this.addAction({change:"updateTemplateWidth"},function(){t.validateRequiredNumber(this.el,50,2e3);$('[name="columnWidth"]').val(t.calculateColumnWidth());t.updateViews()});this.addAction({change:"updateColumnWidth"},function(){t.validateRequiredNumber(this.el,10,2e3);$('[name="templateWidth"]').val(t.calculateTemplateWidth());t.updateViews()});this.addAction({change:"updateGutterWidth"},function(){t.validateRequiredNumber(this.el,0,500);$('[name="columnWidth"]').val(t.calculateColumnWidth());t.updateViews()});this.addAction({click:"enableEditing"},function(){$(this.el).hide();$('[name="gridName"]').prop("disabled",false);if(!t.isGridInUse){$.each(["columnNum","columnWidth","gutter","templateWidth"],function(e,t){const i=$('[name="'+t+'"]');i.prop("disabled",false);i.attr("type","number")})}$("#createTemplateButton").addClass("hidden");$("#saveAndCreateTemplateButton").removeClass("hidden");$("#gridForm").attr("data-action","saveGrid")});this.addAction({click:"back"},function(){window.history.back()});this.validateRequiredNumber=function(e,t,i){const n=parseInt(e.val());if(n!=e.val()||n<t){e.val(t)}if(n>i){e.val(i)}};this.updateViews=function(){const e={columnNum:this.columnNum(),columnWidth:this.columnWidth(),gutter:this.gutterWidth(),templateWidth:this.templateWidth()};t.gridView.update(e);t.gridColumnView.update(e)};this.calculateColumnWidth=function(){return Math.floor(this.templateWidth()/this.columnNum()-this.gutterWidth())};this.calculateTemplateWidth=function(){return Math.ceil((this.columnWidth()+this.gutterWidth())*this.columnNum())};this.columnNum=function(){return parseInt($('[name="columnNum"]').val())};this.columnWidth=function(){return parseInt($('[name="columnWidth"]').val())};this.gutterWidth=function(){return parseInt($('[name="gutter"]').val())};this.templateWidth=function(){return parseInt($('[name="templateWidth"]').val())}});AGN.Lib.Controller.new("grid-layout-view",function(){var o=AGN.Lib.Template,n=AGN.Lib.Tooltip,G=AGN.Lib.Popover,W=AGN.Lib.Modal,H=AGN.Lib.Confirm,j=AGN.Lib.Form,B=AGN.Lib.Action,V=AGN.Lib.Load,d=AGN.Lib.Helpers,z=AGN.Lib.Select,U=AGN.Lib.AutoSave;var c;var s=-1;var r=0;var Y=500;var a=80;var l=30;var q=10;var X=2;var i=0;var u=1;var f=2;var p=3;var K='<div class="popover popover-wide" role="tooltip" style="margin-top: -5px;"><div class="popover-content"></div><div class="bottom-space"></div></div>';var Q="Text";var Z="Placeholder";var J="TocArea";var ee="TocPlaceholder";var te="Label";var ie="Text";var ne="Link";var h="Image";var re="ImageLink";var oe="Select";var ae="Color";var g="Check";var se="Id";var le="Name";var ue="toc_";var v="";var ce="e";var de="w";var fe="n";var pe="s";var m=false;var he=0;var y=2;var b=3;var w={setShown:function(e,t){if(t){e.removeClass("hidden")}else{e.addClass("hidden")}},setTooltip:function(e,t){e.data("tooltip",t);n.createTip(e,t)},removeTooltip:function(e){n.remove(e)},checkHoverState:function(e){if(e.is(":hover")){e.trigger("mouseleave").trigger("mouseenter")}},setLoading:function(e){$("#editor-progress").toggle(!!e);$("#disabled-save-button").toggle(!!e);$("#save-button").toggle(!e);$("#navbar-disabled-save-button").toggle(!!e);$("#navbar-save-button").toggle(!e)},setEditable:function(e){$("#save-button").toggle(!!e);$("#navbar-save-button").toggle(!!e);$("#building-blocks-search").toggleClass("disabled",!e);$("#update-text-version").toggle(!!e);$("#grid-tile-content").toggleClass("translucent",!e);if(e){$("#visibleTargets").select2("enabled")}else{$("#visibleTargets").select2("disable")}},setTargetId:function(e){$("#visibleTargets").select2("val",e)},getAvailableTargetIds:function(){return $("#visibleTargets").children("option").get().map(function(e){return parseInt($(e).val())})},setAvailableTargetIds:function(e){var i=this.getAvailableTargetIds();var n=$("#visibleTargets");n.empty();e.push({id:s,name:t("filter.reset")});_.sortBy(e,function(e){if(e.id>r){return i.indexOf(parseInt(e.id))}else if(e.id==r){return 1e6}else{return 1000001}}).forEach(function(e){$("<option></option>").val(e.id).text(e.name).appendTo(n)})},imagesAdjusted:function(i,e){var n=$.Deferred();var r=undefined,o=undefined;if(e===true){r=i.outerWidth();o=i.outerHeight()}var t=function(){var e=i.outerWidth(),t=i.outerHeight();if(r!==e||o!==t){r=e;o=t;n.notify()}};i.imagesLoaded().progress(t).always(t);return n.promise()},getHeightAccurate:function(e){return e[0].getBoundingClientRect().height},getResizeHandleDirection:function(e){if(e.hasClass("ui-resizable-ne")){return new D("ne")}if(e.hasClass("ui-resizable-se")){return new D("se")}if(e.hasClass("ui-resizable-nw")){return new D("nw")}if(e.hasClass("ui-resizable-sw")){return new D("sw")}if(e.hasClass("ui-resizable-e")){return new D("e")}if(e.hasClass("ui-resizable-w")){return new D("w")}if(e.hasClass("ui-resizable-n")){return new D("n")}if(e.hasClass("ui-resizable-s")){return new D("s")}console.error("Invalid resizing direction handle");return new D("")}};window.onbeforeunload=function(e){if($('[data-controller="grid-layout-view"]').exists()){var i=t("grid.layout.leaveQuestion");e=e||window.event;if(c&&c.isChanged()){if(e){e.returnValue=i}return i}}AGN.Lib.Loader.show()};this.addDomInitializer("grid-layout-view",function(e){if(!c){c=new C}var i=e.json();m=i.IS_BASIC_LB;var t=function(e){var t=$.extend(i,{children:e.children});c.setup(t);c.setChanged(true)};var n=U.initialize("template-components/"+i.templateId,_.bind(c.getDataForAutoSave,c),_.bind(c.checkIfDataRestoreNeeded,c),t,0);n.fail(function(){c.setup(i)});c.controlRssBtn()});this.addDomInitializer("available-building-blocks-menu",function(e){var t=$("#div-containers-cache");var n={};t.children("[data-container-id]").each(function(){var e=$(this);var t=new S(e.json());n[t.getContainerId()]=t});e.find("[data-building-block]").each(function(){var e=$(this);var t=e.data("container-id");var i=n[t];if(i){T.set(e,i);if(c.isEditable()){e.draggable(S.draggableOptions())}}});t.remove()});this.addDomInitializer("mailing-building-blocks-menu",function(e){const t=$("#mailing-div-containers-cache");const n={};t.children("[data-child-id]").each(function(){const e=$(this);const t=new T(e.json());n[t.getId()]=t});e.find("[data-building-block]").each(function(){const e=$(this);const t=e.data("child-id");const i=n[t];if(i){T.set(e,i);if(c.isEditable()){e.draggable(S.draggableOptions())}}});t.remove()});this.addAction({click:"clear-recycle-bin"},function(){if(!c.isEditable()){return}const e=c.getRecycledChildren();if(e.length){$.ajax(this.el.attr("href"),{method:"POST",traditional:true,data:{children:e}}).done(function(e){if(e.success){c.clearRecycleBin()}})}else{c.clearRecycleBin()}});this.addAction({change:"visibleTargets"},function(){if(c.isEditable()){c.setTargetId(parseInt(this.el.val()))}});this.addAction({"select2-open":"visibleTargets"},function(){if(c.isEditable()){var e=this.el;var t=e.select2("dropdown").find(".select2-results");t.css("overflow","hidden");t.children(".select2-result").each(function(){var e=$(this);if(e.data("select2-data").id>0){e.addClass("sortable")}});t.sortable({items:".select2-result.sortable",containment:"parent",tolerance:"pointer",distance:5,opacity:.4,cursor:"move",start:function(e,t){t.item.removeClass("select2-result-selectable")},stop:function(e,t){t.item.addClass("select2-result-selectable")},update:function(e,t){var i=t.item.data("select2-data");var n=t.item.prev();var r=t.item.next();if(n.length){var o=n.data("select2-data");$(o.element[0]).after($(i.element[0]))}else if(r.length){var a=r.data("select2-data");$(a.element[0]).before($(i.element[0]))}c.setLayeringByTargets(w.getAvailableTargetIds())}})}});this.addAction({"select2-close":"visibleTargets"},function(){if(c.isEditable()){this.el.select2("dropdown").find(".select2-results").sortable("destroy")}});this.addAction({change:"setTemplateReleased"},function(){if(c.isEditable()){$("#is-released").val(this.el.is(":checked")?"true":"false");c.setChanged(true)}});this.addAction({click:"toggleGutter"},function(){if(c.isEditable()){var e=M.get(this.el);e.setGuttered(!e.isGuttered());c.setChanged(true);c.adjust()}});this.addAction({click:"insertRow"},function(){if(c.isEditable()){c.addRowBefore(M.get(this.el))}});this.addAction({click:"addRow"},function(){if(c.isEditable()){c.addRow()}});this.addAction({click:"deleteRow"},function(){if(c.isEditable()){c.removeRow(M.get(this.el))}});this.addAction({click:"edit"},function(){if(c.isEditable()){const e=T.get(this.el);if(e){c.editChild(e)}}});this.addAction({click:"clone"},function(){if(c.isEditable()){var e=T.get(this.el);if(e){c.cloneChild(e)}}});this.addAction({click:"remove"},function(){if(c.isEditable()){var e=T.get(this.el);if(e){c.removeChild(e)}}});this.addAction({change:"previewImageSrc",keyup:"previewImageSrc",mouseup:"previewImageSrc"},function(){if(c.isEditable()){F.get(this.el).updateImageSrc(this.el)}});this.addAction({change:"chooseImageFile"},function(){if(c.isEditable()){F.get(this.el).updateImage(this.el,false)}});this.addAction({change:"changeImageCategory"},function(){if(c.isEditable()){const e=this.el.data("placeholder-id");F.get(this.el).syncImageCategories(e,this.el.val())}});this.addAction({change:"chooseMobileImageFile"},function(){if(c.isEditable()){F.get(this.el).updateImage(this.el,true)}});this.addAction({click:"chooseImage"},function(){if(c.isEditable()){var e=this.el.data("placeholder-id");F.get(this.el).chooseImage(e)}});this.addAction({click:"deleteImage"},function(){if(c.isEditable()){const e=this.el.data("placeholder-id");F.get(this.el).deleteImage(e,false)}});this.addAction({click:"deleteMobileImage"},function(){if(c.isEditable()){const e=this.el.data("placeholder-id");F.get(this.el).deleteImage(e,true)}});this.addAction({click:"showMediapoolDialog"},function(){if(c.isEditable()){var e=this.el.data("placeholder-id");F.get(this.el).showMediapoolDialog(e)}});this.addAction({submission:"saveChildContents"},function(){if(c.isEditable()){F.get(this.el).save(j.get(this.el))}});$(document).on("ckeditor-save",function(){const e=j.get($("#child-save-button"));e.submit("event")});this.addAction({change:"changeContentPool"},function(){const e=$("#content-pool-stub");const t=$("#availableMailingsBuildingBlocksArea");const i=parseInt(this.el.val());if(i>0){const n="/mailing/{mailingId}/buildingBlocks.action".replace("{mailingId}",i);t.removeData();t.attr("data-load",AGN.url(n));V.load(t,true)}else{t.empty()}w.setShown(e,i===0)});this.addAction({submission:"save-content"},function(){if(c.isEditable()){var e=false;if(c.isTextVersionGenerationAllowed()){var t=$("#update-text-version input:checked");e=t.length>0}c.saveMadeChoice(e);c.save(e)}});this.addAction({click:"import-from-content-source"},function(){(new e).import()});function e(){e.prototype.import=function(){const t=this;this.getRssChildrenToReplaceWithNewContent().forEach(function(e){t._importContent(e)})};e.prototype.getRssChildrenToReplaceWithNewContent=function(){return _.union(this._getRssImportedStartChildren(),this.getRssTemplateChildren())};e.prototype._importContent=function(t){const i=this;$.get(AGN.url("/layoutbuilder/container/"+t.getContainerId()+"/importRss.action")).done(function(e){i.insertRssChildren(i.getRssChildrenFromSamples(e),t)})};e.prototype.insertRssChildren=function(e,t){if(!e.length){return}var i=t.getColumn();var n=t.getRow();c.replaceChildren(t,e[0]);e.slice(1).forEach(function(e){e.setColumn(i);e.setRow(n);const t=c.cloneChild(e);i=t.getColumn();n=t.getRow()})};e.prototype.getRssChildrenFromSamples=function(e){return e.map(function(e){return new S(e).instantiate()})};e.prototype.getImportedRssChildren=function(){return _.groupBy(c.children.active().children.filter(function(e){return e.isRssImportedChild()}),function(e){return e.data.type||e.data.container.type})};e.prototype.getRssTemplateChildren=function(){return c.children.active().children.filter(function(e){return e.isRssTemplateChild()})};e.prototype._removeRssChildrenAndGetPlaceholder=function(e){e.slice(1).forEach(function(e){const t=e.getRow();c.removeChild(e);if(M.isEmpty(t)){c.removeRow(c.grid.getRow(t))}});return e[0]};e.prototype._getRssImportedStartChildren=function(){const t=this;return _.map(this.getImportedRssChildren(),function(e){return t._removeRssChildrenAndGetPlaceholder(e)})}}B.new({"form:loadershow":"form"},function(){w.setLoading(true)});B.new({"form:loaderhide":"form"},function(){w.setLoading(false)});function C(){var e=this;this.templateId=0;this.targetId=s;this.targets=new A;this.categories=new E;this.children=new x([]);this.imageUriPattern="{image-id}";this.imageByFilenameUriPattern=":filename:";this.watcher=new ve;this.removedChildren=[];this.adjust=_.throttle(this.adjust,200);this.watcher.promise().progress(function(){e.adjust(false)})}C.prototype.setup=function(e){e=$.extend({templateId:0,targetId:s,grid:{},children:[],imageUriPattern:"{image-id}",imageByFilenameUriPattern:":filename:",noPreviewImageLink:"#",mobileImagePrefix:"mobile_",isTextVersionGenerationAllowed:false,isEmptyTextVersion:false,targets:[],interestGroups:[],categories:[],translations:{},urls:{},actions:{}},e);$.i18n.load(e.translations);this.changesNotSaved=false;this.templateId=e.templateId;this.targetId=e.targetId;this.imageUriPattern=e.imageUriPattern;this.imageByFilenameUriPattern=e.imageByFilenameUriPattern;this.noPreviewImageLink=e.noPreviewImageLink;this.textVersionGenerationAllowed=e.isTextVersionGenerationAllowed;this.emptyTextVersion=e.isEmptyTextVersion;this.noImageLink=e.noImageLink;this.targets=new A(e.targets);this.interestGroups=e.interestGroups;this.categories=new E(e.categories);this.children=new x(e.children);this.urls=e.urls;this.actions=e.actions;this.mailingId=e.mailingId;this.mobileSuffix="-mobile";this.mobileImagePrefix=e.mobileImagePrefix;var t=this.children.active();this.grid=new P(e.grid,Math.max(1,t.calculateRowsCount()));t.rebuildStatic({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});t.adjustLayering();this.updateAvailableTargets();if(this.mailingId>0){this.editable=AGN.Opt.Components.MailingContentLock.manageLock(this.mailingId,e.isMailingExclusiveLockingAcquired,e.anotherLockingUserName)}else{this.editable=true}w.setTargetId(this.targetId);this.setTargetId(this.targetId);if(this.editable){this.setupInteractions();this.updateRecycleBin();this.restoreUpdateTextVersionCheckbox(e.mailingId);w.setLoading(false)}else{t.each(function(e){e.setDraggable(false);e.setControlsEnabled(false);e.setResizable(false)});w.setLoading(false);w.setEditable(false)}var i=$("#availableBuildingBlocksArea");var n="/layoutbuilder/template/{templateId}/activeBuildingBlocks.action".replace("{templateId}",this.templateId);i.attr("data-load",AGN.url(n));V.load(i,true)};C.prototype.restoreUpdateTextVersionCheckbox=function(){$("#update-text-version").attr("checked",this.getMadeChoice())};C.prototype.setupInteractions=function(){var a=this;this.children.recycled().each(function(e){e.setRows(1);e.setColumns(1)});function t(t,i){a.children.active().matching(a.targetId).each(function(e){if(e!==t){e.setControlsEnabled(i);if(!e.isContainerDeleted()){e.setResizable(i)}if(e.data.container.modeEdit===y||e.data.container.modeEdit===b){e.setResizable(false)}}})}this.grid.setOnResizingStarted(function(e){t(e,false)});this.grid.setOnResizingStopped(function(e){t(e,true);a.children.active().stick(e.getArea())});var e=null;this.grid.setOnAreaHovered(function(t){var i=a.children.active().matching(a.targetId);if(t){i=i.select(function(e){return e.isInArea(t)});if(e){e.each(function(e){if(!i.contains(e)){e.setHighlighted(false)}})}i.setHighlighted(true);e=i}else{i.setHighlighted(false);e=null}});this.grid.setOnDrop(function(e,t,i){var n=a.children.active();var r=false;if(!n.contains(e)){r=true;if(e instanceof S){e=e.instantiate();a.children.add(e)}else if(e.isRecycled()){e.setRecycled(false);a.updateRecycleBin()}else{e=e.clone();a.children.add(e)}if(a.targetId!==s){e.setTargetId(a.targetId)}n=a.children.active();if(!e.isToc()){e.rebuild({imageUriPattern:a.imageUriPattern,imageByFilenameUriPattern:a.imageByFilenameUriPattern,noImageLink:a.noImageLink})}}e.setArea(i);n.active().stick(i);n.matching(a.targetId).rebuildToc({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});e.adjustSize(a.grid);e.adjustCoordinates(a.grid);if(r){var o=e.data.container.modeEdit;e.setShown(true);if(o===y||o===b){e.setDraggable(false);e.setResizable(false)}a.adjust();a.watcher.bind(n.matching(a.targetId).pulse())}else{a.adjust()}a.updateAvailableTargets();a.setChanged(true)});$("#children").on("dblclick","[data-building-block]",function(e){var t=$(e.target);if(t.is("button")||t.is(".ui-resizable-handle")||t.closest("button").exists()){return}var i=$(this);var n=T.get(i);var r=n.data.container.modeEdit;if(n){if(r===he||r===y){c.editChild(n)}}})};C.prototype.updateAvailableTargets=function(){var e=this.children.active();var t=this.targets;var i=e.collectTargetIds();var o=[];e.groups().forEach(function(e){var i={};e.sort(function(e,t){return e.getZ()-t.getZ()}).forEach(function(e,t){i[e.getTargetId()]=t});o.push(i)});i.sort(function(i,n){var r=0;o.forEach(function(e){if(i in e&&n in e){var t=e[i]-e[n];if(t<0){r++}else if(t>0){r--}}});return r});w.setAvailableTargetIds(i.map(function(e){return{id:e,name:t.name(e)}}));if(i.indexOf(this.targetId)<0){this.targetId=s}w.setTargetId(this.targetId)};C.prototype.getTemplateId=function(){return this.templateId};C.prototype.isTextVersionGenerationAllowed=function(){return this.textVersionGenerationAllowed};C.prototype.saveMadeChoice=function(e){AGN.Lib.WebStorage.set("updateTextVersion_"+this.mailingId,e)};C.prototype.getMadeChoice=function(){return AGN.Lib.WebStorage.get("updateTextVersion_"+this.mailingId)};C.prototype.isEmptyTextVersion=function(){return this.emptyTextVersion};C.prototype.isChanged=function(){return this.changesNotSaved};C.prototype.isEditable=function(){return this.editable};C.prototype.setChanged=function(e){if(!!e){this.controlRssBtn()}this.changesNotSaved=!!e};C.prototype.getGrid=function(){return this.grid};C.prototype.getTargetName=function(e){return this.targets.name(e)};C.prototype.setTargetId=function(e){var t=this.children.active();this.targetId=e;t.unmatching(this.targetId).setShown(false);t=t.matching(this.targetId);t.rebuildToc({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});t.setShown(true);this.adjust();this.watcher.bind(t.pulse())};C.prototype.setLayeringByTargets=function(t){var i=false;this.children.active().groups().forEach(function(e){if(e.length>1){x.make(e).setLayeringByTargets(t);i=true}});if(i){this.updateToc(true)}this.setChanged(true);this.adjust(false)};C.prototype.setChildrenControlsEnabled=function(e){this.children.active().matching(this.targetId).setControlsEnabled(e)};C.prototype.updateToc=function(e){var t=this.children.active().matching(this.targetId);if(t.rebuildToc({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink})&&e){this.adjustSizes(t);this.adjustCoordinates(t)}};C.prototype.adjustSizes=function(e){if(e===undefined){e=this.children.active().matching(this.targetId)}e.adjustSizes(this.grid);this.grid.adjustRows(e)};C.prototype.adjustCoordinates=function(e){if(e===undefined){e=this.children.active().matching(this.targetId)}this.grid.adjustSidebars();e.adjustCoordinates(this.grid)};C.prototype.adjustLayering=function(e){var a=this;if(e===undefined){e=this.children.active().matching(this.targetId)}var s=e.groupsMap();this.grid.each(function(e,o){e.each(function(e,t){var i=o+1+":"+(t+1);var n=x.make(s[i]);if(n.size()>1){var r=1;n.setBorderHighlighted(true);n.each((e,t)=>{e.setShown(t===0)});e.setLayeringIndex(r);e.setOnLayeringRotate(function(){a.setChanged(true);r=r%n.size()+1;n.rotateLayering();this.setLayeringIndex(r);a.updateToc(true);a.adjust(false)})}else{n.setBorderHighlighted(false);n.each(function(e){e.setShown(true)});e.setLayeringIndex(null);e.setOnLayeringRotate(null);a.adjust(false)}})})};C.prototype.adjust=function(e){var t=this.children.active().matching(this.targetId);if(e!==false){this.adjustLayering(t)}this.adjustSizes(t);this.adjustCoordinates(t)};C.prototype.addRowBefore=function(e,t){var r=this.grid.addRowBefore(e);var i=this.children.active();var o=false;i.each(function(e){var t=e.getRows();var i=e.getRow();var n=i+t-1;if(r<=i){e.setRow(i+1)}else if(r>i&&r<=n){o=true;e.setRows(t+1)}});if(t!==false){if(o){this.adjust()}else{this.adjustCoordinates(i.matching(this.targetId))}}this.setChanged(true)};C.prototype.addRowAfter=function(e){if(!this.isEditable()){return}if(this.grid.rows.indexOf(e)==this.grid.getRows()-1){this.addRow()}else{const t=this.grid.rows.indexOf(e);this.addRowBefore(this.grid.rows[t+1])}};C.prototype.addRow=function(e){this.grid.addRow();if(e!==false){this.grid.adjustSidebars()}this.setChanged(true)};C.prototype.removeRow=function(e){var r=this.grid.removeRow(e);var t=this.children.active();var o=false;var a=false;t.each(function(e){var t=e.getRows();var i=e.getRow();var n=i+t-1;if(r>=i&&r<=n){if(t>1){e.setRows(t-1);a=true}else{e.setRecycled(true);o=true}}else if(r<i){e.setRow(i-1)}});if(o){t=this.children.active().matching(this.targetId);t.rebuildToc({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});this.adjust();this.watcher.bind(t.pulse());this.updateAvailableTargets();this.updateRecycleBin()}else if(a){this.adjust()}else{this.adjustCoordinates()}this.setChanged(true)};C.prototype.removeChild=function(e){if(this.children.contains(e)){e.setRecycled(true);this.updateToc(false);this.adjust();this.updateAvailableTargets();this.updateRecycleBin();this.setChanged(true)}};C.prototype.cloneChild=function(e){var i=this;var u=this.grid.getColumns();var t=this.children.active();function l(e,r,o){var a=[];var s={};e.each(function(e){var t=e.getColumn();if(r===e.getRow()&&t>=o){a.push(e);var i=e.getColumns();s[t]=Math.min(s[t]||t,t);for(var n=1;n<i;n++){s[t+n]=t}}});var t=_.groupBy(a,function(e){var t=e.getColumn();while(s[t]&&s[t]!==t){t=s[t]}return t});var i=[];for(var n=o;n<=u;n++){if(s[n]){var l=t[n];if(l){i.push(l)}}else{i.push([])}}return i}function c(e){var t=0;e.forEach(function(e){if(e.length===0){t++}});return t}function d(e,t){function i(e,i){var n=null,r=null;e.forEach(function(e){var t=e.getColumn();var i=t+e.getColumns()-1;n=Math.min(n||t,t);r=Math.max(r||i,i)});var t=0;if(r+i>u){t=u+1-n-i;i=i+t}e.forEach(function(e){var t=e.getColumn()+i;if(t>u){e.setRow(e.getRow()+1);e.setColumn(t-u)}else{e.setColumn(t)}});return t}for(var n=0;n<e.length&&t>0;n++){var r=e[n];if(r.length>0){t+=i(r,t)}else{t--}}}function f(e){var t=i.grid.getRow(e);if(t){i.addRowBefore(t,false)}else{i.addRow(false)}}function n(e,t,i){var n=t.getRow();var r=t.getColumns();var o=t.getColumn()+r;var a=l(e,n,o);var s=u-o+1;if(s>=r){if(c(a)>=r){d(a,r)}else{f(n+1);d(a,r)}i.setRow(n);i.setColumn(o)}else{f(n+1);d(a,s+r);i.setRow(n+1);i.setColumn(1)}}var r=e.clone();n(t,e,r);r.rebuild({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});r.setShown(true);this.children.add(r);this.updateToc(false);this.watcher.bind(this.children.active().matching(this.targetId).pulse());this.adjust();this.setChanged(true);return r};C.prototype.replaceChildren=function(e,t){this.removeChild(e);t.setRow(e.getRow());t.setColumn(e.getColumn());t.rebuild({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});t.setShown(true);this.children.add(t);this.updateToc(false);this.watcher.bind(this.children.active().matching(this.targetId).pulse());this.adjust();this.setChanged(true)};C.prototype.editChild=function(e){if(this.isEditable()){var t=this.imageByFilenameUriPattern;var i={child:{name:e.getName(),containerName:e.getContainerName(),isToc:e.isToc(),isSortable:e.isSortable(),interestGroup:e.getInterestGroup(),targetId:e.getTargetId(),asTocItem:e.asTocItem(),placeholders:e.getPlaceholders()},targets:this.targets.list(),interestGroups:this.interestGroups.slice(),categories:this.categories.list(),imageUriPattern:this.imageUriPattern,noPreviewImageLink:this.noPreviewImageLink,noImageLink:this.noImageLink,urls:this.urls,mailingId:this.mailingId,mobileSuffix:this.mobileSuffix,mobileImagePrefix:this.mobileImagePrefix,resolveAgnImageTags:function(e){if(e){return $.trim(T.resolveAgnImageTags(e,t))}else{return e}}};if(e.isToc()){i.child.toc=this.children.active().asTocItems(false)}F.create(e,i)}};C.prototype.saveChild=function(e,t,i,n,r,o,a){e.setName(t);e.setTargetId(i);e.setTocItem(n);e.setInterestGroup(r);e.setContent(o);if(e.isToc()){this.children.active().each(function(e){var t=a[e.getId()];if(t===true||t===false){e.setTocItem(t)}});this.updateToc(false)}else{e.rebuild({imageUriPattern:this.imageUriPattern,imageByFilenameUriPattern:this.imageByFilenameUriPattern,noImageLink:this.noImageLink});if(e.isTocItem()||n||!e.isMatching(this.targetId)){this.updateToc(false)}}if(!e.isMatching(this.targetId)){e.setShown(false);this.watcher.bind(this.children.active().matching(this.targetId).pulse())}this.adjust();this.setChanged(true);this.updateAvailableTargets()};C.prototype.controlRssBtn=function(){$('[data-action="import-from-content-source"]').toggle(this.children.containsRssChildren())};C.prototype.updateRecycleBin=function(){var e=$("#recyclebin-content");var t=$("#recyclebin-stub");var i=$("#recycle-bin-clear-btn");this.children.sort(function(e,t){if(e.isRecycled()===t.isRecycled()){return 0}return e.isRecycled()?1:-1});var n=this.children.recycled().get();w.setShown(t,n.length===0);w.setShown(i,n.length>0);var r=o.dom("recyclebin-table",{children:n.map(function(e){return{name:e.getName()||e.getContainerName(),id:e.getId(),containerId:e.getContainerId()}})});e.html(r);r.find("[data-building-block]").each(function(e){var t=$(this);t.draggable(S.draggableOptions());T.set(t,n[e])})};C.prototype.getGuttersAsString=function(){var t=[];this.grid.each(function(e){t.push(e.isGuttered()?"1":"0")});return t.join("|")};C.prototype.getChildrenAsSubmittable=function(){var e=this.children.active().groups();var i=[];var n=w.getAvailableTargetIds();e.forEach(function(e){e=_.sortBy(e,function(e){return n.indexOf(e.getTargetId())});var t=0;e.forEach(function(e){e.setZ(t++);i.push(e.asSubmittable())})});return i};C.prototype.validateOverlaps=function(){var e=this.children.active().select(function(e){return e.getRows()>1}).get();for(var t=0;t<e.length;t++){var i=e[t];var n=i.getRow();var r=n+i.getRows()-1;for(var o=t+1;o<e.length;o++){var a=e[o];var s=a.getRow();var l=s+a.getRows()-1;if(s>n&&s<=r&&l>r||s<n&&l>=n&&l<r){var u=i.getColumn();var c=u+i.getColumns()-1;var d=a.getColumn();var f=d+a.getColumns()-1;if(d>c||f<u){return false}}}}return true};C.prototype.save=function(e){if(this.validateOverlaps()){var i=$("#gridTemplateForm");var n=j.get(i);this.setChanged(false);n.setValue("forceGenerateTextVersion",e===true);n.setValue("rowGutters",this.getGuttersAsString());n.setValue("childrenJson",JSON.stringify(this.getChildrenAsSubmittable()));n.setValue("removedChildren",this.removedChildren);n.submit("resource")}else{AGN.Lib.Messages(t("defaults.error"),t("error.template.invalidVerticalSpanning"),"alert")}};C.prototype.checkIfDataRestoreNeeded=function(e){var t=this.getChildrenData();var i=e.children;if(t.length!==i.length){return true}return JSON.stringify(t)!==JSON.stringify(i)};C.prototype.getDataForAutoSave=function(){return{children:this.getChildrenData()}};C.prototype.getChildrenData=function(){return this.children.children.map(function(e){return e.data})};C.prototype.clearEmptyAddedOnTheFlyRows=function(){const t=this;this.grid.each(function(e){e.preventAddOnTheFly=false;if(e.isEmptyRowAddedOnTheFly){t.removeRow(e)}})};C.prototype.processAddedOnTheFlyRows=function(t){const i=this;this.grid.rows.filter(function(e){return e.isAllowedToAppendNewRowOnTheFly(t.pageX,t.pageY)}).forEach(function(e){i.appendRowOnTheFlyAfter(e)})};C.prototype.appendRowOnTheFlyAfter=function(e){this.clearEmptyAddedOnTheFlyRows();this.addRowAfter(e);const t=this.grid.rows[c.grid.rows.indexOf(e)+1];t.animateAppearance();t.isEmptyRowAddedOnTheFly=true;e.preventAddOnTheFly=true};C.prototype.clearRecycleBin=function(){const t=this;const e=this.children.recycled();e.each(function(e){if(e.getId()>0){t.removedChildren.push(e.getId())}});this.children.removeChilds(e.get());this.updateRecycleBin()};C.prototype.getRecycledChildren=function(){const e=this.children.recycled().get();return e.map(function(e){return e.getId()}).filter(function(e){return e>0})};function A(e){var t={};if(e){this.data=e.slice();this.data.forEach(function(e){t[e.id]=e.name})}else{this.data=[]}this.map=t}A.prototype.name=function(e){return this.map[e==s?r:e]};A.prototype.list=function(){return this.data.slice()};function E(e){var t={};if(e){this.data=e.slice();this.data.forEach(function(e){t[e.id]=e.name})}else{this.data=[]}this.map=t}E.prototype.name=function(e){return this.map[e]};E.prototype.list=function(){return this.data.slice()};function x(e){if(e[0]instanceof T){this.children=e.slice()}else{this.children=e.sort(function(e,t){if(e.z===t.z){if(e.columns===t.columns){return e.column-t.column}return t.columns-e.columns}return e.z-t.z}).map(function(e){return new T(e)})}}x.make=function(e){return new x(e||[])};x.prototype.get=function(){return this.children.slice()};x.prototype.size=function(){return this.children.length};x.prototype.each=function(e){this.children.forEach(e)};x.prototype.sort=function(e){this.children.sort(e)};x.prototype.contains=function(e){return this.children.indexOf(e)>=0};x.prototype.containsToc=function(){for(var e=0;e<this.children.length;e++){if(this.children[e].isToc()){return true}}return false};x.prototype.matching=function(t){return this.select(function(e){return e.isMatching(t)})};x.prototype.unmatching=function(t){return this.select(function(e){return!e.isMatching(t)})};x.prototype.containsRssChildren=function(){return this.active().children.some(function(e){return e.isRssImportedChild()||e.isRssTemplateChild()})};x.prototype.active=function(){return this.select(function(e){return!e.isRecycled()})};x.prototype.recycled=function(){return this.select(function(e){return e.isRecycled()})};x.prototype.select=function(e){return new x(this.children.filter(e))};x.prototype.removeChilds=function(t){this.children=this.children.filter(function(e){return t.indexOf(e)===-1})};x.prototype.add=function(e){e.setZ(this.active().calculateMaxZ()+1);this.children.push(e)};x.prototype.groupsMap=function(){var o={};var e=_.groupBy(this.children,function(e){return e.getRow()});$.each(e,function(n,e){var r={};e.forEach(function(e){var t=e.getColumns();if(t>1){var i=e.getColumn();for(var n=1;n<t;n++){r[i+n]=i}}});e.forEach(function(e){var t=e.getColumn();while(r[t]){t=r[t]}var i=n+":"+t;if(o[i]===undefined){o[i]=[]}o[i].push(e)})});return o};x.prototype.groups=function(){var i=[];var e=this.groupsMap();$.each(e,function(e,t){if(t.length){i.push(t)}});return i};x.prototype.collectTargetIds=function(){var t={};this.each(function(e){t[e.getTargetId()]=true});return Object.keys(t).sort()};x.prototype.calculateMaxZ=function(){return this.children.reduce(function(e,t){return Math.max(t.getZ(),e)},0)};x.prototype.calculateRowsCount=function(){return this.children.reduce(function(e,t){return Math.max(t.getRow()+t.getRows()-1,e)},0)};x.prototype.setShown=function(i){this.children.forEach(function(e){e.setShown(i);var t=e.data.container.modeEdit;if(t===y||t===b){e.setDraggable(false);e.setResizable(false)}})};x.prototype.setBorderHighlighted=function(t){this.children.forEach(function(e){e.setBorderHighlighted(t)})};x.prototype.setHighlighted=function(t){this.children.forEach(function(e){e.setHighlighted(t)})};x.prototype.setControlsEnabled=function(t){this.children.forEach(function(e){e.setControlsEnabled(t);if(!e.isContainerDeleted()){e.setResizable(t)}e.checkHoverState()})};x.prototype.asTocItems=function(e){var t;if(e){t=_.map(this.groupsMap(),function(e){return _.maxBy(e,function(e){return e.getZ()})})}else{t=this.children.slice()}var i=t.sort(function(e,t){if(e.getRow()===t.getRow()){if(e.getColumn()===t.getColumn()){return t.getZ()-e.getZ()}return e.getColumn()-t.getColumn()}return e.getRow()-t.getRow()}).map(function(e){return e.asTocItem()}).filter(function(e){return!!e});if(e){return i.filter(function(e){return e.isEnabled})}return i};x.prototype.pulse=function(){var e=this.children.map(function(e){return e.pulse()});return e};x.prototype.rebuildStatic=function(t){this.each(function(e){if(!e.isToc()){e.rebuild(t)}})};x.prototype.rebuildToc=function(t){var i=this;var n=false;this.each(function(e){if(e.isToc()){e.rebuild($.extend({},t,{toc:i.asTocItems(true)}));n=true}});return n};x.prototype.rotateLayering=function(){var e=this.children.slice().sort(function(e,t){return e.getZ()-t.getZ()});var i=e.map(function(e){return e.getZ()});e.forEach(function(e,t){e.setShown(t===1);e.setZ(i[(t+1)%i.length])})};x.prototype.setLayeringByTargets=function(t){var e=this.children.slice().sort(function(e,t){return t.getZ()-e.getZ()});var i=e.map(function(e){return e.getZ()});_.sortBy(e,function(e){return t.indexOf(e.getTargetId())}).forEach(function(e,t){e.setShown(t===0);e.setZ(i[t])})};x.prototype.stick=function(t){this.children.forEach(function(e){if(e.isInArea(t)){e.setArea(t)}})};x.prototype.adjustLayering=function(){var t=this.children.length;this.children.forEach(function(e){e.setZ(--t)})};x.prototype.adjustSizes=function(t){this.children.forEach(function(e){e.adjustSize(t)})};x.prototype.adjustCoordinates=function(t){this.children.forEach(function(e){e.adjustCoordinates(t)})};function T(e){var t={id:0,name:"",targetId:0,row:0,column:0,rows:1,columns:1,z:0,isTocItem:false,isRecycled:false,interestGroup:"",container:{id:0,name:"",isToc:false,isSortable:false,markup:[],content:{},tocItemPlaceholderId:0,type:"",filter:""},content:undefined};this.data=_.merge(t,e);if(this.data.content===undefined){this.data.content=_.clone(this.data.container.content)}this.capsule=new O(this);var i=e.container.modeEdit;if(this.isContainerDeleted()||i===y||i===b){this.setDraggable(false);this.setResizable(false)}}T.get=function(e){return e.data("agn:child")};T.set=function(e,t){e.data("agn:child",t)};T.resolveAgnImageTags=function(e,i){return d.replaceAgnTags(e,function(e,t){if(e.name==="agnIMAGE"&&e.attributes["name"]){if(!e.attributes["source"]||e.attributes["source"]==="mediapool"||e.attributes["source"]==="mediapoolbg"){return i.replace(":filename:",encodeURIComponent(e.attributes["name"]))}}return t})};T.render=function(e,i,n){var r="";e.forEach(function(t){switch(t.type){case Q:if(t.value){r+=T.resolveAgnImageTags(t.value,n.imageByFilenameUriPattern)}else{r+=t.value}break;case Z:var e=i[t.id];if(t.markup){if(e){r+=T.render(t.markup,i,n)}}else{switch(t.placeholderType){case te:case ie:case ne:case ae:case oe:case g:if(e){r+=$.trim(T.resolveAgnImageTags(e,n.imageByFilenameUriPattern))}break;case re:if(e){r+=$.trim(T.resolveAgnImageTags(e,n.imageByFilenameUriPattern))}else{r+=n.noImageLink}break;case h:r+=parseInt(e)>0?n.imageUriPattern.replace("{image-id}",e):n.noImageLink;break;default:console.error("Unknown placeholder type: "+t.placeholderType)}}break;case J:n.toc.forEach(function(e){r+=T.render(t.markup,i,$.extend({tocItem:e},n))});break;case ee:switch(t.placeholderType){case se:r+=ue+n.tocItem.id;break;case le:r+=n.tocItem.name;break;default:console.error("Unknown TOC placeholder type: "+t.placeholderType)}break;default:console.error("Unknown span type: "+t.type)}});return d.escapeAgnTags(r)};T.collectPlaceholders=function(e,t,i,n,r){e.forEach(function(e){switch(e.type){case Z:if(!r||r.call(r,e)){if(n[e.id]===undefined){i.push({id:e.id,type:e.placeholderType,name:e.name,value:t[e.id],options:e.options,help:e.help});n[e.id]=true}}case J:if(e.markup){T.collectPlaceholders(e.markup,t,i,n,r)}break}})};T.draggableOptions=function(){return{stack:"#children .div-container",revert:"invalid",distance:20,cursor:"move",opacity:.4,start:function(){c.setChildrenControlsEnabled(false)},stop:function(){c.setChildrenControlsEnabled(true)}}};T.resizableOptions=function(n){var r=false;return{handles:"ne, se, sw, nw, w, n, e, s",autoHide:true,create:function(){r=new k(n,c.getGrid())},start:function(e,t){if(r===false){r=new k(n,c.getGrid())}var i=$(e.originalEvent.target);n.setControlsEnabled(false);n.capsule.setResizingEnabled(true);r.start(w.getResizeHandleDirection(i))},stop:function(e,t){r.stop(t.size.width,t.size.height);n.capsule.setResizingEnabled(false);n.setControlsEnabled(true);n.checkHoverState();c.updateToc(false);c.adjust();c.setChanged(true)},resize:function(e,t){r.resize(t.size.width,t.size.height)}}};T.prototype.asSubmittable=function(){return{id:this.data.id,containerId:this.data.container.id,name:this.data.name,targetId:this.data.targetId,interestGroup:this.data.container.isSortable?this.data.interestGroup||"":"",type:this.data.container.type,filter:this.data.container.filter,row:this.data.row,column:this.data.column,rows:this.data.rows,columns:this.data.columns,content:$.extend({},this.data.content),isTocItem:this.data.isTocItem}};T.prototype.get$=function(){return this.capsule.get$()};T.prototype.getId=function(){return this.data.id};T.prototype.getName=function(){return this.data.name};T.prototype.getContainerName=function(){return this.data.container.name};T.prototype.setName=function(e){this.data.name=e||""};T.prototype.getContainerId=function(){return this.data.container.id};T.prototype.isRecycled=function(){return this.data.isRecycled};T.prototype.setRecycled=function(e){if(e){this.setShown(false);this.setRows(1);this.setColumns(1);this.capsule.recycle();this.data.isRecycled=true}else{this.data.isRecycled=false}};T.prototype.isInArea=function(e){return!this.isNotInArea(e)};T.prototype.isNotInArea=function(e){var t=e.column,i=t+e.columns-1;var n=e.row,r=n+e.rows-1;var o=this.data.column;var a=o+this.data.columns-1;var s=this.data.row;var l=s+this.data.rows-1;return Math.max(o,a)<t||Math.min(o,a)>i||Math.max(s,l)<n||Math.min(s,l)>r};T.prototype.isMatching=function(e){if(e===s||this.data.targetId===r){return true}return this.data.targetId===e};T.prototype.isToc=function(){return this.data.container.isToc};T.prototype.modeEdit=function(){return this.data.container.modeEdit};T.prototype.isTocItem=function(){return this.data.isTocItem};T.prototype.setTocItem=function(e){this.data.isTocItem=!!e};T.prototype.isSortable=function(){return this.data.container.isSortable};T.prototype.getInterestGroup=function(){if(this.isSortable()){return this.data.interestGroup||""}else{return""}};T.prototype.setInterestGroup=function(e){if(this.isSortable()){this.data.interestGroup=e||""}else{this.data.interestGroup=""}};T.prototype.getTargetId=function(){return this.data.targetId};T.prototype.setTargetId=function(e){this.data.targetId=e>=0?e:r;this.capsule.updateControls()};T.prototype.getRow=function(){return this.data.row};T.prototype.setRow=function(e){return this.data.row=e};T.prototype.getColumn=function(){return this.data.column};T.prototype.setColumn=function(e){this.data.column=e};T.prototype.getZ=function(){return this.capsule.getZ()};T.prototype.setZ=function(e){this.capsule.setZ(e)};T.prototype.getRows=function(){return this.data.rows};T.prototype.setRows=function(e){this.data.rows=e};T.prototype.getColumns=function(){return this.data.columns};T.prototype.setColumns=function(e){this.data.columns=e};T.prototype.getArea=function(){return P.area(this.data.row,this.data.column,this.data.rows,this.data.columns)};T.prototype.setArea=function(e){this.setRow(e.row);this.setColumn(e.column);this.setRows(e.rows);this.setColumns(e.columns)};T.prototype.getHeight=function(){return this.capsule.getHeight()};T.prototype.setShown=function(e){this.capsule.setShown(e);if(!this.isContainerDeleted()){this.setDraggable(e);this.setResizable(e)}};T.prototype.setBorderHighlighted=function(e){this.capsule.setBorderHighlighted(e)};T.prototype.setHighlighted=function(e){this.capsule.setHighlighted(e)};T.prototype.setSize=function(e,t){this.capsule.setSize(e,t)};T.prototype.setCoordinates=function(e){this.capsule.setCoordinates(e)};T.prototype.setControlsEnabled=function(e){this.capsule.setControlsEnabled(e)};T.prototype.checkHoverState=function(){w.checkHoverState(this.capsule.get$())};T.prototype.adjustSize=function(e,t){this.setSize(e.getWidthForSpans(this.getColumns()),t||"auto")};T.prototype.adjustHeight=function(e){this.capsule.adjustHeight(e)};T.prototype.adjustCoordinates=function(e){this.setCoordinates(e.getCoordinates(this.getRow(),this.getColumn()))};T.prototype.setDraggable=function(e){var t=this.capsule.get$();if(e){t.draggable(T.draggableOptions())}else{try{t.draggable("destroy")}catch(e){}}};T.prototype.setResizable=function(e){var t=this.capsule.get$();if(e){t.resizable(T.resizableOptions(this))}else{try{t.resizable("destroy")}catch(e){}}};T.prototype.getPlaceholders=function(t){var e=this.data.content;var i=[];var n={};var r=undefined;if(t){r=function(e){return e.placeholderType===t}}T.collectPlaceholders(this.data.container.markup,e,i,n,r);i.sort(function(e,t){return e.name.localeCompare(t.name)});return ge(i)};function ge(i){const n=new Map(i.filter(function(e){return e.type===g}).map(function(e){return[e.id,e.options.split(",").map(function(t){return i.find(function(e){return t==e.id})})]}));const t=Array.from(n.values()).flat();const r=[];i.filter(function(e){return!t.includes(e)}).forEach(function(e){r.push(e);if(e.type===g){const t=n.get(e.id);t.forEach(function(e){r.push(e)})}});return r}T.prototype.setContent=function(e){$.extend(this.data.content,e)};T.prototype.asTocItem=function(){var t=this.data.container.tocItemPlaceholderId;if(t>0){var e=this.data.content;var i=[];var n={};function r(e){return e.id===t}T.collectPlaceholders(this.data.container.markup,e,i,n,r);if(i.length){var o=i[0];return{id:this.data.id,name:e[o.id]||"",placeholderName:o.name,isEnabled:this.data.isTocItem}}}return null};T.prototype.rebuild=function(e){this.capsule.embrace(T.render(this.data.container.markup,this.data.content,e))};T.prototype.pulse=function(){return this.capsule.pulse()};T.prototype.clone=function(){var e=new T(this.data);e.data.id=0;return e};T.prototype.isContainerDeleted=function(){return this.data.container.isDeleted};T.prototype.isRssTemplateChild=function(){return!!(this.data.container.type&&this.data.container.type.startsWith("rss:contentSourceId="))};T.prototype.isRssImportedChild=function(){const e="rss:import";return!!(this.data.container.type&&this.data.container.type.startsWith(e))||!!(this.data.type&&this.data.type.startsWith(e))};function S(e){this.data=$.extend({id:0,name:"",isToc:false,markup:[],content:{}},e)}S.draggableOptions=function(){return{stack:"#children .div-container",revert:"invalid",distance:20,helper:"clone",appendTo:"body",containment:"window",zIndex:Y,refreshPositions:true,start:function(e,t){t.helper.width($(this).width());c.setChildrenControlsEnabled(false)},stop:function(e,t){t.helper.width("auto");c.setChildrenControlsEnabled(true);c.clearEmptyAddedOnTheFlyRows()},drag:function(e,t){c.processAddedOnTheFlyRows(e)}}};S.prototype.getContainerId=function(){return this.data.id};S.prototype.getRows=function(){return 1};S.prototype.getColumns=function(){return 1};S.prototype.isToc=function(){return this.data.isToc};S.prototype.instantiate=function(){return new T({name:this.data.name,container:this.data})};function D(e){this.horizontal=v;this.vertical=v;for(var t=0;t<e.length;t++){var i=e.charAt(t).toLowerCase();switch(i){case ce:case de:if(this.horizontal===v){this.horizontal=i}else{console.error("Ambiguous direction code: "+e)}break;case fe:case pe:if(this.vertical===v){this.vertical=i}else{console.error("Ambiguous direction code: "+e)}break;default:console.error("Unknown direction code: "+i)}}}D.prototype.isHorizontal=function(){return this.horizontal!==v};D.prototype.isVertical=function(){return this.vertical!==v};D.prototype.isEast=function(){return this.horizontal===ce};D.prototype.isWest=function(){return this.horizontal===de};D.prototype.isNorth=function(){return this.vertical===fe};D.prototype.isSouth=function(){return this.vertical===pe};function k(e,t){var i=e.get$();this.child=e;this.$child=i;this.grid=t}k.prototype.setupConstraints=function(){this.setConstraints(this.grid.getConstraints(this.child,this.direction))};k.prototype.setConstraints=function(e){this.$child.resizable({minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight})};k.prototype.getArea=function(e,t){return this.grid.getArea(this.child,this.direction,e,t)};k.prototype.start=function(e){this.direction=e;this.area={row:this.child.getRow(),column:this.child.getColumn(),rows:this.child.getRows(),columns:this.child.getColumns()};this.z=this.child.getZ();this.setupConstraints();this.grid.setAreaHovered(this.area);this.grid.startResizing(this.child);this.child.setZ(Y)};k.prototype.resize=function(e,t){var i=this.getArea(e,t);if(i.row!==this.area.row||i.column!==this.area.column||i.rows!==this.area.rows||i.columns!==this.area.columns){this.area=i;this.grid.setAreaHovered(i)}};k.prototype.stop=function(e,t){this.area=this.getArea(e,t);this.child.setZ(this.z);this.child.setRow(this.area.row);this.child.setColumn(this.area.column);this.child.setRows(this.area.rows);this.child.setColumns(this.area.columns);this.grid.setAreaHovered(null);this.grid.stopResizing(this.child);this.child.adjustSize(this.grid);this.child.adjustCoordinates(this.grid)};function O(e){var t=this;var i=$.Deferred();var n=o.dom("div-sandbox");this.promise=i.promise();this.watcher=new ve;this.$capsule=n;this.$content=O.stub();if(e.isContainerDeleted()){this.showIsDeleted()}n.find("iframe").on("load",function(){var e=$(this).contents().get(0);$(e.head).append(O.style());$(e.body).append(t.$content);t.watcher.bind(w.imagesAdjusted(t.$content));i.resolveWith(t)});n.appendTo("#children");T.set(n,e);this.controls=new N(n)}O.stub=function(){return $('<div class="div-container"></div>')};O.css=function(){return $("#template-styles").html()};O.style=function(){return $("<style/>",{html:this.css()})};O.prototype.get$=function(){return this.$capsule};O.prototype.updateControls=function(){this.controls.update()};O.prototype.setControlsEnabled=function(e){this.controls.setEnabled(e)};O.prototype.ready=function(e){if(e!==undefined){this.promise.done(e)}return this.promise.state()==="resolved"};O.prototype.pulse=function(){return this.watcher.promise()};O.prototype.embrace=function(e){var t=$(e).filter("*");if(this.ready()){this.$content.replaceWith(t);this.$content=t;var i=this.$capsule.outerWidth();if(i>0){this.setSize(i,"auto")}this.watcher.bind(w.imagesAdjusted(t,true))}else{this.$content=t}};O.prototype.recycle=function(){var t=this;this.setShown(false);this.ready(function(){var e=O.stub();t.watcher.bind(false);t.$content.replaceWith(e);t.$content=e})};O.prototype.getZ=function(){return this.$capsule.css("z-index")};O.prototype.setZ=function(e){this.$capsule.css("z-index",e)};O.prototype.setShown=function(e){w.setShown(this.$capsule,e)};O.prototype.setBorderHighlighted=function(e){if(e){this.$capsule.addClass("highlight-border")}else{this.$capsule.removeClass("highlight-border")}};O.prototype.setHighlighted=function(e){if(e){this.$capsule.addClass("highlight-cont")}else{this.$capsule.removeClass("highlight-cont")}};O.prototype.setCoordinates=function(e){this.$capsule.offset(e)};O.prototype.setSize=function(e,t){if(!m){this.$content.outerWidth(e)}this.$capsule.outerWidth(e);if(this.ready()){this.$content.style("width",function(e){return e},"important");this.$content.style("height","auto","important");if(t==="auto"){t=this.$content.outerHeight()}this.$capsule.outerHeight(t)}else{if(t==="auto"){this.$capsule.outerHeight(a)}else{this.$capsule.outerHeight(t)}}};O.prototype.adjustHeight=function(e){this.$capsule.outerHeight(e)};O.prototype.getHeight=function(){if(this.ready()){return w.getHeightAccurate(this.$content)}else{return a}};O.prototype.setResizingEnabled=function(e){if(e){this.$capsule.css("box-sizing","content-box");this.$capsule.css("opacity",.4);this.$content.style("width","100%","important");this.$content.style("height","100%","important")}else{this.$capsule.css("box-sizing","");this.$capsule.css("opacity","")}};O.prototype.showIsDeleted=function(){var e=this.$capsule.find(".div-sandbox-overlay");e.addClass("deleted");var i=$('<div class="delete-badge" data-tooltip="'+t("grid.container.deleted")+'">'+' <i class="icon-fa5 icon-trash"/><span class="text">!</span>'+"</div>");n.create(i,n.options(i));e.append(i)};function R(e){this.child=e}R.prototype.getOptions=function(){return{targetName:c.getTargetName(this.child.getTargetId()),isToc:this.child.isToc(),containerDeleted:this.child.isContainerDeleted(),containerModeEdit:this.child.modeEdit()}};R.prototype.createControls=function(e){var t=o.dom(e,this.getOptions());T.set(t.find("[data-action]"),this.child);AGN.runAll(t);return t};R.prototype.createInlineControls=function(){return this.createControls("child-controls")};R.prototype.createPopoverControls=function(){return this.createControls("child-popover-controls")};function N(e){var t=this;var i=T.get(e);this.$capsule=e;this.factory=new R(i);this.timeoutId=null;this.state=u;this.update();e.on("mouseenter",function(){t.show()});e.on("mouseleave",function(){t.hide()})}N.popoverOptions=function(e){return{trigger:"manual",html:true,template:K,content:function(){return e.getPopoverContent()}}};N.prototype.stopHiding=function(){if(this.timeoutId){clearTimeout(this.timeoutId);this.timeoutId=undefined;return true}return false};N.prototype.popoverShow=function(){if(!this.stopHiding()){this.popover.show()}this.state=f};N.prototype.popoverHide=function(e){this.stopHiding();if(e===true){this.popover.hide();this.state=u}else{var t=this;this.timeoutId=setTimeout(function(){t.popoverHide(true)},200)}};N.prototype.inlineShow=function(){this.$inlineControls.show();this.state=p};N.prototype.inlineHide=function(){this.$inlineControls.hide();this.state=u};N.prototype.show=function(){if(this.state===i){return}if(this.$inlineControls.height()<this.$capsule.height()){if(this.state===f){this.popoverHide(true)}this.inlineShow()}else{if(this.state===p){this.inlineHide()}this.popoverShow()}};N.prototype.hide=function(e){switch(this.state){case p:this.inlineHide();break;case f:this.popoverHide(e);break}};N.prototype.setEnabled=function(e){if(e){if(this.state===i){this.state=u}}else{this.hide(true);this.state=i}};N.prototype.update=function(){if(this.$inlineControls){this.$inlineControls.remove()}this.$inlineControls=this.factory.createInlineControls();this.$capsule.append(this.$inlineControls);if(this.popover){this.popover.destroy()}if(this.$popoverControls){this.$popoverControls=undefined}this.popover=G.new(this.$capsule,N.popoverOptions(this));var e=this.popover.tip();var t=this;e.on("mouseenter",function(){t.popoverShow()});e.on("mouseleave",function(){t.popoverHide()});if(this.state===p||this.state===f){this.show()}};N.prototype.getPopoverContent=function(){if(this.$popoverControls===undefined){this.$popoverControls=this.factory.createPopoverControls();var e=this.$popoverControls.find("[data-action]");T.set(e,this.child);var t=this;e.on("click",function(){t.popoverHide(true)})}var i=this.$popoverControls.clone(true);AGN.runAll(i);return i};N.prototype.remove=function(){this.state=i;this.stopHiding();this.popover.destroy();this.$popoverControls=undefined;this.$inlineControls.remove();this.$inlineControls=undefined};function ve(){this.deferred=$.Deferred();this.callback=null}ve.prototype.promise=function(){return this.deferred.promise()};ve.prototype.bind=function(e){var t=this;if(e===false){t.callback=null}else{var i=t.callback=function(){if(t.callback===i){t.deferred.notifyWith(this,arguments)}};if($.isArray(e)){e.forEach(function(e){e.progress(i)})}else{e.progress(i)}}};var I={};I.make=function(t,e){I.adjustChildren(t,e);e.forEach(function(e){e.adjustHeight(t.getHeightForSpans(e.getRow(),e.getColumn(),e.getRows(),e.getColumns()))})};I.getChildrenProjections=function(n,e){var s=[];n.each(function(e){s.push({row:e,projections:[]})});var l=[];e.forEach(function(e){var t=[];var i={child:e,height:e.getHeight(),spans:t};var n=e.getRow();var r=n+e.getRows()-1;for(var o=n;o<=r;o++){var a={cascade:i,height:0,margin:0,adjusted:false};t.push(a);s[o-1].projections.push(a)}l.push(i)});$.each(s,function(e,t){var i=n.getRowMargin(t.row.isGuttered());$.each(t.projections,function(e,t){t.margin=i})});$.each(l,function(e,t){I.adjustCascade(t)});return s};I.adjustCascade=function(e){var t=Math.max(e.height,q);var i=0;var n=e.spans;var r=[];for(var o=0;o<n.length;o++){var a=n[o];if(a.adjusted===false){a.height=q;r.push(a)}i+=a.height;if(i+a.margin>=t){for(o=o+1;o<n.length;o++){n[o].height=0}break}if(o+1<n.length){i+=a.margin}}var s=t-i;if(s>0&&r.length){var l=s/r.length;$.each(r,function(e,t){t.height+=l})}};I.adjustChildren=function(e,t){$.each(I.getChildrenProjections(e,t),function(e,t){var i=t.projections;if(i.length){var n=0;var r=0;$.each(i,function(e,t){if(t.height>n){n=t.height;r=e}});if(n===0){n=a}$.each(i,function(e,t){t.adjusted=true;if(e!==r){t.height=n;I.adjustCascade(t.cascade)}});t.row.setHeight(n)}else{t.row.setHeight(a)}})};function P(e,t){this.$template=$("#template");this.columns=e.columns;this.rows=[];this.gap=e.gap;this.columnWidth=e.columnWidth;this.callbacks={};this.hoveredDroppable=null;for(var i=1;i<=t;i++){var n=this.createRow(e.gutters[i-1]);this.$template.append(n.get$());this.rows.push(n)}this.adjustSidebars()}P.area=function(e,t,i,n){return{row:e,column:t,rows:i,columns:n}};P.prototype.createRow=function(e){var l=new M(this.columns,e);var u=this;l.setOnHoverChange(function(e,t,i,n){var r=u.rows.indexOf(l)+1;if(r>0){if(n){u.setAreaHovered(P.area(r,i,t.getRows(),t.getColumns()));u.hoveredDroppable=e}else if(u.hoveredDroppable===e){u.setAreaHovered(false)}}else{u.setAreaHovered(false)}});l.setOnDrop(function(e,t,i){if(u.callbacks.onDrop){var n=u.rows.indexOf(l)+1;if(n>0){var r=e.getRows();var o=u.getRows()-n+1;if(r>o){r=o}var a=e.getColumns();var s=u.getColumns()-i+1;if(a>s){a=s}u.callbacks.onDrop.call(u,e,t,P.area(n,i,r,a))}}});return l};P.prototype.each=function(e){this.rows.forEach(e)};P.prototype.getRows=function(){return this.rows.length};P.prototype.getColumns=function(){return this.columns};P.prototype.getRow=function(e){return this.rows[e-1]||null};P.prototype.getDroppable=function(e,t){var i=this.getRow(e);if(i){return i.getDroppable(t)}return null};P.prototype.getRowMargin=function(e){return X+(e?this.gap:0)};P.prototype.getCoordinates=function(e,t){return this.getDroppable(e,t).getCoordinates()};P.prototype.getConstraints=function(e,t){return $.extend(this.getWidthConstraints(e,t),this.getHeightConstraints(e,t))};P.prototype.getWidthConstraints=function(e,t){var i=e.getColumn();var n=e.getColumns();var r=this.getWidthForSpans(1);var o;if(t.isHorizontal()){if(t.isEast()){o=this.getWidthForSpans(this.getColumns()-i+1)}else{o=this.getWidthForSpans(i+n-1)}}else{o=r}return{minWidth:r,maxWidth:o}};P.prototype.getHeightConstraints=function(e,t){var i=e.getColumns();var n=e.getColumn();var r=n+i-1;var o=e.getRows();var a=e.getRow();var s=a+o-1;var l,u;if(t.isVertical()){if(t.isSouth()){l=this.getMinHeightConstraint(a,n,1,i);s=this.getRows();if(t.isHorizontal()){if(t.isEast()){r=this.getColumns()}else{n=1}}}else{l=this.getMinHeightConstraint(s,n,1,i);a=1}u=this.getMaxHeightConstraint(a,n,s-a+1,r-n+1)}else{l=u=e.getHeight()}return{minHeight:Math.min(l,e.getHeight()),maxHeight:u}};P.prototype.getWidthForSpans=function(e){if(m){return this.columnWidth}return this.columnWidth*e+this.gap*(e-1)};P.prototype.getHeightForSpans=function(e,t,i,n,r){var o=this;if(r===undefined){r=function(e,t){return e.getHeight()>t.getHeight()?e:t}}function a(e){return o.rows[e-1].getDroppables().slice(t-1,t+n-1).reduce(r)}var s=e;var l=e+i-1;if(s===l){return a(s).getHeight()}else{var u=a(s).get$();var c=a(l).get$();return c.position().top-u.position().top+c.outerHeight()}};P.prototype.getMinHeightConstraint=function(e,t,i,n){function r(e,t){return e.getHeight()<t.getHeight()?e:t}return this.getHeightForSpans(e,t,i,n,r)};P.prototype.getMaxHeightConstraint=function(e,t,i,n){function r(e,t){return e.getHeight()>t.getHeight()?e:t}return this.getHeightForSpans(e,t,i,n,r)};P.prototype.getArea=function(e,t,i,n){var r=this;var o,a;if(t.isHorizontal()){a=Math.ceil(i/(this.columnWidth+this.gap));if(t.isEast()){o=e.getColumn()}else{o=e.getColumn()+e.getColumns()-a}}else{o=e.getColumn();a=e.getColumns()}function s(e){var t=r.rows[e-1];if(t){return t.getDroppables().slice(o-1,o+a-1).reduce(function(e,t){return e.getHeight()>t.getHeight()?e:t})}else{return null}}function l(e){return e.get$().position().top}var u,c;if(t.isVertical()){var d,f;c=1;if(t.isSouth()){u=e.getRow();d=s(u);while(f=s(u+c)){if(n>l(f)-l(d)){c++}else{break}}}else{u=e.getRow()+e.getRows()-1;f=s(u);while(d=s(u-1)){if(n>l(f)-l(d)+f.getHeight()-d.getHeight()){u--;c++}else{break}}}}else{u=e.getRow();c=e.getRows()}return P.area(u,o,c,a)};P.prototype.setAreaHovered=function(i){if(i){this.each(function(e,t){if(t>=i.row-1&&t<=i.row-1+i.rows-1){e.setHovered(true,i.column,i.column+i.columns-1)}else{e.setHovered(false)}})}else{this.each(function(e){e.setHovered(false)})}if(this.callbacks.onAreaHovered){this.callbacks.onAreaHovered.call(this,i)}};P.prototype.startResizing=function(e){if(this.callbacks.onResizingStarted){this.callbacks.onResizingStarted.call(this,e)}};P.prototype.stopResizing=function(e){if(this.callbacks.onResizingStopped){this.callbacks.onResizingStopped.call(this,e)}};P.prototype.adjustRows=function(e){I.make(this,e.get())};P.prototype.getDroppables=function(){var r=[];var t=this.gap;this.each(function(e,i){var n=(e.isGuttered()?t:0)+X;e.each(function(e,t){r.push({droppable:e,row:i+1,column:t+1,marginBottom:n})})});return r};P.prototype.adjustSidebars=function(){var a=[];$.each(this.rows,function(e,t){var i=t.get$();var n=parseInt(i.css("marginTop"));var r=i.position().top;var o=i.outerHeight(true);a[e]={top:r+n/2,middle:r+n+(o-n)/2}});$.each(this.rows,function(e,t){var i=a[e];var n=a[e+1];t.setRemoveButtonShown(true);t.setInsertButtonShown(true);t.setGutterButtonShown(!m&&!!n);if(!m&&n){t.adjustGutterButton(n.top-l/2)}if(e===0){t.adjustInsertButton(0);t.adjustRemoveButton(n?(n.top-l/2)/2:i.middle)}else{t.adjustInsertButton(i.top-l/2);t.adjustRemoveButton(i.middle-l/2)}})};P.prototype.addRowBefore=function(e){var t=this.rows.indexOf(e);if(t>=0){var i=true;if(t>0){i=this.rows[t-1].isGuttered()}var n=this.createRow(i);this.rows[t].get$().before(n.get$());this.rows.splice(t,0,n)}return t+1};P.prototype.addRow=function(){if(this.rows.length>0){this.rows[this.rows.length-1].setGuttered(true)}var e=this.createRow(true);this.$template.append(e.get$());this.rows.push(e);return this.rows.length};P.prototype.removeRow=function(e){var t=this.rows.indexOf(e);if(t>=0){this.rows[t].remove();this.rows.splice(t,1)}return t+1};P.prototype.setOnDrop=function(e){this.callbacks.onDrop=e};P.prototype.setOnAreaHovered=function(e){this.callbacks.onAreaHovered=e};P.prototype.setOnResizingStarted=function(e){this.callbacks.onResizingStarted=e};P.prototype.setOnResizingStopped=function(e){this.callbacks.onResizingStopped=e};function M(e,i){this.$row=o.dom("droppables-row");this.$gutterButton=o.dom("toggle-gutter-button");this.$removeButton=o.dom("remove-row-button");this.$insertButton=o.dom("insert-row-button");this.$row.data("agn:row",this);this.$gutterButton.data("agn:row",this);this.$removeButton.data("agn:row",this);this.$insertButton.data("agn:row",this);this.droppables=[];this.callbacks={};for(var n=1;n<=e;n++){var r=this.createDroppable();this.droppables.push(r);this.$row.append(r.get$())}this.setGuttered(i);this.$gutterButton.appendTo("#sidebar-gutters");this.$removeButton.appendTo("#sidebar-actions");this.$insertButton.appendTo("#sidebar-actions");w.setTooltip(this.$removeButton,t("grid.row.delete"));w.setTooltip(this.$insertButton,t("grid.row.add"))}M.get=function(e){return e.data("agn:row")};M.prototype._isPointerAtAddOnTheFlyPosition=function(e,t){const i=this.$row;const n=10;const r=i.offset().top;const o=i.offset().left;const a=i.outerHeight();const s=i.outerWidth();const l=r+a;const u=this.isGuttered()?c.grid.gap:1;return e>o&&e<o+s&&(t>l-n&&t<l+u+n)};M.prototype.isAllowedToAppendNewRowOnTheFly=function(e,t){return this._isPointerAtAddOnTheFlyPosition(e,t)&&(!this.preventAddOnTheFly&&!this.isEmptyRowAddedOnTheFly)};M.prototype.animateAppearance=function(){const e=this.$row;const t=e.clone(true);e.hide().after(t);t.show().addClass("container-row-animated");t.one("animationend",function(){e.show();t.remove()})};M.prototype.createDroppable=function(){var e=new L(this);var r=this;e.setOnHoverChange(function(e,t){if(r.callbacks.onHoverChange){var i=this;var n=r.droppables.indexOf(i)+1;if(n>0){r.callbacks.onHoverChange.call(r,i,e,n,t)}}});e.setOnDrop(function(e){if(r.callbacks.onDrop){var t=this;var i=r.droppables.indexOf(t)+1;if(i>0){r.callbacks.onDrop.call(r,e,t,i)}}});return e};M.isEmpty=function(t){return!c.children.active().children.some(e=>e.getRow()>=t&&e.getRow()+e.getRows()-1<=t)};M.prototype.get$=function(){return this.$row};M.prototype.each=function(e){this.droppables.forEach(e)};M.prototype.getDroppables=function(){return this.droppables.slice()};M.prototype.getDroppable=function(e){return this.droppables[e-1]||null};M.prototype.setHeight=function(t){if(t>0){t=Math.max(t,q)}else{t=a}this.droppables.forEach(function(e){e.setHeight(t)})};M.prototype.isGuttered=function(){return this.$row.hasClass("guttered")};M.prototype.setGuttered=function(e){if(e){this.$row.addClass("guttered");w.setTooltip(this.$gutterButton,t("grid.gutter.hide"));this.$gutterButton.find("#show-spacing-icon").hide();this.$gutterButton.find("#hide-spacing-icon").show()}else{this.$row.removeClass("guttered");w.setTooltip(this.$gutterButton,t("grid.gutter.show"));this.$gutterButton.find("#show-spacing-icon").show();this.$gutterButton.find("#hide-spacing-icon").hide()}};M.prototype.setHovered=function(n,r,o){if(r===undefined){this.droppables.forEach(function(e){e.setHovered(n)})}else{if(o===undefined){o=r}this.droppables.forEach(function(e,t){var i=t+1;if(r<=i&&i<=o){e.setHovered(n)}else{e.setHovered(!n)}})}};M.prototype.remove=function(){this.droppables.forEach(function(e){e.remove()});this.droppables=[];this.$row.remove();w.removeTooltip(this.$gutterButton);this.$gutterButton.remove();w.removeTooltip(this.$removeButton);this.$removeButton.remove();w.removeTooltip(this.$insertButton);this.$insertButton.remove();this.callbacks.onDrop=undefined};M.prototype.adjustGutterButton=function(e){this.$gutterButton.css("top",e)};M.prototype.setGutterButtonShown=function(e){w.setShown(this.$gutterButton,e)};M.prototype.adjustRemoveButton=function(e){this.$removeButton.css("top",e)};M.prototype.setRemoveButtonShown=function(e){w.setShown(this.$removeButton,e)};M.prototype.adjustInsertButton=function(e){this.$insertButton.css("top",e)};M.prototype.setInsertButtonShown=function(e){w.setShown(this.$insertButton,e)};M.prototype.setOnHoverChange=function(e){this.callbacks.onHoverChange=e};M.prototype.setOnDrop=function(e){this.callbacks.onDrop=e};function L(e){this.$droppable=o.dom("droppable");this.$droppable.data("agn:droppable",this);this.$droppable.droppable(L.options(this));this.row=e;this.callbacks={}}L.get=function(e){return e.data("agn:droppable")};L.options=function(i){return{accept:"[data-building-block]",tolerance:"pointer",deactivate:function(){i.setHovered(false);if(i.callbacks.onHoverChange){i.callbacks.onHoverChange(false)}},drop:function(e,t){i.setHovered(false);if(i.callbacks.onDrop){i.callbacks.onDrop(T.get(t.draggable))}i.row.isEmptyRowAddedOnTheFly=false},over:function(e,t){if(i.callbacks.onHoverChange){i.callbacks.onHoverChange(T.get(t.draggable),true)}else{i.setHovered(true)}},out:function(e,t){if(i.callbacks.onHoverChange){i.callbacks.onHoverChange(T.get(t.draggable),false)}else{i.setHovered(false)}}}};L.prototype.get$=function(){return this.$droppable};L.prototype.getCoordinates=function(){return this.$droppable.offset()};L.prototype.getRow=function(){return this.row};L.prototype.getHeight=function(){return w.getHeightAccurate(this.$droppable)};L.prototype.setHeight=function(e){this.$droppable.outerHeight(e)};L.prototype.setHovered=function(e){if(e){this.$droppable.addClass("container-hover-accept")}else{this.$droppable.removeClass("container-hover-accept")}};L.prototype.setLayeringIndex=function(e){if(e>0){if(this.$rotationButton){this.$rotationButton.css("visibility","");this.$rotationButton.find(".layer-number").text(e)}else{var t=this;this.$rotationButton=o.dom("child-z-index-button",{index:e});if(c.isEditable()){this.$rotationButton.on("click",function(){if(t.callbacks.onLayeringRotate){t.callbacks.onLayeringRotate()}})}this.$droppable.append(this.$rotationButton)}}else{if(this.$rotationButton){this.$rotationButton.css("visibility","hidden")}}};L.prototype.remove=function(){this.$droppable.droppable("destroy");if(this.$rotationButton){this.$rotationButton.remove();this.$rotationButton=undefined}this.$droppable.remove();this.callbacks.onDrop=undefined;this.callbacks.onHoverChange=undefined;this.callbacks.onLayeringRotate=undefined};L.prototype.setOnDrop=function(t){var i=this;this.callbacks.onDrop=function(e){t.call(i,e)}};L.prototype.setOnHoverChange=function(i){var n=this;this.callbacks.onHoverChange=function(e,t){i.call(n,e,t)}};L.prototype.setOnLayeringRotate=function(e){if(e){var t=this;this.callbacks.onLayeringRotate=function(){e.call(t)}}else{this.callbacks.onLayeringRotate=undefined}};function F(e,t,i){const o=this;this.$modal=e;this.child=t;this.options=i;const n=t.getPlaceholders(h);const r=[];n.forEach(function(e){const t=parseInt(e.value);if(t>0){r.push(t)}});if(r.length>0){$.ajax(this.options.urls.MEDIAPOOL_LOAD_ELEMENTS,{type:"POST",dataType:"json",traditional:true,contentType:"application/json",data:JSON.stringify(r)}).done(function(r){n.forEach(function(e){const t=parseInt(e.value);if(t>0){const i=r[t];$("#image-category-id-"+e.id).select2("val",i.categoryId);o.updateImagePreview(e.id,i.src,i.name,i.title);if(i.mobileSrc){const n=o.buildMobilePlaceholder(e.id);o.updateImagePreview(n,i.mobileSrc,i.mobileName,i.mobileTitle);o.changeImageControlsState(n,true);o.changeMobileImageBlockVisibility(n,true)}}})})}me(t,e);this.updateImageSrcPreview=_.throttle(this.updateImageSrcPreview,300)}function me(e,t){e.getPlaceholders(g).filter(function(e){return e}).forEach(function(e){const t=$('<div id="'+e.id+'-children" class="col-sm-offset-1 col-sm-11" data-show-by-checkbox="#content-'+e.id+'"></div>');t.insertAfter($("#content-"+e.id).closest(".form-group"));e.options.split(",").forEach(function(e){t.append($(".ph-"+e))})});AGN.Lib.CoreInitializer.run("checkbox-hider",t)}F.get=function(e){var t=e.data("agn:child-dialog");if(t){return t}return e.closest(".modal").data("agn:child-dialog")};F.create=function(e,t){var i=W.createFromTemplate(t,"div-editing-dialog");i.data("agn:child-dialog",new F(i,e,t))};F.prototype.updateImageSrc=function(e){var t=e.data("placeholder-id");var i=$.trim(e.val());this.updateImageSrcPreview(t,i)};F.prototype.updateImageSrcPreview=function(e,t){var i=$("#preview-"+e);if(i.attr("src")!==t){i.attr("src",this.options.resolveAgnImageTags(t)||this.options.noPreviewImageLink)}};F.prototype.updateImage=function(e,t){const i=e.data("placeholder-id");const n=e.prop("files");const r=$("#content-"+i);if(n&&n.length){const o=n[0];if(o.type==="image"||o.type.match("image/.*")){const a=new FileReader;const s=this;if(t){const l=i.replace(this.options.mobileSuffix,"");const u=$("#image-name-"+l).text();d.renameFile(o,this.options.mobileImagePrefix+u)}else{const c=this.buildMobilePlaceholder(i);this.changeMobileImageBlockVisibility(c,true);this.updateImagePreview(c)}a.onload=function(e){s.updateImagePreview(i,e.target.result,o.name,o.name)};a.readAsDataURL(o)}else{d.clearFormField(e);this.updateImagePreview(i)}}else{this.updateImagePreview(i)}r.val("")};F.prototype.syncImageCategories=function(e,i){const t=$("#content-"+e).val();const n=this._findPlaceholdersWithImage(t);n.forEach(function(e){const t=$("#image-category-id-"+e.id);z.get(t).selectValue(i)})};F.prototype._findPlaceholdersWithImage=function(t){return this.child.getPlaceholders(h).filter(function(e){return t==$("#content-"+e.id).val()})};F.prototype.updateImagePreview=function(e,t,i,n){var r=$("#preview-"+e);var o=$("#image-name-"+e);if(r.attr("src")!==t){r.attr("src",t||this.options.noPreviewImageLink)}r.attr("title",n||"");o.text(i||"")};F.prototype.changeMobileImageBlockVisibility=function(e,t){const i=$("#image-block-"+e);if(t){i.removeClass("hidden")}else{i.addClass("hidden")}};F.prototype.chooseImage=function(e){var t=$("#file-"+e);if(t.val()){t.trigger("click")}else{this.showMediapoolDialog(e)}};F.prototype.deleteImage=function(e,t){this.clearImageData(e);if(!t){const i=this.buildMobilePlaceholder(e);this.clearImageData(i);this.changeImageControlsState(i,false);this.changeMobileImageBlockVisibility(i,false)}};F.prototype.clearImageData=function(e){var t=$("#file-"+e);var i=$("#image-name-"+e);var n=$("#content-"+e);var r=$("#preview-"+e);d.clearFormField(t);i.text("");n.val("");r.attr("src",this.options.noPreviewImageLink)};F.prototype.showMediapoolDialog=function(r){const o=this;H.request(this.options.urls.MEDIAPOOL_IMAGE_PICK).done(function(e){const t=o.buildMobilePlaceholder(r);o.loadMobileAlternative(e.id).then(function(e){$("#content-"+t).val(e.id);o.updateImagePreview(t,e.src,e.name,e.title);o.changeImageControlsState(t,true)}).catch(function(){o.updateImagePreview(t);o.changeImageControlsState(t,false)}).finally(function(){d.clearFormField($("#file-"+t));o.changeMobileImageBlockVisibility(t,true)});var i=e.categoryId;const n=o._findPlaceholdersWithImage(e.id);if(n.length>0){i=$("#image-category-id-"+n[0].id).val()}$("#content-"+r).val(e.id);z.get($("#image-category-id-"+r)).selectValue(i);d.clearFormField($("#file-"+r));o.updateImagePreview(r,e.src,e.name,e.title)})};F.prototype.changeImageControlsState=function(e,t){const i=$("#preview-"+e);$("#image-delete-button-"+e).find(".btn").prop("disabled",t);$("#choose-image-btn-"+e).prop("disabled",t);i.toggleClass("clickable",!t);i.attr("data-action",t?"":"chooseImage")};F.prototype.loadMobileAlternative=function(i){return new Promise(function(t,e){$.ajax({url:AGN.url("/mediapool/content/images/mobile-alternative/"+i+"/load.action"),type:"GET",success:function(e){t(e)},error:function(){e()},statusCode:{404:function(){e()}}})})};F.prototype.validate=function(e){var t=this.validateImageCategories(e);var i=this.validateImageFormats(e);return t&&i&&this.validateHtml()};F.prototype.validateHtml=function(){var i={};this.child.getPlaceholders().forEach(function(e){if(e.type!==h){var t=$("#content-"+e.id).val();if($.trim(t)){i[e.name]=t}}});if(Object.keys(i).length<=0){return true}var t=false;$.ajax({type:"POST",url:AGN.url("/layoutbuilder/template/"+c.getTemplateId()+"/validateHtml.action"),contentType:"application/json",async:false,data:JSON.stringify({htmlPlaceholders:i})}).done(function(e){AGN.Lib.JsonMessages(e.popups,true);t=!!e.success});return t};F.prototype.validateImageCategories=function(a){var s=true;this.child.getPlaceholders(h).forEach(function(e){var i=e.id;var n=$("#image-category-id-"+i).val();if(n<=0){var r=!!$("#file-"+i).val();var o=$("#content-"+i).val();if(r||parseInt(o)>0){s=false;a.showFieldError("image-category-id-"+i,t("error.grid.noCategorySelected"))}}});return s};F.prototype.validateImageFormats=function(r){var o=true;function a(e){var t=e.match(/[^.\\/]\.([^.\\/]+)$/);if(t){var i=t[1].toUpperCase();return i in{GIF:1,JPG:1,JPEG:1,PNG:1,SVG:1,ICO:1}}return false}this.child.getPlaceholders(h).forEach(function(e){var i=e.id;var n=$("#file-"+i).val();if(n&&!a(n)){o=false;r.showFieldError("content-"+i,t("grid.divchild.format.error"))}});return o};F.prototype.updateImagesCategories=function(){var e=this;var t=$.Deferred();var n=[];this.child.getPlaceholders(h).forEach(function(e){var t=e.id;var i=parseInt($("#content-"+t).val());if(i>0){n.push({imageId:i,categoryId:$("#image-category-id-"+t).val()})}});if(n.length){var i={};n.forEach(function(e){i[e.imageId]=e.categoryId});$.ajax(e.options.urls.MEDIAPOOL_SET_CATEGORIES,{type:"POST",dataType:"json",contentType:"application/json",data:JSON.stringify(i)}).done(function(){t.resolve()}).fail(function(){t.reject()})}else{t.resolve()}return t.promise()};F.prototype.uploadImages=function(e){const o=this;const t=$.Deferred();const a=[];this.child.getPlaceholders(h).forEach(function(e){const t=e.id;const i=o.buildMobilePlaceholder(t);const n=$("#file-"+t).prop("files");const r=$("#file-"+i).prop("files");if(n&&n.length){a.push({placeholderId:t,image:n[0],categoryId:$("#image-category-id-"+t).val()})}if(r&&r.length){a.push({placeholderId:i,image:r[0],categoryId:$("#image-category-id-"+t).val()})}});if(a.length){const i=new FormData;a.forEach(function(e,t){i.append("images["+t+"].file",e.image);i.append("images["+t+"].fileName",e.image.name);i.append("images["+t+"].title",e.image.name);i.append("images["+t+"].categoryId",e.categoryId)});$.ajax(o.options.urls.MEDIAPOOL_IMAGE,{type:"POST",dataType:"json",enctype:"multipart/form-data",processData:false,contentType:false,data:i}).done(function(e){AGN.Lib.JsonMessages(e.popups);if(e.data){e.data.forEach(function(e,t){if(e>0){const i=a[t].placeholderId;$("#content-"+i).val(e);d.clearFormField($("#file-"+i))}})}if(e.success===true){t.resolve()}else{t.reject()}}).fail(function(){t.reject()})}else{t.resolve()}return t.promise()};F.prototype.buildMobilePlaceholder=function(e){return e+this.options.mobileSuffix};F.prototype.save=function(e){var t=this;this.updateCkditorsValues();if(this.validate(e)){var s=this.$modal;var l=this.child;var i=this.$modal.find(".modal-body");var n=$("#child-save-button");i.addClass("ui-modal-loading");i.scrollTop(0);n.prop("disabled",true);this.updateImagesCategories(e).then(function(){return t.uploadImages(e)}).always(function(){i.removeClass("ui-modal-loading");n.prop("disabled",false)}).done(function(){var n={};var e=l.getPlaceholders();s.find(".js-wysiwyg").each(function(){var e=$(this);var t=e.attr("id");if(CKEDITOR.instances[t]){CKEDITOR.instances[t].updateElement()}AGN.Lib.Editor.get(e).val(e.val());window.removeEditor(t)});e.forEach(function(e){const t=e.id;const i=$("#content-"+t);n[t]=e.type===g?i.prop("checked")?"checked":"":n[t]=i.val()});var t=$("#child-title").val();var i=parseInt($("#target-group-id").val());var r=$("#is-toc-enabled").is(":checked");var o=$("#is-interest-sortable").is(":checked")?$("#interest-group").val():"";s.modal("hide");if(l.isToc()){var a={};$("input.js-is-toc-item").each(function(){var e=$(this);a[e.data("child-id")]=e.is(":checked")});c.saveChild(l,t,i,r,o,n,a)}else{c.saveChild(l,t,i,r,o,n)}})}};F.prototype.updateCkditorsValues=function(){this.$modal.find(".js-wysiwyg").each(function(){var e=CKEDITOR.instances[$(this).attr("id")];if(e){e.updateElement()}})}});AGN.Lib.Controller.new("grid-overview",function(){var u;this.addDomInitializer("grid-overview",function(e){u=this.config;e.all(".card[data-grid-id]").each(function(){var e=$(this);var t=u.grids[parseInt(e.data("grid-id"))];var i=[],n=165/90,r=1e3,o=r/n,a=t.columnWidth*r/t.templateWidth,s=t.gutter*r/t.templateWidth,l;if(e.find("svg").exists()){return}e.find(".js-grid").append('<svg class="grid-preview" viewBox="0 0 '+r+" "+o+'"></svg>');_.times(t.columnNum,function(e){i.push({type:"gutter",width:s/2});i.push({type:"col",width:a});i.push({type:"gutter",width:s/2})});_.reduce(i,function(e,t){t.xPos=e;return e+t.width},0);l=d3.select(e.find("svg")[0]).selectAll("g").data(i).enter().append("g").attr("transform",function(e){return"translate("+e.xPos+",0)"});l.append("rect").attr("class",function(e){return"grid-preview-"+e.type}).attr("width",function(e){return e.width}).attr("height",o)})});this.addAction({click:"back"},function(){history.back()});this.addAction({click:"pick"},function(){var e=u.grids[this.el.data("grid-id")];if(e){$.ajax(e.viewLink,{method:"POST",data:{newTemplateName:u.newTemplateName}}).done(function(e){AGN.Lib.Page.render(e)})}});this.addAction({submission:"createNewGrid"},function(){var e=this.el;var i=AGN.Lib.Form.get(e);var n=e.find("#newGridName");$.ajax(u.urls.CHECK_NAME,{type:"GET",data:{name:n.val()}}).done(function(e){if(e.used){i.showFieldError("newGridName",t("fields.name.errors.name_in_use"))}else{i.submit("static")}})})});AGN.Lib.Controller.new("grid-template",function(){var i;var n;var r=new f;var o=AGN.Lib.Storage;var a;var s;var l;this.addDomInitializer("grid-template",function(){var e=this.config;n=this.el;i=new d(n,e)});this.addDomInitializer("grid-template-css",function(){a=this.config.templateId;s=this.config.previewWidths;l=this.config.previewMediaQueries;const e=$('[name="previewSize"]');o.restoreChosenFields(e);if(e.is(":checked")===false){e.filter("[value=1]").prop("checked",true)}u()});function u(){const e=$(".template-preview-wrapper");e.empty();var t=$("#layoutPreviewForm");var i=parseInt($("input[name=previewSize]:checked").val());var n=s[i]+2;e.append('<div>           <div id="layout-preview-container" class="center-block">               <iframe name="layoutPreviewFrame" id="layoutPreviewFrame"                     class="mailing-preview-frame js-simple-iframe" border="0"                     data-max-width="'+n+'" data-media-query="'+l[i]+'"                     style="width:'+n+'px;">                   Your Browser does not support IFRAMEs, please update!               </iframe>           </div>       </div>');AGN.Lib.CoreInitializer.run("iframe");c(t,i);t.submit()}function e(){$("#layoutPreviewForm").find('input[name="css"]').val($("#cssContents").val())}this.addAction({click:"update-css-preview"},function(){o.saveChosenFields($("input[name=previewSize]:checked"));e();u()});function c(e,t){const i=e.find('input[name="previewSize"]');if(i.length>0){i.remove()}e.append('<input type="hidden" name="previewSize" value="'+t+'" />')}this.addAction({submission:"grid-template-validation"},function(){i.validateTemplateName(n.find("#newTemplateName"))});this.addAction({click:"back"},function(){history.back()});this.addAction({click:"delete"},function(){var e=this;var t=e.el;var n="";if(t.prop("tagName")=="A"){n=t.prop("href")}else{n=t.data("url")}var i=$.get(n);i.done(function(e){var t=$(e),i;i=t.filter(".modal").add(t.find(".modal"));if(i.length!=1){AGN.Lib.Page.render(e,n);return}AGN.Lib.Confirm.create(e).done(function(e){AGN.Lib.Page.render(e,n)})});e.event.preventDefault();return false});function d(e,t){this.templateNameValidationUrl=t.templateNameValidationUrl;this.form=AGN.Lib.Form.get(e)}d.prototype.validateTemplateName=function(e){var i=e.val();var n=this.form;var r=this.templateNameValidationUrl;if(i==""){n.showFieldError("newTemplateName",t("fields.required.errors.missing"))}else{$.ajax({type:"GET",url:r,data:{newTemplateName:i}}).done(function(e){if(e.newTemplateName==false){n.showFieldError("templateName",t("fields.name.errors.name_in_use"))}else{n.submit("static")}})}};this.addAction({click:"update-preview"},function(){var e=this.el;r.updateInputValue(e.data("target-form"),e.data("content-type"))});function f(){this.contentTypes={css:{inputSelector:'input[name="css"]',contentId:"#cssContents"},outerHtml:{inputSelector:'input[name="outerHtml"]',contentId:"#templateOuterHTML"},styles:{inputSelector:'input[name^="styles["]',getContentSelector:function(e){return'input[name="'+e+'"]'}}}}f.updateFields=function(e,n,r){var t=$("form").not("#"+r.attr("id"));_.each(t.find(e),function(e){var t=$(e);var i=t.val();r.find(n(t.attr("name"))).val(i)})};f.updateField=function(e,t,i){i.find(e).val(t)};f.prototype.updateInputValue=function(e,t){var i=this.contentTypes[t];var n=$(e);if(t=="styles"&&i&&n){f.updateFields(i.inputSelector,i.getContentSelector,n)}else if(i&&n){var r=$(i.contentId).val();f.updateField(i.inputSelector,r,n)}n.submit()}});AGN.Lib.Controller.new("image-editor",function(){var e=AGN.Lib.Confirm,t=AGN.Lib.Template;var o,a;var s=0,l=0;var u=false;var i=false;function n(e){o=e.x;a=e.y;s=e.w;l=e.h}this.addDomInitializer("img-editor-init",function(){u=false;i=false;$("#editor-result").prop("disabled",true)});this.addAction({click:"editCategory"},function(){e.create(t.text("modal-element-category-select",{categoryId:$("#category-id").val()})).done(function(e){if(e&&e.categoryId){$("#category-id").val(e.categoryId)}})});this.addAction({click:"cropImage"},function(){c();if(i){f();d();i=false}else{$("#editor-canvas").Jcrop({onChange:n,onSelect:n,bgOpacity:1});$("#editor-crop-btn").addClass("btn-primary");i=true}});this.addAction({click:"saveCrop"},function(){c();var i=document.getElementById("editor-canvas");var n=i.getContext("2d");var r=new Image;r.src=$("#editor-img").attr("src");if(s>1&&l>1){r.onload=function(){i.width=s;i.height=l;n.save();n.drawImage(r,o,a,s,l,0,0,s,l);n.restore();var e=$("#editor-img").data("content-type");var t=i.toDataURL(e);$("#editor-img").attr("src",t);$("#editor-canvas").css("width",s);$("#editor-canvas").css("height",l);$("#l-editor-img-width").attr("value",s);$("#l-editor-img-height").attr("value",l);d();f()}}});this.addAction({click:"rotateImage"},function(){f();c();var i=document.getElementById("editor-canvas");var n=i.getContext("2d");var e=$("#editor-img").data("content-type");var t=i.toDataURL(e);var r=new Image;r.src=t;$("#editor-img").attr("src",t);r.onload=function(){var e=i.width;var t=i.height;i.width=t;i.height=e;e=i.width;t=i.height;n.save();n.translate(e,t/e);n.rotate(Math.PI/2);n.drawImage(r,0,0);n.restore();d()}});this.addAction({input:"changeSize"},function(){f();var o=document.getElementById("editor-canvas");var a=o.getContext("2d");var s=new Image;s.src=$("#editor-img").attr("src");s.onload=function(){var e=$("#l-editor-img-width").val();var t=$("#l-editor-img-height").val();var i=s.width;var n=s.height;if(u){if($("#l-editor-img-width").is(":focus")){var r=e/i;t=Math.round(r*n);$("#l-editor-img-height").attr("value",t)}else if($("#l-editor-img-height").is(":focus")){var r=t/n;e=Math.round(r*i);$("#l-editor-img-width").attr("value",e)}}o.width=e;o.height=t;a.save();a.drawImage(s,0,0,e,t);a.restore();d()}});this.addAction({input:"pcChangeSize"},function(){f();var o=document.getElementById("editor-canvas");var a=o.getContext("2d");var s=new Image;s.src=$("#editor-img").attr("src");s.onload=function(){var e=$("#l-editor-img-percent").val();var t=s.width;var i=s.height;var n=Math.round(t*(e/100));var r=Math.round(i*(e/100));$("#l-editor-img-height").attr("value",r);$("#l-editor-img-width").attr("value",n);o.width=n;o.height=r;a.save();a.drawImage(s,0,0,n,r);a.restore();d()}});this.addAction({click:"blockSizes"},function(){if(u){u=false;$("#editor-lock-btn").removeClass("btn-primary")}else{u=true;$("#editor-lock-btn").addClass("btn-primary")}});function c(){var e=document.getElementById("editor-canvas");var t=$("#editor-img").data("content-type");var i=e.toDataURL(t);$("#editor-img").attr("src",i)}function d(){var e=document.getElementById("editor-canvas");var t=$("#editor-img").data("content-type");var i=e.toDataURL(t);var n=$("#editor-result");var r=i.indexOf(",");if(r>=0){i=i.substring(r+1)}if(n.val()!=i){n.val(i);n.prop("disabled",false)}var o=e.width+$("#l-img-editor-tools").width()+10;$("#l-img-editor").css("min-width",o)}function f(){var e=$("#editor-canvas").data("Jcrop");if(typeof e!="undefined"){$("#editor-canvas").appendTo("#canvas-editor-area");$("#editor-canvas").removeAttr("style");e.destroy()}$("#editor-crop-btn").removeClass("btn-primary");i=false;s=0;l=0}});AGN.Lib.Controller.new("import-profile-mappings",function(){const n="do-not-import-column";const r=AGN.Lib.Template;const o=AGN.Lib.Form;const u=AGN.Lib.CoreInitializer;var a;var c;var s;var d;var l=[];var i;var f;var p;this.addDomInitializer("import-profile-mappings",function(){a=this.config;f=$("#upload-file-container");p=$("#content-container");h(a.columnMappings);s=o.get(this.el);s.initFields()});function h(e){c=$("#columnMappings tbody");c.html("");d=r.prepare("column-mapping-table-row");for(var t=0;t<e.length;t++){const i=e[t];g(t,i.id,i.fileColumn,i.databaseColumn,i.mandatory,i.encrypted,i.defaultValue)}P();x();l=L()}function g(e,t,i,n,r,o,a){const s=d({index:e,id:t,fileColumn:i,databaseColumn:n,mandatory:r,encrypted:o,defaultValue:a});c.append(s);const l=$('[data-mapping-row="'+e+'"]').find("[data-mapping-db-column]");u.run("select",l)}this.addAction({click:"upload"},function(){const e=o.get(this.el);const i=$("#uploadFile").prop("files")[0];$.ajax(a.urls.UPLOAD,{type:"POST",dataType:"json",enctype:"multipart/form-data",processData:false,contentType:false,data:e.data()}).done(function(e){if(e.success===true){h(v(e.data));const t=r.dom("uploaded-file-selected",{fileName:i.name});f.hide();t.insertAfter(f);p.removeClass("hidden")}else{AGN.Lib.JsonMessages(e.popups)}})});function v(e){const t=m(false);const i=t.filter(function(e){return!e.fileColumn});const n=[];for(var r=0;r<e.length;r++){const o=e[r];const a=t.findIndex(function(e){return e.fileColumn===o.fileColumn});if(a===-1){n.push(o)}else{n.push(t[a])}}return[].concat(n,i)}this.addAction({click:"delete-file"},function(){const e=$.post(AGN.url("/recipient/import/file/delete.action"));e.done(function(){$("#uploaded-file-container").remove();$("#uploadFile").val("");f.show()})});this.addAction({submission:"save-mappings"},function(){const i=o.get(this.el);_.each(m(true),function(e,t){i.setValueOnce("columnsMappings["+t+"].id",e.id);i.setValueOnce("columnsMappings["+t+"].fileColumn",e.fileColumn);i.setValueOnce("columnsMappings["+t+"].databaseColumn",e.databaseColumn);i.setValueOnce("columnsMappings["+t+"].mandatory",e.mandatory);i.setValueOnce("columnsMappings["+t+"].encrypted",e.encrypted);i.setValueOnce("columnsMappings["+t+"].defaultValue",e.defaultValue)});i.submit()});function m(e){if(!c||!c.length){return[]}const t=_.map(c.find("[data-mapping-row]"),function(e){const t=$(e);return{id:y(t,"id"),fileColumn:y(t,"fileColumn"),databaseColumn:y(t,"db-column"),mandatory:y(t,"mandatory"),encrypted:y(t,"encrypted"),defaultValue:y(t,"defaultValue")}});if(e){const i=C();if(i.databaseColumn&&i.databaseColumn!==n){t.push(i)}}return t}function y(e,t){const i=e.find("[data-mapping-"+t+"]");if(i.is(":checkbox")){return i.is(":checked")}return i.val()}this.addAction({change:"change-new-col-name"},function(){if(i&&i!==n){S(i)}const e=this.el.find(":selected").val();i=e;T(e);N(e)});this.addAction({change:"change-exist-col-name"},function(){const e=M();if(e){S(e);T(this.el.val());l=L()}});this.addAction({click:"delete-mapping"},function(){b(this.el)});this.addAction({click:"bulk-delete"},function(){_.each($(".column-checkbox:checkbox:checked"),function(e){b($(e))})});function b(e){const t=e.closest("tr");const i=y(t,"db-column");t.remove();if(i&&i!==n){S(i)}}this.addAction({click:"add-mapping"},function(){if(!s.valid({})){s.handleErrors();return}s.cleanErrors();const e=C();if(w(e)){AGN.Lib.Messages(t("defaults.error"),t("export.columnMapping.error.duplicate"),"alert");return}this.el.closest("tr").remove();const i=E()+1;g(i,e.id,e.fileColumn,e.databaseColumn,e.mandatory,e.encrypted,e.defaultValue);P();x()});function w(t){if(t.databaseColumn===n){return false}const e=m(false);return e.some(function(e){return e.fileColumn===t.databaseColumn||e.databaseColumn===t.databaseColumn})}function C(){const e=$("#encrypted-new");const t=e?e.is(":checked"):false;return{id:0,fileColumn:"",databaseColumn:$("#database-column-new").val(),mandatory:$("#mandatory-new").is(":checked"),encrypted:t,defaultValue:A()}}function A(){if($("[data-action=change-date-input]").is(":checked")){const e=parseInt($("#daysCount").val()||0);const t=e===0?"":e>0?"+"+e:e;return"CURRENT_TIMESTAMP"+t}return $("[name=default-value-new]").val()}function E(){return $("[data-mapping-row]").last().data("mapping-row")}this.addAction({change:"change-date-input"},function(){$("#dateInput").toggle(!this.el.is(":checked"));$("#daysInput").toggle(this.el.is(":checked"));e($("#daysCount"))});function e(r){r.on("change.offset keyup.offset",function(e){const t=r.val();if(t){const i=parseInt(t);if(!isNaN(i)){const n=(i<0?"":"+")+i;if(n!=t){r.val(n)}}else{r.val(t.replace(/[^\d+-]/g,""))}}else if(e.type==="change"){r.val("+0")}})}function x(){_.each(c.find("[data-mapping-db-column]"),function(e){T($(e).val())})}function T(t){_.each(c.find("[data-mapping-db-column]"),function(e){D($(e),t)});D($("#database-column-new"),t)}function S(t){_.each(c.find("[data-mapping-db-column]"),function(e){k($(e),t)});k($("#database-column-new"),t)}function D(e,t){if(e.val()!==t&&t!==n){e.find('[value="'+t+'"]').remove()}}function k(e,t){if(e.val()!==t){e.append($("<option>",{value:t,text:t}))}}function O(e,t){if(t==="date"){AGN.runAll(e)}else if(t==="datetime"){s.initFields()}}function R(e){const t=a.columns[e].dataType.toLowerCase();switch(t){case"date":case"datetime":return t;default:return"text"}}function N(e){const t=R(e);const i=$("[name=default-value-new]");const n=i.val();const r=i.closest("td");if(r.children().first().data("type")!==t){r.empty();r.append(I(t,n));O(r,t)}}function I(e,t){switch(e){case"date":case"datetime":return r.text("date-def-val-input",{withTime:e==="datetime",val:t});default:return r.text("text-def-val-input")}}function P(){c.append(r.text("new-mapping-row"));u.run("select",$("#database-column-new"))}function M(){const t=L();return l.filter(function(e){return t.indexOf(e)<0})[0]}function L(){const t=[];_.each(c.find("[data-mapping-db-column]"),function(e){t.push($(e).val())});return t}});AGN.Lib.Controller.new("import-profile",function(){var n;var o;var i=false;var r;this.addAction({click:"save"},function(){if(v(d(m()))){const e=AGN.Lib.Form.get($("#importProfileForm"));b(e);e.setValue("isGenderSectionFocused",i);e.submit()}});this.addDomInitializer("import-profile-view",function(){r=this.config.isAllowedToShowMailinglists;$("#importProfileForm").on("click change",function(e){const t=$(e.target);i=(t.is("input")||t.is("select")||t.is("button")||t.parent().is("button"))&&t.parents("#recipient-import-gender-settings").length>0});e(w(this.config.genderMappings));C()});this.addAction({change:"new-recipients-action-select"},function(){C()});this.addAction({click:"add-gender-mapping",enterdown:"gender-enterdown"},function(){this.event.preventDefault();if(g()){h();p("","");m().find("[data-gender-text-value]").focus()}});this.addAction({click:"delete-gender-mapping"},function(){this.el.closest("tr").remove()});const a=function(e){$("#mailinglists").toggleClass("hidden",!e);$("#mailinglists-to-show").toggleClass("hidden",e)};this.addDomInitializer("allMailinglists-checkbox",function(){C()});this.addAction({change:"mode-select-change"},function(){const e=$("#all-mailinglists-wrapper").is(":visible");if(!e&&$("#allMalinglistsCheckbox").is(":checked")){$("#allMalinglistsCheckbox").click()}});this.addAction({change:"allMailinglists-checkbox"},function(){s($(this.el).is(":checked"))});const s=function(e){$('#mailinglists [type="checkbox"]').prop("disabled",e)};function l(e){const t=$("#allMalinglistsCheckbox");if(e){t.attr("checked",false);$("#all-mailinglists-wrapper").hide()}else{$("#all-mailinglists-wrapper").show()}t.attr("disabled",e||!r)}function u(e){a(!e);s($("#allMalinglistsCheckbox").is(":checked")||!r||e)}function e(e){o=$("#recipient-import-gender-settings tbody");n=AGN.Lib.Template.prepare("gender-settings-table-row");_.each(e,function(e){p(e[0],e[1])});p("","")}function c(e){const t=e.find("[data-gender-text-value]");if(t.is("input")){return t.val().trim()}else{return t.text().trim()}}function d(e){const t=c(e);const i=t.length?t.split(","):[];return new Set(_.without(_.map(i,_.trim),""))}function f(e){const t=e.find("[data-gender-int-value]");return t.is("select")?t.val():t.text()[0]}function p(e,i){if(i===0||i){i+=" ("+t("import.gender.short."+i)+")"}else{i=""}o.append(n({intValue:i,textValues:e}));AGN.Lib.CoreInitializer.run("select",o.find("[data-gender-int-value]:last-child"))}function h(){const e=o.find('[data-action="add-gender-mapping"]');e.after("<a href='#' class='btn btn-regular btn-alert' data-action='delete-gender-mapping'>"+"<i class='icon icon-trash-o'></i></a>");e.remove()}function g(){const e=d(m());if(e.size<1){AGN.Lib.Messages(t("defaults.error"),t("import.gender.error.empty"),"alert");return false}return v(e)}function v(e){const i=o.find("[data-gender-settings-row]").toArray();for(var n=0;n<i.length-1;n++){if(_.intersection(Array.from(e),Array.from(d($(i[n])))).length){AGN.Lib.Messages(t("defaults.error"),t("import.gender.error.duplicate"),"alert");return false}}return true}function m(){return o.find("[data-gender-settings-row]:last-child")}function y(){const r={};_.each(o.find("[data-gender-settings-row]"),function(e){const t=$(e);const i=c(t);const n=f(t);if(i.length){r[n]=!r.hasOwnProperty(n)?i:r[n]+", "+i}});return r}function b(i){_.each(y(),function(e,t){i.setValue("genderMapping["+t+"]",e)})}function w(t){if(!t){t=""}const i=[];Object.keys(t).forEach(function(e){i.push([e,t[e]])});i.sort(function(e,t){return e[1]-t[1]});return i}function C(){const e=$("#import_actionnewrecipients");const t=e.length&&e.val()>0;l(t);u(t)}});AGN.Lib.Controller.new("logon-password-change",function(){this.addAction({click:"showPasswordChangeForm"},function(){$("#suggestion-view").addClass("hidden");$("#submission-view").removeClass("hidden")})});AGN.Lib.Controller.new("mailing-upload-attachment",function(){this.addDomInitializer("mailing-upload-attachment",function(){t()});this.addAction({change:"use-pdf"},function(){e($(this.elem).prop("checked"))});this.addAction({change:"change-attachment-file"},function(){i(false)});this.addAction({change:"change-upload-file"},function(){i(true)});function t(){$("#attachment").val("");$("#attachmentName").val("");$("#backgroundAttachment").val("");$("#targetId").select2("val",0);AGN.Lib.Select.get($("#type")).selectFirstValue()}function i(e){var t="";if(e){t=$("#pdfUploadId").select2("val")}else{var i=$("#attachment").prop("files");if(i&&i.length){t=i[0].name}}$("#attachmentName").val(t)}function e(e){t();i(e)}});AGN.Lib.Controller.new("mailing-content-controller",function(){const r=AGN.Lib.Confirm;const o=AGN.Lib.Template;const n=AGN.Lib.Storage;var a;var s;var l;var u;var c;var d;var f;this.addDomInitializer("mailing-content-initializer",function(){f=$("#table_body");s=o.prepare("mailing-content-table-entry-template");l=this.config.isMailingExclusiveLockingAcquired;u=this.config.isEditableMailing;c=this.config.isContentGenerationAllowed;const e=this.config.dynTagsMap;const t=this.config.targetGroupList;const i=this.config.interestGroupList;const n=this.config.dynTagNames;a=new b(e,t,i,n);h();g()});this.addDomInitializer("gridTemplate-textContent-initializer",function(){f=$("#textModulesTable");d=this.config.templateId;u=true;c=this.config.isContentGenerationAllowed;l=true;s=o.prepare("gridTemplate-textContent-tableRow-template");a=new b(this.config.dynTags,this.config.targets,[],[]);h()});this.addAction({click:"createContentEditorModal"},function(){const e=parseInt(this.el.data("dyn-name-id"));if(e>0){$.ajax({url:AGN.url("/mailing/content/name/{id}/view.action".replace("{id}",e.toString())),method:"GET",dataType:"json",success:function(e){const t=new w(e);const i=a.isHtmlContentBlock(t.name);const n=r.createFromTemplate({dynTag:t,targetGroups:_.cloneDeep(a.targetGroups),interestGroups:_.cloneDeep(a.interestGroups),saveUrl:AGN.url("/mailing/content/save.action"),DynTagObject:w,isFullHtmlTags:t.name=="HTML-Version",showHTMLEditor:i,isEditableMailing:u,isContentGenerationAllowed:c},"content-editor-template");n.done(function(e){a.setDynTag(e);m(e);p()})},statusCode:{404:function(){AGN.Lib.Messages(t("defaults.error"),t("defaults.error"),"alert")}}})}});this.addAction({click:"createGridTemplateTextContentEditorModal"},function(){const e=parseInt(this.el.data("dyn-name-id"));if(e>0){$.ajax({url:AGN.url("/layoutbuilder/template/"+d+"/textModules/"+e+"/view.action"),method:"GET",dataType:"json",success:function(e){const t=new w(e);const i=a.isHtmlContentBlock(t.name);const n=r.createFromTemplate({dynTag:t,targetGroups:_.cloneDeep(a.targetGroups),interestGroups:_.cloneDeep(a.interestGroups),saveUrl:AGN.url("/layoutbuilder/template/"+d+"/textModules/update.action"),DynTagObject:w,isFullHtmlTags:t.name=="HTML-Version",showHTMLEditor:i,isEditableMailing:u,isContentGenerationAllowed:c},"content-editor-template");n.done(function(e){a.setDynTag(e);m(e)})},statusCode:{404:function(){AGN.Lib.Messages(t("defaults.error"),t("defaults.error"),"alert")}}})}});const p=function(){const e=AGN.Lib.Form.get($("#preview"));e.setValue("reload",false);e.setResourceSelectorOnce("#preview");e.submit()};const h=function(){a.dynTags.forEach(function(e){f.append(i(e))})};const g=function(){const e=$("#content-source-select");if(!e){return}const t="web-storage#last-content-source";const i=n.get(t);if(i){if(v(i.id,e)){e.val(i.id);e.change()}else{n.delete(t)}}};const v=function(e,t){var i=false;t.find("option").each(function(){if(this.value===e){i=true;return false}});return i};const m=function(e){const t=i(e);f.find('[data-dyn-name-id="'+e.id+'"]').replaceWith(t)};const i=function(e){const t=e.contentBlocks.map(function(e){return y(e)},[]);const i=e.contentBlocks.map(function(e){return e.content.length>35?e.content.substring(0,35)+"...":e.content},[]);return s({id:e.id,name:e.name,targetGroups:t,contents:i,editable:!!l})};const y=function(e){var i=t("mailing.default.target_group_name");if(e.targetId>0){const n=a.getTargetGroupById(e.targetId);const r=n.deleted?t("mailing.default.target_group_deleted"):n.id;i=n.targetName+" ("+r+")"}return i};const b=function e(i,n,r,o){this.dynTags=Object.entries(i).map(function(e){return new w(e[1])},[]);this.interestGroups=_.cloneDeep(r);this.interestGroups.unshift({column:"",shortname:t("mailing.default.interest_group_name")});this.targetGroups=_.cloneDeep(n);this.targetGroups.unshift({id:0,targetName:t("mailing.default.target_group_name")});this.targetGroupsMap=n.reduce(function(e,t){e[t.id]=t;return e},{});this.dynTagNames=o;this.isHtmlContentBlock=function(e){if(typeof o!="undefined"&&o!=null&&o.length!=null&&o.length>0){return o.includes(e)}return false};this.getDynTagById=function(t){const e=this.dynTags.filter(function(e){return e.id===t});return e[0]};this.setDynTag=function(e){const t=this.getDynTagById(e.id);const i=this.dynTags.indexOf(t);if(i>-1){this.dynTags[i]=e.clone()}};this.getTargetGroupById=function(e){return this.targetGroupsMap[e]||{id:0,targetName:t("mailing.default.target_group_name")}}};const w=function(e){this.id=e.id||0;this.name=e.dynName===undefined?e.name:e.dynName;this.mailingId=e.mailingID===undefined?e.mailingId:e.mailingID;this.interestGroup=this.interestGroup||"";this.interestGroup=e.interestValue===undefined?e.interestGroup:e.dynInterestGroup;if(e.contentBlocks){this.contentBlocks=e.contentBlocks.map(function(e){return new C(e)})}else{this.contentBlocks=Object.entries(e.dynContent).map(function(e){return new C(e[1])})}this.contentBlocks.__proto__.swap=function(e,t){const i=this[e];this[e]=this[t];this[t]=i;return this};const t={id:0,index:0,targetId:0,content:""};this.getContentBlockByTargetId=function(t){const e=this.contentBlocks.filter(function(e){return e.targetId===t});return e[0]};this.getContentBlockById=function(t){const e=this.contentBlocks.filter(function(e){return e.uniqueId===t});return e[0]};this.createNewContentBlock=function(){const e=new C(t);e.index=this.contentBlocks.length;this.contentBlocks.push(e);n(this.contentBlocks);return e};this.moveUpContentBlock=function(e){const t=this.getContentBlockById(e);if(t.index>1){this.contentBlocks.swap(t.index-1,t.index-2);n(this.contentBlocks)}};this.moveDownContentBlock=function(e){const t=this.getContentBlockById(e);if(t.index<this.contentBlocks.length){this.contentBlocks.swap(t.index-1,t.index);n(this.contentBlocks)}};this.setFirstContentBlock=function(e){const t=this.getContentBlockById(e);if(t.index>1){const i=this.contentBlocks.splice(t.index-1,1);this.contentBlocks=i.concat(this.contentBlocks);n(this.contentBlocks)}};this.setLastContentBlock=function(e){const t=this.getContentBlockById(e);if(t.index<this.contentBlocks.length){const i=this.contentBlocks.splice(t.index-1,1);this.contentBlocks=this.contentBlocks.concat(i);n(this.contentBlocks)}};this.changeTargetGroup=function(e,t){const i=this.getContentBlockById(e);i.targetId=t;return i};this.changeInterestGroup=function(e){this.interestGroup=e};this.changeContent=function(e,t){const i=this.getContentBlockById(e);i.content=t||"";return i};this.changeOrder=function(e){const t=function(t){return function(e){return t.getContentBlockById(parseInt(e))}};this.contentBlocks=e.map(t(this));n(this.contentBlocks)};this.remove=function(e){const t=this.getContentBlockById(e);const i=this.contentBlocks.indexOf(t);if(i>-1){this.contentBlocks.splice(i,1);n(this.contentBlocks)}};this.removeAll=function(){this.contentBlocks=[]};this.clone=function(){return new w(this)};const n=function(e){e.forEach(function(e,t){e.index=t+1})}};const C=function(e){if(typeof C.uniqueIdCounter==="undefined"){C.uniqueIdCounter=0}this.uniqueId=++C.uniqueIdCounter;this.id=e.id;this.index=e.dynOrder===undefined?e.index:e.dynOrder;this.content=e.dynContent===undefined?e.content:e.dynContent;this.targetId=e.targetID===undefined?e.targetId:e.targetID}});AGN.Lib.Controller.new("mailing-content-editor-controller",function(){const a=AGN.Lib.Modal;const o=AGN.Lib.Confirm;const s=AGN.Lib.Template;const F=AGN.Lib.AutoSave;var l;var u;var c;var d;var f;var p;var h;var g;var v;var m;var y;var b;var _;var e=".mailingContentNamespace";var w=".l-mailing-content-entry";var C="content_entry_";this.addDomInitializer("mailing-content-editor-initializer",function(e){var t=a.get(e);l=t.dynTag;u=t.targetGroups;c=t.saveUrl;d=t.DynTagObject;f=t.showHTMLEditor;p=t.isEditableMailing;h=t.isContentGenerationAllowed;g=$("#content_area");v=$("#ordered_area");m=$("#target_groups");y=$("#interest_groups");b=$("#editable_area");_=s.prepare("mailing-content-entry-template");z();B();V();Y(l);X(l.interestGroup);if(l.contentBlocks.length>0){var i=l.contentBlocks[0];N(i,false)}else{I()}q();K();var n=function(){var t=Array();T();var e=l.contentBlocks;Array.prototype.forEach.call(e,function(e){t.push({targetGroupId:e.targetId,content:e.content,uniqueId:e.uniqueId})});return t};var r=function(e){var o;l.removeAll();Z();Array.prototype.forEach.call(e,function(e){var t=v.find(".l-stub");var i=l.createNewContentBlock();i.uniqueId=e.uniqueId;i.content=e.content;i.targetId=e.targetGroupId;var n=D(i.targetId);var r=_({name:n.targetName,id:C+i.uniqueId});t.before(r);P();o=i});if(o){N(o);E(A())}};var o=function(e){return e.length!==l.contentBlocks.length||!l.contentBlocks.every(function(t){return e.some(function(e){return e.targetGroupId===t.targetId&&e.content===t.content})})};F.initialize("mailing-components/"+l.mailingId+"/"+l.id,n,o,r,0);G()});function G(){if(A()==="html"){M()}else{L()}}this.addAction({click:"selectContentEntry"},function(){var e=$(this.el);var t=O(e);var i=l.getContentBlockById(t);N(i)});this.addAction({click:"deleteContentEntry"},function(){this.event.stopPropagation();var e=$(this.el).parent();var t=O(e);var i=e.next(w);i=i.length>0?i:e.prev(w);l.remove(t);e.remove();if(l.contentBlocks.length>0){var n=O(i);var r=l.getContentBlockById(n);N(r)}else{N();ee()}});this.addAction({click:"createEnlargedContentEditorModal"},function(){T();var i=S();if(i){var e=l.getContentBlockById(i);var t=o.createFromTemplate({content:e.content,selectedContentBlock:i,editorType:A(),isFullHtmlTags:l.name=="HTML-Version",showHTMLEditor:f,isEditableMailing:p,isContentGenerationAllowed:h},"enlarged-content-editor-template");const n=$("#content_modal");const r=$("#enlarged_content_modal");n.trigger("modal:enlarged",[r]);t.done(function(e){n.trigger("modal:enlarged:apply",[r]);var t=l.changeContent(i,e.content);x(t.content);E(e.editorType)})}});this.addAction({click:"addDynContent"},function(){I()});this.addAction({click:"saveDynTag"},function(){const e=$.Event("saveDynTag");this.el.closest(".modal").trigger(e,[l]);if(!e.isDefaultPrevented()){i()}});function i(){T();if(W()){const i=$('[data-action="saveDynTag"]');$.ajax({type:"POST",url:c,dataType:"json",contentType:"application/json",data:JSON.stringify(l),success:function(e){var t=o.get(i);AGN.Lib.JsonMessages(e.popups,true);if(e.success){t.positive(new d(e.data));R()}}})}}var W=function(){var e=l.contentBlocks.map(function(e){return e.targetId}).filter(function(e,t,i){return i.indexOf(e,t+1)>-1},[]);if(e.length){AGN.Lib.Messages(t("Error"),t("mailing.validation.target_group_duplicated"),"alert");return false}if(f){var i=l.contentBlocks.find(function(e){return(new DOMParser).parseFromString(e,"text/html").querySelector("script")});if(i){AGN.Lib.Messages(t("Error"),t("fields.error.illegal_script_element"),"alert");return false}}var n=l.contentBlocks.filter(function(e){return e.targetId===0},[]);if(n.length!==l.contentBlocks.length){if(n.length&&n[0].index<l.contentBlocks.length){AGN.Lib.Messages(t("Error"),t("mailing.validation.all_recipients_not_last"),"alert");return false}}return true};var H=function(){var e=r();var t=e.prev(w);if(t.length!==0){e.insertBefore(t);l.moveUpContentBlock(O(e))}};var j=function(){var e=r();var t=e.next(w);if(t.length!==0){e.insertAfter(t);l.moveDownContentBlock(O(e))}};var B=function(){const e=$("#content_modal");e.on("saveDynTagContent",function(e,t){U(t);i()})};var V=function(){var t=27;var i=38;var n=40;$(document).off("keydown"+e);$(document).on("keydown"+e,function(e){e.stopPropagation();switch(e.which){case t:R();break;case i:H();break;case n:j();break;default:return}})};var z=function(){g.sortable({opacity:.4,delay:100,scroll:true,scrollSensitivity:40,scrollSpeed:15,cursor:"move",items:w,helper:"clone",containment:v,appendTo:v,start:function(e,t){t.item.css("cursor","move")},stop:function(e,t){t.item.removeAttr("style");var i=$(e.target);var n=i.sortable("toArray");var r=n.map(function(e){return e.replace(C,"")});l.changeOrder(r)}})};var A=function(){var e=$("#tab-content-wysiwyg");if(e.is(":visible")){return"wysiwyg"}var t=$("#contentEditor");if(t.is(":visible")){return"html"}const i=$("#tab-content-ai-text-generation");if(i.is(":visible")){return"ai-text-generation"}return""};var E=function(e){if(!e||e===""){return}var t=$('[data-toggle-tab$="'+e+'"]');if(t){t.trigger("click")}};var x=function(t,e){const i=$("#tab-content-wysiwyg");const n=$("#contentEditor");const r=$("#tab-content-ai-text-generation");if(i.is(":visible")){var o=CKEDITOR.instances["content"];if(o.status==="ready"){o.setData(t)}else{o.on("instanceReady",function(e){e.editor.setData(t)})}}if(n.is(":visible")){var a;if(e===false){a=1}else{a=null}var s=ace.edit("contentEditor");if($("body").hasClass("dark-theme")){s.setTheme("ace/theme/idle_fingers")}s.setValue(t,a)}if(r.is(":visible")){r.closest("form").find(".js-wysiwyg").val(t)}};var T=function(){var e=S();if(e>0){var t=$("#tab-content-wysiwyg");var i=$("#contentEditor");var n;if(t.is(":visible")){var r=CKEDITOR.instances["content"];n=r.getData()}if(i.is(":visible")){var o=ace.edit("contentEditor");if($("body").hasClass("dark-theme")){o.setTheme("ace/theme/idle_fingers")}n=o.getValue()}if(n!==undefined){l.changeContent(e,n)}}};var U=function(e){const t=S();if(t>0){l.changeContent(t,e)}};var Y=function(e){e.contentBlocks.forEach(function(e){var t=v.find(".l-stub");var i=D(e.targetId);var n=_({name:i.targetName,id:C+e.uniqueId});t.before(n)})};var n=function(e){m.val(e).trigger("change")};var q=function(){m.off("change"+e);m.on("change"+e,function(e){var t=parseInt($(e.target).val());var i=S();if(i>0){var n=l.changeTargetGroup(i,t);Q(n)}})};var X=function(e){y.val(e).trigger("change")};var K=function(){y.off("change"+e);y.on("change"+e,function(e){var t=$(e.target).val();l.changeInterestGroup(t)})};var Q=function(e){var t=k(e.uniqueId);if(t.length>0){var i=D(e.targetId);t.find(".l-name").children().text(i.targetName)}};var r=function(){return v.find(w+".selected")};var Z=function(){v.find(w).remove()};var S=function(){var e=r();if(e.length>0){return O(e)}};var J=function(e){v.children().removeClass("selected");var t=k(e,v);t.addClass("selected")};var D=function(t){var e=u.filter(function(e){return e.id===t});return e[0]};var k=function(e,t){t=t?t:$(document);return t.find("#"+C+e)};var O=function(e){return parseInt(e.attr("id").replace(C,""))};var R=function(){$(".modal").modal("toggle")};var N=function(e,t){T();if(e!==undefined){J(e.uniqueId);x(e.content,t);n(e.targetId)}else{x("");n(0)}};var I=function(){var e=v.find(".l-stub");var t=l.createNewContentBlock();var i=D(t.targetId);var n=_({name:i.targetName,id:C+t.uniqueId});e.before(n);P();N(t)};var ee=function(){if(b.is(":visible")){b.hide()}};var P=function(){if(b.is(":hidden")){b.show()}};const te=function(e){const i=e.val().length;$('[data-char-counter-for="'+e.attr("id")+'"]').find("span:first").text(t("fields.content.charactersEntered",i))};this.addAction({"editor:create":"count-textarea-chars","editor:change":"count-textarea-chars",input:"count-textarea-chars"},function(){te(this.el)});this.addAction({click:"hide-char-counter"},function(){L()});this.addAction({click:"show-char-counter"},function(){M()});function M(){$("[data-char-counter-for]").first().show()}function L(){$("[data-char-counter-for]").first().hide()}$(document).on("ckeditor-save",function(){i()})});AGN.Lib.Controller.new("mailing-overview",function(){const e=AGN.Lib.Form;var i="dd.MM.yyyy";this.addDomInitializer("mailing-overview",function(){i=this.config.adminDateFormat});this.addAction({click:"restore"},function(){const t=e.get(this.el);$.post(this.el.attr("href")).done(function(e){t.updateHtml(e)})});this.addAction({click:"bulk-restore"},function(){const t=e.get(this.el);$.ajax(AGN.url("/mailing/bulkRestore.action"),{method:"POST",data:t.data()}).done(function(e){t.updateHtml(e)})});this.addAction({click:"send-date-filter-period"},function(){o(this.el);$("#filterSendDateBegin").val(n());$("#filterSendDateEnd").val(r());t($("input[name='sendDatePeriod']:checked").length>0)});this.addAction({click:"reset-send-date-filter"},function(){$("#filterSendDateBegin").val("");$("#filterSendDateEnd").val("");$('input[name="sendDatePeriod"]:checked').removeAttr("checked");t(false)});function t(e){const t=$("#filterSendDateBegin");const i=$("#filterSendDateEnd");t.get(0).toggleAttribute("readonly",e);i.get(0).toggleAttribute("readonly",e);t.toggleClass("js-datepicker",!e);i.toggleClass("js-datepicker",!e)}function n(){const e=$("input[name='sendDatePeriod']:checked").val();if(!e){return""}const t=new Date;t.setDate(t.getDate()-e);return AGN.Lib.DateFormat.format(t,i)}function r(){return $("input[name='sendDatePeriod']:checked").length?AGN.Lib.DateFormat.format(new Date,i):""}function o(e){if(e.is(":checked")){const t="input:checkbox[name='"+e.attr("name")+"']";$(t).prop("checked",false);e.prop("checked",true)}else{e.prop("checked",false)}}});AGN.Lib.Controller.new("mailing-parameter-list-search",function(){this.addDomInitializer("mailing-parameter-list-search",function(){var e=this.config;var t=e.mailingQuery;var i=e.paramQuery;var n=$("#param-search-field");var r=$("#mailing-search-field");new o(n,"paramQuery",i,false);new o(r,"mailingQuery",t,true)});function o(e,i,n,r){var o=n;var a={results:[]};var s=e;s.select2({openOnEnter:true,minimumInputLength:1,initSelection:function(e,t){},id:function(e){if(r){return e.mailingID}return o},formatResult:function(e){return'<div style="box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);">'+'<div class="row">'+'<div class="col-sm-6">'+t("fields.mailing.parameter")+"</div>"+'<div class="col-sm-6">'+e.name+"</div>"+"</div>"+'<div class="row">'+'<div class="col-sm-6">'+t("fields.mailing.description")+"</div>"+'<div class="col-sm-6">'+e.description+"</div>"+"</div>"+'<div class="row">'+'<div class="col-sm-6">'+t("fields.mailing.for_mailing")+"</div>"+'<div class="col-sm-6">'+e.mailingID+"</div>"+"</div>"+'<div class="row">'+'<div class="col-sm-6">'+t("fields.mailing.change_date")+"</div>"+'<div class="col-sm-6  ">'+new Date(e.changeDate).toLocaleDateString()+"</div>"+"</div>"+"</div>"},formatSelection:function(e){if(r){return e.mailingID}AGN.Lib.Page.reload(AGN.url("/mailing/parameters/"+e.mailingInfoID+"/view.action"),true)},ajax:{url:AGN.url("/mailing/parameters/search.action"),data:function(e){var t={};o=e;u(o,s);t[i]=e;return t},results:function(e){var t=0;e.forEach(function(e){e.id=t++});a={results:e};return a},cache:true}});s.on("select2-open",function(){l(o,s)});function l(e,t){var i=e||"";t.select2("search",i)}function u(e,t){var i=e||"";var n=t.select2("container").find(".select2-chosen");t.select2("val",i);n.text(i)}u(n,s)}});AGN.Lib.Controller.new("mailing-parameters",function(){var n=0;this.addDomInitializer("mailing-parameters",function(){var e=this.config;n=e.maxIndex});this.addAction({click:"add-mailing-parameter"},function(){var e=$("#mailingParamsTable tr:last");var t=AGN.Lib.Template.text("mailing-param-row-new",{key:++n});e.after(t);var i=e.find("#newMailingParameterBtn");i.after('<a href="#" class="btn btn-regular btn-alert" data-action="remove-mailing-parameter" id="removeMailingParameterBtn"> <i class="icon icon-trash-o"></i> </a>');i.remove()});this.addAction({click:"remove-mailing-parameter"},function(){var e=this.el.closest("tr");e.remove()})});AGN.Lib.Controller.new("mailing-params",function(){var r=_.template(AGN.Opt.Templates["mailing-param-row"]);var o;var a=false;var t;this.addDomInitializer("mailing-params",function(){o=$("#mailingParamsTable tbody");a=this.config.isChangeable;t=this.config.params;i(t);const e=$("#mailingSettingsForm");e.dirty("setAsClean");e.dirty("refreshEvents")});function i(e){_.each(e,function(e,t){c(t,e.name,e.value,e.description)});if(a){f("","","")}}function n(){if(p("","")){h();f("","","")}}function e(e){if(!e.is("[data-param-description]")){return e.closest("td").next().find("input:text")}var t=e.closest("tr").find("[data-param-name]");if(!t.val()){return t}if(!e.is('[data-action="param-enterdown"]:last')){return e.closest("tr").next().find("input:text:first")}n();return o.find("[data-param-name]:last")}this.addAction({enterdown:"param-enterdown"},function(){this.event.preventDefault();e(this.el).focus()});this.addAction({click:"add-param-row"},function(){this.event.preventDefault();n();o.find("[data-param-name]:last").focus()});function s(){const e=t.map(function(e){const t=_.omit(e,"mailingID","mailingInfoID","changeDate");Object.keys(t).forEach(function(e){if(t[e]===null){t[e]=""}});return t});return JSON.stringify(e)!==JSON.stringify(AGN.Opt.collectMailinParams())}this.addAction({click:"delete-param-row"},function(){this.el.closest("tr").remove();$("#mailingSettingsForm").dirty("setAsDirty");u()});this.addAction({change:"param-enterdown"},function(){u()});function l(){return $("#mailingSettingsForm").dirty("showDirtyFields").filter(function(e,t){return!$(t).closest("[data-param-row]").length}).length===0}function u(){const e=$("#mailingSettingsForm");if(l()&&!s()){e.dirty("setAsClean")}}function c(e,t,i,n){if(p(t,i)){o.append(r({index:e,name:t,value:i,description:n,isChangeable:a}))}}function d(){return o.find("[data-param-row]:last-child")}function f(e,t,i){var n=d().data("param-row")||0;c(++n,e,t,i)}function p(i,n){var r=true;_.each(o.find("[data-param-row]"),function(e){var t=$(e);if(r){if(g(t,"name")==i&&g(t,"value")==n){r=false}}});return r}function h(){var e=o.find("#newParamBtn");e.after("<a href='#' class='btn btn-regular btn-alert' data-action='delete-param-row'>"+"<i class='icon icon-trash-o'></i></a>");e.remove()}function g(e,t){return e.find("[data-param-"+t+"]").val()}});AGN.Lib.Controller.new("mailing-predelivery",function(){var n={aol:"aolonelinespam",yahoo:"yahoospam",gmailnew:"gmailnewspam",ol2003:"ol2003spam"};this.addAction({change:"adjustSpamProvider"},function(){var e=$(this.el);var t=n[e.attr("name")];if(!t){return}var i=$('[name="'+t+'"]');if(e.prop("checked")){i.prop("disabled",false)}else{i.prop("disabled",true);i.prop("checked",false)}});this.addInitializer("readjustSpamProviders",function(){_.each(n,function(e,t){var i=$("[name="+t+"]");if(i.length===0){return}var n=$('[name="'+e+'"]');if(i.prop("checked")){n.prop("disabled",false)}else{n.prop("disabled",true);n.prop("checked",false)}})});function e(e,t){var i=e.closest(".list-group").find('input[type="checkbox"]:enabled');i.prop("checked",t);i.trigger("change")}this.addAction({click:"toggle-checkboxes-on"},function(){e($(this.el),true)});this.addAction({click:"toggle-checkboxes-off"},function(){e($(this.el),false)})});AGN.Lib.Controller.new("mailing-preview",function(){var n=AGN.Lib.Form,e=AGN.Lib.Messages,o=AGN.Lib.Helpers,r=AGN.Lib.Select,a=AGN.Lib.Storage;var s,l;var u;var c=false;this.addDomInitializer("mailing-preview",function(e){var t=this.config;s=t.RECIPIENT_MODE;l=t.TARGET_MODE;u=t.MAILING_ID;f();var i=n.get($("#container-preview"));if(i.getValue("reload")=="false"){i.setValue("reload",true);i.submit().done(function(){$("[data-stored-field]").on("change",function(){var e=$(this);a.saveChosenFields(e);c=c||h(e.prop("name"))});i.initFields();i.initValidator();AGN.Lib.CoreInitializer.run("view");g()})}});this.addAction({click:"refresh-preview"},function(){c=false;d()});this.addAction({change:"change-stored-header-data"},function(){if(c){c=false;d()}});this.addAction({change:"change-header-data"},function(){d()});this.addAction({click:"toggle-tab-recipientMode"},function(){i(s)});this.addAction({click:"toggle-tab-targetGroupMode"},function(){i(l)});function i(e){var t=$('[name="modeTypeId"]');if(t.exists()){t.val(e);t.trigger("change")}}function d(e){var t=n.get($("#preview"));if(e&&typeof e=="function"){e(t)}t.setValue("reload",false);t.setResourceSelectorOnce("#preview");t.submit()}function f(){var i=false;$("[data-stored-field]").each(function(){var e=$(this),t=e.prop("name");if(!h(t)){if(a.restoreChosenFields(e)){i=true}}});p();a.restoreChosenFields($("[name='modeTypeId']"));a.restoreChosenFields($("[name='customerATID']"));a.restoreChosenFields($("[name='customerEmail']"));a.restoreChosenFields($("[name='targetGroupId']"))}function p(){var e=a.get("toggle_tab#preview-targetModeContent");if(e&&!e.hidden){$("[name='modeTypeId']").val(l);a.saveChosenFields($("[name='modeTypeId']"))}var t=a.get("toggle_tab#preview-recipientModeContent");if(t&&!t.hidden){$("[name='modeTypeId']").val(s);a.saveChosenFields($("[name='modeTypeId']"))}}function h(e){if(!e){return false}return e=="customerATID"||e=="customerEmail"||e=="modeTypeId"||e=="targetGroupId"}function g(){v();y()}this.addAction({click:"change-preview-customer-options"},function(){y()});function v(){const e=m();if(!e.exists()){return}const t=e.val().length<=0;$("#personalized-test-run-container").toggleClass("hidden",t)}function m(){return $("#personalized-test-recipients")}function y(){const e=b();const t=r.get(m()).getSelectedValue().indexOf(e)===-1;$('[data-action="add-to-personalized-test-run"]').toggle(!!t)}function b(){if(w()){return $("#customerEmail").val()}return $('[name="customerATID"]').find(":selected").data("email")}function w(){return $('[name="useCustomerEmail"]:checked').val()!=="false"}function C(){return new Promise(function(i,n){var r=b();if(!o.isValidEmail(r)){e(t("defaults.error"),t("defaults.invalidEmail"),"alert");return}$.get(AGN.url("/mailing/preview/"+u+"/isRecipient.action"),{email:r}).done(function(e){if(e.success){i(r)}else{AGN.Lib.JsonMessages(e.popups,true);n()}})})}this.addAction({input:"change-personalized-test-recipients",change:"change-personalized-test-recipients"},function(){g()});this.addAction({click:"add-to-personalized-test-run"},function(){C().then(function(e){const t=m();const i=r.get(t);if(!i.hasOption(e)){t.append($("<option>",{value:e,text:e}))}t.val(_.union(t.val(),[e]));AGN.Lib.CoreInitializer.run("select",t);g()})});this.addAction({click:"personalized-test-run"},function(){const t=m();const e=t.val();$.post(AGN.url("/mailing/send/"+u+"/personalized-test.action"),{mailingTestRecipients:e}).done(function(e){if(e&&e.success===true){t.val([]);AGN.Lib.CoreInitializer.run("select",t);v()}AGN.Lib.JsonMessages(e.popups,true)})})});AGN.Lib.Controller.new("mailing-priorities",function(){var t=AGN.Lib.Template,o=AGN.Lib.Helpers,i=AGN.Lib.DateFormat;var a=2;var s=0;var r,l,u,c,d;var f;var p;var h;var g;function n(){var i=1;var n=10;u.children(".l-mailing-entry").each(function(){var e=$(this);var t=0;if(e.data("type")==a){t=n;i=n;n+=10}else{t=i;if(i>n){n=Math.round(i/10)*10}}i++;e.find(".l-badge .badge").text(t)})}function v(e){var t=[];u.children(".l-mailing-entry").each(function(){var e=$(this).data("id");if(e>0){t.push(e)}});return e?t.join(e):t}function m(){var e=0;u.children(".l-mailing-entry").each(function(){if($(this).data("id")>0){e++}});return e}function y(e){var t=v(";");var i=l.val();if(p==null&&h==null||e){p=t;h=i;if(i>0){r.prop("disabled",true)}else{var n=m();l.val(n);r.prop("disabled",!n)}}else{r.prop("disabled",t==p&&i==h)}}function b(){$("#datebased-container, #normal-container, #ordered-area").find(".l-mailing-entry").remove()}function w(e,t){return i.toArray(i.parse(e),t)}function C(e){return o.pad(e[0],4)+"-"+o.pad(parseInt(e[1])+1,2)+"-"+o.pad(e[2],2)}function A(e,t,i,n){var r=_.clone(e);if(!!t){r[0]=e[0]+t}if(!!i){r[1]=e[1]+i}if(!!n){r[2]=e[2]+n}return r}function E(){return _.reduce(_.keys(f),function(e,t){return e<t?e:t})}var x=function(e){var i=[];var n=_.clone(e);_.keys(f).forEach(function(e){f[e].forEach(function(e){if(e.mailingType==a&&!n.includes(e.id)){var t=_.clone(e);n.push(t.id);i.push(e)}})});return i};function T(e){var t=f[e]||[];t=t.filter(function(e){return e.mailingType!=a||e.mailingType==a&&e.priority>0});var i=t.map(function(e){return e.id});return _.union(t,x(i),"id").sort(function(e,t){return e.priority>t.priority?1:-1})}function S(e){var t=T(e);b();D(t);y(true)}function D(e){if(e&&e.length){e.forEach(function(e){k(e);var t=g(e);var i=e.priority;var n=e.mailingType;if(i){u.find(".l-stub").before(t)}else{if(n==a){c.find(".l-stub").before(t)}if(n==s){d.find(".l-stub").before(t)}}})}}function k(e){var t="normal-mailing-icon";if(e.mailingType==a){t="datebase-mailing-icon"}e.iconClass=t}var O=function(e,t){var i=e===c.attr("id");var n=e===d.attr("id");var r=e===u.attr("id");return r||i&&t==a||n&&t==s};var R=function(e,t){if(t){e.parent().addClass("highlight")}else{e.parent().removeClass("highlight")}};var N=function(e){for(var t in e){var i=f[e[t]].find(function(e){return e.mailingType==a});if(!!i){return e[t]}}return""};var I=function(e){var i=[true];var t=w(N(e));var n=!t?e:e.filter(function(e){return e<t});n.forEach(function(e){var t=w(e);if(t){i.push(t)}});if(!!t){i.push({from:t,to:A(t,50)})}return i};var P=function(e){var t=$("#date-picker");var i=_.keys(e).sort();if(i.length){var n=I(i,e);t.pickadate(_.merge({editable:true,disable:n,klass:{input:"picker__input js-datepicker",holder:"datepicker__holder picker__holder datepicker__holder-right"}},o.objFromString(t.data("datepicker-options"))));var r=t.pickadate("picker");if(!r.get("select")){r.set("select",w(E()))}}else{t.pickadate({editable:false})}t.trigger("change")};function M(e){r=$("#save-button");l=$("#priorityCount");u=$("#ordered-area");c=$("#datebased-container");d=$("#normal-container");f=e.mailingsMap;g=t.prepare("draggable-mailing-entry")}this.addDomInitializer("mailing-priorities",function(){var e=this;M(e.config);var t=$(".l-content-area");$(".priority-container").sortable({opacity:.4,connectWith:".priority-container",items:".l-mailing-entry",helper:"clone",containment:t,appendTo:t,update:function(){if(this.id===u.attr("id")){n();y()}},out:function(){R($(this),false)},over:function(e,t){R($(e.target),false);R($(this),true)},start:function(){R($(this),true)},stop:function(){R($(this),false)},receive:function(e,t){var i=t.item.data("type");var n=e.target.id;if(!O(n,i)){t.sender.sortable("cancel")}}});P(f)});this.addAction({click:"back"},function(){window.history.back()});this.addAction({click:"save"},function(){var e=AGN.Lib.Form.get(this.el);e.setValueOnce("prioritizedIds",v());e.submit()});this.addAction({change:"priorityCount"},function(){y()});this.addAction({change:"change-date"},function(){var e=this.el.pickadate("picker").get("select");if(e){S(C([e.year,e.month,e.date]))}else{S()}})});AGN.Lib.Controller.new("reference-content-settings",function(){var e=AGN.Lib.Template;var i=false;var n=false;var r;var o=[];var a=[];var s;function l(e){$("#tile-mailingReferenceContent").toggleClass("hidden",!e)}function u(){var e=$("#referenceTableSelect");var t=e.children("option:selected");$("#keyColumnText").val(t.exists()?t.data("key-column"):"")}function c(e,t){return $(r({name:"Item"+e,value:t,disable:n}))}function d(e){var t=c(o.length+1,e);$("#reference-content-items").append(t);o.push(t)}this.addDomInitializer("reference-content-settings",function(){s=$("#mailingSettingsForm");u();r=e.prepare("mailing-reference-content-item");i=this.config.isAvailable;n=this.config.disable;o=[];if(i){if($.isArray(this.config.items)){this.config.items.forEach(function(e){d(e)});a=this.config.items.slice()}l(this.config.isEnabled)}else{l(false)}s.dirty("setAsClean");s.dirty("refreshEvents")});this.addAction({change:"enable-reference-content"},function(){if(i){l(this.el.prop("checked"))}else{AGN.Lib.Messages(t("defaults.warning"),t("mailing.default.item_referencetable_warning"),"warning");$(this.el).prop("checked",false).trigger("change.dirty")}});this.addAction({change:"select-reference-table"},function(){u()});this.addAction({click:"add-reference-content-item"},function(){d("");s.dirty("setAsDirty")});this.addAction({click:"delete-reference-content-item"},function(){var t=this.el.closest(".form-group")[0];var e=o.findIndex(function(e){return e[0]==t});while(e+1<o.length){var i=o[e].find("input");var n=o[e+1].find("input");i.val(n.val());e++}o[e].remove();o.pop();var r=a.length===o.length&&a.every(function(e){return o.includes(e)});if(!r){s.dirty("setAsDirty")}})});AGN.Lib.Controller.new("mailing-send",function(){const r=AGN.Lib.Form,e=AGN.Lib.Modal,i=AGN.Lib.Confirm,n=AGN.Lib.Page,o=AGN.Lib.Template;const a="RECIPIENT";const s="TARGET";const l="SEND_TO_SELF";const u={disableSendButtons:function(){$("#test-send-controls-group #adminSendButton").addClass("disabled");$("#test-send-controls-group #testSendButton").addClass("disabled")},enableSendButtons:function(){$("#test-send-controls-group #adminSendButton").removeClass("disabled");$("#test-send-controls-group #testSendButton").removeClass("disabled")},hideGreenMarks:function(){$(".transmission-mark").remove();$("#recipient-add-btn, .recipient-remove-btn").removeClass("hidden")},updateWorkStatus:function(e,t){const i=$(o.text("mailing-workstatus-icon",{workstatus:e,tooltip:t}));$("#workstatus-icon").replaceWith(i)}};this.addAction({click:"configure-delivery-mailing-size-warning"},function(){const e=this.el;i.createFromTemplate({},"warning-mailing-size-modal").done(function(){e.prop("disabled",true);n.reload(e.data("url"))})});this.addAction({click:"configure-delivery-mailing-size-error"},function(){e.createFromTemplate({},"error-mailing-size-modal")});this.addAction({click:"resume-sending"},function(){const t=this.el;const e=t.data("link");const i=$.post(e);i.done(function(e){n.render(e);t.closest(".form-group").remove()})});this.addAction({click:"configure-delivery"},function(){this.el.prop("disabled",true);n.reload(this.el.data("url"),true);this.el.prop("disabled",false)});this.addAction({click:"start-delivery"},function(){if($("#test-run-options").val()==a){var i=true;$('input[name="mailingTestRecipients"]').each(function(){const e=$(this).val();if(e&&e.trim()){i=false}});if(i){AGN.Lib.Messages(t("defaults.error"),t("error.enterEmailAddresses"),"alert");return}}u.disableSendButtons();const e=r.get(this.el);e.setActionOnce(this.el.data("url"));e.submit()});this.addAction({click:"recipients-row-remove"},function(){var e,t,i=this.el.closest("tr"),n=$('[name="statusmailRecipients"]');i.remove();t=$('[name^="statusmailRecipient_"]');e=_.map(t,function(e){return $(e).val()});n.val(e.join(" "));r.get(this.el).submit()});this.addAction({click:"recipients-row-add",keydown:"recipients-row-field"},function(){if(this.event.type=="keydown"&&this.event.keyCode!=13){return}var e,t=$("#newStatusMail"),i=$('[name^="statusmailRecipient_"]'),n=$('[name="statusmailRecipients"]');e=_.map(i,function(e){return $(e).val()});e.push(t.val());n.val(e.join(" "));r.get(this.el).submit().done(function(){$("#newStatusMail").trigger("focus")})});this.addInitializer("statusmailRecipients",function(e){var t,i=$('[name="statusmailRecipients"]'),n=$("#statusEmailContainer");$(".js-recipients-row").remove();if(i.val()==""){return}t=i.val()||"";t=t.split(" ");_.each(t,function(e){if(e==""){return}n.prepend(o.text("recipients-row",{email:e}))})});this.addDomInitializer("delivery-status-view",function(){if(!this.config.isTransmissionRunning){u.hideGreenMarks()}const e=this.config.workStatus;const t=this.config.workStatusTooltip;if(e&&t){u.updateWorkStatus(e,t)}});this.addAction({click:"add-test-recipient",enterdown:"new-test-recipient"},function(){this.event.preventDefault();const e=this.el.closest("tr");const t=this.el.is("input")?this.el:e.find("input");const i=o.dom("test-recipient-row",{value:t.val()||""});e.before(i);t.val("");AGN.runAll(i);t.focus();p(false)});this.addAction({input:"new-test-recipient"},function(){p(false)});this.addAction({input:"edit-test-recipient",enterdown:"edit-test-recipient"},function(){this.event.preventDefault();p(false)});this.addAction({input:"edit-test-run-target-name"},function(){p(false)});this.addAction({enterdown:"edit-test-run-target-name"},function(){this.event.preventDefault()});this.addAction({click:"remove-test-recipient"},function(){const e=this.el.closest("tr");e.remove();p(false)});var c;this.addDomInitializer("test-run-recipients",function(){c=JSON.parse(this.config?this.config.approvalOptions:"[]");d();$("#get-approval-switch").on("change",function(){d()});f();$("#test-run-options").on("change",function(){f()})});function d(){const e=$("#get-approval-switch").prop("checked");const t=$("#test-run-options");t.find("option:not([value='"+c.join("']):not([value='")+"']").attr("disabled",e);if(e&&c.indexOf(t.val())===-1){t.val(t.find("option:not(:disabled):first").val()).trigger("change")}}function f(){const e=$("#test-run-options");if(!e.length){return}const t=e.val()==a;const i=e.val()==s;const n=e.val()==l;const r=!t||!$("#save-target-toggle").prop("checked");$("#test-recipients-table").toggleClass("hidden",!t);$("#adminSendButton").toggleClass("hidden",t||i||n);$("#testTargetSaveButton").toggleClass("hidden",r);$("#test-run-target-name-input").toggleClass("hidden",r);$("#adminTargetGroupSelect").prop("disabled",!i);$("#test-recipients-table input").prop("disabled",!t)}function p(e){const t=$("#testTargetSaveButton");const i=t.find("i");if(e){i.hide()}t.toggleClass("btn-primary",!e,500);t.toggleClass("btn-success",e,500);if(e){t.css({cursor:"not-allowed","pointer-events":"none"})}else{t.css({cursor:"","pointer-events":""})}i.toggleClass("icon-save",!e);i.toggleClass("icon-check",e);i.show(500)}function h(){const t=$('input[name="targetName"]');const e=AGN.Lib.Validator.get("length").errors(t,{min:3,required:true});const i=r.get(t);if(!e.length){i.cleanErrors();return true}e.forEach(function(e){i.showFieldError$(t,e.msg)});return false}function g(){$.ajax({type:"POST",url:AGN.url("/mailing/send/test/saveTarget.action"),data:{mailingTestRecipients:v(),targetName:$('input[name="targetName"]').val().trim()}}).done(function(e){if(e.success===true){p(true)}else{AGN.Lib.JsonMessages(e.popups)}})}this.addAction({click:"save-target-for-test-run"},function(){if(!h()){return}g()});function v(){return $('input[name="mailingTestRecipients"]').map(function(){return this.value.trim()}).get().filter(function(e){return e})}function m(e){const t=AGN.Lib.Form.get(e);t.initFields()}this.addAction({change:"prioritization-toggle"},function(){y($(this.el),"isPrioritizationDisallowed")});this.addAction({change:"encrypted-send-toggle"},function(){y($(this.el),"isEncryptedSend")});this.addAction({change:"sendStatusOnErrorOnly-toggle"},function(){y($(this.el),"statusOnErrorEnabled")});function y(e,i){const n=e.prop("checked");e.prop("disabled",true);function r(){e.prop("checked",!n);AGN.Lib.Messages(t("defaults.error"),t("defaults.error"),"alert")}const o={};o[i]=e.is(":checked");$.ajax({type:"POST",url:e.data("url"),data:o}).done(function(e){if(e&&e.success){AGN.Lib.Messages(t("defaults.success"),t("defaults.saved"),"success")}else{r()}}).fail(r).always(function(){e.prop("disabled",false)})}AGN.Lib.Controller.new("mailing-deletion-modal",function(){this.addDomInitializer("mailing-deletion-modal",function(){this.el.find(".js-confirm-positive").on("click",function(){const e=$("#delivery-status-box");if(e.exists()){AGN.Lib.Load.get(e).stop()}})})})});AGN.Lib.Controller.new("delivery-settings-view",function(){this.addDomInitializer("delivery-settings-view",function(){var n;if(this.config.adminLocale==="en_US"){n=","}else{n="."}const e=$("#maxRecipients");e.val("");e.focusout(function(){if($(this).val()==="0"){e.val("")}});$("#sendBtn").mousedown(function(){if(e.val()===""){e.val("0")}});_.each($(".commaSplitLabel"),function(e){const t=$(e);const i=t.text().replace(/\B(?=(\d{3})+(?!\d))/g,n);t.text(i)})})});AGN.Lib.Controller.new("mailing-settings-view",function(){var o=AGN.Lib.Form;var i=0;var a;var n=false;var r=[];var s;var l=0;var u;var c=false;var e=function(){var e=$("#target-mode-desc");if($("[name='targetMode']:checked").val()==a.TARGET_MODE_OR){e.text(t("mailing.default.targetmode_or"))}else{e.text(t("mailing.default.targetmode_and"))}};var d=function(){var e=$("#mailingParamsTable tbody");if(e&&e.length){return _.map(e.find("[data-param-row]"),function(e){var t=$(e);return{name:F(t,"name"),value:F(t,"value"),description:F(t,"description")}}).filter(function(e){return e.name||e.value||e.description})}return[]};const f=function(e){if(!e.length){return}const i=e.val().length;$('[data-char-counter-for="'+e.attr("id")+'"]').find("span:first").text(t("fields.content.charactersEntered",i))};this.addDomInitializer("mailing-settings-view",function(){a=this.config;r=$("#targetGroupIds").val()||[];$("#targetModeAndBtn").closest(".form-group").toggle(r.length>1);s=$("#settingsGeneralMailingList");s.select2("readonly",false);if(l>0){l=s.select2("val",l)}if(a.selectedRemovedMailinglistId){p()}S(a.mailingType);if(!a.isMailingGrid||a.mailingId||a.isCopying){M()}v();e();h();if($("#email-tile").length){f($("#emailSubject"));f($("#pre-header"))}AGN.Opt.collectMailinParams=d});function p(){var e=o.get($("#mailingSettingsForm"));e.showFieldError("mailinglistId",t("fields.mailinglist.errors.removed"),true)}function h(){if(i>0){var e=$("#gt-wrapper");if(e.exists()){e.animate({scrollTop:i},50)}else{$(document).scrollTop(i+50)}}else{var t=$("#mailingSettingsForm").find('[name="shortname"]');if($(t).exists()){$(t).focus()}}i=0}function g(e){var t=e.dirty("showDirtyFields");if(t.length>0){var i=t.filter(function(e,t){var i=$(t);return!(i.prop("readonly")===true||i.is(":disabled")||i.prop("type")==="hidden")});return i.length===0}else{return false}}function v(){const e=$("#mailingSettingsForm");e.dirty("destroy");e.dirty({preventLeaving:true,leavingMessage:t("grid.layout.leaveQuestion"),onDirty:function(){if(g(e)&&!c){e.dirty("setAsClean")}}});if(g(e)&&!c){e.dirty("setAsClean")}c=false}window.onbeforeunload=function(){if(!$("#mailingSettingsForm").dirty("isDirty")===true){AGN.Lib.Loader.show()}};this.addAction({change:"selectTargetGroups"},function(){var e=this.el.val()||[];var t=$("#targetModeAndBtn");var i=t.closest(".form-group");if(e.length>1&&r.length<=1){t.prop("checked",true)}i.toggle(e.length>1);r=e});function m(e){var r={};e.forEach(function(e){var t=$(e);if(t.exists()&&t.closest(".form-group").is(":visible")&&!t.prop("disabled")){var i=t.prop("name");var n=t.val();if(i){r[i]=n}}});return r}this.addAction({click:"calculateRecipients"},function(){if(a){u=b();$.ajax({type:"POST",url:AGN.url("/mailing/ajax/"+a.mailingId+"/calculateRecipients.action"),traditional:true,data:u}).always(function(e){if(e&&e.success===true){w(e.count)}else{w("?");AGN.Lib.Messages(t("defaults.error"),t("defaults.error"),"alert")}})}});this.addAction({change:"change-mailing-settings"},function(){n=true;y()});function y(){if(!u){return}const e=b();if(!_.isEqual(e,u)){u=null;w("?")}}function b(){const e=["#settingsGeneralMailingList","#settingsTargetgroupsListSplit","#settingsTargetgroupsListSplitPart","#lightWeightMailingList","#assignTargetGroups","#targetGroupIds","#altgIds","#followUpType"];return $.extend(m(e),{changeMailing:n,targetMode:$('[name="targetMode"]:checked').val(),isWmSplit:a.wmSplit})}function w(e){const t=$("#calculatedRecipientsBadge");t.text(e)}this.addAction({change:"set-parent-mail-mailinglist"},function(){A()});this.addAction({change:"scroll-to"},function(){var e=C(this.el);i=Math.round(e)});function C(e){var t=e.closest(".tile");if(t.exists()){return t.position().top}else{return e.position().top}}this.addAction({change:"change-general-mailing-type"},function(){var e=this;var t=e.el.val();s.select2("readonly",false);if(l>0){s.select2("val",l)}S(t)});this.addAction({change:"save-mailing-list-id"},function(){const i=this.el.select2("val");const e=$("#settingsGeneralMailType").val();if(!E(e)){l=i}if(a.selectedRemovedMailinglistId){s.find('option[value="'+a.selectedRemovedMailinglistId+'"]').remove();var n=o.get($(this.el));n.cleanFieldError("mailinglistId")}if(a.allowedMailinglistsAddresses){const r=a.mailinglists.find(function(e){return e.id==i});if(r){if(r.senderEmail){$("#emailSenderMail").val(r.senderEmail).trigger("change")}if(r.replyEmail){$("#emailReplyEmail").val(r.replyEmail)}if(r.senderEmail&&r.replyEmail){AGN.Lib.Messages(t("defaults.info"),t("mailing.default.sender_and_reply_emails_changed"),"info")}else if(r.senderEmail){AGN.Lib.Messages(t("defaults.info"),t("mailing.default.sender_email_changed"),"info")}else if(r.replyEmail){AGN.Lib.Messages(t("defaults.info"),t("mailing.default.reply_email_changed"),"info")}}}});this.addAction({change:"change-target-mode"},e);function A(){var e=$("#lightWeightMailingList").val();var t=$("#parentmailing-"+e+"-mailinglist").attr("data-mailing-list-id");s.select2("val",t);s.select2("readonly",true)}var E=function(e){return a.FOLLOWUP_MAILING_TYPE==e};var x=function(e){return a.ACTIONBASED_MAILING_TYPE==e};var T=function(e){return a.DATEBASED_MAILING_TYPE==e};function S(e){var t=false;if(a.followUpAllowed){if(E(e)){A();t=true}D(t,"#followUpControls")}D(T(e),"#mailing-bcc-recipients");var i=x(e)?a.campaignEnableTargetGroups:true;D(i,"#mailingTargets")}function D(e,t){var i=$(t);if(i){if(e){i.removeClass("hidden");i.show()}else{i.hide()}}}this.addAction({change:"change-mediatype"},function(){var e=$(this.el);var t=k(e);N(e,t);M()});function k(e){return e.find("input:checkbox:first").is(":checked")}function O(){var t=$("#tile-mediaTypes").find(".list-group");var e=R();t.empty();e.forEach(function(e){t.append(e)})}function R(){return $("#tile-mediaTypes").find(".list-group li").toArray().sort(function(e,t){var i=$(e);var n=$(t);if(!k(i)&&k(n))return 1;if(k(i)&&!k(n))return-1;return i.data("priority")-n.data("priority")})}function N(e,t){O();G(e,t)}function I(){if(a.isMailingGrid){return}const e=$("#tile-mediaTypes").find('[data-mediatype="email"]');if(!k(e)){$("#frame-tile").remove();$("#email-tile").remove()}}function P(){const e=$("#frame-tile").length&&$("#email-tile").length;if(!e){const t=$("#email-tile-template").html();const i=$("#frame-tile-template").html();const n=$("#base-info-tile");n.after(t);n.after(i)}}function M(){P();I();var r=$("#mediatypes-tile");$("#tile-mediaTypes").find(".list-group li").toArray().filter(function(e){return $(e).data("mediatype")!=="email"&&$(e).data("mediatype")!=="post"}).reverse().forEach(function(e){var t=$(e);var i=t.data("mediatype");$("#"+i+"-tile").remove();if(k(t)){var n=AGN.Lib.Template.dom(i+"-tile-template");r.after(n)}});AGN.Lib.Form.get($("#mailingSettingsForm")).initFields();AGN.Lib.CoreInitializer.run("tab-toggle");AGN.Lib.CoreInitializer.run("ace");AGN.Lib.CoreInitializer.run("select")}function G(e,t){if(t){e.find("label").after("          <div class='list-group-item-controls'>              <a href='#' data-action='prioritise-mediatype-down'>                <i class='icon icon-chevron-circle-down'></i>              </a>              <a href='#' data-action='prioritise-mediatype-up'>               <i class='icon icon-chevron-circle-up'></i>              </a>          </div>      ")}else{e.find(".list-group-item-controls").remove()}}this.addAction({click:"prioritise-mediatype-up"},function(){L($(this.el).closest("li"),true)});this.addAction({click:"prioritise-mediatype-down"},function(){L($(this.el).closest("li"),false)});function W(e){var t=e.prev();var i=e.attr("data-priority");e.attr("data-priority",t.attr("data-priority"));t.attr("data-priority",i);t.before(e)}function H(e){var t=e.next();var i=e.attr("data-priority");e.attr("data-priority",t.attr("data-priority"));t.attr("data-priority",i);t.after(e)}function j(e,t){return t&&e.prev().length||!t&&e.next().length&&k(e.next())}function L(e,t){var i=o.getWrapper(e);c=true;if(j(e,t)){if(t){W(e)}else{H(e)}i.dirty("setAsDirty");M()}}this.addAction({submission:"save"},function(){const n=o.get(this.el);$("#tile-mediaTypes").find(".list-group li").toArray().forEach(function(e){const t=$(e);const i=t.data("mediatype");n.setValueOnce(i+"Mediatype.priority",t.data("priority"))});B(n);n.submit()});function B(i){_.each(d(),function(e,t){i.setValueOnce("params["+t+"].name",e.name);i.setValueOnce("params["+t+"].value",e.value);i.setValueOnce("params["+t+"].description",e.description)})}function F(e,t){return e.find("[data-param-"+t+"]").val()}this.addAction({input:"count-text-chars",textarea:"count-text-chars","editor:create":"count-textarea-chars","editor:change":"count-textarea-chars"},function(){f(this.el)})});AGN.Lib.Controller.new("mailing-styles",function(){function e(){const e=$("form#mailingStylesForm");const o=$("form#mailingPreviewForm");const t=e.find('input[name^="styles["]');$.each(t,function(e,t){const i=$(t);const n=i.attr("name");const r=o.find('input[name="'+n+'"]');r.val(i.val())});o.submit()}this.addAction({submission:"updatePreview"},function(){e()});this.addAction({click:"updateMailingPreview"},function(){e()});this.addAction({click:"saveMailingStyles"},function(){$("form#mailingStylesForm").submit()})});AGN.Lib.Controller.new("mailinglist-list",function(){var r=null;function n(){var e=$(".js-data-table-body");if(e.exists()){var t=e.data("_table");if(t&&t.api){return t.api}}return null}function o(e){var i=$.Deferred();if(e&&e.length){var n=$.ajax(r.urls.MAILINGLIST_BULK_DELETE,{method:"POST",traditional:true,data:{bulkIds:e}}).fail(function(){i.reject()});AGN.Lib.Confirm.request(n).done(function(e){AGN.Lib.Page.render(e)}).then(i.resolve,i.reject)}else{i.reject();AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}return i.promise()}this.addDomInitializer("mailinglist-list",function(){r=this.config});this.addAction({click:"bulk-delete"},function(){var e=n();if(e){var t=e.getSelectedRows();var i=t.map(function(e){return e.id});o(i).done(function(){e.updateRowData({remove:t})})}})});AGN.Lib.Controller.new("manage-table-import",function(){const i=AGN.Lib.Form;var a="#new-default-column-format";var s="#new-default-column-value";var l="#new-default-column-encrypted";var u=".manage-tables-mapping-row";var c=AGN.Lib.Template;var d=null;var f;var p;this.addDomInitializer("manage-table-import",function(){d=this.config;t(d.mappings)});this.addAction({click:"add-default-column"},function(){var e=$(u).length;var t=$(a).val(),i=$(s).val(),n=!!$(l).prop("checked"),r=$("#new-default-column-type").val();if("value"===r&&!(i.startsWith("'")&&i.endsWith("'"))){i="'"+i+"'"}var o=c.dom("manage-tables-import-row",{index:e,targetColumns:d.importColumns,format:t,value:i,encrypted:n});$("#manage-tables-tbody").append(o);$(a).val("");$(s).val("");$(l).prop("checked",false)});this.addAction({click:"delete-mapping-row"},function(){var e=this.el,t=e.parents(u),i=e.parents("tbody");t.remove();h(i.find(u))});this.addAction({click:"create-mapping"},function(){const e=i.get(this.el);$.ajax(d.urls.CREATE_MAPPINGS,{type:"POST",dataType:"json",enctype:"multipart/form-data",processData:false,contentType:false,data:e.data()}).done(function(e){if(e.success===true){t(e.data);AGN.Lib.JsonMessages(e.popups)}else{AGN.Lib.JsonMessages(e.popups)}})});this.addAction({click:"import-data"},function(){const e=this.el.data("url");const t=i.get($("#form"));t.setActionOnce(e);o(t)});function t(e){f=$("#manage-tables-tbody");f.html("");p=c.prepare("column-mapping-table-row");for(var t=0;t<e.length;t++){const i=e[t];r(t,i.id,i.sourceColumn,i.targetColumn,i.mandatory,i.encrypted,i.format,i.defaultValue)}}function e(){if(!f||!f.length){return[]}return _.map(f.find("[data-mapping-row]"),function(e){const t=$(e);return{sourceColumn:n(t,"fileColumn"),targetColumn:n(t,"db-column"),mandatory:n(t,"mandatory"),encrypted:n(t,"encrypted"),defaultValue:n(t,"defaultValue"),format:n(t,"format")}})}function n(e,t){const i=e.find("[data-mapping-"+t+"]");if(i.is(":checkbox")){return i.is(":checked")}return i.val()}function r(e,t,i,n,r,o,a,s){const l=p({index:e,id:t,fileColumn:i,databaseColumn:n,mandatory:r,encrypted:o,format:a,defaultValue:s});f.append(l);const u=$('[data-mapping-row="'+e+'"]').find("[data-mapping-db-column]");AGN.Lib.CoreInitializer.run("select",u)}this.addAction({submission:"save"},function(){const e=i.get(this.el);o(e)});function o(i){_.each(e(),function(e,t){i.setValueOnce("mappings["+t+"].sourceColumn",e.sourceColumn);i.setValueOnce("mappings["+t+"].targetColumn",e.targetColumn);i.setValueOnce("mappings["+t+"].mandatory",e.mandatory);i.setValueOnce("mappings["+t+"].encrypted",e.encrypted);i.setValueOnce("mappings["+t+"].defaultValue",e.defaultValue);i.setValueOnce("mappings["+t+"].format",e.format)});i.submit()}function h(e){var i=0;e.each(function(){var e=$(this);var t=e.find('[name*="mappings["]');t.each(function(){var e=$(this);var t=e.attr("name");t=t.replace(/mappings\[\d+]/g,"mappings["+i+"]");e.attr("name",t)});i++})}});AGN.Lib.Controller.new("manage-tables-viewfield",function(){var t="true";this.addAction({change:"typeFieldChangeAction"},function(){var e=$("#nullable");if(this.el.val()==="DATE"||this.el.val()==="DATETIME"){t=e.val();e.val("true")}else{e.val(t)}})});AGN.Lib.Controller.new("mediapool-element-category-select",function(){var n=AGN.Lib.Confirm,i=AGN.Lib.Helpers,r=AGN.Lib.Select;this.addDomInitializer("mediapool-element-category-select",function(e){var t=i.objFromString(e.data("config"));if(t&&t.categoryId){r.get($("#mediapool-file-category-id")).selectValueOrSelectFirst(t.categoryId)}});this.addAction({change:"selectCategory"},function(){var e=this.el.parents(".form-group");e.removeClass("has-alert has-feedback js-form-error");e.find(".js-form-error-msg").addClass("hidden")});this.addAction({click:"applyCategory"},function(){var e=$("#mediapool-file-category-id");var t=parseInt(e.val());if(t>0){n.get(this.el).positive({categoryId:t})}else{var i=e.parents(".form-group");i.addClass("has-alert has-feedback js-form-error");i.find(".js-form-error-msg").removeClass("hidden")}})});AGN.Lib.Controller.new("mediapool-overview",function(){var s=AGN.Lib.Helpers;var r=AGN.Lib.Template;var o=AGN.Lib.Confirm;var l=AGN.Lib.Form;var n=AGN.Lib.Page;var i;var u;var a;function c(e){var t=r.dom("modal-replace-image",e);t.find("form").data("selected-file",e.file);if(e.preview){t.find("#replacement-preview").prop("src",e.preview)}return o.create(t)}function d(e,t){e.all("input, textarea, select, button").prop("disabled",!t)}function f(){$("#duplication-update-fields:not(.hidden)").addClass("hidden")}this.addDomInitializer("mediapool-overview",function(){u={};i=this.config;this.config.imagesList.forEach(function(e){u[e.id]=e})});this.addAction({click:"replace-image"},function(){var e=this.el.data("image-id");a=u[e];if(a){var t=$("#replacement-image");s.clearFormField(t);t.trigger("click")}});this.addAction({click:"toggle-overwrite-existing-data"},function(){var e=this.el;var t=$(e).is(":checked");var i=$(e).closest("table").find('[data-action="change-overwriting-state"]');i.prop("checked",t);i.trigger("change")});this.addAction({change:"change-overwriting-state"},function(){var e=$(this.el);var t=e.is(":checked");var i="";var n="";var r=parseInt(e.prop("id").replace("overwrite-",""));var o=$('[name="images['+r+'].id"]').val();if(t&&u[o]){var a=u[o];i=a.title;n=a.categoryId}$("#image-title-"+r).val(i);var s=$("#image-category-id"+r);if(s.data("select2")){s.select2("val",n)}var l=$('[id^="duplication-error-"]:not([hidden])').find('[id^="overwrite-"]:not(:checked)');$("#updateAllData").prop("checked",l.length===0)});this.addAction({change:"replacement-image"},function(){f();var e=this.el;var t=e.prop("files");if(t&&t.length&&a){var i=new FileReader;var n=t[0];i.onload=function(e){if(a){c({image:a,file:n,preview:e.target.result})}};i.readAsDataURL(n)}});this.addAction({"reset-upload":"mediapool-upload-image"},function(){f()});this.addAction({"upload:add":"mediapool-upload-image"},function(){var t=this.data;var i=!$("#duplication-update-fields").hasClass("hidden");p(t.file.name,function(e){t.file.id=e.data;i=!!e.data||i});if(i){$("#updateAllData").prop("checked",false);$("#duplication-update-fields").removeClass("hidden")}});function p(e,t){$.ajax(i.urls.VERIFY_IMAGE_URL,{data:JSON.stringify({imageName:e}),contentType:"application/json",async:false,type:"POST",success:t})}this.addAction({submission:"submit-image-save"},function(){var e=this.el;var t=l.get(e);var i=t._dataNextRequest;this.event.preventDefault();var n=1;var r=true;for(key in i){var o=$("[name='images["+n+"].fileName']").val();var a=$("[id='overwrite-"+n+"']").is(":checked");p(o,function(e){if(e.data&&!a){r=false;$("[name='images["+n+"].id']").val(e.data);$("[id='duplication-error-"+n+"']").removeAttr("hidden")}else if(!a){$("[id='duplication-error-"+n+"']").hide()}});n++}if(r){t.submit()}});this.addAction({submission:"submit-image-replace"},function(){var e=this.el;var t=l.get(e);var i=new FormData;$.each(t.data(),function(e,t){i.append(e,t)});i.append("file",this.el.data("selected-file"));d(e,false);$.ajax(t.getAction(),{type:"POST",dataType:"html",enctype:"multipart/form-data",processData:false,contentType:false,data:i}).always(function(){d(e,true)}).done(function(e){n.render(e,false)})});this.addAction({click:"change-category-bulk"},function(){var i=this.el.data("form-url");var n=l.get(this.el);var e=n.data();if(!e||!e.bulkId||!e.bulkId.length){AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert");return}o.create(r.text("modal-element-category-select",{categoryId:null})).done(function(e){if(e&&e.categoryId){n.setActionOnce(i);n.setValueOnce("categoryId",e.categoryId);n.submit()}})});this.addAction({change:"change-mobile-base"},function(){var e=$(this.el);var t=s.objFromString(e.data("config"));var i=$("#file-name-"+t.count);var n=t.initialValue;var r=AGN.Lib.Select.get(e).getSelectedValue();var o=r&&r.length>0;var a=o?t.mobilePrefix+r:n;i.val(a);i.prop("readonly",o)});this.addDomInitializer("ai-images-generation",function(){h({isFirstRow:true});g({isFirstRow:true})});function h(e){const t=r.dom("ai-image-generation-important-objects-row",e);$("#important-objects-table").find("tbody").append(t);AGN.runAll(t)}function g(e){const t=r.dom("ai-image-generation-filter-row",e);$("#ai-image-filters-table").find("tbody").append(t);AGN.runAll(t);AGN.Lib.Field.create(t)}this.addAction({change:"disable-important-objects"},function(){const e=$("#important-objects-table");v(this.el,e)});this.addAction({click:"add-important-object"},function(){const e=this.el.closest("[data-important-object-row]");const t=C(e);const i=e.find(":input");i.each(function(){const e=$(this);e.val("").trigger("change");const t=e.closest(".js-colorpicker");if(t.exists()){t.data("colorpicker").updateComponent("transparent")}});h(_.extend({isFirstRow:false},t))});this.addAction({click:"remove-important-object"},function(){this.el.closest("[data-important-object-row]").remove()});this.addAction({change:"disable-image-generation-filters"},function(){const e=$("#ai-image-filters-table");v(this.el,e);disable-image-generation-filters});function v(e,t){const i=!e.is(":checked");t.toggleClass("disabled",i);t.find(":input, button").prop("disabled",i)}this.addAction({click:"add-generation-filter"},function(){const e=this.el.closest("[data-image-generation-filter-row]");const t=A(e);g(_.extend({isFirstRow:false},t))});this.addAction({click:"remove-generation-filter"},function(){this.el.closest("[data-image-generation-filter-row]").remove()});this.addAction({click:"generate-ai-image"},function(){const e=l.get(this.el);y(e);b(e);e.jqxhr().done(function(e){if(e.success){m(e.data.remainingGenerationsCount);const t=$("#ai-generated-image");t.attr("src",e.data.url);t.removeClass("hidden");$("#save-generated-img-btn").removeClass("hidden")}else{AGN.Lib.JsonMessages(e.popups)}})});function m(e){if(e<=0){$("#remaining-generations-text").text(t(`mediapool.imageGeneration.limitExceeded`));$("#generate-btn").remove()}else{$("#remaining-generations-text").text(t(`mediapool.imageGeneration.remainingGenerations`,e))}}function y(n){e().forEach(function(t,i){Object.keys(t).forEach(function(e){n.setValueOnce("importantObjects["+i+"]"+"."+e,t[e])})})}function b(n){const e=_.groupBy(w(),"name");_.forEach(e,function(e,t){const i=_.map(e,"value");n.setValueOnce("filters["+t+"]",i)})}this.addAction({click:"save-generated-ai-image"},function(){const e=$("#ai-generated-image").attr("src");$.post(AGN.url("/mediapool/content/images/saveGenerated.action"),{url:e}).done(function(e){n.render(e)})});function e(){if($("#important-objects-table").hasClass("disabled")){return[]}return $("[data-important-object-row]:not(:first)").map(function(){return C($(this))}).get()}function w(){if($("#ai-image-filters-table").hasClass("disabled")){return[]}return $("[data-image-generation-filter-row]:not(:first)").map(function(){return A($(this))}).get()}function C(e){return{objects:e.find("[data-row-objects]").val(),objectColors:e.find("[data-row-objects-colours]").val(),amount:e.find("[data-row-amount]").val(),layout:e.find("[data-row-layout]").val()}}function A(e){return{name:e.find("[data-row-filter-name]").val(),value:e.find("[data-row-filter-value]").val()}}});AGN.Lib.Controller.new("news-editor",function(){var r=AGN.Lib.Template;var o=["de","en"];var a=0;this.addDomInitializer("news-editor-init",function(){var e=$('input[name="newsId"]').val();var t=$(".existent-news");if(t&&t.length>0&&e==0){$(t).each(function(){var e=$(this).find(".existent-news-language").val();var t=$(this).find(".existent-news-title").val();var i=$(this).find(".existent-news-content").val();n(e,t,i);l();s();$(this).remove()})}else if(e==0){n(i(),"","");l();s()}});this.addAction({click:"addNewsContent"},function(){n(i(),"","");l();s()});this.addAction({click:"removeNewsContent"},function(){var e=$(this.el).closest(".l-news-content-block");$(e).remove();l();s();u()});this.addAction({change:"changeLanguage"},function(){u()});function n(e,t,i){if(e!=""){var n=r.dom("news-content-template-row",{lang:e,index:a,title:t,content:i});if($("#news-content-editor > .l-news-content-block").length==0){$("#news-content-editor").append('<div class="tile-separator"></div>')}n.appendTo("#news-content-editor");AGN.runAll(n);u();a++}}function s(){var e=c();var t=$("#news-content-editor > .l-news-content-block").last().find("input[name='index']").val();if(o.length==e.length){$("#add-news-"+t).hide()}else{$("#add-news-"+t).show()}}function l(){var e=$("#news-content-editor > .l-news-content-block");$("button[id^='add-news-']").hide();var t=$(e).first().find("input[name='index']").val();if(e.length==1){$("#delete-news-"+t).hide()}else{$("#delete-news-"+t).show()}}function u(){var e=t();$("#news-content-editor > .l-news-content-block").find("select.news-language").each(function(){$("option",this).not(":selected").remove();var i=$(this);$.each(e,function(e,t){$(i).append($("<option>",{value:t,text:t}))})})}function t(){var i=[];var n=c();$.each(o,function(e,t){if($.inArray(t,n)==-1){i.push(t)}});return i}function c(){var e=$("#news-content-editor > .l-news-content-block").find("select.news-language").find("option:selected");return e.map(function(){return $(this).val()}).toArray()}function i(){var i=c();var n="";if(i.length==0){n=o[0]}else{$.each(o,function(e,t){if(i.indexOf(t)<0){n=t;return false}})}return n}});AGN.Lib.Controller.new("notification-global-stat",function(){this.addAction({change:"selectReportType"},function(){var e=$("#globalStatInfo");switch(this.el.val()){case"STATUS":n(false,true,false);e.show();break;case"BROWSER":n(false,false,true);e.hide();break;case"PROGRESS":n(true,false,false);e.show();break}});this.addAction({click:"close"},function(){var e=$("#notifications-container");e.fadeOut("slow",function(){e.remove()})});this.addAction({click:"refreshStat"},function(){r()});this.addAction({change:"select-month"},function(){r()});this.addAction({change:"select-year"},function(){r()});this.addAction({click:"weekProgressStat"},function(){$("#selectMode").val("WEEK");e(false,false);r();i(true,false,false)});this.addAction({click:"monthProgressStat"},function(){$("#selectMode").val("MONTH");e(true,false);$("#refreshStat").show();i(false,true,false);r()});this.addAction({click:"dateRangeProgressStat"},function(){$("#selectMode").val("RANGE");e(false,true);$("#refreshStat").show();i(false,false,true);r()});this.addAction({change:"end-date-change"},function(){var e=$("#startDay").val();var t=$("#endDay").val();$("#startDay").pickadate("picker").set("max",t);$("#endDay").pickadate("picker").set("min",e);r()});this.addAction({change:"start-date-change"},function(){var e=$("#startDay").val();var t=$("#endDay").val();$("#startDay").pickadate("picker").set("max",t);$("#endDay").pickadate("picker").set("min",e);r()});function e(e,t){$("#month-progress-stat").hide();$("#daterange-progress-stat").hide();if(e){$("#month-progress-stat").show()}if(t){$("#daterange-progress-stat").show()}}function i(e,t,i){$("#weekProgressStat").removeClass("active");$("#monthProgressStat").removeClass("active");$("#dateRangeProgressStat").removeClass("active");if(e){$("#weekProgressStat").addClass("active")}if(t){$("#monthProgressStat").addClass("active")}if(i){$("#dateRangeProgressStat").addClass("active")}}function n(e,t,i){$("#notificationGlobalStatusStat").hide();$("#notificationGlobalBrowserStat").hide();$("#notificationGlobalProgressStat").hide();if(e){AGN.Lib.DomInitializer.try("notification-global-progress-stat");$("#notificationGlobalProgressStat").show();$("#dateSelectMode").show();$("#dateModeControls").show()}if(t){AGN.Lib.DomInitializer.try("notification-global-status-stat");$("#notificationGlobalStatusStat").show();$("#dateSelectMode").hide();$("#dateModeControls").hide()}if(i){AGN.Lib.DomInitializer.try("notification-global-browser-stat");$("#notificationGlobalBrowserStat").show();$("#dateSelectMode").hide();$("#dateModeControls").hide()}}function r(){$("#notifications-container").remove();if(o()){if($("#monthProgressStat").attr("class")=="active"||$("#dateRangeProgressStat").attr("class")=="active"){AGN.Lib.DomInitializer.try("notification-global-progress-stat")}}}function o(){if($("#dateRangeProgressStat").attr("class")=="active"){var e=$("#startDay").val();var t=$("#endDay").val();if(a(e)||a(t)){s();return false}if(new Date(e).getTime()>new Date(t).getTime()){s();return false}}return true}function a(e){return typeof e==="undefined"||e==""}function s(){AGN.Lib.Messages(t("defaults.error"),t("error.statistic.period_format"),"alert");setTimeout(function(){var e=$("#notifications-container");e.fadeOut("slow",function(){e.remove()})},7e3)}});AGN.Lib.Controller.new("notification-schedule",function(){var t,n,r,i;this.addDomInitializer("notification-schedule",function(e){t=e.find("#startDate");n=e.find("#endDate");r=e.find("#startTime");i=e.find("#endTime");t.pickadate("picker").on("set",a);r.on("change",a);n.pickadate("picker").on("set",d);i.on("change",d)});function o(){var e=t.pickadate("get","select");return e&&new Date(e.obj)}function a(){var e=n.pickadate("picker");var t=o();e.off("set");if(t){var i=c(t);l(t,i);s(i);u(r.val())}else{l(true,false);s(null);u(null)}e.on("set",d)}function e(){var e=o();if(e){l(e,c(e))}else{l(true,false)}}function s(e){var t=n.pickadate("picker");if(e){t.set("select",e)}else{t.clear()}}function l(e,t){var i=n.pickadate("picker");i.set("min",e);i.set("max",t);i.set("select",i.get("select"))}function u(e){i.val(e)}function c(e){var t=new Date(e);t.setDate(t.getDate()+28);return t}function d(){n.removeClass("enableable");i.removeClass("enableable");n.pickadate("off","set");i.unbind("change");t.pickadate("off","set");t.pickadate("picker").on("set",e);r.unbind("change");r.on("change",e)}});AGN.Lib.Controller.new("notification-settings",function(){this.addAction({"editor:create":"content","editor:change":"content"},function(){var e=this.el.val().length;$("#contentSize").text(t("fields.content.charactersEntered",e))})});AGN.Lib.Controller.new("preview-header-new",function(){var e=this;this.addInitializer("set-preview-customer-options",function(){var e=$('[name="useCustomerEmail"]:checked').val()=="true";$('[name="customerEmail"]').prop("disabled",!e);$("#btnCustomEmailRefresh").prop("disabled",!e);$('select[name="customerID"]').prop("disabled",e)});this.addAction({change:"change-preview-customer-options"},function(){e.runInitializer("set-preview-customer-options")})});AGN.Lib.Controller.new("profile-field-view",function(){const n=AGN.Lib.Form;var r;this.addDomInitializer("profile-field-view",function(){r=this.config});this.addAction({submission:"submit-profile-field-save"},function(){const e=this.el;const t=$("span[class*='icon-state-']");e.find(t).each(function(){const e=$(this);e.show();e.closest(".form-group").addClass("has-feedback")});const i=n.get(e);if(r.targetUrl){i.setValueOnce("targetUrl",r.targetUrl)}i.submit()})});AGN.Lib.Controller.new("recipient-import-errors-edit",function(){const e=AGN.Lib.Page;this.addDomInitializer("recipient-import-errors-edit",function(){if(t()){e.reload(AGN.url("/recipient/import/chooseMethod.action?cancelImport=true"))}else{window.onbeforeunload=function(){return"If you leave the page, the import will be canceled automatically!"}}});function t(){if(typeof performance==="undefined"||typeof performance.getEntriesByType!=="function"){return false}const e=performance.getEntriesByType("navigation");if(e.length>0){return e[0].type==="reload"}return false}this.addAction({submission:"save-errors"},function(){i();const e=AGN.Lib.Form.get(this.el);e.submit("static")});this.addAction({click:"ignore-errors"},function(){i();e.reload(AGN.url("/recipient/import/errors/ignore.action"))});this.addAction({click:"cancel"},function(){i();e.reload(AGN.url("/recipient/import/cancel.action"))});function i(){window.onbeforeunload=null}});AGN.Lib.Controller.new("recipient-import-view",function(){this.addAction({click:"delete-file"},function(){const e=$.post(AGN.url("/recipient/import/file/delete.action"));e.done(function(){$("#uploaded-file-container").remove();$("#uploadFile").removeClass("hidden")})});this.addDomInitializer("recipient-import-view",function(){const e=this.config.attachmentCsvFileID;if(e>0){const t=$("#useCsvUpload");t.prop("checked",true);t.trigger("change")}})});AGN.Lib.Controller.new("recipient-list",function(){var e=AGN.Lib.Action,n=AGN.Lib.Modal,r=AGN.Lib.Form,i=AGN.Lib.Messages,o=AGN.Lib.Storage;const a="_advanced";const s="-1";var l={};var u=false;var c;var d;var f;e.new({"qb:invalidrules":"#targetgroup-querybuilder"},function(){i(t("defaults.error"),t("querybuilder.errors.invalid_definition"),"alert")});this.addDomInitializer("recipient-list",function(){p(this.config,false)});this.addDomInitializer("recipient-duplicate-list",function(){p(this,true)});this.addAction({enterdown:"search-recipient"},function(){u=true});function p(e,t){d=$("#basicSearch");f=$("#advancedSearch");d.on("click",function(){v()});f.on("click",function(){m()});if(!y()){c=$("#tab-basicSearch").find('[data-action="change-mailinglist-id"]').val();v()}if(y()){c=$("#tab-advancedSearch").find('[data-action="change-mailinglist-id"]').val();m()}if(t){h()}else{g(e)}w()}function h(){var e=$("#recipientForm").find(".table-controls .well");e.first().html(e.last().html())}function g(e){u=false;if(e&&e.initialRules){l=$.extend({},JSON.parse(e.initialRules))}var t=$("#targetgroup-querybuilder");t.on("change",function(){$("#target-group-save-button").toggleClass("hidden",!S())});t.on("afterClear.queryBuilder",function(){$("#target-group-save-button").toggleClass("hidden",true)});t.on("afterReset.queryBuilder "+"afterDeleteGroup.queryBuilder "+"afterDeleteRule.queryBuilder "+"afterSetRules.queryBuilder "+"afterUpdateRuleFilter.queryBuilder",function(e){$("#target-group-save-button").toggleClass("hidden",!S())})}function v(){$("input[name=advancedSearch]").val(false);b();C(true,true);C(false,false)}function m(){$("input[name=advancedSearch]").val(true);C(false,true);C(true,false)}function y(){return!d.hasClass("tab active")&&f.hasClass("tab active")}this.addAction({validation:"search-recipient"},function(){if(u){var e=this.data;this.data=_.merge({},e,{ignore_qb_validation:false,skip_empty:false})}else if(this.data&&this.data.ignore_qb_validation){b()}});this.addAction({submission:"search-recipient"},function(){if(u){var e=$("input[name=advancedSearch]").val();if(e==true){E()}else{A()}x($(this.el),{ignore_qb_validation:false})}});function b(){var e=T();if(e){e.clearErrors();e.setRules(l);E()}}this.addAction({click:"target-group-save"},function(){var e=T();if(e){e.clearErrors()}var t=r.get($(this.el));var i=t.validate(_.merge({},t.validatorOptions,{ignore_qb_validation:false,skip_empty:false}));if(i){n.createFromTemplate({},"target-group-save")}});function w(){const e=c===s;if(e||!y()){$("#search_recipient_type").prop("disabled",e);$("#search_recipient_state").prop("disabled",e)}if(e||y()){$("#search_recipient_type_advanced").prop("disabled",e);$("#search_recipient_state_advanced").prop("disabled",e)}}this.addAction({change:"change-target-group"},function(){var e=$("#search_targetgroup").val();$("#search_targetgroup_advanced").select2("val",e)});this.addAction({change:"change-recipient-type"},function(){var e=$("#search_recipient_type").val();$("#search_recipient_type_advanced").select2("val",e)});this.addAction({change:"change-user-status"},function(){var e=$("#search_recipient_state").val();$("#search_recipient_state_advanced").select2("val",e)});this.addAction({change:"change-target-group-advanced"},function(){var e=$("#search_targetgroup_advanced").val();$("#search_targetgroup").select2("val",e)});this.addAction({change:"change-recipient-type-advanced"},function(){var e=$("#search_recipient_type_advanced").val();$("#search_recipient_type").select2("val",e)});this.addAction({change:"change-user-status-advanced"},function(){var e=$("#search_recipient_state_advanced").val();$("#search_recipient_state").select2("val",e)});this.addAction({click:"choose-advanced-search"},function(){if(A()){x($(this.el),{ignore_qb_validation:false})}});this.addAction({click:"toggle-recipient-tab"},function(){var e=$(this.el);var t=$('[data-action="toggle-recipient-tab"]');_.each(t,function(e){o.set("toggle_tab"+$(e).data("tab-id"),{hidden:true})});o.set("toggle_tab"+e.data("tab-id"),{hidden:false});var i=e.data("url");if(!!i){window.location.href=i}});this.addAction({click:"reset-search"},function(){$("#search_first_name").val("");$("#search_name").val("");$("#search_email").val("");$("#search_mailinglist").select2("val",0);$("#search_targetgroup").select2("val",0);$("#search_recipient_type").select2("val","");$("#search_recipient_state").select2("val",0);$("#search_mailinglist_advanced").select2("val",0);$("#search_targetgroup_advanced").select2("val",0);$("#search_recipient_type_advanced").select2("val","");$("#search_recipient_state_advanced").select2("val",0);D();x($(this.el),{ignore_qb_validation:false})});this.addAction({click:"createNewTarget"},function(){var e=T();if(e){e.clearErrors()}var t=r.get($(this.el));var i=t.validate(_.merge({},t.validatorOptions,{ignore_qb_validation:false,skip_empty:false}));if(i){AGN.Lib.Confirm.createFromTemplate({rules:t.get$().find('[name="searchQueryBuilderRules"]').val()},"new-targetgroup-modal").done(function(e){t.updateHtml(e)})}});this.addAction({change:"change-mailinglist-id"},function(){c=$(this.el).select2("val");w()});this.addAction({click:"refresh-basic-search"},function(){A();x($(this.el),{ignore_qb_validation:false})});this.addAction({click:"refresh-advanced-search"},function(){E();x($(this.el),{ignore_qb_validation:false})});function C(e,t){const i=e?a:"";const n=["#search_mailinglist","#search_altg","#search_targetgroup"];if(c!==s||t){n.push("#search_recipient_type","#search_recipient_state")}n.forEach(function(e){$(e+i).prop("disabled",t)})}function A(){var t={firstname:$("#search_first_name").val().trim(),lastname:$("#search_name").val().trim(),email:$("#search_email").val().trim()};var e=Object.keys(t).map(function(e){return{id:e,value:t[e],operator:"like"}});return O(e,true)}function E(){var e=k(["firstname","lastname","email"]);$("#search_first_name").val(e.firstname);$("#search_name").val(e.lastname);$("#search_email").val(e.email)}function x(e,t){var i=r.get(e);i.submit("",_.merge({ignore_qb_validation:true,skip_empty:true},i.validatorOptions,t))}function T(){return $("#targetgroup-querybuilder").prop("queryBuilder")}function S(){var e=T();if(e){return e.containsNotEmptyRule()}else{return false}}function D(){var e=T();if(e){e.clearErrors();return e.reset()}else{return false}}function k(e){var i=T();var n={};if(i){var r=i.getRules({allow_invalid:true,skip_empty:true});e.forEach(function(e){var t=i.findRuleByField(r,e,true);n[e]=t?t.value:""})}return n}function O(e,n){var r=T();if(r){return e.reduce(function(e,t){var i=r.getRules({allow_invalid:true,skip_empty:true});if(t.id){if(t.value){return r.setOrReplaceRule(i,t,n)===true||e}else{return r.deleteRuleByField(null,t.id,n)===true||e}}else{return e}},false)}else{return false}}});AGN.Lib.Controller.new("recipient-statistics-view",function(){this.addAction({change:"type-change"},function(){const e=this.el;var t=e.find("option:selected");const i=$("#mailinglist-select");if(t.is("[data-mailinglist-required]")&&i.val()==="0"){AGN.Lib.Select.get(i).selectNext()}AGN.Lib.Form.get(e).submit()})});AGN.Lib.Controller.new("recipient-view",function(){var s="OK";var l="USED";var u="BLACKLISTED";var r=AGN.Lib.Form,o=AGN.Lib.Confirm,a=AGN.Lib.Template,e=AGN.Lib.Tile;var c;var i=false;var d;this.addDomInitializer("recipient-view",function(e){var o=r.get(e);var a=this;d=this.config;c=new f(a.config.urls.CHECK_ADDRESS,function(e){var i=e.status;switch(i){case s:o.cleanFieldError("email");break;case l:var n=a.config.urls.EXISTING_USER_URL_PATTERN.replace(":recipientID:",e.recipientID);var r='<div style="display: flex; width: 100%; justify-content: space-between; align-items: center;">'+t("error.inUse")+'<a href="'+n+'" class="btn btn-regular btn-inverse">'+t("recipient.existing.btn")+"</a>"+"</div>";o.showFieldError("email",r,true);break;case u:o.showFieldError("email",t("error.isBlacklisted"),true);break}});$("#recipient-email").on("change input",_.debounce(function(){c.check($(this).val())},300));n()});this.addAction({mouseleave:"toggleSaveAndBack"},function(){var e=this.el;var t=e.parent();setTimeout(function(){if(!i&&!e.is(":hover")){t.removeClass("open")}},400)});this.addAction({mouseenter:"toggleSaveAndBack"},function(){this.el.parent().addClass("open")});this.addAction({mouseenter:"toggleSubmenuSaveAndBack"},function(){i=true});this.addAction({mouseleave:"toggleSubmenuSaveAndBack"},function(){i=false;this.el.closest(".dropdown").removeClass("open")});this.addAction({submission:"recipient-save"},function(){var i=r.get(this.el);var e=$("#recipient-email").val();this.event.preventDefault();var n=function(){$.post(d.urls.CHECK_MATCH_ALTG,i.params()).done(function(e){if(e.popups&&e.popups.alert&&e.popups.alert.length>0){AGN.Lib.JsonMessages(e.popups)}else if(!e.success||e.success.length===0){o.create(a.text("hide-recipient-confirmation-modal")).done(function(){i.setActionOnce(d.urls.SAVE_AND_BACK_TO_LIST);i.submit()})}else{i.submit()}}).fail(function(){i.submit()})};if(c&&e&&e.trim()){c.jqxhr(e.trim()).done(function(e){if(e.isBlacklisted===true){o.create(a.text("email-confirmation-modal",{question:t("recipient.blacklisted.question")})).done(function(){if(e.inUse===true){o.create(a.text("email-confirmation-modal",{question:t("recipient.duplicate.question")})).done(n)}else{n()}})}else if(e.inUse===true){o.create(a.text("email-confirmation-modal",{question:t("recipient.duplicate.question")})).done(n)}else{n()}}).fail(n)}else{n()}});function n(){$(".not-allowed-usertype").each(function(){const e=$(this);if(e.prop("selected")){e.parent("select").prop("disabled",true)}else{e.prop("disabled",true)}})}function f(e,t){this.url=e;this.running=false;this.callback=$.isFunction(t)?t:$.noop;this.lastAddress=null;this.lastResult=null;this.scheduledCheck=null}f.prototype.jqxhr=function(e){return $.get(this.url,{email:e})};f.prototype.scheduleCheck=function(t){var i=this;if(i.scheduledCheck){clearTimeout(i.scheduledCheck)}if(i.running){i.scheduledCheck=setTimeout(function(){i.scheduleCheck(t)},300)}else{i.running=true;i.lastAddress=null;i.lastResult=null;try{i.jqxhr(t).always(function(){i.running=false}).done(function(e){i.lastAddress=t;i.lastResult={status:e.isBlacklisted===true?u:e.inUse===true?l:s,recipientID:e.existingRecipientId||0};i.report()})}catch(e){i.running=false}}};f.prototype.check=function(e){e=e?e.trim():"";if(e){if(this.lastAddress==e){this.report()}else{this.scheduleCheck(e)}}else{this.report(s)}};f.prototype.report=function(e){if(arguments.length){this.callback.call(null,e)}else{if(this.lastAddress){this.report(this.lastResult)}}}});AGN.Lib.Controller.new("reference-table-settings-modal",function(){$(document).on("shown.bs.modal",".modal[reference-table-settings-modal]",function(){var e=$(this).find("input[data-associated-with], select[data-associated-with]");e.each(function(){var e=$(this);var t=$(e.data("associated-with"));if(e.is(":checkbox")){e.prop("checked",t.val()==="true")}else{e.val(t.val())}})});this.addAction({click:"apply-button"},function(){var e=$(this.el);var t=AGN.Lib.Form.get(e);var i=t.validate();if(i){var n=e.closest(".modal").find("input[data-associated-with], select[data-associated-with]");n.each(function(){var e=$(this);var t=$(e.data("associated-with"));if(e.is(":checkbox")){t.val(e.prop("checked"))}else{t.val(e.val())}});AGN.Lib.Modal.getWrapper(e).modal("hide")}})});AGN.Lib.Controller.new("sidemenu",function(){var l=20;var t=AGN.Lib.WebStorage;var r=500;var o=400;var a=1e3/3;this.addAction({mouseenter:"activateSubmenu"},function(){var e=$(this.el).find(".menu-item");var t=e.next(".submenu");var i=t.find(".subitems");$(".submenu.open").not(t).each(function(){s($(this))});if(!f()){clearTimeout(e.data("closeTimerId"));t.addClass("open");var n=t.find(".arrow");u(n,t,e);d(n,t,e);e.data("openTimerId",setTimeout(function(){if(t.is(".open")){i.addClass("open")}},a))}});this.addAction({click:"switch-to-new-design"},function(){const e=this.el;$.post(AGN.url("/ui-design/switch.action")).done(function(){e.prop("disabled",true);window.setTimeout(function(){AGN.Lib.Page.reload(e.data("switch-url"))},500)}).fail(function(){e.prop("checked",!e.prop("checked"))})});this.addAction({mouseleave:"activateSubmenu"},function(){var e=$(this.el).find(".menu-item");var t=e.next(".submenu");var i=t.find(".subitems");if(!f()){clearTimeout(e.data("openTimerId"));var n=i.is(".open")?r:o;e.data("closeTimerId",setTimeout(function(){s(t)},n))}});this.addAction({click:"expandMenu"},function(){if(f()){i()}else{e()}$(window).trigger("viewportChanged")});function s(e){e.removeClass("open");e.find(".subitems").removeClass("open")}function u(e,t,i){var n=t.find(".submenu-header");var r=i.scrollTop()+i.offset().top+i.outerHeight()/2-n.outerHeight()/2;var o=i.offset().left+i.outerWidth()+e.outerWidth();var a=$(window);var s=n.outerHeight()+c(t);if(r+s>a.height()+a.scrollTop()){r=a.height()+a.scrollTop()-s-l}if(r-a.scrollTop()<0){r=a.scrollTop()}t.offset({top:r,left:o})}function c(e){return e.find(".subitems").find("li").first().height()*e.find(".subitems").find("li").length}function d(e,t,i){var n=i.offset().top+i.outerHeight()/2-e.outerHeight()/2;e.offset({top:n,left:e.offset().left})}function e(){n(true);$("body").addClass("wide-sidebar")}function i(){n(false);$("body").removeClass("wide-sidebar")}function n(e){if(e!==true){e=false}t.set("is-wide-sidebar",{value:e});$.ajax(AGN.url("/sidebar/ajax/setIsWide.action"),{type:"GET",data:{isWide:e}})}function f(){return $("body").hasClass("wide-sidebar")}});AGN.Lib.Controller.new("support",function(){var e=AGN.Lib.Form,i=AGN.Lib.Popover,n=AGN.Lib.JsonMessages;function r(){var e=$("#support-mail-text").val();var i=0;if(e){i=e.length}$("#support-message-length").text(t("fields.content.charactersEntered",i))}this.addDomInitializer("support",function(){r();$("#support-mail-text").on("change input",_.throttle(function(){r()},100))});this.addAction({submission:"send-support-request"},function(){this.event.preventDefault();e.get(this.el).submit()});this.addAction({submitted:"send-support-request"},function(){if(this.data.success){var e=i.get(this.el);if(e){e.hide()}}n(this.data.popups)})});AGN.Lib.Controller.new("target-create-mailinglist",function(){this.addAction({click:"select-mediatype"},function(){var e=this.el.closest("form");var t=e.find("#createMailinglistOkBtn");if(!e.find('input:checked[name="mediatypes"]').length){t.attr("disabled","disabled")}else{t.removeAttr("disabled")}})});AGN.Lib.Controller.new("target-scheduler",function(){var r=AGN.Lib.ScheduleTimeTable,o=AGN.Lib.ScheduleTimeTable.PeriodRow;var a;this.addAction({submission:"save-scheduler-data"},function(){var e=AGN.Lib.Form.get($(this.el));e.setValueOnce("intervalAsJson",a.getSubmissionJson("period"));e.submit()});this.addDomInitializer("target-scheduler-init",function(e){var t=e.json();if(a){a.clean()}a=new r($("#tile-schedule-time"));var i=[];if(t.intervalAsJson){i=JSON.parse(t.intervalAsJson).map(function(e){return o.deserialize(e)})}i.forEach(function(e){a.addRow(e)});if(i.length===0){a.addEmptyPeriodRow()}var n=AGN.Lib.Form.get(e);n.initFields()})});AGN.Lib.Controller.new("target-group-view",function(e){var i=AGN.Lib.Action,n=AGN.Lib.Form,r=AGN.Lib.Editor;i.new({"qb:invalidrules":"#targetgroup-querybuilder"},function(){AGN.Lib.Messages(t("defaults.error"),t("querybuilder.errors.general"),"alert")});this.addDomInitializer("target-group-view",function(){var i=$(this.el);$("[data-toggle-tab]").on("click",function(e){var t=n.get(i).validate({skip_empty:true});if(!t){e.preventDefault();return false}});if(this.config.errorPositionDetails){a(this.config.errorPositionDetails)}});this.addAction({click:"switch-tab-viewEQL"},function(){var e=this.el,t=AGN.Lib.Form.get($(e));t.setValueOnce("viewFormat","EQL");t.submit("",{skip_empty:true})});this.addAction({click:"switch-tab-viewQB"},function(){var e=this.el,t=AGN.Lib.Form.get($(e));t.setValueOnce("viewFormat","QUERY_BUILDER");const i=t.submit("",{skip_empty:true});i.done(function(e){o(e);AGN.Lib.Tab.show($("#eql-editor-tab-trigger"));$("#eql-alert").remove();$("#eql").before(s(e.popups.alert[0]))})});this.addAction({submission:"save-target"},function(){n.get(this.el).submit(this.el.data("submit-type")).done(o)});function o(e){if(e.success){return}a(e.data);AGN.Lib.JsonMessages(e.popups)}function a(e){const t=r.get($("#eql")).editor;t.focus();t.gotoLine(e.line,e.column)}function s(e){return'<ul = id="eql-alert">'+'         <div class="tile">'+'             <li class="tile-notification tile-notification-alert">'+e+"</li>"+"         </div>"+"    </ul>"}});AGN.Lib.Controller.new("template-css",function(){this.addAction({click:"updatePreview"},function(){var e=$("#layoutPreviewForm");e.find('input[name="css"]').val($("#cssContents").val());e.submit()});this.addAction({click:"saveLayoutCss"},function(){var e=AGN.Lib.Form.get($("#gridTemplateForm"));var t=$('#save-css-approve-modal-form select[name="templatesToUpdate"]').val();var i=e.getValue("templateId");if(i){t.push(i)}e.setValueOnce("bulkIds",t);e.submit()})});AGN.Lib.Controller.new("template-outer-html-edit",function(){this.addAction({click:"updatePreview"},function(){var e=$("#layoutPreviewForm");e.find('input[name="outerHTML"]').val($("#templateOuterHTML").val());e.submit()});this.addAction({click:"saveOuterHTML"},function(){$("#gridTemplateForm").submit()})});AGN.Lib.Controller.new("template-styles",function(){function e(){var e=$("form#gridTemplateForm");var o=$("form#layoutPreviewForm");var t=e.find('input[name^="styles."]');$.each(t,function(e,t){var i=$(t);var n=i.attr("name");var r=o.find('input[name="'+n+'"]');r.val(i.val())});o.submit()}this.addAction({submission:"updatePreview"},function(){e()});this.addAction({click:"updateLayoutPreview"},function(){e()});this.addAction({click:"saveLayoutStyles"},function(){$("form#gridTemplateForm").submit()})});AGN.Lib.Controller.new("trackable-link-list",function(){var e;var t;AGN.Opt.DefaultExtensions={};var n=new AGN.Lib.TrackableLinkExtensions;var r;this.addDomInitializer("trackable-link-list",function(){t=this.config.KEEP_UNCHANGED;r=this.config.SAVE_ALL_URL;AGN.Opt.DefaultExtensions=this.config.defaultExtensions;if(this.config.scrollToLinkId){i($("#link-"+this.config.scrollToLinkId))}});this.addDomInitializer("trackable-link-extensions",function(){n.load(this.config.extensions,s())});AGN.Lib.Action.new({change:"[id^=link-], #tile-trackableLinkEditAll"},function(){e=this.el.attr("id")});this.addAction({scrollTo:"scroll-to"},function(){if(e){i($(this.el).find("#"+e))}});this.addAction({click:"save-bulk-actions",enterdown:"description-enterdown, bulkActionExtensionsEnterdown"},function(){var i=AGN.Lib.Form.get($("#trackableLinkForm"));var e=$("#bulkActionsForm").serializeFormDataObject();i._data={};$.each(e,function(e,t){i.setValue(e,t)});i.setValue("modifyAllLinksExtensions",false);o(i);i.setActionOnce(r);i.submit();AGN.Lib.Modal.getWrapper(this.el).modal("hide")});this.addAction({click:"save",enterdown:"settingsExtensionsEnterdown"},function(){this.event.preventDefault();var e=AGN.Lib.Form.get($("#trackableLinkForm"));e._data={};e.setValue("modifyBulkLinksExtensions",false);a(e);o(e);e.setActionOnce(r);e.submit()});function i(e){if(e&&e.length>0){var t=e.closest('[data-sizing="scroll"]');if(t.length>0){var i=t.find(":first-child").offset().top;var n=e.offset().top;t.scrollTop(0);t.scrollTop(n-i)}}}function o(i){_.each(n.collect(),function(e,t){i.setValue("extensions["+t+"].name",e.name);i.setValue("extensions["+t+"].value",e.value)})}function a(e){e.setValue("bulkUsage",t);e.setValue("bulkAction",t);e.setValue("bulkDeepTracking",t);e.setValue("bulkStatic",t)}function s(){return l()?$("#bulkActionExtensions tbody"):$("#settingsExtensions tbody")}function l(){return $(".modal").is(":visible")}});AGN.Lib.Controller.new("trackable-link",function(){var e=this;var t=new AGN.Lib.TrackableLinkExtensions;this.addDomInitializer("trackable-link-extensions",function(){t.load(this.config.extensions,$("#extensions tbody"))});this.addAction({click:"save"},function(){this.event.preventDefault();var e=AGN.Lib.Form.get($("#trackableLinkForm"));i(e);e.submit("static")});function i(i){_.each(t.collect(),function(e,t){i.setValue("extensions["+t+"].name",e.name);i.setValue("extensions["+t+"].value",e.value)})}this.addAction({change:"link-details-trackable"},function(){e.runInitializer("trackableAction")});this.addInitializer("trackableAction",function(e){var t=$('[data-action="link-details-trackable"] :selected');var i=$("#linkAction");i.prop("disabled",i.prop("disabled")||t.val()==0)})});AGN.Lib.Controller.new("user|groups-permissions",function(){var e;this.addDomInitializer("user|groups-permissions",function(){e=this.config.permissionCategories.map(function(e){return e.subCategories}).flatMap(function(e){return Object.values(e)}).flatMap(function(e){return e.permissions})});this.addAction({click:"reset-filter"},function(){$("#permission-filter").val("").trigger("change");l();u()});function t(t){e.filter(function(e){return i(e,t)}).forEach(function(e){$('[id="'+e.name+'"]').closest("li").show()})}this.addAction({click:"apply-filter"},function(){var e=$("#permission-filter").val();if(!e.length){return}c();t(e);s()});function i(t,e){var i=false;e.forEach(function(e){if(n(e)(t)){i=true}});return i}function n(e){switch(e){case"granted":return function(e){return e.granted};case"grantedForUser":return function(e){return e.granted&&!e.showInfoTooltip};case"grantedByGroup":return function(e){return e.showInfoTooltip};case"grantable":return function(e){return!e.granted&&e.changeable};case"notGrantable":return function(e){return!e.granted&&!e.changeable};case"new":return function(e){return e.recent};default:return function(){return true}}}function r(){$(".sub-category-header").each(function(){return $(this).show()})}function o(){a().each(function(){this.show()})}function a(){return $(".permission-categories-tile").map(function(){return $(this)})}function s(){l();a().each(function(){this.toggle(this.has(".list-group-item:visible").length>0)});$(".sub-category-header").each(function(){return $(this).toggle($(this).next("div").find("li:visible").length>0)})}function l(){o();r()}function u(){$(".list-group-item").each(function(){$(this).show()})}function c(){$(".list-group-item").each(function(){$(this).hide()})}});AGN.Lib.Controller.new("userform-view",function(){var u=AGN.Lib.FormBuilder.FormBuilder;var c=AGN.Lib.Editor;var a=AGN.Lib.Confirm;var i;var n=0;this.addDomInitializer("userform-view",function(){var e=this.config;i=e.actionURLPattern;n=e.formId;$("#userFormForm").dirty()});this.addAction({click:"activate-and-test"},function(){const t=this.el;const i=t.attr("href");a.createFromTemplate({},"userform-activate-and-test").done(function(){$.post(AGN.url("/webform/"+n+"/activate.action")).done(function(e){AGN.Lib.JsonMessages(e.popups,true);if(e.success){$("#is-active-switch").prop("checked",true);t.removeAttr("data-action");window.open(i,"_blank")}})})});this.addAction({change:"change-intro-action"},function(){var e=$("#startActionLink");var t=this.el.val();o(e,t)});this.addAction({change:"change-final-action"},function(){var e=$("#finalActionLink");var t=this.el.val();o(e,t)});this.addAction({click:"check-velocity-script"},function(){var e=$(this.el);var t=AGN.Lib.Helpers.objFromString(e.data("action-options"));r(t.type)});this.addAction({click:"saveUserForm"},function(){var e=l("successFormBuilder");var t=l("errorFormBuilder");var i=e&&s("successTemplate");var n=t&&s("errorTemplate");if(i||n){a.createFromTemplate({needSuccessCodeChoose:i,needErrorCodeChoose:n},"warning-save-different-tabs")}else{var r=e?"FORM_BUILDER":"HTML";var o=t?"FORM_BUILDER":"HTML";d(r,o)}});this.addAction({click:"save-specific-code-mode"},function(){var e=$("#choose-code-format-modal-form");var t=e.find('[name="success_template_mode"]:checked').val();var i=e.find('[name="error_template_mode"]:checked').val();d(t,i)});this.addAction({change:"formTestRecipient"},function(){var e=$("#formTestLink");var t=$("#formTestRecipient");e.attr("href",t.val())});function s(e){var t=CKEDITOR.instances[e];if(t){t.updateElement()}return $("#userFormForm").dirty("isFieldDirty",$("#"+e))}function l(e){if(u.isCreated("#"+e)){return u.get("#"+e).isChanged()}return false}function d(e,t){var i=AGN.Lib.Form.get($("form#userFormForm"));if(u.isCreated("#successFormBuilder")){var n=u.get("#successFormBuilder");if(e==="FORM_BUILDER"){c.get($("#successTemplate")).val(n.generateHtml())}var r=n.getJson();i.setValueOnce("successSettings.formBuilderJson",r);var o=$("#successFormBuilder").find("input:enabled,select:enabled");o.prop("disabled",true)}if(u.isCreated("#errorFormBuilder")){var a=u.get("#errorFormBuilder");if(t==="FORM_BUILDER"){c.get($("#errorTemplate")).val(a.generateHtml())}var s=a.getJson();i.setValueOnce("errorSettings.formBuilderJson",s);var l=$("#errorFormBuilder").find("input:enabled,select:enabled");l.prop("disabled",true)}i.submit();if(o){o.prop("disabled",false)}if(l){l.prop("disabled",false)}}function r(e){var i=AGN.Lib.Editor.get($("#"+e+"Template")).val();if(i.match(/#(?:set|include|macro|parse|if|foreach)/gi)){AGN.Lib.Messages(t("defaults.error"),t("userform.error.velocity_not_allowed"),"alert");var n=$('[data-toggle-tab="#tab-'+e+'-template-html"]');if(n){n.trigger("click")}}}function o(e,t){if(e.exists()){if(t>0){e.attr("href",i.replace(":action-ID:",t));e.removeClass("hidden")}else{e.attr("href","#");e.addClass("hidden")}}}});AGN.Lib.Controller.new("workflow-list",function(){var r=null;function o(){var e=$(".js-data-table-body");if(e.exists()){var t=e.data("_table");if(t&&t.api){return t.api}}return null}this.addDomInitializer("workflow-list",function(){r=this.config});function a(e,i){var n=$.Deferred();if(e&&e.length){var r=$.ajax(i,{method:"POST",traditional:true,data:{bulkIds:e}}).fail(function(){n.reject()});AGN.Lib.Confirm.request(r).then(n.resolve,n.reject)}else{n.reject();AGN.Lib.Messages(t("Error"),t("messages.error.nothing_selected"),"alert")}return n.promise()}this.addAction({click:"bulk-delete"},function(){var e=o();if(e){var t=e.getSelectedRows();var i=t.map(function(e){return e.id});a(i,r.urls.WORKFLOW_BULK_DELETE).done(function(){e.updateRowData({remove:t})})}});this.addAction({click:"bulk-deactivate"},function(){var e=o();if(e){var t=e.getSelectedRows();var i=e.getSelectedNodes();var n=t.map(function(e){return e.id});a(n,r.urls.WORKFLOW_BULK_DEACTIVATE).done(function(){i.forEach(function(e){e.setDataValue("status",{name:"inactive",messageKey:"default.status.inActive"})});e.refreshClientSideRowModel("filter");e.deselectAll()})}})});AGN.Lib.Controller.new("workflow-view",function(){var m=AGN.Lib.WM.Definitions,r=AGN.Lib.WM.Editor,o=AGN.Lib.WM.Node,f=AGN.Lib.WM.EditorsHelper,s=AGN.Lib.WM.MailingEditorHelper,a=AGN.Lib.WM.Dialogs,u=AGN.Lib.WM.MailingSelector,l=AGN.Lib.Confirm,p=AGN.Lib.Template,h=AGN.Lib.WM.Utils,c=AGN.Lib.Select,n=AGN.Lib.WM.DateTimeUtils,y=AGN.Lib.Form;var g=this;var b;if(!jsPlumb.Connectors["FixedBezierConnector"]){jsPlumbUtil.extend(AGN.Opt.Components.JsPlumbFixedBezierConnector,jsPlumb.Connectors.AbstractConnector);jsPlumb.Connectors["FixedBezierConnector"]=AGN.Opt.Components.JsPlumbFixedBezierConnector}this.addDomInitializer("workflow-view",function(){var e=this.config;m.constants=e.constants;m.workflowId=e.workflowId;m.shortname=e.shortname;m.statisticUrl=e.statisticUrl;var t=e.icons.map(o.deserialize);var i=o.deserializeConnections(e.icons,o.toMap(t));if(b){b.recycle()}b=new r(e.isEditable!==false,e.isContextMenuEnabled!==false,e.isFootnotesEnabled===true);b.setOnInitialized(function(){b.batch(function(){t.forEach(function(e){b.add(e)});i.forEach(function(e){b.connect(e.source,e.target)})});b.updateNodeTitles();b.updateFootnotes();if(m.workflowId===0){m.intialSchema=b.serializeIcons()}});b.setMinimapEnabled(e.isMinimapEnabled!==false);var n=$("#slider");if(n.exists()){n.slider({min:m.MIN_ZOOM,max:m.MAX_ZOOM,value:m.DEFAULT_ZOOM,step:m.ZOOM_STEP,create:function(){var t=$(this).slider("instance");b.setZoom(m.DEFAULT_ZOOM);b.setOnZoom(function(e){t.value(e)})},slide:function(e,t){b.setZoom(t.value)}})}if(e.fitPdfPage===true){b.fitPdfPage()}window.status=e.initializerFinishStatus||""});this.addDomInitializer("mailing-data-transfer-modal",function(e){var i=e.find("input[data-mailing-param]");var n=e.find("#transferAllSettings");var r={};var o=[];i.on("change",function(){var e=$(this);var t=e.data("mailing-param");if(e.prop("checked")){r[t]=true}else{delete r[t]}o=Object.keys(r);n.prop("checked",o.length==i.length)});n.on("change",function(){var e=n.prop("checked");i.prop("checked",e);if(e){i.each(function(){r[$(this).data("mailing-param")]=true});o=Object.keys(r)}else{r={};o=[]}});this.addAction({click:"transfer-mailing-data"},function(){l.get(e).positive(o)})});this.addDomInitializer("own-workflow-expanding-modal",function(e){var t=e.find("#workflow-select");var i=e.find('input[name="copyContent"]');this.addAction({click:"expand-own-workflow"},function(){l.get(e).positive({workflowId:t.val(),copyContent:i.filter(":checked").val()=="true"})})});this.addDomInitializer("icon-comment-editor-initializer",function(){var e=f.registerEditor("icon-comment",{formName:"iconCommentForm",safeToSave:true,fillEditor:function(e){$("#iconComment").val(e.getComment())},saveEditor:function(){f.saveIconComment($("#iconComment").val());this.cancelEditor()},cancelEditor:function(){$("#icon-comment-editor").dialog("close");return false}});g.addAction({click:"icon-comment-editor-save"},function(){e.saveEditor()});g.addAction({click:"icon-comment-editor-cancel"},function(){e.cancelEditor()})});this.addDomInitializer("parameter-editor-initializer",function(){f.registerEditor("parameter",{formName:"parameterForm",getTitle:function(){return t("workflow.parameter")},fillEditor:function(e){var t=$('form[name="'+this.formName+'"]');c.get(t.find("select[name=value]")).setOptions(b.getParametersOptions(e));var i=e.getData();t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,i,"")},saveEditor:function(){return f.formToObject(this.formName)}});g.addAction({click:"parameter-editor-save"},function(){f.saveCurrentEditorWithUndo()})});this.addDomInitializer("deadline-editor-initializer",function(){var e=f.registerEditor("deadline",{panelIds:["fixedDeadlinePanel","delayDeadlinePanel"],timeUnitIds:["deadlineTimeUnitMinute","deadlineTimeUnitHour","deadlineTimeUnitDay","deadlineTimeUnitWeek","deadlineTimeUnitMonth"],formName:"deadlineForm",getDefaultDelayData:function(e){var t={};if(e===m.constants.deadlineTypeDelay&&this.isPrecededByImportIcon){t={timeUnit:m.constants.deadlineTimeUnitHour,delayValue:m.constants.defaultImportDelayLimit}}return t},getTitle:function(){return t("workflow.deadline.title")},fillEditor:function(e){var t=e.getData();$("#deadline-editor").find(".editor-error-messages").css("display","none");this.isPrecededByImportIcon=this.checkPrecededByImportIcon(e);var i=$('form[name="'+this.formName+'"]');i.submit(false);$('form[name="'+this.formName+'"] #deadlineDate').pickadate("picker").set("select",this.dateAsUTC(t.date||new Date));this.fillDelayData(i,t);$('form[name="'+this.formName+'"] #time').val(("0"+t.hour).slice(-2)+":"+("0"+t.minute).slice(-2))},fillDelayData:function(e,t){e.get(0).reset();var i=$('form[name="'+this.formName+'"] input[name="deadlineType"]:checked').val();var n=this.getDefaultDelayData(i);f.fillFormFromObject(this.formName,t,"",n);this.updateVisibility();var r=t.delayValue||n.delayValue;f.initSelectWithValueOrChooseFirst($('form[name="'+this.formName+'"] select[name="delayValue"]'),r)},saveEditor:function(){var e=f.formToObject(this.formName);var t=$('form[name="'+this.formName+'"] #time').val();e.date=$('form[name="'+this.formName+'"] #deadlineDate').pickadate("picker").get("select").obj;e.hour=t.substring(0,2);e.minute=t.substring(3,5);return e},updateVisibility:function(){var e=$('form[name="'+this.formName+'"]');var t=e.find('input[name="deadlineType"]:checked').val();if(this.checkPresentNodeOfType([m.NODE_TYPE_ACTION_BASED_MAILING,m.NODE_TYPE_DATE_BASED_MAILING])){e.find("input#typeFixedDeadline").parent().parent().parent().hide();e.find('input[value="'+m.constants.deadlineTypeDelay+'"]').prop("checked",true);t=m.constants.deadlineTypeDelay}else{e.find("input#typeFixedDeadline").parent().parent().parent().show()}if(t===m.constants.deadlineTypeDelay){this.switchPanelsVisibility("delayDeadlinePanel");this.switchTimeContainerVisibility(false);var i=e.find('select[name="timeUnit"]').val();switch(i){case m.constants.deadlineTimeUnitMinute:this.switchTimeUnitsVisibility("deadlineTimeUnitMinute");break;case m.constants.deadlineTimeUnitHour:this.switchTimeUnitsVisibility("deadlineTimeUnitHour");break;case m.constants.deadlineTimeUnitDay:this.switchTimeUnitsVisibility("deadlineTimeUnitDay");this.switchTimeContainerVisibility(true);$("#deadlineTimeHelp").removeAttr("style");break;case m.constants.deadlineTimeUnitWeek:this.switchTimeUnitsVisibility("deadlineTimeUnitWeek");break;case m.constants.deadlineTimeUnitMonth:this.switchTimeUnitsVisibility("deadlineTimeUnitMonth");break}e.find('input[name="useTime"]').css("display","inline")}else if(t===m.constants.deadlineTypeFixedDeadline){this.switchPanelsVisibility("fixedDeadlinePanel");this.switchTimeContainerVisibility(true);this.hideDiv("deadlineTimeHelp");e.find('input[name="useTime"]').css("display","none")}},switchPanelsVisibility:function(t){var i=this;this.panelIds.forEach(function(e){if(e!==t){i.hideDiv(e)}});this.showDiv(t)},switchTimeUnitsVisibility:function(t){var i=this;this.timeUnitIds.forEach(function(e){if(e!==t){i.hideDiv(e);$("#"+e+" select").removeAttr("name")}});this.showDiv(t);$("#"+t+" select").attr("name","delayValue")},switchTimeContainerVisibility:function(e){var t=this;if(e){t.showDiv("deadlineTimeContainer")}else{t.hideDiv("deadlineTimeContainer")}},hideAllItems:function(e){var t=this;e.forEach(function(e){t.hideDiv(e)})},validateEditor:function(){var e=true;var i=m.constants.defaultImportDelayLimit;if(this.isPrecededByImportIcon){var n=$('form[name="'+this.formName+'"]');var r=n.find('input[name="deadlineType"]:checked').val();if(r===m.constants.deadlineTypeDelay){var o=n.find('select[name="timeUnit"]').val();if(o===m.constants.deadlineTimeUnitMinute){e=false}else if(o===m.constants.deadlineTimeUnitHour){if($("#deadlineTimeUnitHour select").val()<i){e=false}}}}if(e){f.saveCurrentEditorWithUndo()}else{var a=$("#deadline-editor").find(".editor-error-messages");a.html(t("error.workflow.deadlineIsTooShortForImport",i));a.css("display","block")}},onTimeChanged:function(){var e=$('form[name="'+this.formName+'"]');var t=e.find('input[name="deadlineType"]:checked').val();var i=e.find('select[name="timeUnit"]').val();if(t==m.constants.deadlineTypeDelay&&i==m.constants.deadlineTimeUnitDay){e.find('input[name="useTime"]').prop("checked",true)}},hideDiv:function(e){$('form[name="'+this.formName+'"] #'+e).css("display","none")},showDiv:function(e){$('form[name="'+this.formName+'"] #'+e).css("display","block")},dateAsUTC:function(e){if(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}else{return null}},checkPresentNodeOfType:function(e){return f.getNodesByTypes(e).length>0},checkPrecededByImportIcon:function(e){return f.getNodesByIncomingConnections(e).some(function(e){return m.NODE_TYPE_IMPORT==e.getType()})}});g.addAction({change:"deadline-editor-update"},function(){e.updateVisibility()});g.addAction({change:"deadline-editor-time-change"},function(){e.onTimeChanged()});g.addAction({click:"deadline-editor-save"},function(){e.validateEditor()})});this.addDomInitializer("archive-editor-initializer",function(){var e=f.registerEditor("archive",{formName:"archiveForm",safeToSave:true,getTitle:function(){return t("workflow.mailing.archive")},createNewArchive:function(){f.processForward(m.constants.forwardArchiveCreate,"#settings_general_campaign",d)},fillEditor:function(e){var t=$('form[name="'+this.formName+'"]');var i=e.getData();t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,i,"")},saveEditor:function(){return f.formToObject(this.formName)}});g.addAction({click:"archive-editor-new"},function(){e.createNewArchive()})});this.addDomInitializer("recipient-editor-initializer",function(){var n=m.constants.isAltgExtended;var i=f.registerEditor("recipient",{formName:"recipientForm",targetSelector:"#recipientTargetSelect",altgSelector:"#recipientAltgSelect",safeToSave:true,getTargetFieldSelect:function(){return new c($(this.targetSelector).select2({formatSelection:function(e){if($(e.element).data("editable")){return'<a href="#" class="btn-link-light" '+'data-action="recipient-editor-target-edit" data-target-id="'+e.id+'">'+e.text+"</a>"}else{return e.text}}}))},getAltgFieldSelect:function(){return new c($(this.altgSelector).select2({formatSelection:function(e){return e.text}}))},createNewTarget:function(){f.processForward(m.constants.forwardTargetGroupCreate,this.targetSelector,d)},editTarget:function(e){$("#forwardTargetItemId").val(e);f.processForward(m.constants.forwardTargetGroupEdit,this.targetSelector,d)},getTitle:function(){return t("workflow.recipient")},fillEditor:function(e){var t=e.getData();if(!n){if(m.constants.accessLimitTargetId>0){t.targets=_.union([m.constants.accessLimitTargetId],t.targets);t.targetsOption="ALL_TARGETS_REQUIRED"}}var i=$('form[name="'+this.formName+'"]');i.submit(false);i.get(0).reset();f.fillFormFromObject(this.formName,t,"");this.getTargetFieldSelect().selectValue(t.targets);if(n){this.getAltgFieldSelect().selectValue(t.altgs)}},saveEditor:function(){var e=f.formToObject(this.formName);e.targets=this.getTargetFieldSelect().getSelectedValue();if(n){e.altgs=this.getAltgFieldSelect().getSelectedValue()}return e}});g.addAction({click:"recipient-editor-create-new-target"},function(){i.createNewTarget()});g.addAction({click:"recipient-editor-save"},function(){if(n){var e=AGN.Lib.Form.get($("#"+i.formName));if(e.valid({})){e.cleanErrors();f.saveCurrentEditorWithUndo()}else{e.handleErrors()}}else{f.saveCurrentEditorWithUndo()}});g.addAction({click:"recipient-editor-target-edit"},function(){i.editTarget(this.el.data("target-id"))})});this.addDomInitializer("export-editor-initializer",function(){var o=this.config;var e=f.registerEditor("export",{formName:"exportForm",safeToSave:true,getTitle:function(){return t("auto_export")},createNewAutoExport:function(){f.processForward(m.constants.forwardAutoExportCreate,'form[name="'+this.formName+'"] select[name=importexportId]',d)},editAutoExport:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.val();$("#forwardTargetItemId").val(t);f.processForward(m.constants.forwardAutoExportEdit,'form[name="'+this.formName+'"] select[name=importexportId]',d)},fillEditor:function(e){var i=$("#export-editor .editor-error-messages");var n=$('form[name="'+this.formName+'"]');var r=e.getData();n.submit(false);n.get(0).reset();f.fillFormFromObject(this.formName,r,"");this.addLinks();if(o.isDisabled=="true"){i.html(t("error.workflow.autoExportPermission"));i.css("display","block")}else{i.css("display","none")}},validateEditor:function(){var i=$("#export-editor .editor-error-messages");var e=$('form[name="'+this.formName+'"] select[name=importexportId]');if(e.val()>0){$.ajax({type:"POST",url:AGN.url("/workflow/validateDependency.action"),data:{workflowId:m.workflowId||0,type:m.DEPENDENCY_TYPE_AUTO_EXPORT,entityId:e.val()}}).done(function(e){if(e.valid===true){f.saveCurrentEditorWithUndo()}else{i.html(t("error.workflow.autoExportInUse"));i.css("display","block")}}).fail(function(){i.html(t("Error"));i.css("display","block")})}else{i.html(t("error.workflow.noExport"));i.css("display","block")}},onChange:function(){this.addLinks()},addLinks:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.val();if(t>0){$("#export-editor #editAutoExportLink").css("display","block");$("#export-editor #createAutoExportLink").css("display","none")}else{$("#export-editor #createAutoExportLink").css("display","block");$("#export-editor #editAutoExportLink").css("display","none")}},saveEditor:function(){return f.formToObject(this.formName)},isSetFilledAllowed:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.find(":selected");return!(e.val()==0||t.data("is-available")!=true)}});g.addAction({change:"export-editor-change"},function(){e.onChange()});g.addAction({click:"export-editor-new"},function(){e.createNewAutoExport()});g.addAction({click:"export-editor-autoexport"},function(){e.editAutoExport()});g.addAction({click:"export-editor-save"},function(){e.validateEditor()})});this.addDomInitializer("import-editor-initializer",function(){var o=this.config;var e=f.registerEditor("import",{formName:"importForm",safeToSave:true,getTitle:function(){return t("auto_import")},createNewAutoImport:function(){f.processForward(m.constants.forwardAutoImportCreate,"#importexportId",d)},editAutoImport:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.val();$("#forwardTargetItemId").val(t);f.processForward(m.constants.forwardAutoImportEdit,'form[name="'+this.formName+'"] select[name=importexportId]',d)},fillEditor:function(e){var i=$("#import-editor .editor-error-messages");var n=$('form[name="'+this.formName+'"]');var r=e.getData();n.submit(false);n.get(0).reset();f.fillFormFromObject(this.formName,r,"");this.addLinks();if(o.isDisabled=="true"){i.html(t("error.workflow.autoImportPermission"));i.css("display","block")}else{i.css("display","none")}},validateEditor:function(){var i=$("#import-editor .editor-error-messages");var e=$('form[name="'+this.formName+'"] select[name=importexportId]');if(e.val()>0){$.ajax({type:"POST",url:AGN.url("/workflow/validateDependency.action"),data:{workflowId:m.workflowId||0,type:m.DEPENDENCY_TYPE_AUTO_IMPORT,entityId:e.val()}}).done(function(e){if(e.valid===true){f.saveCurrentEditorWithUndo()}else{i.html(t("error.workflow.autoImportInUse"));i.css("display","block")}}).fail(function(){i.html(t("Error"));i.css("display","block")})}else{i.html(t("error.workflow.noImport"));i.css("display","block")}},onChange:function(){this.addLinks()},addLinks:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.val();if(t>0){$("#import-editor #editAutoImportLink").css("display","block");$("#import-editor #createAutoImportLink").css("display","none")}else{$("#import-editor #createAutoImportLink").css("display","block");$("#import-editor #editAutoImportLink").css("display","none")}},saveEditor:function(){return f.formToObject(this.formName)},isSetFilledAllowed:function(){var e=$('form[name="'+this.formName+'"] select[name=importexportId]');var t=e.find(":selected");return!(e.val()==0||t.data("is-available")!=true)}});g.addAction({change:"import-editor-change"},function(){e.onChange()});g.addAction({click:"import-editor-new"},function(){e.createNewAutoImport()});g.addAction({click:"import-editor-update"},function(){e.editAutoImport()});g.addAction({click:"import-editor-save"},function(){e.validateEditor()})});this.addDomInitializer("start-editor-initializer",function(){var c=this.config;var d=new u(c.form,c.container,c.selectedName,c.noMailingOption);var i=c.profileFields;var v=c.isBigData;var e={rulesNumber:0,isStartEditor:false,timePattern:/^(\d{2}):(\d{2})$/,getTitle:function(){return this.isStartEditor?t("workflow.start.title"):t("workflow.stop.title")},getStartStopDate:function(e){e=e||f.formToObject("startForm");var t=$('form[name="startForm"]');var i=null;if(this.isStartEditor){switch(e.startType){case m.constants.startTypeDate:i=t.find("#startDate").pickadate("picker");break;case m.constants.startTypeEvent:i=t.find("#executionDate").pickadate("picker");break}}else if(e.endType==m.constants.endTypeDate){i=t.find("#startDate").pickadate("picker")}if(i){var n=i.get("select");if(n){return n.obj}}return null},generateReminderComment:function(){var e=$('#workflowForm input[name="workflow.shortname"]').val();var i=n.getDateStr(this.getStartStopDate(),c.localeDatePattern);return(this.isStartEditor?t("workflow.start.reminder_text"):t("workflow.stop.reminder_text")).replace(/:campaignName/g,e).replace(/:startDate/g,i).replace(/:endDate/g,i)},fillEditor:function(e){var i=e.getData();var n=e.getType();this.isStartEditor=n=="start";const r=this.isStartEditor&&(e.data.startType===m.constants.startTypeEvent||!b.isAutoOptimizationWorkflow(e));this.updateEditorType(this.isStartEditor,r);var o=$('form[name="startForm"]');o.submit(false);o.find(".rule-row").each(function(){$(this).remove()});o.find("#remindCalendarDateTitle").text(this.isStartEditor?t("workflow.start.start_date"):t("workflow.stop.end_date"));if(i.rules!=undefined){for(var a=0;a<i.rules.length;a++){var s=i.rules[a];this.createRuleRow(a,s)}this.rulesNumber=i.rules.length}o.get(0).reset();i.adminTimezone=c.adminTimezone;i.sendReminder=i.scheduleReminder;f.fillFormFromObject("startForm",i,"");d.setMailingId(i.mailingId);d.cleanOptions(1);var l=new Date;o.find("#startDate").pickadate("picker").set("select",this.dateAsUTC(i.date!=undefined?i.date:l));o.find("#executionDate").pickadate("picker").set("select",this.dateAsUTC(i.date!=undefined?i.date:l));o.find("#remindDate").pickadate("picker").set("select",this.dateAsUTC(i.remindDate!=undefined?i.remindDate:l));if(i.date!=undefined){o.find("#startTime").val(this.formatTime(i.hour,i.minute));o.find("#remindTime").val(this.formatTime(i.remindHour,i.remindMinute))}else{this.setCurrentTime()}this.updateChainFieldsVisibility();this.updateVisibility();this.updateOperatorsAvailability();if(i.startType==m.constants.startTypeEvent&&i.event==m.constants.startEventReaction&&i.reaction==m.constants.reactionClickedLink&&i.mailingId!=0&&i.mailingId!=null){this.onMailingSelectChange(i.mailingId,i.linkId)}if(!i.comment){o.find("#reminderComment").val(this.generateReminderComment())}var u;if(i.recipients!=""){u=2}else{u=1}$('#start-editor input[name="userType"][value='+u+"]").prop("checked",true).trigger("change");$("#start-editor .editor-error-messages").css("display","none");y.get(o).cleanErrors();if(!this.isStartEditor&&b.isAllLinkedFilledStartsHasDateType(e)){this.hideDiv("end-date-radio")}else{this.showDiv("end-date-radio")}},saveEditor:function(){var e=f.formToObject("startForm");e.date=this.getStartStopDate(e);if(e.date==null){e.date=new Date;e.date.setHours(0);e.date.setMinutes(0);e.date.setSeconds(0);e.date.setMilliseconds(0)}var t;var i=$('form[name="startForm"] #startTime').val();if(t=this.timePattern.exec(i)){e.hour=t[1];e.minute=t[2]}else{e.hour=0;e.minute=0}e.scheduleReminder=e.sendReminder;var n=$('form[name="startForm"] #remindTime').val();if(t=this.timePattern.exec(n)){e.remindHour=t[1];e.remindMinute=t[2]}else{e.remindHour=0;e.remindMinute=0}if($('input[name="remindSpecificDate"]:checked').val()=="true"){e.remindDate=$('form[name="startForm"] #remindDate').pickadate("picker").get("select").obj}else{e.remindDate=e.date;e.remindHour=0;e.remindMinute=0}if(e.rules==undefined){e.rules=[]}if(e.linkId==undefined||e.linkId==null){e.linkId=0}if(e.dateFieldOperator!=c.equelsOperatorCode){e.dateFieldOperator=c.equelsOperatorCode}if(e.userType==2){e.remindAdminId=0;e.recipients=$.trim(e.recipients).toLowerCase().split(/[,;\s\n\r]+/).filter(function(e){return!!e}).join(", ")}else{e.recipients=""}delete e.userType;return e},validateEditorInternal:function(d){var f=this;var p=true;var h=$("#start-editor .editor-error-messages");var g=$('form[name="startForm"]');var e=this.isStartEditor?g.find('input[name="startType"]:checked').val():g.find('input[name="endType"]:checked').val();if(this.isStartEditor&&e==m.constants.startTypeEvent){n();r()}if(this.isStartEditor&&e==m.constants.startTypeDate||!this.isStartEditor&&e==m.constants.endTypeDate){r()}if(p&&g.find("#sendReminder").is(":checked")){var i=g.find('input[name="userType"]:checked').val();if(i==2){o()}}return p;function n(){var e=g.find('select[name="event"]').val();switch(e){case m.constants.startEventDate:var i=g.find("#executionDate").pickadate("picker").get("select").obj;if(i){var n=g.find("#startTime").val();if(!f.timePattern.test(n)){p=false}}else{p=false}var r=g.find("#dateFieldValue");if(!$.trim(r.val())){p=false;if(d){h.html(t("error.workflow.startDateOmitted"));h.css("display","block")}}const s=g.find("#dateProfileField");if(!$.trim(s.val())){p=false;if(d){y.get(s).showFieldError("dateProfileField",t("fields.required.errors.missing"))}}break;case m.constants.startEventReaction:var o=g.find('select[name="reaction"]').val();switch(o){case m.constants.reactionClickedLink:const l=g.find('select[name="linkId"]').val();if(!l||parseInt(l,10)<=0){p=false;if(d){h.html(t("error.workflow.noLinkSelected"));h.css("display","block")}}case m.constants.reactionOpened:case m.constants.reactionClicked:const u=g.find('select[name="mailingId"]').val();if(parseInt(u,10)<=0){p=false;if(d){h.html(t("error.workflow.noMailing"));h.css("display","block")}}break;case m.constants.reactionChangeOfProfile:if(typeof v!="undefined"&&v==true){var a=g.find('select[name="profileField"]').val();if(!a){p=false}}const c=g.find("#startProfileField");if(!$.trim(c.val())){p=false;if(d){y.get(c).showFieldError("profileField",t("fields.required.errors.missing"))}}break;case m.constants.reactionWaitingForConfirm:case m.constants.reactionOptIn:case m.constants.reactionOptOut:break;default:p=false;break}break}}function r(){var e=g.find("#startDate").pickadate("picker").get("select").obj;if(e){var t=g.find("#startTime").val();if(!f.timePattern.test(t)){p=false}}else{p=false}}function o(){var e=$.trim(g.find('textarea[name="recipients"]').val()).split(/[,;\s\n\r]+/).filter(function(e){return!!e});if(!e.length){if(d){p=false;h.html(t("error.workflow.emptyRecipientList"));h.css("display","block")}}}},validateEditor:function(){if(this.validateEditorInternal(true)){f.saveCurrentEditorWithUndo()}},isSetFilledAllowed:function(){return this.validateEditorInternal(false)},setCurrentTime:function(){var t=this;$.ajax({type:"GET",url:AGN.url("/workflow/getCurrentAdminTime.action"),success:function(e){$('form[name="startForm"] #startTime').val(t.formatTime(e.hour,e.minute));$('form[name="startForm"] #remindTime').val(t.formatTime(e.remindHour,e.remindMinute))}})},updateEditorType:function(e,i){var n=$("#startStopType");n.empty();if(e){n.append(p.text("start-types",{showStartEventTab:i}));$("#eventReaction").html(t("workflow.start.reaction_based"));$("#eventDate").html(t("workflow.start.date_based"))}else{n.append(p.text("stop-types"));if(this.checkPresentNodeOfType([m.NODE_TYPE_ACTION_BASED_MAILING,m.NODE_TYPE_DATE_BASED_MAILING])){$("#endTypeActiomaticLabel").html(t("workflow.stop.open_end"))}else{$("#endTypeActiomaticLabel").html(t("workflow.stop.automatic_end"))}}},onRulesChanged:function(){var r=0;$('form[name="startForm"] #profileFieldAddedRules tr').each(function(){var e=$(this);var t=e.attr("id");var i=t.substring(5);var n=$("#"+t);n.find(".rule-field").attr("name",function(e,t){return t?t.replace(i,r+""):""});n.find(".delete-rule").attr("data-rule-index",function(e,t){return t==i?r:t});e.attr("id","rule_"+r);r++});this.updateChainFieldsVisibility()},updateChainFieldsVisibility:function(){if(this.rulesNumber>0){$('form[name="startForm"] [name="rules[0].chainOperator"]').css("visibility","hidden");$('form[name="startForm"] #newRule_chainOperator').css("visibility","visible")}else{$('form[name="startForm"] #newRule_chainOperator').css("visibility","hidden")}},updateOperatorsAvailability:function(){var e=$('form[name="startForm"] select[name="profileField"]').val();var t=i[e];$('form[name="startForm"] select.primary-operator').each(function(){var e=$(this);e.children("option").prop("disabled",function(){var e=$(this).data("types");if(e=="*"||!e){return false}return e.split(/[\s,]+/).indexOf(t)==-1});AGN.Lib.CoreInitializer.run("select",e);if(e.val()==null){f.initSelectWithFirstValue(e)}})},addRule:function(){var e=$('form[name="startForm"]');var t={chainOperator:e.find("#newRule_chainOperator").val(),parenthesisOpened:e.find("#newRule_parenthesisOpened").val(),primaryOperator:e.find("#newRule_primaryOperator").val(),primaryValue:e.find("#newRule_primaryValue").val(),parenthesisClosed:e.find("#newRule_parenthesisClosed").val()};this.createRuleRow(this.rulesNumber,t);f.fillFormFromObject("startForm",t,"rules["+this.rulesNumber+"].");this.rulesNumber++;if($("#newRule_primaryOperator").val()==m.constants.operatorIs){$("#newRule_primaryValue").parents("td").replaceWith(this.createSimpleNewRuleValueField())}this.updateChainFieldsVisibility();this.updateOperatorsAvailability();e.find("#profileFieldRuleAdd select").each(function(){f.initSelectWithFirstValue($(this))});e.find("#profileFieldRuleAdd input").each(function(){$(this).val("")})},removeRuleRow:function(e){$('form[name="startForm"] #rule_'+e).remove();this.rulesNumber--;this.onRulesChanged()},createRuleRow:function(e,i){var n=$('form[name="startForm"] #profileFieldAddedRules');var r=this.createSimpleRuleValueField(e);var o=h.arrayAsOptionsHtml(m.constants.operators);if(this.curProfileField&&this.curProfileField.toLowerCase()==m.GENDER_PROFILE_FIELD){r=this.createGenderSelect()}else if(i.primaryOperator==m.constants.operatorIs){r=this.createIsOperatorSelect()}n.append('<tr class="rule-row" id="rule_'+e+'">'+'<td><select name="rules['+e+'].chainOperator" class="rule-field">'+'<option value="'+m.constants.chainOperatorAnd+'">'+t("workflow.defaults.and")+"</option>"+'<option value="'+m.constants.chainOperatorOr+'">'+t("workflow.defaults.or")+"</option>"+"</select></td>"+'<td><select name="rules['+e+'].parenthesisOpened" class="parentheses-opened rule-field">'+'<option value="0">&nbsp</option>'+'<option value="1">(</option>'+"</select></td>"+'<td><select name="rules['+e+'].primaryOperator" class="primary-operator rule-field" data-action="start-rule-operator-change">'+o+"</select></td>"+r+'<td><select name="rules['+e+'].parenthesisClosed" class="parenthesis-closed rule-field">'+'<option value="0">&nbsp</option>'+'<option value="1">)</option>'+"</select></td>"+'<td><a class="mailing_delete delete-rule btn btn-regular btn-alert" href="#" data-action="start-editor-rule-remove" data-rule-index="'+e+'"><i class="icon icon-minus-circle"></i></a></td>'+"</tr>");this.addRuleProperties($("#rule_"+e+" .primary-value"),e);AGN.runAll(n)},onStartTypeChanged:function(){var e=this.isStartEditor?$('form[name="startForm"] input[name="startType"]:checked').val():$('form[name="startForm"] input[name="endType"]:checked').val();if(this.isStartEditor&&e==m.constants.startTypeDate||!this.isStartEditor&&e==m.constants.endTypeDate){this.toggleFormat();this.hideDiv("startEventPanel");this.showDiv("startDatePanel");this.showDiv("startIconTime");this.showDiv("startRemindAdmin")}else if(this.isStartEditor&&e==m.constants.startTypeEvent){this.hideDiv("startDatePanel");this.showDiv("startEventPanel");this.showDiv("startIconTime");this.showDiv("startRemindAdmin");this.onStartEventChanged()}else if(this.isStartEditor&&e==m.constants.startTypeOpen||!this.isStartEditor&&e==m.constants.endTypeAutomatic){this.hideDiv("startDatePanel");this.hideDiv("startEventPanel");this.hideDiv("startIconTime");this.hideDiv("startRemindAdmin")}},onStartEventChanged:function(){var e=$("#startEvent").val();if(e==m.constants.startEventReaction){this.toggleFormat();this.hideDiv("dateStartPanel");this.showDiv("reactionStartPanel");this.onExecutionChanged();this.onProfileFieldChanged()}else if(e==m.constants.startEventDate){this.toggleFormat();this.hideDiv("reactionStartPanel");this.showDiv("dateStartPanel");this.hideDiv("executionDateLabel");this.showDiv("firstExecutionDateLabel");$("#startIconDateFormat").insertAfter("#startIconDateFieldOperator");this.showDiv("startIconDateFormat")}},toggleFormat:function(){var e,t,i,n,r;return function(){i=i||$("select#startEvent");t=t||$("input#typeEvent");e=e||$("input#startTime");n=t.prop("checked");r=i.val()==m.constants.startEventDate;t.prop("checked")&&r?e.inputmask("h:00"):e.inputmask("h:s")}}(),onRuleModeChanged:function(){var e=$('input[name="useRules"]:checked').val();if(e=="false"){this.hideDiv("profileFieldRules")}else{this.showDiv("profileFieldRules")}},onProfileFieldChanged:function(){var e=$('form[name="startForm"] select[name="profileField"]').val();var t=i[e];if(t&&t.toLowerCase()==m.FIELD_TYPE_DATE){$("#startIconDateFormat").insertAfter("#reactionProfileField");this.showDiv("startIconDateFormat")}else{this.hideDiv("startIconDateFormat")}this.updateOperatorsAvailability()},getRuleIndex:function(e){return e.attr("id").substring(5)},onRuleOperatorChanged:function(e){if(this.curProfileField&&this.curProfileField.toLowerCase()==m.GENDER_PROFILE_FIELD){return}var t=e.closest("tr");var i=t.attr("id")?this.getRuleIndex(t):null;if(e.val()==m.constants.operatorIs){var n=$(this.createIsOperatorSelect());t.find(".primary-value").parents("td").replaceWith(n);AGN.Lib.CoreInitializer.run("select",n)}else if(t.find(".primary-value").hasClass("null-select")){var r;if(i==null){r=this.createSimpleNewRuleValueField()}else{r=this.createSimpleRuleValueField(i)}t.find(".primary-value").parents("td").replaceWith(r)}if(i==null){this.addNewRuleProperties(t.find(".primary-value"))}else{this.addRuleProperties(t.find(".primary-value"),i)}},createGenderSelect:function(){var e=h.mapAsOptionsHtml(m.constants.genderOptions);return'<td><select class="primary-value form-control">'+e+"</select></td>"},createIsOperatorSelect:function(){return'<td><select class="primary-value null-select form-control">'+'<option value="NULL">NULL</option>'+'<option value="NOT_NULL">NOT NULL</option>'+"</select></td>"},createSimpleRuleValueField:function(e){return'<td><input name="rules['+e+'].primaryValue" type="text" class="primary-value rule-field form-control"/></td>'},createSimpleNewRuleValueField:function(){return'<td><input id="newRule_primaryValue" type="text" class="primary-value form-control"/></td>'},addRuleProperties:function(e,t){e.filter("select, input").attr("name","rules["+t+"].primaryValue").addClass("rule-field")},addNewRuleProperties:function(e){e.filter("select, input").attr("id","newRule_primaryValue")},onExecutionChanged:function(){var e=$('input[name="executeOnce"]:checked').val();if(e=="false"){this.hideDiv("executionDateLabel");this.showDiv("firstExecutionDateLabel")}else{this.hideDiv("firstExecutionDateLabel");this.showDiv("executionDateLabel")}},onReactionChanged:function(){var e=$('form[name="startForm"] #startReaction').val();if(e==m.constants.reactionOpened||e==m.constants.reactionNotOpened||e==m.constants.reactionClicked||e==m.constants.reactionNotClicked||e==m.constants.reactionBought||e==m.constants.reactionNotBought||e==m.constants.reactionClickedLink){this.hideDiv("reactionStartProfile");this.showDiv("reactionStartMailing")}else if(e==m.constants.reactionChangeOfProfile){this.hideDiv("reactionStartMailing");this.showDiv("reactionStartProfile")}else{this.hideDiv("reactionStartMailing");this.hideDiv("reactionStartProfile")}if(e==m.constants.reactionClickedLink){this.showDiv("reactionStartMailingLink")}else{this.hideDiv("reactionStartMailingLink")}},onReminderChanged:function(){if($('input[name="sendReminder"]:checked').val()){$('form[name="startForm"]').find("#reminderComment").val(this.generateReminderComment());this.showDiv("reminderDetails")}else{this.hideDiv("reminderDetails")}return false},onScheduleReminderDateChanged:function(){if($('form[name="startForm"] input[name="remindSpecificDate"]:checked').val()=="true"){this.showDiv("dateTimePicker")}else{this.hideDiv("dateTimePicker")}return false},onMailingSelectChange:function(e,t){var i=$('form[name="startForm"] select[name="linkId"]');var n=parseInt(e,10);if(n>0){i.attr("readonly","readonly");$.ajax({type:"POST",url:AGN.url("/workflow/getMailingLinks.action"),data:{mailingId:n},success:function(e){i.empty();i.append($("<option></option>",{value:"",text:m.EMPTY_OPTION_PLACEHOLDER}));$.each(e,function(e,t){i.append($("<option></option>",{value:t.id,text:t.url}))});i.removeAttr("readonly");if(t!=null&&t!=undefined){i.val(t);f.initSelectWithValueOrChooseFirst(i,t)}else{f.initSelectWithFirstValue(i)}}})}else{i.empty()}},updateVisibility:function(){this.onStartTypeChanged();this.onStartEventChanged();this.onReactionChanged();this.onRuleModeChanged();this.onExecutionChanged();this.onReminderChanged();this.onScheduleReminderDateChanged()},hideDiv:function(e){$('form[name="startForm"] #'+e).css("display","none")},showDiv:function(e){$('form[name="startForm"] #'+e).css("display","")},dateAsUTC:function(e){if(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}else{return null}},formatTime:function(e,t){var i=0;var n=0;e=parseInt(e,10);if(e>=0){i=e}t=parseInt(t,10);if(t>=0){n=t}return(i<10?"0"+i:i)+":"+(n<10?"0"+n:n)},checkPresentNodeOfType:function(e){return f.getNodesByTypes(e).length>0}};f.registerEditor("start",e);f.registerEditor("stop",e);g.addAction({change:"start-editor-execution-changed"},function(){e.onExecutionChanged()});g.addAction({change:"start-editor-event-changed"},function(){e.onStartEventChanged()});g.addAction({change:"start-editor-type-changed"},function(){e.onStartTypeChanged()});g.addAction({change:"start-editor-rule-changed"},function(){e.onRuleModeChanged()});g.addAction({change:"start-editor-reaction-changed"},function(){e.onReactionChanged()});g.addAction({change:"start-editor-profile-field-changed"},function(){e.onProfileFieldChanged()});g.addAction({click:"start-editor-add-rule"},function(){e.addRule()});g.addAction({click:"start-editor-reminder-changed"},function(){e.onReminderChanged()});g.addAction({click:"start-editor-schedule-reminder-date-changed"},function(){e.onScheduleReminderDateChanged()});g.addAction({click:"start-editor-validate"},function(){e.validateEditor()});g.addAction({click:"start-editor-mailing-sort-date"},function(){d.onMailingSortClick("date")});g.addAction({change:"start-editor-mailing-select"},function(){e.onMailingSelectChange(this.el.val())});g.addAction({click:"start-editor-mailing-sort-shortname"},function(){d.onMailingSortClick("shortname")})});this.addDomInitializer("decision-editor-initializer",function(){var d=this.config;var n=d.profileFields;var s=new u(d.form,d.container,d.selectName,d.noMailingOption);var l;var e=f.registerEditor("decision",{rulesNumber:0,rulePrefix:"decision_",prevProfileField:"",curProfileField:"",getTitle:function(){return t("workflow.decision")},fillEditor:function(e){var t=$('form[name="decisionForm"]');l=0;var i=e.getData();t.submit(false);t.find(".rule-row").each(function(){$(this).remove()});this.curProfileField=i.profileField;this.possibleToUseAutoOptimization=b.isAutoOptimizationDecisionAllowed(e);if(i.rules!=undefined){for(var n=0;n<i.rules.length;n++){var r=i.rules[n];this.createRuleRow(n,r)}this.rulesNumber=i.rules.length}t.get(0).reset();if(i.profileField){i.profileField=i.profileField.toLowerCase()}f.fillFormFromObject("decisionForm",i,"");s.setMailingId(i.mailingId);s.cleanOptions(1);if(i.decisionDate==undefined){i.decisionDate=new Date}var o=t.find("#decisionDate");var a=t.find("#decisionTime");if(this.checkPresentNodeOfType([m.NODE_TYPE_ACTION_BASED_MAILING,m.NODE_TYPE_DATE_BASED_MAILING])){o.parent().parent().parent().parent().hide();a.parent().parent().parent().parent().hide()}else{o.parent().parent().parent().parent().show();a.parent().parent().parent().parent().show();o.pickadate("picker").set("select",this.dateAsUTC(i.decisionDate));a.val(("0"+i.decisionDate.getHours()).slice(-2)+":"+("0"+i.decisionDate.getMinutes()).slice(-2))}this.updateChainFieldsVisibility();this.updateVisibility();this.updateDateFormatVisibility();this.updateOperatorsAvailability();if(i.decisionType==m.constants.decisionTypeDecision&&i.decisionCriteria==m.constants.decisionReaction&&i.reaction==m.constants.reactionClickedLink&&(i.mailingId!=0&&i.mailingId!=null)){this.onMailingSelectChange(i.mailingId,i.linkId)}else{f.resetSelect(t.find('select[name="linkId"]'))}$("#decision-editor .editor-error-messages").css("display","none");y.get(t).cleanErrors()},saveEditor:function(){var e=f.formToObject("decisionForm");if(e.decisionCriteria==m.constants.decisionProfileField&&l!=0){e.mailingId=l}l=0;if(e.rules==undefined){e.rules=[]}if(!e.threshold){e.threshold=""}if(this.checkPresentNodeOfType([m.NODE_TYPE_ACTION_BASED_MAILING,m.NODE_TYPE_DATE_BASED_MAILING])){e.decisionDate=null}else{var t=$('form[name="decisionForm"]');e.decisionDate=t.find("#decisionDate").pickadate("picker").get("select").obj;var i=t.find("#decisionTime").val();e.decisionDate.setHours(i.substring(0,2));e.decisionDate.setMinutes(i.substring(3,5))}return e},validateEditor:function(){var e=$('form[name="decisionForm"]');var i=$("#decision-editor .editor-error-messages");var n=e.find('input[name="decisionType"]:checked').val();var r=$("#decisionCriteria").val();var o=e.find('select[name="mailingId"]').val();var a=e.find('select[name="linkId"]').val();var s=e.find('select[name="reaction"]').val();var l=e.find('input[name="threshold"]').val();if(n==m.constants.decisionTypeDecision&&r==m.constants.decisionReaction&&o==0){i.html(t("error.workflow.noMailing"));i.css("display","block")}else if(n==m.constants.decisionTypeDecision&&r==m.constants.decisionReaction&&s==m.constants.reactionClickedLink&&(a==0||a==null)){i.html(t("error.workflow.noLinkSelected"));i.css("display","block")}else if(n==m.constants.decisionTypeDecision&&r==m.constants.decisionProfileField){if(d.isMailtrackingActive=="true"){const c=e.find("#decisionProfileField");if(!$.trim(c.val())){y.get(e).showFieldError("profileField",t("fields.required.errors.missing"))}else{f.saveCurrentEditorWithUndo()}}}else if(n==m.constants.decisionTypeAutoOptimization){if(l){var u=parseInt(l,10);if(u&&u>0){f.saveCurrentEditorWithUndo()}else{i.html(t("error.workflow.noValidThreshold"));i.css("display","block")}}else{f.saveCurrentEditorWithUndo()}}else{f.saveCurrentEditorWithUndo()}},onTypeChanged:function(){var e=$('form[name="decisionForm"] input[name="decisionType"]:checked').val();if(!this.possibleToUseAutoOptimization&&e===m.constants.decisionTypeAutoOptimization){const i=$("#decision-editor .editor-error-messages");i.html(t("error.workflow.autoOptimizationDecisionForbidden"));i.css("display","block");$('form[name="decisionForm"] input[name="decisionType"]').filter(':radio[value="'+m.constants.decisionTypeDecision+'"]').prop("checked",true);return}if(e==m.constants.decisionTypeDecision){this.hideDecisionFormDiv("autoOptimizationPanel");this.showDecisionFormDiv("decisionPanel")}else if(e==m.constants.decisionTypeAutoOptimization){this.hideDecisionFormDiv("decisionPanel");this.showDecisionFormDiv("autoOptimizationPanel")}this.updateVisibilityOfRuleMailingReceived()},onDecisionReactionChanged:function(){var e=$('form[name="decisionForm"] select[name="reaction"]').val();if(e==m.constants.reactionClickedLink){this.showDecisionFormDiv("reactionLinkPanel");var t=$('form[name="decisionForm"] select[name="mailingId"]').val();this.onMailingSelectChange(t,0)}else{this.hideDecisionFormDiv("reactionLinkPanel")}},onCriteriaChanged:function(){var e=$('form[name="decisionForm"] select[name="decisionCriteria"]').val();if(e==m.constants.decisionReaction){this.hideDecisionFormDiv("decisionProfileFieldPanel");this.showDecisionFormDiv("decisionReactionPanel")}else if(e==m.constants.decisionProfileField){this.hideDecisionFormDiv("decisionReactionPanel");this.showDecisionFormDiv("decisionProfileFieldPanel")}this.updateVisibilityOfRuleMailingReceived()},onMailingSelectChange:function(e,t){var i=$('form[name="decisionForm"] select[name="linkId"]');var n=parseInt(e,10);if(n>0){i.attr("readonly","readonly");$.ajax({type:"POST",url:AGN.url("/workflow/getMailingLinks.action"),data:{mailingId:n},success:function(e){i.empty();i.append($("<option></option>",{value:"",text:m.EMPTY_OPTION_PLACEHOLDER}));$.each(e,function(e,t){i.append($("<option></option>",{value:t.id,text:t.url}))});i.removeAttr("readonly");if(t!=null&&t!=undefined){i.val(t);f.initSelectWithValueOrChooseFirst(i,t)}else{f.initSelectWithFirstValue(i)}}})}else{i.empty()}},onRuleOperatorChanged:function(e){if(this.curProfileField&&this.curProfileField.toLowerCase()==m.GENDER_PROFILE_FIELD){return}var t=e.closest("tr");var i=t.attr("id")?this.getRuleIndex(t):null;if(e.val()==m.constants.operatorIs){var n=$(this.createIsOperatorSelect());t.find(".primary-value").parents("td").replaceWith(n);AGN.Lib.CoreInitializer.run("select",n)}else if(t.find(".primary-value").hasClass("null-select")){var r;if(i==null){r=this.createSimpleNewRuleValueField()}else{r=this.createSimpleRuleValueField(i)}t.find(".primary-value").parents("td").replaceWith(r)}if(i==null){this.addNewRuleProperties(t.find(".primary-value"))}else{this.addRuleProperties(t.find(".primary-value"),i)}},getRuleIndex:function(e){return e.attr("id").substring(14)},onProfileFieldChanged:function(){var e=$('form[name="decisionForm"]');var t=e.find('select[name="profileField"]').val();this.curProfileField=t;var i=this;if(t&&t.toLowerCase()==m.GENDER_PROFILE_FIELD){$("#decisionProfileFieldRules .primary-value").each(function(){$(this).parents("td").remove()});e.find(".rule-row").each(function(){var e=i.getRuleIndex($(this));$(this).find(".decision-rule-operator").parents("td").after(i.createGenderSelect());i.addRuleProperties($(this).find(".primary-value"),e)});$("#decision_newRule_primaryOperator").parents("td").after(this.createGenderSelect());this.addNewRuleProperties($("#decisionProfileFieldRuleAdd .primary-value"))}else if(this.prevProfileField&&this.prevProfileField.toLowerCase()==m.GENDER_PROFILE_FIELD){$("#decisionProfileFieldRules .primary-value").each(function(){$(this).parents("td").remove()});e.find(".rule-row").each(function(){var e=i.getRuleIndex($(this));if($(this).find(".decision-rule-operator").val()==m.constants.operatorIs){$(this).find(".primary-value").parents("td").remove();$(this).find("select").parents("td").after(i.createIsOperatorSelect());i.addRuleProperties($(this).find(".primary-value"),e)}else{$(this).find(".decision-rule-operator").parents("td").after(i.createSimpleRuleValueField(e))}});if($("#decision_newRule_primaryOperator").val()==m.constants.operatorIs){$("#decisionProfileFieldRuleAdd").find("select").parents("td").after(this.createIsOperatorSelect());this.addNewRuleProperties($("#decisionProfileFieldRuleAdd .primaryValue"))}else{$("#decision_newRule_primaryOperator").parents("td").after(this.createSimpleNewRuleValueField())}}this.updateDateFormatVisibility();this.updateOperatorsAvailability();this.prevProfileField=t},updateDateFormatVisibility:function(){var e=$('form[name="decisionForm"] select[name="profileField"]').val();var t=n[e];if(t&&t.toLowerCase()==m.FIELD_TYPE_DATE){this.showDecisionFormDiv("decisionDateFormat")}else{this.hideDecisionFormDiv("decisionDateFormat")}},updateOperatorsAvailability:function(){var e=$('form[name="decisionForm"]');var t=e.find('select[name="profileField"]').val();var i=n[t];e.find("select.decision-rule-operator").each(function(){var e=$(this);e.children("option").prop("disabled",function(){var e=$(this).data("types");if(t&&t.toLowerCase()==m.GENDER_PROFILE_FIELD){return this.text!="="&&this.text!="!="}if(e=="*"||!e){return false}return e.split(/[\s,]+/).indexOf(i)==-1});AGN.Lib.CoreInitializer.run("select",e);if(e.val()==null){f.initSelectWithFirstValue(e)}})},onRulesChanged:function(){var r=0;var o=this;$('form[name="decisionForm"] #decisionProfileFieldAddedRules .rule-row').each(function(){var e=$(this);var t=e.attr("id");var i=o.getRuleIndex(e);var n=$("#"+t);n.find(".rule-field").attr("name",function(e,t){return t?t.replace(i,r+""):""});n.find(".delete-rule").attr("data-rule-index",function(e,t){return t==i?r:t});e.attr("id","decision_rule_"+r);r++});this.updateChainFieldsVisibility()},updateChainFieldsVisibility:function(){var e=$('form[name="decisionForm"]');if(this.rulesNumber>0){e.find('[name="rules[0].chainOperator"]').css("visibility","hidden");e.find("#decision_newRule_chainOperator").css("visibility","visible")}else{e.find("#decision_newRule_chainOperator").css("visibility","hidden")}},addRule:function(){var e=$('form[name="decisionForm"]');var t={chainOperator:e.find("#decision_newRule_chainOperator").val(),parenthesisOpened:e.find("#decision_newRule_parenthesisOpened").val(),primaryOperator:e.find("#decision_newRule_primaryOperator").val(),primaryValue:e.find("#decision_newRule_primaryValue").val(),parenthesisClosed:e.find("#decision_newRule_parenthesisClosed").val()};this.createRuleRow(this.rulesNumber,t);f.fillFormFromObject("decisionForm",t,"rules["+this.rulesNumber+"].");this.rulesNumber++;if($("#decision_newRule_primaryOperator").val()==m.constants.operatorIs){$("#decision_newRule_primaryValue").parents("td").replaceWith(this.createSimpleNewRuleValueField())}this.updateChainFieldsVisibility();this.updateOperatorsAvailability();e.find("#decisionProfileFieldRuleAdd select").each(function(){f.initSelectWithFirstValue($(this))});e.find("#decisionProfileFieldRuleAdd input").each(function(){$(this).val("")})},removeRuleRow:function(e){$('form[name="decisionForm"] #decision_rule_'+e).remove();this.rulesNumber--;this.onRulesChanged()},createRuleRow:function(e,i){var n=$('form[name="decisionForm"]');var r=this.createSimpleRuleValueField(e);var o=h.arrayAsOptionsHtml(m.constants.operators);if(this.curProfileField&&this.curProfileField.toLowerCase()==m.GENDER_PROFILE_FIELD){r=this.createGenderSelect()}else if(i.primaryOperator==m.constants.operatorIs){r=this.createIsOperatorSelect()}n.find("#decisionProfileFieldAddedRules").append('<tr class="rule-row" id="decision_rule_'+e+'">'+'<td><select name="rules['+e+'].chainOperator" class="rule-field">'+'<option value="'+m.constants.chainOperatorAnd+'">'+t("workflow.defaults.and")+"</option>"+'<option value="'+m.constants.chainOperatorOr+'">'+t("workflow.defaults.or")+"</option>"+"</select></td>"+'<td><select name="rules['+e+'].parenthesisOpened" class="parentheses-opened rule-field">'+'<option value="0">&nbsp</option>'+'<option value="1">(</option>'+"</select></td>"+'<td><select name="rules['+e+'].primaryOperator" class="decision-rule-operator rule-field" data-action="decision-rule-operator-change">'+o+"</select></td>"+r+'<td><select name="rules['+e+'].parenthesisClosed" class="parenthesis-closed rule-field">'+'<option value="0">&nbsp</option>'+'<option value="1">)</option>'+"</select></td>"+'<td><a class="mailing_delete delete-rule btn btn-regular btn-alert" href="#" data-action="decision-editor-rule-remove" data-rule-index="'+e+'"><i class="icon icon-minus-circle"></i></a></td>'+"</tr>");this.addRuleProperties($("#decision_rule_"+e+" .primary-value"),e);AGN.runAll(n.find("#decisionProfileFieldAddedRules"))},createGenderSelect:function(){var e=h.mapAsOptionsHtml(m.constants.genderOptions);return'<td><select class="primary-value form-control">'+e+"</select></td>"},createIsOperatorSelect:function(){return'<td><select class="primary-value null-select form-control">'+'<option value="NULL">NULL</option>'+'<option value="NOT_NULL">NOT NULL</option>'+"</select></td>"},createSimpleRuleValueField:function(e){return'<td><input name="rules['+e+'].primaryValue" type="text" class="primary-value rule-field form-control"/></td>'},createSimpleNewRuleValueField:function(){return'<td><input id="decision_newRule_primaryValue" type="text" class="primary-value form-control"/></td>'},addRuleProperties:function(e,t){e.filter("select, input").attr("name","rules["+t+"].primaryValue").addClass("rule-field")},addNewRuleProperties:function(e){e.filter("select, input").attr("id","decision_newRule_primaryValue")},updateVisibility:function(){this.onTypeChanged();this.onDecisionReactionChanged();this.onCriteriaChanged()},hideDecisionFormDiv:function(e){$('form[name="decisionForm"] #'+e).css("display","none")},showDecisionFormDiv:function(e){$('form[name="decisionForm"] #'+e).css("display","block")},updateVisibilityOfRuleMailingReceived:function(){var e=$('form[name="decisionForm"] input[name="decisionType"]:checked').val();if(e==m.constants.decisionTypeAutoOptimization){this.hideDecisionFormDiv("ruleMailingReceivedWrapper")}else if(e==m.constants.decisionTypeDecision){var t=$('form[name="decisionForm"] select[name="decisionCriteria"]').val();if(t==m.constants.decisionReaction){this.hideDecisionFormDiv("ruleMailingReceivedWrapper")}else if(t==m.constants.decisionProfileField){this.hideDecisionFormDiv("ruleMailingReceivedWrapper");var i=this.showDecisionFormDiv;f.forEachPreviousNode(function(e){if(m.NODE_TYPES_MAILING.includes(e.getType())){var t=e.getData();l=t.mailingId;i("ruleMailingReceivedWrapper");return false}})}}},dateAsUTC:function(e){if(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}else{return null}},checkPresentNodeOfType:function(e){return f.getNodesByTypes(e).length>0}});g.addAction({click:"decision-editor-mailing-sort-shortname"},function(){s.onMailingSortClick("shortname")});g.addAction({click:"decision-editor-mailing-sort-date"},function(){s.onMailingSortClick("date")});g.addAction({change:"decision-editor-mailing-select"},function(){e.onMailingSelectChange(this.el.val())});g.addAction({change:"decision-rule-operator-change"},function(){e.onRuleOperatorChanged(this.el)});g.addAction({click:"decision-editor-rule-remove"},function(){e.removeRuleRow(this.el.data("rule-index"))});g.addAction({click:"decision-editor-rule-add"},function(){e.addRule()});g.addAction({change:"decision-editor-type-change"},function(){e.onTypeChanged()});g.addAction({change:"decision-editor-criteria-change"},function(){e.onCriteriaChanged()});g.addAction({change:"decision-editor-reaction-change"},function(){e.onDecisionReactionChanged()});g.addAction({click:"decision-editor-save"},function(){e.validateEditor()});g.addAction({change:"decision-editor-profile-field-change"},function(){e.onProfileFieldChanged()})});this.addDomInitializer("mailing-editor-initializer",function(){var e=this.config;var n=new s(e,d);var i=f.registerEditor("mailing",{formName:"mailingForm",safeToSave:true,getTitle:function(){return t("workflow.defaults.mailing")},fillEditor:function(e){var t=$('form[name="'+this.formName+'"]');var i=e.getData();t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,i,"");n.fillEditorBase(e);$("#mailing-editor .editor-error-messages").css("display","none")},createNewMailing:function(){n.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){n.editMailing(m.constants.forwardMailingEdit)},copyMailing:function(){n.copyMailing(m.constants.forwardMailingCopy)},saveEditor:function(){n.setNodeFields();n.disableInputs();return f.formToObject(this.formName)},saveWithCheckStatus:function(){var e=n.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,n)}}});g.addAction({click:"mailing-editor-save"},function(){n.validateEditor(i.saveWithCheckStatus)});g.addAction({click:"mailing-editor-base-close"},function(){n.closeOneMailinglistWarningDialog()});g.addAction({click:"mailing-editor-base-accept"},function(){n.acceptOneMailinglistPerCampaign()});g.addAction({click:"mailing-editor-base-sort-shortname"},function(){n.onMailingSortClick("shortname","shortname")});g.addAction({click:"mailing-editor-base-sort-data"},function(){var e=h.getConfigData(this.el);n.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"mailing-editor-base-status-change"},function(){n.onMailingsStatusChange(this.el.val())});g.addAction({change:"mailing-editor-base-select-change"},function(){n.onMailingSelectChange(this.el.val())});g.addAction({click:"mailing-editor-base-secure-cancel"},function(){n.cancelSecurityDialog()});g.addAction({click:"mailing-editor-base-toggle-settings"},function(){var e=h.getConfigData(this.el);n.toggleSendSettings(e.editorId)})});this.addDomInitializer("followup-mailing-editor-initializer",function(){var e=this.config.baseMailingData;var r=this.config.followupMailingData;e.$dropdown=$("#followup-m-editor");var o=new s(e,d);var a=new s(r,d);o.selectedFollowUpMailingId=0;o.findPreviousMailingIds=function(){var i=[];f.forEachPreviousNode(function(e){var t=e.getType();if(m.NODE_TYPES_MAILING.includes(t)&&m.NODE_TYPE_FOLLOWUP_MAILING!=t){i.push(e.getId())}});return i};o.getMailingsByWorkStatus=function(a,s,l,u){var c=this;var d=$(this.formNameJId+" "+this.selectNameJId);var e=_.uniq(this.findPreviousMailingIds()).toString();d.attr("readonly","readonly");$.ajax({type:"POST",url:AGN.url("/workflow/getMailingsByWorkStatus.action"),data:{mailingTypes:this.mailingTypesForLoading.join(","),status:a,sort:s,order:l,mailingId:this.selectedFollowUpMailingId,parentMailingId:$(this.formNameJId+" "+this.selectNameJId).val(),mailingStatus:"W",takeMailsForPeriod:true,mailingsInCampaign:e},success:function(e){d.html("");d.append('<option value="0">'+t("workflow.defaults.no_mailing")+"</option>");for(var i=0;i<e.length;i++){var n=e[i];var r="";var o="";if(n.WORK_STATUS=="mailing.status.sent"||n.WORK_STATUS=="mailing.status.norecipients"){r="style='color: #808080;'"}if(u==n.MAILING_ID){o="selected"}d.append("<option "+r+" value='"+n.MAILING_ID+"' status='"+n.WORK_STATUS+"' senddate='"+n.SENDDATE+"' "+o+">"+n.SHORTNAME+"</option>")}d.removeAttr("readonly");c.mailingsStatus=a;c.mailingsSort=s;c.mailingsOrder=l;d.val(c.mailingId);f.initSelectWithValueOrChooseFirst(d,c.mailingId)}})};a.onMailingSelectChange=function(e){o.selectedFollowUpMailingId=e;this.setSelectMailingOptions(e)};var i=f.registerEditor("followup_mailing",{formName:"followupMailingForm",safeToSave:false,getTitle:function(){return t("workflow.mailing.followup")},fillEditor:function(e){var i=$('form[name="'+this.formName+'"]');var n=$("#followup_mailing-editor .editor-error-messages");a.fillEditorBase(e);o.fillEditorBase(e);i.submit(false);i.get(0).reset();f.fillFormFromObject(this.formName,e.getData(),"");if(r.disableFollowup=="true"){n.html(t("error.workflow.followupPermission"));n.css("display","block");o.disableInputs()}else{n.css("display","none")}},createNewMailing:function(){var e=o.node.getData();e.baseMailingId=o.getSelectedMailingOption().val();e.decisionCriterion=o.getSelectedDecisionOption().val();a.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){var e=o.node.getData();e.baseMailingId=o.getSelectedMailingOption().val();e.decisionCriterion=o.getSelectedDecisionOption().val();a.editMailing(m.constants.forwardMailingEdit)},copyMailing:function(){var e=o.node.getData();e.baseMailingId=o.getSelectedMailingOption().val();e.decisionCriterion=o.getSelectedDecisionOption().val();a.copyMailing(m.constants.forwardMailingCopy)},saveEditor:function(){o.disableInputs();a.disableInputs();this.setNodeFields();return f.formToObject(this.formName)},saveWithCheckStatus:function(){var e=a.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,a)}},validateEditor:function(e){var i=$(o.formNameJId+" "+o.selectNameJId);var n=$(a.formNameJId+" "+a.selectNameJId);if(i.val()>0&&n.val()>0){if(e){e()}else{f.saveCurrentEditorWithUndo()}}else{var r=$("#followup_mailing-editor").find(".editor-error-messages");r.html(t("error.workflow.noMailing"));r.css("display","block")}},setNodeFields:function(){o.node.setFilled(parseInt(o.mailingId,10)>0&&parseInt(a.mailingId,10)>0)}});g.addAction({click:"followup-mailing-editor-base-sort-shortname"},function(){a.onMailingSortClick("shortname","shortname")});g.addAction({click:"followup-mailing-editor-base-sort-data"},function(){var e=h.getConfigData(this.el);a.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"followup-mailing-editor-base-status-change"},function(){a.onMailingsStatusChange(this.el.val())});g.addAction({change:"followup-mailing-editor-base-select-change"},function(){a.onMailingSelectChange(this.el.val())});g.addAction({click:"followup-base-mailing-editor-base-sort-shortname"},function(){o.onMailingSortClick("shortname","shortname")});g.addAction({click:"followup-base-mailing-editor-base-sort-data"},function(){var e=h.getConfigData(this.el);o.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"followup-base-mailing-editor-base-status-change"},function(){o.onMailingsStatusChange(this.el.val())});g.addAction({change:"followup-base-mailing-editor-base-select-change"},function(){o.onMailingSelectChange(this.el.val())});g.addAction({click:"followup-base-mailing-editor-base-secure-cancel"},function(){a.cancelSecurityDialog()});g.addAction({click:"followup-mailing-editor-base-secure-cancel"},function(){a.cancelSecurityDialog()});g.addAction({click:"followup-mailing-editor-save"},function(){i.validateEditor(i.saveWithCheckStatus)})});this.addDomInitializer("mailing_mediatype_sms-editor-initializer",function(){const e=this.config;const i=new s(e,d);const n=f.registerEditor("mailing_mediatype_sms",{formName:"smsMailingForm",safeToSave:false,getTitle:function(){return t("workflow.mailing.mediatype_sms")},fillEditor:function(e){const t=$('form[name="'+this.formName+'"]');t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,e.getData(),"");i.fillEditorBase(e);$("#mailing_mediatype_sms-editor .editor-error-messages").css("display","none")},createNewMailing:function(){i.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){i.editMailing(m.constants.forwardMailingEdit)},saveEditor:function(){i.setNodeFields();i.disableInputs();return f.formToObject(this.formName)},saveWithCheckStatus:function(){const e=i.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,i)}},copyMailing:function(){i.copyMailing(m.constants.forwardMailingCopy)}});g.addAction({click:"sms-mailing-editor-save"},function(){i.validateEditor(n.saveWithCheckStatus)});g.addAction({click:"action-mailing-editor-base-sort-shortname"},function(){i.onMailingSortClick("shortname","shortname")});g.addAction({click:"action-mailing-editor-base-sort-data"},function(){const e=h.getConfigData(this.el);i.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"action-mailing-editor-base-status-change"},function(){i.onMailingsStatusChange(this.el.val())});g.addAction({change:"action-mailing-editor-base-select-change"},function(){i.onMailingSelectChange(this.el.val())});g.addAction({click:"action-mailing-editor-base-secure-cancel"},function(){i.cancelSecurityDialog()})});this.addDomInitializer("mailing_mediatype_post-editor-initializer",function(){const e=this.config;const i=new s(e,d);const n=f.registerEditor("mailing_mediatype_post",{formName:"postMailingForm",safeToSave:false,getTitle:function(){return t("workflow.mailing.mediatype_post")},fillEditor:function(e){const t=$('form[name="'+this.formName+'"]');t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,e.getData(),"");i.fillEditorBase(e);$("#mailing_mediatype_post-editor .editor-error-messages").css("display","none")},createNewMailing:function(){i.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){i.editMailing(m.constants.forwardMailingEdit)},saveEditor:function(){i.setNodeFields();i.disableInputs();return f.formToObject(this.formName)},saveWithCheckStatus:function(){const e=i.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,i)}},copyMailing:function(){i.copyMailing(m.constants.forwardMailingCopy)}});g.addAction({click:"post-mailing-editor-save"},function(){i.validateEditor(n.saveWithCheckStatus)});g.addAction({click:"action-mailing-editor-base-sort-shortname"},function(){i.onMailingSortClick("shortname","shortname")});g.addAction({click:"action-mailing-editor-base-sort-data"},function(){const e=h.getConfigData(this.el);i.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"action-mailing-editor-base-status-change"},function(){i.onMailingsStatusChange(this.el.val())});g.addAction({change:"action-mailing-editor-base-select-change"},function(){i.onMailingSelectChange(this.el.val())});g.addAction({click:"action-mailing-editor-base-secure-cancel"},function(){i.cancelSecurityDialog()})});this.addDomInitializer("action-mailing-editor-initializer",function(){var e=this.config;var i=new s(e,d);var n=f.registerEditor("actionbased_mailing",{formName:"actionbasedMailingForm",safeToSave:false,getTitle:function(){return t("workflow.mailing.action_based")},fillEditor:function(e){var t=$('form[name="'+this.formName+'"]');t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,e.getData(),"");i.fillEditorBase(e);$("#actionbased_mailing-editor .editor-error-messages").css("display","none")},createNewMailing:function(){i.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){i.editMailing(m.constants.forwardMailingEdit)},saveEditor:function(){i.setNodeFields();i.disableInputs();return f.formToObject(this.formName)},saveWithCheckStatus:function(){var e=i.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,i)}},copyMailing:function(){i.copyMailing(m.constants.forwardMailingCopy)}});g.addAction({click:"action-mailing-editor-save"},function(){i.validateEditor(n.saveWithCheckStatus)});g.addAction({click:"action-mailing-editor-base-sort-shortname"},function(){i.onMailingSortClick("shortname","shortname")});g.addAction({click:"action-mailing-editor-base-sort-data"},function(){var e=h.getConfigData(this.el);i.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"action-mailing-editor-base-status-change"},function(){i.onMailingsStatusChange(this.el.val())});g.addAction({change:"action-mailing-editor-base-select-change"},function(){i.onMailingSelectChange(this.el.val())});g.addAction({click:"action-mailing-editor-base-secure-cancel"},function(){i.cancelSecurityDialog()})});this.addDomInitializer("date-mailing-initializer",function(){var e=this.config;var i=new s(e,d);var n=f.registerEditor("datebased_mailing",{formName:"datebasedMailingForm",safeToSave:false,getTitle:function(){return t("workflow.mailing.date_based")},fillEditor:function(e){var t=$('form[name="'+this.formName+'"]');t.submit(false);t.get(0).reset();f.fillFormFromObject(this.formName,e.getData(),"");i.fillEditorBase(e);$("#datebased_mailing-editor .editor-error-messages").css("display","none")},saveEditor:function(){i.setNodeFields();i.disableInputs();return f.formToObject(this.formName)},createNewMailing:function(){i.createNewMailing(m.constants.forwardMailingCreate)},editMailing:function(){i.editMailing(m.constants.forwardMailingEdit)},saveWithCheckStatus:function(){var e=i.showSecurityQuestion();if(e){f.saveCurrentEditorWithUndo(false,i)}},copyMailing:function(){i.copyMailing(m.constants.forwardMailingCopy)}});g.addAction({click:"date-mailing-editor-base-sort-shortname"},function(){i.onMailingSortClick("shortname","shortname")});g.addAction({click:"date-mailing-editor-base-sort-data"},function(){var e=h.getConfigData(this.el);i.onMailingSortClick("shortname",e.sortByDate)});g.addAction({change:"date-mailing-editor-base-status-change"},function(){i.onMailingsStatusChange(this.el.val())});g.addAction({change:"date-mailing-editor-base-select-change"},function(){i.onMailingSelectChange(this.el.val())});g.addAction({click:"date-mailing-editor-base-secure-cancel"},function(){i.cancelSecurityDialog()});g.addAction({click:"date-mailing-editor-save"},function(){i.validateEditor(n.saveWithCheckStatus)})});this.addAction({click:"mailing-editor-copy"},function(){f.getCurrentEditor().copyMailing()});this.addAction({click:"mailing-editor-new"},function(){f.getCurrentEditor().createNewMailing()});this.addAction({click:"mailing-editor-edit"},function(){f.getCurrentEditor().editMailing()});this.addAction({click:"editor-save-current"},function(){f.saveCurrentEditorWithUndo()});this.addAction({click:"editor-cancel"},function(){f.cancelEditor()});this.addAction({click:"chain-mode"},function(){if(b.isChainMode()||b.connectSelected()){b.setChainModeEnabled(false)}else{b.setChainModeEnabled(true)}$(this.el).toggleClass("button-selected",b.isChainMode())});this.addAction({click:"delete-selected"},function(){b.deleteSelected()});this.addAction({click:"align-all"},function(){b.alignAll()});this.addAction({click:"zoom-in"},function(){var e=$("#slider").slider("instance");e.value(e.value()+m.ZOOM_STEP);b.setZoom(e.value())});this.addAction({click:"zoom-out"},function(){var e=$("#slider").slider("instance");e.value(e.value()-m.ZOOM_STEP);b.setZoom(e.value())});this.addAction({click:"reset-zoom"},function(){b.setZoom(m.DEFAULT_ZOOM);$("#slider").slider("value",m.DEFAULT_ZOOM)});this.addAction({change:"show-grid"},function(){b.toggleGrid()});this.addAction({click:"workflow-save"},function(){A(true,{})});this.addAction({click:"workflow-copy"},function(){var t=m.workflowId;var e=b.getNodes().some(function(e){return e.isFilled()});a.confirmCopy(e).done(function(e){window.location.href=AGN.url("/workflow/copy.action"+"?workflowId="+t+"&isWithContent="+(e==true));return false})});this.addAction({change:"workflow-view-change-status"},function(){if($("#workflow_active").is(":checked")){$("#workflow-status").val(m.constants.statusActive)}else{$("#workflow-status").val(m.constants.statusInactive)}});this.addAction({click:"evaluate-statistic"},function(){const e=$("#statistic-iframe");e.removeClass("hidden");e.attr("src",m.statisticUrl)});this.addAction({click:"undo"},function(){b.undo()});this.addAction({click:"create-workflow-enlarged-editor-modal"},function(){b.enlargeEditor(function(){d(true)})});this.addAction({click:"workflow-generate-pdf"},function(){var e=m.workflowId<=0||!m.shortname;var i=b.hasUnsavedChanges();if(e||i){var n="";if(e){n=t("workflow.pdf.save_new_campaign")}else if(i){n=t("workflow.pdf.save_modified_campaign")}a.confirmSaveBeforePdfGenerating(function(){d(true)},n)}else{window.location.href=AGN.url("/workflow/"+m.workflowId+"/generatePDF.action");AGN.Lib.Loader.hide()}});this.addAction({click:"workflow-dry-run"},function(){var e=false;var t=m.constants.statusOpen;if(m.constants.initialWorkflowStatus!=m.constants.statusTesting){e=true;t=m.constants.statusTesting}a.confirmTestingStartStop(e).done(function(){var e=$("#workflow_active");e.prop("disabled",true);A(true,{status:t})})});this.addAction({click:"workflow-pause"},function(){A(true,{status:m.constants.statusPaused})});this.addAction({click:"workflow-unpause"},function(){e(true,{status:m.constants.statusActive})});this.addAction({click:"workflow-activate"},function(){v(true,{status:m.constants.statusActive})});this.addAction({click:"workflow-deactivate"},function(){C(true,{status:m.constants.statusInactive})});$(window).on("resize viewportChanged",function(){if(b){b.updateMinimap()}});$(document).on("keydown",function(e){if(e.target&&!$(e.target).is("input, textarea")){switch(e.keyCode){case m.KEY_SPACE:b.setPanningEnabled(true);break;case m.KEY_SHIFT:b.setMultiConnectionEnabled(true);break;case m.KEY_CTRL:b.setMouseWheelZoomEnabled(true);break}}});$(document).on("keyup",function(e){if(e.target&&!$(e.target).is("input, textarea")){switch(e.keyCode){case m.KEY_DELETE:b.deleteSelected();break;case m.KEY_SPACE:b.setPanningEnabled(false);break;case m.KEY_SHIFT:b.setMultiConnectionEnabled(false);break;case m.KEY_ENTER:b.editIcon();break;case m.KEY_CTRL:b.setMouseWheelZoomEnabled(false);break}}});function d(e,t){var i=$("#workflow_active").is(":checked");var n=m.constants.initialWorkflowStatus;var r=n===m.constants.statusActive&&!i;var o=n!==m.constants.statusActive&&i;if(r||!h.checkActivation(true)){if(o){v(e,t)}else if(r){C(e,t)}else{A(e,t)}}}function v(e,t){a.Activation(function(){b.getNodesByTypes([m.NODE_TYPE_START]).filter(i).forEach(w);A(e,t)},E().join("<br/>"))}function i(e){const t=_.clone(e.data.date);t.setHours(e.data.hour);t.setMinutes(e.data.minute);t.setSeconds(0);return t<=new Date}function w(e){const t=$.ajax({url:AGN.url("/workflow/getCurrentAdminTime.action"),async:false}).responseJSON||{};const i=t.hour;const n=t.minute;if(!i||!n){return}e.data.date=new Date;const r=e.data.date;r.setHours(parseInt(i,10));r.setMinutes(parseInt(n,10));r.setSeconds(r.getSeconds()>55?r.getSeconds()+120:r.getSeconds()+60);e.data.hour=r.getHours();e.data.minute=r.getMinutes();b.updateNodeTitle(e,true);AGN.Lib.Form.get($("form#workflowForm")).setValueOnce("startTimeAdjusted",true)}function e(e,t){a.Activation(function(){A(e,t)},{},true)}function C(e,t){a.Deactivation(function(){A(e,t)})}function A(e,i){var t=function(){var t=AGN.Lib.Form.get($("form#workflowForm"));i=$.extend({},i);Object.keys(i).forEach(function(e){t.setValueOnce(e,i[e])});if(b.isGridDisplayed()){b.toggleGrid()}t.setValueOnce("workflowSchema",b.serializeIcons());t.setValueOnce("editorPositionLeft",-1);t.setValueOnce("editorPositionTop",-1);t.submit("static")};if(e){x().done(t)}else{t()}}function E(){return b.getNodesByTypes(m.NODE_TYPES_MAILING).map(function(e){return e.getTitle()})}function x(){var e=$.Deferred();if($("#name").val().length<3){AGN.Lib.Messages(t("workflow.defaults.error"),t("error.workflow.shortName"),"alert");e.reject()}else{if(T()){return l.create(p.text("mailing-types-replace-modal"))}else{e.resolve()}}return e.promise()}function T(){var e=b.getNodes();var t="UNKNOWN";var i={};for(var n=0;n<e.length;n++){var r=e[n];if(r.type===m.NODE_TYPE_START&&r.filled){var o="UNKNOWN";switch(r.data.startType){case m.constants.startTypeDate:o="DATE";break;case m.constants.startTypeEvent:switch(r.event){case m.constants.startEventDate:o="RULE";break;case m.constants.startEventReaction:o="REACTION";break}break}if(t!==o){if(t==="UNKNOWN"){t=o}else{return false}}}switch(r.type){case m.NODE_TYPE_MAILING:case m.NODE_TYPE_FOLLOWUP_MAILING:case m.NODE_TYPE_MAILING_MEDIATYPE_SMS:case m.NODE_TYPE_MAILING_MEDIATYPE_POST:i["DATE"]=true;break;case m.NODE_TYPE_ACTION_BASED_MAILING:i["REACTION"]=true;break;case m.NODE_TYPE_DATE_BASED_MAILING:i["RULE"]=true;break}}if(t!=="UNKNOWN"){i=Object.keys(i);if(i.length===1){if(t!==i[0]){return true}}else{if(i.length>1){return true}}}return false}this.addDomInitializer("open-edit-icon-initializer",function(e){var t=e.json();var i=t.nodeId;var n=t.elementValue;if(i){var r=o.get($("#"+i));if(r&&n){switch(r.type){case m.NODE_TYPE_MAILING:case m.NODE_TYPE_ACTION_BASED_MAILING:case m.NODE_TYPE_MAILING_MEDIATYPE_SMS:case m.NODE_TYPE_MAILING_MEDIATYPE_POST:case m.NODE_TYPE_DATE_BASED_MAILING:case m.NODE_TYPE_FOLLOWUP_MAILING:r.data.mailingId=n;break;case m.NODE_TYPE_RECIPIENT:if(n!="0"&&$.inArray(n,r.data.targets)==-1){r.data.targets.push(n)}break;case m.NODE_TYPE_ARCHIVE:r.data.campaignId=n;break;case m.NODE_TYPE_IMPORT:case m.NODE_TYPE_EXPORT:r.data.importexportId=n;break;default:console.debug("Unknown node type")}b.editIcon(r)}}})});AGN.Lib.Controller.new("wysiwyg-agn-tags",function(){var r=AGN.Lib.Template,e=AGN.Lib.Select,n=AGN.Lib.Confirm;var o;var a;var s={};var l={};s["agnFULLVIEW"]=function(){const e=$("#agn-tag-name").children("option:selected");const t=e.val();if(!t){return}if(!$("#createLinkToggle").prop("checked")){return"["+t+"]"}var i=$("#tagLinkText").val();if(!i){i="fullview"}return'<a href="['+t+']">'+i+"</a>"};s["agnWEBVIEW"]=s["agnFULLVIEW"];s["agnFORM"]=function(){var e=$("#agn-tag-name").children("option:selected");var t=e.val(),i=e.data("attributes");if(!t){return}var n=$("#createLinkToggle").prop("checked")===true;if(n){var r=$("#tagLinkText").val();if(!r){var o=i.findIndex(function(e){return e.name==="name"});if(o>-1){r=$("#agn-tag-attribute-"+o).val()}}if(r){return'<a href="['+t+d(i)+']">'+r+"</a>"}}return"["+t+d(i)+"]"};l["agnFORM"]=function(){var e=$("#createLinkToggle");if(e.prop("checked")!==true){$("#tagLinkParams").hide()}e.on("change",function(){var e=$(this).prop("checked");if(e===false){$("#tagLinkParams").hide()}else{$("#tagLinkParams").show()}})};l["agnFULLVIEW"]=l["agnFORM"];l["agnWEBVIEW"]=l["agnFULLVIEW"];function u(e,t){var i=$("#agn-tag-attributes");i.empty();if(t&&t.length>0){t.forEach(function(e,t){switch(e.type){case"SELECT":i.append(o({index:t,name:e.name,options:e.options}));break;case"TEXT":i.append(a({index:t,name:e.name}));break}})}try{const n=r.dom(e+"-extended-attributes");if(n){i.append(n)}}catch(e){}AGN.runAll(i)}function c(){var e=$("#agn-tag-name").children("option:selected");var t=e.val();if(t){return"["+t+d(e.data("attributes"))+"]"}else{return null}}function d(e){var n="";if(e&&e.length>0){e.forEach(function(e,t){var i=$("#agn-tag-attribute-"+t);n+=" "+e.name+'="'+_.escape(i.val())+'"'})}return n}this.addDomInitializer("wysiwyg-agn-tags",function(){o=r.prepare("agn-tag-select-attribute");a=r.prepare("agn-tag-text-attribute");var i=$("#agn-tag-name");this.config.forEach(function(e){var t=$("<option>",{value:e.name,text:e.name});i.append(t);t.data("attributes",e.attributes)});e.get(i).selectFirstValue();i.trigger("change")});this.addAction({change:"select-agn-tag"},function(){var e=this.el.children("option:selected");u(e.val(),e.data("attributes"));var t=e.val(),i=l[t];if(i){i()}});this.addAction({click:"insert-agn-tag"},function(){var e=$("#agn-tag-name").val();var t=s[e];var i;if(t){i=t()}else{i=c()}if(i){n.get(this.el).positive(i)}})});AGN.Lib.Controller.new("wysiwyg-image-browser",function(){var t;var i=r("CKEditorFuncNum");var n=r("mailingID");this.addDomInitializer("wysiwyg-image-browser",function(){t=this.config;e()});this.addAction({click:"submit-image"},function(){var e=$("li[image-tab-name].active").attr("image-tab-name");if(e==="mediapool"){a()}else{o()}});this.addAction({change:"update-image"},function(){e()});this.addAction({click:"close-window"},function(){window.close()});function e(){var e=l();var t=$("#other-images-tab .image-preview");var i=$("#other-images-tab .no_image_message");if(!e||!e.length){i.show();t.hide()}else{t.attr("src",s(e));t.show();i.hide()}return 1}function r(e){var t=new RegExp("(?:[?&]|&amp;)"+e+"=([^&]+)","i");var i=window.location.search.match(t);return i&&i.length>1?i[1]:""}function o(){var e=s(l());window.opener.CKEDITOR.tools.callFunction(i,e);window.close()}function a(){var e=document.querySelector('[data-action="mpSelectImage"].active');if(e){var t=e.querySelector("img").getAttribute("src");window.opener.CKEDITOR.tools.callFunction(i,t);window.close()}}function s(e){if(e.substr(0,4).toLowerCase()!=="http"){return t.rdirDomain+"/image?ci="+t.companyId+"&mi="+n+"&name="+encodeURIComponent(e)}return encodeURI(e)}function l(){return $('#other-images-tab [data-action="update-image"]').val()}});AGN.Lib.Controller.new("dashboard",function(){var e=this;var a;var t;var i,n;this.addDomInitializer("dashboard-news-counters",function(){var e=this.config;i=e.newsDateUrl;n=e.newsCountersUrl;$.ajax({url:n}).done(function(e){if(!!e["counters"]){a=e["counters"];u();if(c("MESSAGE")&&!$(".modal-news").exists()){o()}}})});this.addDomInitializer("dashboard-statistics",function(){t=this.config;if(t.mailingId>0){r(t.mailingId)}});this.addAction({click:"open-mailing-statistics"},function(){if(t.mailingId>0){AGN.Lib.Page.reload(t.mailingStatisticsLinkPattern.replace(":mailing-id:",t.mailingId))}});this.addAction({change:"update-template-links"},function(){e.runInitializer("UpdateDashboardTemplateLinks")});this.addAction({change:"statistics-select-mailing"},function(){t.mailingId=this.el.val();r(t.mailingId);return false});function r(e){jQuery.ajax({type:"GET",url:t.urls.STATISTICS,data:{mailingId:e},success:function(e){var t;var i;var n;e=_.merge({common:[["no Data","0"]],clickers:[["no Data","0"]],clickersPercent:[0],openers:[["no Data","0"]],openersPercent:[0]},e);t=[];i=[];for(var r=0;r<e["common"].length;r++){var o=parseInt(e["common"][r][1]);t.push(e["common"][r][0]);i.push(o)}c3.generate(AGN.Lib.DashboardStatisticsService.data.statChartData.build(t,i));t=[];i=[];n=0;for(var r=0;r<e["clickers"].length;r++){var o=l(e["clickers"][r][1]*100,1);t.push(e["clickers"][r][0]);i.push(o);n+=o}if(!isNaN(n)&&n>0){for(var r=0;r<i.length;r++){t[r]+=" "+l(100*i[r]/n,1)+"%"}}var a=l(e["clickersPercent"][0]*100,1)+"%*";c3.generate(AGN.Lib.DashboardStatisticsService.data.clickChartData.build(a,t,i));t=[];i=[];n=0;for(var r=0;r<e["openers"].length;r++){var o=l(e["openers"][r][1]*100,1);t.push(e["openers"][r][0]);i.push(o);n+=o}if(!isNaN(n)&&n>0){for(var r=0;r<i.length;r++){t[r]+=" "+l(100*i[r]/n,1)+"%"}}var s=l(e["openersPercent"][0]*100,1)+"%*";c3.generate(AGN.Lib.DashboardStatisticsService.data.viewChartData.build(s,t,i));AGN.Lib.CoreInitializer.run("equalizer")}})}function l(e,t){return parseFloat(e).toFixed(t)*1}this.addAction({click:"showNewsPopup"},function(){o()});this.addAction({click:"chooseNewsType"},function(){var e=this.el.parent().data("news-type");s(e)});function o(){var e="MESSAGE";var t=0;var i=d("MESSAGE");if(i<1){var n=false;for(var r in a){if(a.hasOwnProperty(r)){var o=c(r);if(o>t){t=o;e=r;n=true}}}if(!n){for(r in a){if(a.hasOwnProperty(r)){o=d(r);if(o>t){t=o;e=r}}}}}AGN.Lib.Modal.createFromTemplate({openedNewsType:e},"modal-news");$("#buttonNewsCounter").text("");$(".l-news-menu-item").each(function(e){var t=$(this);var i=c(t.data("news-type"));if(i>0){t.find(".l-news-menu-counter").text(i)}else{t.find(".l-news-menu-counter").html("&nbsp;")}if($(this).hasClass("active")){s(t.data("news-type"))}});u()}function s(e){if(c(e)>0){$("#newsCounter"+e).html("&nbsp;");$.ajax({url:i,data:{type:e}});a[e]["unreadCount"]=0;u()}}Number.isInteger=Number.isInteger||function(e){return typeof e==="number"&&isFinite(e)&&Math.floor(e)===e};function u(){var e=c("NEWS");var t=$("#buttonNewsCounter");var i=t.parent();var n="5px";var r="5px";var o="";if(e>0){i.removeClass("hidden");n="4px";r="4px";o=e}else{i.addClass("hidden")}i.parent().css("padding-top",n);i.parent().css("padding-bottom",r);t.text(o);return e}function c(e){if(!!a&&!!a[e]&&Number.isInteger(a[e]["unreadCount"])){return a[e]["unreadCount"]}return 0}function d(e){if(!!a&&!!a[e]&&Number.isInteger(a[e]["availableCount"])){return a[e]["availableCount"]}return 0}this.addInitializer("UpdateDashboardTemplateLinks",function(e){if(!e){e=$(document)}var t=e.find(".js-template-link"),n=$('[data-action="update-template-links"]').val();_.each(t,function(e){var t=$(e),i=t.attr("href");i=i.replace(/templateID=\d+/,"templateID="+n);t.attr("href",i)})});this.addInitializer("EndlessScroll",function(e){if(!e){e=$(document)}var t=e.find(".js-endless-scroll");if(t.length<1){return}t.each(function(e){var t=1;var i=$(this);i.endlessScroll({pagesToKeep:null,fireOnce:true,fireDelay:1e3,loader:"",insertAfter:".js-endless-scroll .js-endless-scroll-content",ceaseFire:function(){return i.find(".message-list-item-last").length!==0},callback:function(){var e;AGN.Lib.Loader.prevent();e=$.ajax({method:"GET",url:i.data("url"),data:{page:t+1}});i.find(".js-endless-scroll-content").append('<div class="message-list-loader"><i class="icon icon-refresh icon-spin"></i></div>');e.done(function(e){t+=1;i.find(".js-endless-scroll-content").append(e);i.find(".message-list-loader").remove();AGN.Lib.CoreInitializer.run("icons-defs",i)});return e}})})});this.addAction({click:"copy-recent-mailing"},function(){p(this,"/mailing/{mailing-id}/copy.action")});this.addAction({click:"edit-recent-mailing"},function(){p(this,"/mailing/{mailing-id}/settings.action")});this.addAction({click:"open-recent-mailing-statistic"},function(){p(this,"/statistics/mailing/{mailing-id}/view.action")});this.addAction({click:"delete-recent-mailing"},function(){this.event.preventDefault();const t=$(this.el);$.ajax({url:AGN.url("/mailing/"+f(this)+"/confirmDelete.action"),data:{fromPage:"dashboard"}}).done(function(e){AGN.Lib.RenderMessages($(e));AGN.Lib.Confirm.create(e).done(function(e){t.closest("li").remove();AGN.Lib.Form.get(t).updateHtml(e)})})});function f(e){return $(e.el).parent().data("mailing-id")}function p(e,t){e.event.preventDefault();const i=f(e);AGN.Lib.Page.reload(AGN.url(t.replace("{mailing-id}",i)))}});(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.interact=e()}})(function(){var e,t,i;return function o(a,s,l){function u(i,e){if(!s[i]){if(!a[i]){var t=typeof require=="function"&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var n=new Error("Cannot find module '"+i+"'");throw n.code="MODULE_NOT_FOUND",n}var r=s[i]={exports:{}};a[i][0].call(r.exports,function(e){var t=a[i][1][e];return u(t?t:e)},r,r.exports,o,a,s,l)}return s[i].exports}var c=typeof require=="function"&&require;for(var e=0;e<l.length;e++)u(l[e]);return u}({1:[function(t,e,i){"use strict";if(typeof window==="undefined"){e.exports=function(e){t("./src/utils/window").init(e);return t("./src/index")}}else{e.exports=t("./src/index")}},{"./src/index":19,"./src/utils/window":52}],2:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var r=e("./utils/extend.js");function o(e,t){for(var i=0;i<t.length;i++){var n;n=t[i];var r=n;if(e.immediatePropagationStopped){break}r(e)}}var a=function(){function t(e){n(this,t);this.options=r({},e||{})}t.prototype.fire=function e(t){var i=void 0;var n="on"+t.type;var r=this.global;if(i=this[t.type]){o(t,i)}if(this[n]){this[n](t)}if(!t.propagationStopped&&r&&(i=r[t.type])){o(t,i)}};t.prototype.on=function e(t,i){if(this[t]){this[t].push(i)}else{this[t]=[i]}};t.prototype.off=function e(t,i){var n=this[t];var r=n?n.indexOf(i):-1;if(r!==-1){n.splice(r,1)}if(n&&n.length===0||!i){this[t]=undefined}};return t}();t.exports=a},{"./utils/extend.js":41}],3:[function(e,t,i){"use strict";function y(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var b=e("./utils/extend");var _=e("./utils/getOriginXY");var w=e("./defaultOptions");var C=e("./utils/Signals").new();var n=function(){function m(e,t,i,n,r,o){var a=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;y(this,m);var s=e.target;var l=(s&&s.options||w).deltaSource;var u=_(s,r,i);var c=n==="start";var d=n==="end";var f=c?e.startCoords:e.curCoords;var p=e.prevEvent;r=r||e.element;var h=b({},f.page);var g=b({},f.client);h.x-=u.x;h.y-=u.y;g.x-=u.x;g.y-=u.y;this.ctrlKey=t.ctrlKey;this.altKey=t.altKey;this.shiftKey=t.shiftKey;this.metaKey=t.metaKey;this.button=t.button;this.buttons=t.buttons;this.target=r;this.currentTarget=r;this.relatedTarget=o||null;this.preEnd=a;this.type=i+(n||"");this.interaction=e;this.interactable=s;this.t0=c?e.downTimes[e.downTimes.length-1]:p.t0;var v={interaction:e,event:t,action:i,phase:n,element:r,related:o,page:h,client:g,coords:f,starting:c,ending:d,deltaSource:l,iEvent:this};C.fire("set-xy",v);if(d){this.pageX=p.pageX;this.pageY=p.pageY;this.clientX=p.clientX;this.clientY=p.clientY}else{this.pageX=h.x;this.pageY=h.y;this.clientX=g.x;this.clientY=g.y}this.x0=e.startCoords.page.x-u.x;this.y0=e.startCoords.page.y-u.y;this.clientX0=e.startCoords.client.x-u.x;this.clientY0=e.startCoords.client.y-u.y;C.fire("set-delta",v);this.timeStamp=f.timeStamp;this.dt=e.pointerDelta.timeStamp;this.duration=this.timeStamp-this.t0;this.speed=e.pointerDelta[l].speed;this.velocityX=e.pointerDelta[l].vx;this.velocityY=e.pointerDelta[l].vy;this.swipe=d||n==="inertiastart"?this.getSwipe():null;C.fire("new",v)}m.prototype.getSwipe=function e(){var t=this.interaction;if(t.prevEvent.speed<600||this.timeStamp-t.prevEvent.timeStamp>150){return null}var i=180*Math.atan2(t.prevEvent.velocityY,t.prevEvent.velocityX)/Math.PI;var n=22.5;if(i<0){i+=360}var r=135-n<=i&&i<225+n;var o=225-n<=i&&i<315+n;var a=!r&&(315-n<=i||i<45+n);var s=!o&&45-n<=i&&i<135+n;return{up:o,down:s,left:r,right:a,angle:i,speed:t.prevEvent.speed,velocity:{x:t.prevEvent.velocityX,y:t.prevEvent.velocityY}}};m.prototype.preventDefault=function e(){};m.prototype.stopImmediatePropagation=function e(){this.immediatePropagationStopped=this.propagationStopped=true};m.prototype.stopPropagation=function e(){this.propagationStopped=true};return m}();C.on("set-delta",function(e){var t=e.iEvent,i=e.interaction,n=e.starting,r=e.deltaSource;var o=n?t:i.prevEvent;if(r==="client"){t.dx=t.clientX-o.clientX;t.dy=t.clientY-o.clientY}else{t.dx=t.pageX-o.pageX;t.dy=t.pageY-o.pageY}});n.signals=C;t.exports=n},{"./defaultOptions":18,"./utils/Signals":34,"./utils/extend":41,"./utils/getOriginXY":42}],4:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=e("./utils/clone");var c=e("./utils/is");var a=e("./utils/events");var r=e("./utils/extend");var d=e("./actions/base");var s=e("./scope");var o=e("./Eventable");var f=e("./defaultOptions");var p=e("./utils/Signals").new();var l=e("./utils/domUtils"),h=l.getElementRect,g=l.nodeContains,v=l.trySelector,m=l.matchesSelector;var y=e("./utils/window"),b=y.getWindow;var _=e("./utils/arr"),w=_.contains;var C=e("./utils/browser"),A=C.wheelEvent;s.interactables=[];var E=function(){function l(e,t){n(this,l);t=t||{};this.target=e;this.events=new o;this._context=t.context||s.document;this._win=b(v(e)?this._context:e);this._doc=this._win.document;p.fire("new",{target:e,options:t,interactable:this,win:this._win});s.addDocument(this._doc,this._win);s.interactables.push(this);this.set(t)}l.prototype.setOnEvents=function e(t,i){var n="on"+t;if(c.function(i.onstart)){this.events[n+"start"]=i.onstart}if(c.function(i.onmove)){this.events[n+"move"]=i.onmove}if(c.function(i.onend)){this.events[n+"end"]=i.onend}if(c.function(i.oninertiastart)){this.events[n+"inertiastart"]=i.oninertiastart}return this};l.prototype.setPerAction=function e(t,i){for(var n in i){if(n in f[t]){if(c.object(i[n])){this.options[t][n]=u(this.options[t][n]||{});r(this.options[t][n],i[n]);if(c.object(f.perAction[n])&&"enabled"in f.perAction[n]){this.options[t][n].enabled=i[n].enabled===false?false:true}}else if(c.bool(i[n])&&c.object(f.perAction[n])){this.options[t][n].enabled=i[n]}else if(i[n]!==undefined){this.options[t][n]=i[n]}}}};l.prototype.getRect=function e(t){t=t||this.target;if(c.string(this.target)&&!c.element(t)){t=this._context.querySelector(this.target)}return h(t)};l.prototype.rectChecker=function e(t){if(c.function(t)){this.getRect=t;return this}if(t===null){delete this.options.getRect;return this}return this.getRect};l.prototype._backCompatOption=function e(t,i){if(v(i)||c.object(i)){this.options[t]=i;for(var n=0;n<d.names.length;n++){var r;r=d.names[n];var o=r;this.options[o][t]=i}return this}return this.options[t]};l.prototype.origin=function e(t){return this._backCompatOption("origin",t)};l.prototype.deltaSource=function e(t){if(t==="page"||t==="client"){this.options.deltaSource=t;return this}return this.options.deltaSource};l.prototype.context=function e(){return this._context};l.prototype.inContext=function e(t){return this._context===t.ownerDocument||g(this._context,t)};l.prototype.fire=function e(t){this.events.fire(t);return this};l.prototype._onOffMultiple=function e(t,i,n,r){if(c.string(i)&&i.search(" ")!==-1){i=i.trim().split(/ +/)}if(c.array(i)){for(var o=0;o<i.length;o++){var a;a=i[o];var s=a;this[t](s,n,r)}return true}if(c.object(i)){for(var l in i){this[t](l,i[l],n)}return true}};l.prototype.on=function e(t,i,n){if(this._onOffMultiple("on",t,i,n)){return this}if(t==="wheel"){t=A}if(w(l.eventTypes,t)){this.events.on(t,i)}else if(c.string(this.target)){a.addDelegate(this.target,this._context,t,i,n)}else{a.add(this.target,t,i,n)}return this};l.prototype.off=function e(t,i,n){if(this._onOffMultiple("off",t,i,n)){return this}if(t==="wheel"){t=A}if(w(l.eventTypes,t)){this.events.off(t,i)}else if(c.string(this.target)){a.removeDelegate(this.target,this._context,t,i,n)}else{a.remove(this.target,t,i,n)}return this};l.prototype.set=function e(t){if(!c.object(t)){t={}}this.options=u(f.base);var i=u(f.perAction);for(var n in d.methodDict){var r=d.methodDict[n];this.options[n]=u(f[n]);this.setPerAction(n,i);this[r](t[n])}for(var o=0;o<l.settingsMethods.length;o++){var a;a=l.settingsMethods[o];var s=a;this.options[s]=f.base[s];if(s in t){this[s](t[s])}}p.fire("set",{options:t,interactable:this});return this};l.prototype.unset=function e(){a.remove(this.target,"all");if(c.string(this.target)){for(var t in a.delegatedEvents){var i=a.delegatedEvents[t];if(i.selectors[0]===this.target&&i.contexts[0]===this._context){i.selectors.splice(0,1);i.contexts.splice(0,1);i.listeners.splice(0,1);if(!i.selectors.length){i[t]=null}}a.remove(this._context,t,a.delegateListener);a.remove(this._context,t,a.delegateUseCapture,true)}}else{a.remove(this,"all")}p.fire("unset",{interactable:this});s.interactables.splice(s.interactables.indexOf(this),1);for(var n=0;n<(s.interactions||[]).length;n++){var r;r=(s.interactions||[])[n];var o=r;if(o.target===this&&o.interacting()&&!o._ending){o.stop()}}return s.interact};return l}();s.interactables.indexOfElement=function e(t,i){i=i||s.document;for(var n=0;n<this.length;n++){var r=this[n];if(r.target===t&&r._context===i){return n}}return-1};s.interactables.get=function e(t,i,n){var r=this[this.indexOfElement(t,i&&i.context)];return r&&(c.string(t)||n||r.inContext(t))?r:null};s.interactables.forEachMatch=function(e,t){for(var i=0;i<this.length;i++){var n;n=this[i];var r=n;var o=void 0;if((c.string(r.target)?c.element(e)&&m(e,r.target):e===r.target)&&r.inContext(e)){o=t(r)}if(o!==undefined){return o}}};E.eventTypes=s.eventTypes=[];E.signals=p;E.settingsMethods=["deltaSource","origin","preventDefault","rectChecker"];t.exports=E},{"./Eventable":2,"./actions/base":6,"./defaultOptions":18,"./scope":33,"./utils/Signals":34,"./utils/arr":35,"./utils/browser":36,"./utils/clone":37,"./utils/domUtils":39,"./utils/events":40,"./utils/extend":41,"./utils/is":46,"./utils/window":52}],5:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var b=e("./scope");var _=e("./utils");var a=e("./utils/events");var w=e("./utils/browser");var r=e("./utils/domObjects");var C=e("./utils/interactionFinder");var u=e("./utils/Signals").new();var o={};var s=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer"];var A=0;b.interactions=[];var E=function(){function l(e){var t=e.pointerType;n(this,l);this.target=null;this.element=null;this.prepared={name:null,axis:null,edges:null};this.pointers=[];this.pointerIds=[];this.downTargets=[];this.downTimes=[];this.prevCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0};this.curCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0};this.startCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0};this.pointerDelta={page:{x:0,y:0,vx:0,vy:0,speed:0},client:{x:0,y:0,vx:0,vy:0,speed:0},timeStamp:0};this.downEvent=null;this.downPointer={};this._eventTarget=null;this._curEventTarget=null;this.prevEvent=null;this.pointerIsDown=false;this.pointerWasMoved=false;this._interacting=false;this._ending=false;this.pointerType=t;u.fire("new",this);b.interactions.push(this)}l.prototype.pointerDown=function e(t,i,n){var r=this.updatePointer(t,i,true);u.fire("down",{pointer:t,event:i,eventTarget:n,pointerIndex:r,interaction:this})};l.prototype.start=function e(t,i,n){if(this.interacting()||!this.pointerIsDown||this.pointerIds.length<(t.name==="gesture"?2:1)){return}if(b.interactions.indexOf(this)===-1){b.interactions.push(this)}_.copyAction(this.prepared,t);this.target=i;this.element=n;u.fire("action-start",{interaction:this,event:this.downEvent})};l.prototype.pointerMove=function e(t,i,n){if(!this.simulation){this.updatePointer(t);_.setCoords(this.curCoords,this.pointers)}var r=this.curCoords.page.x===this.prevCoords.page.x&&this.curCoords.page.y===this.prevCoords.page.y&&this.curCoords.client.x===this.prevCoords.client.x&&this.curCoords.client.y===this.prevCoords.client.y;var o=void 0;var a=void 0;if(this.pointerIsDown&&!this.pointerWasMoved){o=this.curCoords.client.x-this.startCoords.client.x;a=this.curCoords.client.y-this.startCoords.client.y;this.pointerWasMoved=_.hypot(o,a)>l.pointerMoveTolerance}var s={pointer:t,pointerIndex:this.getPointerIndex(t),event:i,eventTarget:n,dx:o,dy:a,duplicate:r,interaction:this,interactingBeforeMove:this.interacting()};if(!r){_.setCoordDeltas(this.pointerDelta,this.prevCoords,this.curCoords)}u.fire("move",s);if(!r){if(this.interacting()){this.doMove(s)}if(this.pointerWasMoved){_.copyCoords(this.prevCoords,this.curCoords)}}};l.prototype.doMove=function e(t){t=_.extend({pointer:this.pointers[0],event:this.prevEvent,eventTarget:this._eventTarget,interaction:this},t||{});u.fire("before-action-move",t);if(!this._dontFireMove){u.fire("action-move",t)}this._dontFireMove=false};l.prototype.pointerUp=function e(t,i,n,r){var o=this.getPointerIndex(t);u.fire(/cancel$/i.test(i.type)?"cancel":"up",{pointer:t,pointerIndex:o,event:i,eventTarget:n,curEventTarget:r,interaction:this});if(!this.simulation){this.end(i)}this.pointerIsDown=false;this.removePointer(t,i)};l.prototype.end=function e(t){this._ending=true;t=t||this.prevEvent;if(this.interacting()){u.fire("action-end",{event:t,interaction:this})}this.stop();this._ending=false};l.prototype.currentAction=function e(){return this._interacting?this.prepared.name:null};l.prototype.interacting=function e(){return this._interacting};l.prototype.stop=function e(){u.fire("stop",{interaction:this});if(this._interacting){u.fire("stop-active",{interaction:this});u.fire("stop-"+this.prepared.name,{interaction:this})}this.target=this.element=null;this._interacting=false;this.prepared.name=this.prevEvent=null};l.prototype.getPointerIndex=function e(t){if(this.pointerType==="mouse"||this.pointerType==="pen"){return 0}return this.pointerIds.indexOf(_.getPointerId(t))};l.prototype.updatePointer=function e(t,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:i&&/(down|start)$/i.test(i.type);var r=_.getPointerId(t);var o=this.getPointerIndex(t);if(o===-1){o=this.pointerIds.length;this.pointerIds[o]=r}if(n){u.fire("update-pointer-down",{pointer:t,event:i,down:n,pointerId:r,pointerIndex:o,interaction:this})}this.pointers[o]=t;return o};l.prototype.removePointer=function e(t,i){var n=this.getPointerIndex(t);if(n===-1){return}u.fire("remove-pointer",{pointer:t,event:i,pointerIndex:n,interaction:this});this.pointers.splice(n,1);this.pointerIds.splice(n,1);this.downTargets.splice(n,1);this.downTimes.splice(n,1)};l.prototype._updateEventTargets=function e(t,i){this._eventTarget=t;this._curEventTarget=i};return l}();for(var l=0;l<s.length;l++){var c=s[l];o[c]=d(c)}function d(y){return function(e){var t=_.getPointerType(e);var i=_.getEventTargets(e),n=i[0],r=i[1];var o=[];if(w.supportsTouch&&/touch/.test(e.type)){A=(new Date).getTime();for(var a=0;a<e.changedTouches.length;a++){var s;s=e.changedTouches[a];var l=s;var u=l;var c=C.search(u,e.type,n);o.push([u,c||new E({pointerType:t})])}}else{var d=false;if(!w.supportsPointerEvent&&/mouse/.test(e.type)){for(var f=0;f<b.interactions.length&&!d;f++){d=b.interactions[f].pointerType!=="mouse"&&b.interactions[f].pointerIsDown}d=d||(new Date).getTime()-A<500||e.timeStamp===0}if(!d){var p=C.search(e,e.type,n);if(!p){p=new E({pointerType:t})}o.push([e,p])}}for(var h=0;h<o.length;h++){var g=o[h];var v=g[0];var m=g[1];m._updateEventTargets(n,r);m[y](v,e,n,r)}}}function f(e){for(var t=0;t<b.interactions.length;t++){var i;i=b.interactions[t];var n=i;n.end(e);u.fire("endall",{event:e,interaction:n})}}var p={};var h=w.pEventTypes;if(r.PointerEvent){p[h.down]=o.pointerDown;p[h.move]=o.pointerMove;p[h.up]=o.pointerUp;p[h.cancel]=o.pointerUp}else{p.mousedown=o.pointerDown;p.mousemove=o.pointerMove;p.mouseup=o.pointerUp;p.touchstart=o.pointerDown;p.touchmove=o.pointerMove;p.touchend=o.pointerUp;p.touchcancel=o.pointerUp}p.blur=f;function g(e,t){var i=e.doc;var n=t.indexOf("add")===0?a.add:a.remove;for(var r in b.delegatedEvents){n(i,r,a.delegateListener);n(i,r,a.delegateUseCapture,true)}for(var o in p){n(i,o,p[o],w.isIOS?{passive:false}:undefined)}}u.on("update-pointer-down",function(e){var t=e.interaction,i=e.pointer,n=e.pointerId,r=e.pointerIndex,o=e.event,a=e.eventTarget,s=e.down;t.pointerIds[r]=n;t.pointers[r]=i;if(s){t.pointerIsDown=true}if(!t.interacting()){_.setCoords(t.startCoords,t.pointers);_.copyCoords(t.curCoords,t.startCoords);_.copyCoords(t.prevCoords,t.startCoords);t.downEvent=o;t.downTimes[r]=t.curCoords.timeStamp;t.downTargets[r]=a||o&&_.getEventTargets(o)[0];t.pointerWasMoved=false;_.pointerExtend(t.downPointer,i)}});b.signals.on("add-document",g);b.signals.on("remove-document",g);E.pointerMoveTolerance=1;E.doOnInteractions=d;E.endAll=f;E.signals=u;E.docEvents=p;b.endAllInteractions=f;t.exports=E},{"./scope":33,"./utils":44,"./utils/Signals":34,"./utils/browser":36,"./utils/domObjects":38,"./utils/events":40,"./utils/interactionFinder":45}],6:[function(e,t,i){"use strict";var n=e("../Interaction");var a=e("../InteractEvent");var r={firePrepared:o,names:[],methodDict:{}};n.signals.on("action-start",function(e){var t=e.interaction,i=e.event;t._interacting=true;o(t,i,"start")});n.signals.on("action-move",function(e){var t=e.interaction,i=e.event,n=e.preEnd;o(t,i,"move",n);if(!t.interacting()){return false}});n.signals.on("action-end",function(e){var t=e.interaction,i=e.event;o(t,i,"end")});function o(e,t,i,n){var r=e.prepared.name;var o=new a(e,t,r,i,e.element,null,n);e.target.fire(o);e.prevEvent=o}t.exports=r},{"../InteractEvent":3,"../Interaction":5}],7:[function(e,t,i){"use strict";var n=e("./base");var r=e("../utils");var o=e("../InteractEvent");var a=e("../Interactable");var s=e("../Interaction");var l=e("../defaultOptions");var u={defaults:{enabled:false,mouseButtons:null,origin:null,snap:null,restrict:null,inertia:null,autoScroll:null,startAxis:"xy",lockAxis:"xy"},checker:function e(t,i,n){var r=n.options.drag;return r.enabled?{name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis}:null},getCursor:function e(){return"move"}};s.signals.on("before-action-move",function(e){var t=e.interaction;if(t.prepared.name!=="drag"){return}var i=t.prepared.axis;if(i==="x"){t.curCoords.page.y=t.startCoords.page.y;t.curCoords.client.y=t.startCoords.client.y;t.pointerDelta.page.speed=Math.abs(t.pointerDelta.page.vx);t.pointerDelta.client.speed=Math.abs(t.pointerDelta.client.vx);t.pointerDelta.client.vy=0;t.pointerDelta.page.vy=0}else if(i==="y"){t.curCoords.page.x=t.startCoords.page.x;t.curCoords.client.x=t.startCoords.client.x;t.pointerDelta.page.speed=Math.abs(t.pointerDelta.page.vy);t.pointerDelta.client.speed=Math.abs(t.pointerDelta.client.vy);t.pointerDelta.client.vx=0;t.pointerDelta.page.vx=0}});o.signals.on("new",function(e){var t=e.iEvent,i=e.interaction;if(t.type!=="dragmove"){return}var n=i.prepared.axis;if(n==="x"){t.pageY=i.startCoords.page.y;t.clientY=i.startCoords.client.y;t.dy=0}else if(n==="y"){t.pageX=i.startCoords.page.x;t.clientX=i.startCoords.client.x;t.dx=0}});a.prototype.draggable=function(e){if(r.is.object(e)){this.options.drag.enabled=e.enabled===false?false:true;this.setPerAction("drag",e);this.setOnEvents("drag",e);if(/^(xy|x|y|start)$/.test(e.lockAxis)){this.options.drag.lockAxis=e.lockAxis}if(/^(xy|x|y)$/.test(e.startAxis)){this.options.drag.startAxis=e.startAxis}return this}if(r.is.bool(e)){this.options.drag.enabled=e;if(!e){this.ondragstart=this.ondragstart=this.ondragend=null}return this}return this.options.drag};n.drag=u;n.names.push("drag");r.merge(a.eventTypes,["dragstart","dragmove","draginertiastart","draginertiaresume","dragend"]);n.methodDict.drag="draggable";l.drag=u.defaults;t.exports=u},{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"./base":6}],8:[function(e,t,i){"use strict";var n=e("./base");var m=e("../utils");var f=e("../scope");var r=e("../interact");var o=e("../InteractEvent");var a=e("../Interactable");var s=e("../Interaction");var l=e("../defaultOptions");var u={defaults:{enabled:false,accept:null,overlap:"pointer"}};var c=false;s.signals.on("action-start",function(e){var t=e.interaction,i=e.event;if(t.prepared.name!=="drag"){return}t.activeDrops.dropzones=[];t.activeDrops.elements=[];t.activeDrops.rects=[];t.dropEvents=null;if(!t.dynamicDrop){h(t.activeDrops,t.element)}var n=t.prevEvent;var r=v(t,i,n);if(r.activate){p(t.activeDrops,r.activate)}});o.signals.on("new",function(e){var t=e.interaction,i=e.iEvent,n=e.event;if(i.type!=="dragmove"&&i.type!=="dragend"){return}var r=t.element;var o=i;var a=g(o,n,r);t.dropTarget=a.dropzone;t.dropElement=a.element;t.dropEvents=v(t,n,o)});s.signals.on("action-move",function(e){var t=e.interaction;if(t.prepared.name!=="drag"){return}y(t,t.dropEvents)});s.signals.on("action-end",function(e){var t=e.interaction;if(t.prepared.name==="drag"){y(t,t.dropEvents)}});s.signals.on("stop-drag",function(e){var t=e.interaction;t.activeDrops={dropzones:null,elements:null,rects:null};t.dropEvents=null});function d(e,t){var i=[];var n=[];for(var r=0;r<f.interactables.length;r++){var o;o=f.interactables[r];var a=o;if(!a.options.drop.enabled){continue}var s=a.options.drop.accept;if(m.is.element(s)&&s!==t||m.is.string(s)&&!m.matchesSelector(t,s)){continue}var l=m.is.string(a.target)?a._context.querySelectorAll(a.target):[a.target];for(var u=0;u<l.length;u++){var c;c=l[u];var d=c;if(d!==t){i.push(a);n.push(d)}}}return{elements:n,dropzones:i}}function p(e,t){var i=void 0;for(var n=0;n<e.dropzones.length;n++){var r=e.dropzones[n];var o=e.elements[n];if(o!==i){t.target=o;r.fire(t)}i=o}}function h(e,t){var i=d(e,t);e.dropzones=i.dropzones;e.elements=i.elements;e.rects=[];for(var n=0;n<e.dropzones.length;n++){e.rects[n]=e.dropzones[n].getRect(e.elements[n])}}function g(e,t,i){var n=e.interaction;var r=[];if(c){h(n.activeDrops,i)}for(var o=0;o<n.activeDrops.dropzones.length;o++){var a=n.activeDrops.dropzones[o];var s=n.activeDrops.elements[o];var l=n.activeDrops.rects[o];r.push(a.dropCheck(e,t,n.target,i,s,l)?s:null)}var u=m.indexOfDeepestElement(r);return{dropzone:n.activeDrops.dropzones[u]||null,element:n.activeDrops.elements[u]||null}}function v(e,t,i){var n={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};var r={dragEvent:i,interaction:e,target:e.dropElement,dropzone:e.dropTarget,relatedTarget:i.target,draggable:i.interactable,timeStamp:i.timeStamp};if(e.dropElement!==e.prevDropElement){if(e.prevDropTarget){n.leave=m.extend({type:"dragleave"},r);i.dragLeave=n.leave.target=e.prevDropElement;i.prevDropzone=n.leave.dropzone=e.prevDropTarget}if(e.dropTarget){n.enter={dragEvent:i,interaction:e,target:e.dropElement,dropzone:e.dropTarget,relatedTarget:i.target,draggable:i.interactable,timeStamp:i.timeStamp,type:"dragenter"};i.dragEnter=e.dropElement;i.dropzone=e.dropTarget}}if(i.type==="dragend"&&e.dropTarget){n.drop=m.extend({type:"drop"},r);i.dropzone=e.dropTarget;i.relatedTarget=e.dropElement}if(i.type==="dragstart"){n.activate=m.extend({type:"dropactivate"},r);n.activate.target=null;n.activate.dropzone=null}if(i.type==="dragend"){n.deactivate=m.extend({type:"dropdeactivate"},r);n.deactivate.target=null;n.deactivate.dropzone=null}if(i.type==="dragmove"&&e.dropTarget){n.move=m.extend({dragmove:i,type:"dropmove"},r);i.dropzone=e.dropTarget}return n}function y(e,t){var i=e.activeDrops,n=e.prevDropTarget,r=e.dropTarget,o=e.dropElement;if(t.leave){n.fire(t.leave)}if(t.move){r.fire(t.move)}if(t.enter){r.fire(t.enter)}if(t.drop){r.fire(t.drop)}if(t.deactivate){p(i,t.deactivate)}e.prevDropTarget=r;e.prevDropElement=o}a.prototype.dropzone=function(e){if(m.is.object(e)){this.options.drop.enabled=e.enabled===false?false:true;if(m.is.function(e.ondrop)){this.events.ondrop=e.ondrop}if(m.is.function(e.ondropactivate)){this.events.ondropactivate=e.ondropactivate}if(m.is.function(e.ondropdeactivate)){this.events.ondropdeactivate=e.ondropdeactivate}if(m.is.function(e.ondragenter)){this.events.ondragenter=e.ondragenter}if(m.is.function(e.ondragleave)){this.events.ondragleave=e.ondragleave}if(m.is.function(e.ondropmove)){this.events.ondropmove=e.ondropmove}if(/^(pointer|center)$/.test(e.overlap)){this.options.drop.overlap=e.overlap}else if(m.is.number(e.overlap)){this.options.drop.overlap=Math.max(Math.min(1,e.overlap),0)}if("accept"in e){this.options.drop.accept=e.accept}if("checker"in e){this.options.drop.checker=e.checker}return this}if(m.is.bool(e)){this.options.drop.enabled=e;if(!e){this.ondragenter=this.ondragleave=this.ondrop=this.ondropactivate=this.ondropdeactivate=null}return this}return this.options.drop};a.prototype.dropCheck=function(e,t,i,n,r,o){var a=false;if(!(o=o||this.getRect(r))){return this.options.drop.checker?this.options.drop.checker(e,t,a,this,r,i,n):false}var s=this.options.drop.overlap;if(s==="pointer"){var l=m.getOriginXY(i,n,"drag");var u=m.getPageXY(e);u.x+=l.x;u.y+=l.y;var c=u.x>o.left&&u.x<o.right;var d=u.y>o.top&&u.y<o.bottom;a=c&&d}var f=i.getRect(n);if(f&&s==="center"){var p=f.left+f.width/2;var h=f.top+f.height/2;a=p>=o.left&&p<=o.right&&h>=o.top&&h<=o.bottom}if(f&&m.is.number(s)){var g=Math.max(0,Math.min(o.right,f.right)-Math.max(o.left,f.left))*Math.max(0,Math.min(o.bottom,f.bottom)-Math.max(o.top,f.top));var v=g/(f.width*f.height);a=v>=s}if(this.options.drop.checker){a=this.options.drop.checker(e,t,a,this,r,i,n)}return a};a.signals.on("unset",function(e){var t=e.interactable;t.dropzone(false)});a.settingsMethods.push("dropChecker");s.signals.on("new",function(e){e.dropTarget=null;e.dropElement=null;e.prevDropTarget=null;e.prevDropElement=null;e.dropEvents=null;e.activeDrops={dropzones:[],elements:[],rects:[]}});s.signals.on("stop",function(e){var t=e.interaction;t.dropTarget=t.dropElement=t.prevDropTarget=t.prevDropElement=null});r.dynamicDrop=function(e){if(m.is.bool(e)){c=e;return r}return c};m.merge(a.eventTypes,["dragenter","dragleave","dropactivate","dropdeactivate","dropmove","drop"]);n.methodDict.drop="dropzone";l.drop=u.defaults;t.exports=u},{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../interact":21,"../scope":33,"../utils":44,"./base":6}],9:[function(e,t,i){"use strict";var n=e("./base");var u=e("../utils");var c=e("../InteractEvent");var r=e("../Interactable");var o=e("../Interaction");var a=e("../defaultOptions");var s={defaults:{enabled:false,origin:null,restrict:null},checker:function e(t,i,n,r,o){if(o.pointerIds.length>=2){return{name:"gesture"}}return null},getCursor:function e(){return""}};c.signals.on("new",function(e){var t=e.iEvent,i=e.interaction;if(t.type!=="gesturestart"){return}t.ds=0;i.gesture.startDistance=i.gesture.prevDistance=t.distance;i.gesture.startAngle=i.gesture.prevAngle=t.angle;i.gesture.scale=1});c.signals.on("new",function(e){var t=e.iEvent,i=e.interaction;if(t.type!=="gesturemove"){return}t.ds=t.scale-i.gesture.scale;i.target.fire(t);i.gesture.prevAngle=t.angle;i.gesture.prevDistance=t.distance;if(t.scale!==Infinity&&t.scale!==null&&t.scale!==undefined&&!isNaN(t.scale)){i.gesture.scale=t.scale}});r.prototype.gesturable=function(e){if(u.is.object(e)){this.options.gesture.enabled=e.enabled===false?false:true;this.setPerAction("gesture",e);this.setOnEvents("gesture",e);return this}if(u.is.bool(e)){this.options.gesture.enabled=e;if(!e){this.ongesturestart=this.ongesturestart=this.ongestureend=null}return this}return this.options.gesture};c.signals.on("set-delta",function(e){var t=e.interaction,i=e.iEvent,n=e.action,r=e.event,o=e.starting,a=e.ending,s=e.deltaSource;if(n!=="gesture"){return}var l=t.pointers;i.touches=[l[0],l[1]];if(o){i.distance=u.touchDistance(l,s);i.box=u.touchBBox(l);i.scale=1;i.ds=0;i.angle=u.touchAngle(l,undefined,s);i.da=0}else if(a||r instanceof c){i.distance=t.prevEvent.distance;i.box=t.prevEvent.box;i.scale=t.prevEvent.scale;i.ds=i.scale-1;i.angle=t.prevEvent.angle;i.da=i.angle-t.gesture.startAngle}else{i.distance=u.touchDistance(l,s);i.box=u.touchBBox(l);i.scale=i.distance/t.gesture.startDistance;i.angle=u.touchAngle(l,t.gesture.prevAngle,s);i.ds=i.scale-t.gesture.prevScale;i.da=i.angle-t.gesture.prevAngle}});o.signals.on("new",function(e){e.gesture={start:{x:0,y:0},startDistance:0,prevDistance:0,distance:0,scale:1,startAngle:0,prevAngle:0}});n.gesture=s;n.names.push("gesture");u.merge(r.eventTypes,["gesturestart","gesturemove","gestureend"]);n.methodDict.gesture="gesturable";a.gesture=s.defaults;t.exports=s},{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"./base":6}],10:[function(e,t,i){"use strict";var n=e("./base");var b=e("../utils");var r=e("../utils/browser");var o=e("../InteractEvent");var a=e("../Interactable");var s=e("../Interaction");var l=e("../defaultOptions");var h=r.supportsTouch||r.supportsPointerEvent?20:10;var u={defaults:{enabled:false,mouseButtons:null,origin:null,snap:null,restrict:null,inertia:null,autoScroll:null,square:false,preserveAspectRatio:false,axis:"xy",margin:NaN,edges:null,invert:"none"},checker:function e(t,i,n,r,o,a){if(!a){return null}var s=b.extend({},o.curCoords.page);var l=n.options;if(l.resize.enabled){var u=l.resize;var c={left:false,right:false,top:false,bottom:false};if(b.is.object(u.edges)){for(var d in c){c[d]=g(d,u.edges[d],s,o._eventTarget,r,a,u.margin||h)}c.left=c.left&&!c.right;c.top=c.top&&!c.bottom;if(c.left||c.right||c.top||c.bottom){return{name:"resize",edges:c}}}else{var f=l.resize.axis!=="y"&&s.x>a.right-h;var p=l.resize.axis!=="x"&&s.y>a.bottom-h;if(f||p){return{name:"resize",axes:(f?"x":"")+(p?"y":"")}}}}return null},cursors:r.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"},getCursor:function e(t){if(t.axis){return u.cursors[t.name+t.axis]}else if(t.edges){var i="";var n=["top","bottom","left","right"];for(var r=0;r<4;r++){if(t.edges[n[r]]){i+=n[r]}}return u.cursors[i]}}};o.signals.on("new",function(e){var t=e.iEvent,i=e.interaction;if(t.type!=="resizestart"||!i.prepared.edges){return}var n=i.target.getRect(i.element);var r=i.target.options.resize;if(r.square||r.preserveAspectRatio){var o=b.extend({},i.prepared.edges);o.top=o.top||o.left&&!o.bottom;o.left=o.left||o.top&&!o.right;o.bottom=o.bottom||o.right&&!o.top;o.right=o.right||o.bottom&&!o.left;i.prepared._linkedEdges=o}else{i.prepared._linkedEdges=null}if(r.preserveAspectRatio){i.resizeStartAspectRatio=n.width/n.height}i.resizeRects={start:n,current:b.extend({},n),inverted:b.extend({},n),previous:b.extend({},n),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}};t.rect=i.resizeRects.inverted;t.deltaRect=i.resizeRects.delta});o.signals.on("new",function(e){var t=e.iEvent,i=e.phase,n=e.interaction;if(i!=="move"||!n.prepared.edges){return}var r=n.target.options.resize;var o=r.invert;var a=o==="reposition"||o==="negate";var s=n.prepared.edges;var l=n.resizeRects.start;var u=n.resizeRects.current;var c=n.resizeRects.inverted;var d=n.resizeRects.delta;var f=b.extend(n.resizeRects.previous,c);var p=s;var h=t.dx;var g=t.dy;if(r.preserveAspectRatio||r.square){var v=r.preserveAspectRatio?n.resizeStartAspectRatio:1;s=n.prepared._linkedEdges;if(p.left&&p.bottom||p.right&&p.top){g=-h/v}else if(p.left||p.right){g=h/v}else if(p.top||p.bottom){h=g*v}}if(s.top){u.top+=g}if(s.bottom){u.bottom+=g}if(s.left){u.left+=h}if(s.right){u.right+=h}if(a){b.extend(c,u);if(o==="reposition"){var m=void 0;if(c.top>c.bottom){m=c.top;c.top=c.bottom;c.bottom=m}if(c.left>c.right){m=c.left;c.left=c.right;c.right=m}}}else{c.top=Math.min(u.top,l.bottom);c.bottom=Math.max(u.bottom,l.top);c.left=Math.min(u.left,l.right);c.right=Math.max(u.right,l.left)}c.width=c.right-c.left;c.height=c.bottom-c.top;for(var y in c){d[y]=c[y]-f[y]}t.edges=n.prepared.edges;t.rect=c;t.deltaRect=d});a.prototype.resizable=function(e){if(b.is.object(e)){this.options.resize.enabled=e.enabled===false?false:true;this.setPerAction("resize",e);this.setOnEvents("resize",e);if(/^x$|^y$|^xy$/.test(e.axis)){this.options.resize.axis=e.axis}else if(e.axis===null){this.options.resize.axis=l.resize.axis}if(b.is.bool(e.preserveAspectRatio)){this.options.resize.preserveAspectRatio=e.preserveAspectRatio}else if(b.is.bool(e.square)){this.options.resize.square=e.square}return this}if(b.is.bool(e)){this.options.resize.enabled=e;if(!e){this.onresizestart=this.onresizestart=this.onresizeend=null}return this}return this.options.resize};function g(e,t,i,n,r,o,a){if(!t){return false}if(t===true){var s=b.is.number(o.width)?o.width:o.right-o.left;var l=b.is.number(o.height)?o.height:o.bottom-o.top;if(s<0){if(e==="left"){e="right"}else if(e==="right"){e="left"}}if(l<0){if(e==="top"){e="bottom"}else if(e==="bottom"){e="top"}}if(e==="left"){return i.x<(s>=0?o.left:o.right)+a}if(e==="top"){return i.y<(l>=0?o.top:o.bottom)+a}if(e==="right"){return i.x>(s>=0?o.right:o.left)-a}if(e==="bottom"){return i.y>(l>=0?o.bottom:o.top)-a}}if(!b.is.element(n)){return false}return b.is.element(t)?t===n:b.matchesUpTo(n,t,r)}s.signals.on("new",function(e){e.resizeAxes="xy"});o.signals.on("set-delta",function(e){var t=e.interaction,i=e.iEvent,n=e.action;if(n!=="resize"||!t.resizeAxes){return}var r=t.target.options;if(r.resize.square){if(t.resizeAxes==="y"){i.dx=i.dy}else{i.dy=i.dx}i.axes="xy"}else{i.axes=t.resizeAxes;if(t.resizeAxes==="x"){i.dy=0}else if(t.resizeAxes==="y"){i.dx=0}}});n.resize=u;n.names.push("resize");b.merge(a.eventTypes,["resizestart","resizemove","resizeinertiastart","resizeinertiaresume","resizeend"]);n.methodDict.resize="resizable";l.resize=u.defaults;t.exports=u},{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"../utils/browser":36,"./base":6}],11:[function(e,t,i){"use strict";var a=e("./utils/raf");var d=e("./utils/window").getWindow;var f=e("./utils/is");var p=e("./utils/domUtils");var n=e("./Interaction");var r=e("./defaultOptions");var h={defaults:{enabled:false,container:null,margin:60,speed:300},interaction:null,i:null,x:0,y:0,isScrolling:false,prevTime:0,start:function e(t){h.isScrolling=true;a.cancel(h.i);h.interaction=t;h.prevTime=(new Date).getTime();h.i=a.request(h.scroll)},stop:function e(){h.isScrolling=false;a.cancel(h.i)},scroll:function e(){var t=h.interaction.target.options[h.interaction.prepared.name].autoScroll;var i=t.container||d(h.interaction.element);var n=(new Date).getTime();var r=(n-h.prevTime)/1e3;var o=t.speed*r;if(o>=1){if(f.window(i)){i.scrollBy(h.x*o,h.y*o)}else if(i){i.scrollLeft+=h.x*o;i.scrollTop+=h.y*o}h.prevTime=n}if(h.isScrolling){a.cancel(h.i);h.i=a.request(h.scroll)}},check:function e(t,i){var n=t.options;return n[i].autoScroll&&n[i].autoScroll.enabled},onInteractionMove:function e(t){var i=t.interaction,n=t.pointer;if(!(i.interacting()&&h.check(i.target,i.prepared.name))){return}if(i.simulation){h.x=h.y=0;return}var r=void 0;var o=void 0;var a=void 0;var s=void 0;var l=i.target.options[i.prepared.name].autoScroll;var u=l.container||d(i.element);if(f.window(u)){s=n.clientX<h.margin;r=n.clientY<h.margin;o=n.clientX>u.innerWidth-h.margin;a=n.clientY>u.innerHeight-h.margin}else{var c=p.getElementClientRect(u);s=n.clientX<c.left+h.margin;r=n.clientY<c.top+h.margin;o=n.clientX>c.right-h.margin;a=n.clientY>c.bottom-h.margin}h.x=o?1:s?-1:0;h.y=a?1:r?-1:0;if(!h.isScrolling){h.margin=l.margin;h.speed=l.speed;h.start(i)}}};n.signals.on("stop-active",function(){h.stop()});n.signals.on("action-move",h.onInteractionMove);r.perAction.autoScroll=h.defaults;t.exports=h},{"./Interaction":5,"./defaultOptions":18,"./utils/domUtils":39,"./utils/is":46,"./utils/raf":50,"./utils/window":52}],12:[function(e,t,i){"use strict";var n=e("../Interactable");var c=e("../actions/base");var r=e("../utils/is");var o=e("../utils/domUtils");var a=e("../utils"),s=a.warnOnce;n.prototype.getAction=function(e,t,i,n){var r=this.defaultActionChecker(e,t,i,n);if(this.options.actionChecker){return this.options.actionChecker(e,t,r,this,n,i)}return r};n.prototype.ignoreFrom=s(function(e){return this._backCompatOption("ignoreFrom",e)},"Interactable.ignoreForm() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).");n.prototype.allowFrom=s(function(e){return this._backCompatOption("allowFrom",e)},"Interactable.allowForm() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).");n.prototype.testIgnore=function(e,t,i){if(!e||!r.element(i)){return false}if(r.string(e)){return o.matchesUpTo(i,e,t)}else if(r.element(e)){return o.nodeContains(e,i)}return false};n.prototype.testAllow=function(e,t,i){if(!e){return true}if(!r.element(i)){return false}if(r.string(e)){return o.matchesUpTo(i,e,t)}else if(r.element(e)){return o.nodeContains(e,i)}return false};n.prototype.testIgnoreAllow=function(e,t,i){return!this.testIgnore(e.ignoreFrom,t,i)&&this.testAllow(e.allowFrom,t,i)};n.prototype.actionChecker=function(e){if(r.function(e)){this.options.actionChecker=e;return this}if(e===null){delete this.options.actionChecker;return this}return this.options.actionChecker};n.prototype.styleCursor=function(e){if(r.bool(e)){this.options.styleCursor=e;return this}if(e===null){delete this.options.styleCursor;return this}return this.options.styleCursor};n.prototype.defaultActionChecker=function(e,t,i,n){var r=this.getRect(n);var o=t.buttons||{0:1,1:4,3:8,4:16}[t.button];var a=null;for(var s=0;s<c.names.length;s++){var l;l=c.names[s];var u=l;if(i.pointerIsDown&&/mouse|pointer/.test(i.pointerType)&&(o&this.options[u].mouseButtons)===0){continue}a=c[u].checker(e,t,this,n,i,r);if(a){return a}}}},{"../Interactable":4,"../actions/base":6,"../utils":44,"../utils/domUtils":39,"../utils/is":46}],13:[function(e,t,i){"use strict";var n=e("../interact");var r=e("../Interactable");var o=e("../Interaction");var a=e("../actions/base");var s=e("../defaultOptions");var p=e("../scope");var u=e("../utils");var l=e("../utils/Signals").new();e("./InteractableMethods");var h={signals:l,withinInteractionLimit:v,maxInteractions:Infinity,defaults:{perAction:{manualStart:false,max:Infinity,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}},setActionDefaults:function e(t){u.extend(t.defaults,h.defaults.perAction)},validateAction:d};o.signals.on("down",function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget;if(t.interacting()){return}var o=f(t,i,n,r);g(t,o)});o.signals.on("move",function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget;if(t.pointerType!=="mouse"||t.pointerIsDown||t.interacting()){return}var o=f(t,i,n,r);g(t,o)});o.signals.on("move",function(e){var t=e.interaction,i=e.event;if(!t.pointerIsDown||t.interacting()||!t.pointerWasMoved||!t.prepared.name){return}l.fire("before-start",e);var n=t.target;if(t.prepared.name&&n){if(n.options[t.prepared.name].manualStart||!v(n,t.element,t.prepared)){t.stop(i)}else{t.start(t.prepared,n,t.element)}}});function d(e,t,i,n){if(u.is.object(e)&&t.testIgnoreAllow(t.options[e.name],i,n)&&t.options[e.name].enabled&&v(t,i,e)){return e}return null}function c(e,t,i,n,r,o){for(var a=0,s=n.length;a<s;a++){var l=n[a];var u=r[a];var c=d(l.getAction(t,i,e,u),l,u,o);if(c){return{action:c,target:l,element:u}}}return{}}function f(e,t,i,n){var r=[];var o=[];var a=n;function s(e){r.push(e);o.push(a)}while(u.is.element(a)){r=[];o=[];p.interactables.forEachMatch(a,s);var l=c(e,t,i,r,o,n);if(l.action&&!l.target.options[l.action.name].manualStart){return l}a=u.parentNode(a)}return{}}function g(e,t){var i=t.action,n=t.target,r=t.element;i=i||{};if(e.target&&e.target.options.styleCursor){e.target._doc.documentElement.style.cursor=""}e.target=n;e.element=r;u.copyAction(e.prepared,i);if(n&&n.options.styleCursor){var o=i?a[i.name].getCursor(i):"";e.target._doc.documentElement.style.cursor=o}l.fire("prepared",{interaction:e})}o.signals.on("stop",function(e){var t=e.interaction;var i=t.target;if(i&&i.options.styleCursor){i._doc.documentElement.style.cursor=""}});function v(e,t,i){var n=e.options;var r=n[i.name].max;var o=n[i.name].maxPerElement;var a=0;var s=0;var l=0;if(!(r&&o&&h.maxInteractions)){return}for(var u=0;u<p.interactions.length;u++){var c;c=p.interactions[u];var d=c;var f=d.prepared.name;if(!d.interacting()){continue}a++;if(a>=h.maxInteractions){return false}if(d.target!==e){continue}s+=f===i.name|0;if(s>=r){return false}if(d.element===t){l++;if(f!==i.name||l>=o){return false}}}return h.maxInteractions>0}n.maxInteractions=function(e){if(u.is.number(e)){h.maxInteractions=e;return n}return h.maxInteractions};r.settingsMethods.push("styleCursor");r.settingsMethods.push("actionChecker");r.settingsMethods.push("ignoreFrom");r.settingsMethods.push("allowFrom");s.base.actionChecker=null;s.base.styleCursor=true;u.extend(s.perAction,h.defaults.perAction);t.exports=h},{"../Interactable":4,"../Interaction":5,"../actions/base":6,"../defaultOptions":18,"../interact":21,"../scope":33,"../utils":44,"../utils/Signals":34,"./InteractableMethods":12}],14:[function(e,t,i){"use strict";var p=e("./base");var h=e("../scope");var g=e("../utils/is");var n=e("../utils/domUtils"),v=n.parentNode;p.setActionDefaults(e("../actions/drag"));p.signals.on("before-start",function(e){var r=e.interaction,o=e.eventTarget,t=e.dx,i=e.dy;if(r.prepared.name!=="drag"){return}var n=Math.abs(t);var a=Math.abs(i);var s=r.target.options.drag;var l=s.startAxis;var u=n>a?"x":n<a?"y":"xy";r.prepared.axis=s.lockAxis==="start"?u[0]:s.lockAxis;if(u!=="xy"&&l!=="xy"&&l!==u){r.prepared.name=null;var c=o;var d=function e(t){if(t===r.target){return}var i=r.target.options.drag;if(!i.manualStart&&t.testIgnoreAllow(i,c,o)){var n=t.getAction(r.downPointer,r.downEvent,r,c);if(n&&n.name==="drag"&&m(u,t)&&p.validateAction(n,t,c,o)){return t}}};while(g.element(c)){var f=h.interactables.forEachMatch(c,d);if(f){r.prepared.name="drag";r.target=f;r.element=c;break}c=v(c)}}});function m(e,t){if(!t){return false}var i=t.options.drag.startAxis;return e==="xy"||i==="xy"||i===e}},{"../actions/drag":7,"../scope":33,"../utils/domUtils":39,"../utils/is":46,"./base":13}],15:[function(e,t,i){"use strict";e("./base").setActionDefaults(e("../actions/gesture"))},{"../actions/gesture":9,"./base":13}],16:[function(e,t,i){"use strict";var n=e("./base");var r=e("../Interaction");n.defaults.perAction.hold=0;n.defaults.perAction.delay=0;r.signals.on("new",function(e){e.autoStartHoldTimer=null});n.signals.on("prepared",function(e){var t=e.interaction;var i=o(t);if(i>0){t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.target,t.element)},i)}});r.signals.on("move",function(e){var t=e.interaction,i=e.duplicate;if(t.pointerWasMoved&&!i){clearTimeout(t.autoStartHoldTimer)}});n.signals.on("before-start",function(e){var t=e.interaction;var i=o(t);if(i>0){t.prepared.name=null}});function o(e){var t=e.prepared&&e.prepared.name;if(!t){return null}var i=e.target.options;return i[t].hold||i[t].delay}t.exports={getHoldDuration:o}},{"../Interaction":5,"./base":13}],17:[function(e,t,i){"use strict";e("./base").setActionDefaults(e("../actions/resize"))},{"../actions/resize":10,"./base":13}],18:[function(e,t,i){"use strict";t.exports={base:{accept:null,preventDefault:"auto",deltaSource:"page"},perAction:{origin:{x:0,y:0},inertia:{enabled:false,resistance:10,minSpeed:100,endSpeed:10,allowResume:true,smoothEndDuration:300}}}},{}],19:[function(e,t,i){"use strict";e("./inertia");e("./modifiers/snap");e("./modifiers/restrict");e("./pointerEvents/base");e("./pointerEvents/holdRepeat");e("./pointerEvents/interactableTargets");e("./autoStart/hold");e("./actions/gesture");e("./actions/resize");e("./actions/drag");e("./actions/drop");e("./modifiers/snapSize");e("./modifiers/restrictEdges");e("./modifiers/restrictSize");e("./autoStart/gesture");e("./autoStart/resize");e("./autoStart/drag");e("./interactablePreventDefault.js");e("./autoScroll");t.exports=e("./interact")},{"./actions/drag":7,"./actions/drop":8,"./actions/gesture":9,"./actions/resize":10,"./autoScroll":11,"./autoStart/drag":14,"./autoStart/gesture":15,"./autoStart/hold":16,"./autoStart/resize":17,"./inertia":20,"./interact":21,"./interactablePreventDefault.js":22,"./modifiers/restrict":24,"./modifiers/restrictEdges":25,"./modifiers/restrictSize":26,"./modifiers/snap":27,"./modifiers/snapSize":28,"./pointerEvents/base":30,"./pointerEvents/holdRepeat":31,"./pointerEvents/interactableTargets":32}],20:[function(e,t,i){"use strict";var v=e("./InteractEvent");var u=e("./Interaction");var m=e("./modifiers/base");var y=e("./utils");var b=e("./utils/raf");u.signals.on("new",function(e){e.inertiaStatus={active:false,smoothEnd:false,allowResume:false,startEvent:null,upCoords:{},xe:0,ye:0,sx:0,sy:0,t0:0,vx0:0,vys:0,duration:0,lambda_v0:0,one_ve_v0:0,i:null};e.boundInertiaFrame=function(){return n.apply(e)};e.boundSmoothEndFrame=function(){return r.apply(e)}});u.signals.on("down",function(e){var t=e.interaction,i=e.event,n=e.pointer,r=e.eventTarget;var o=t.inertiaStatus;if(o.active){var a=r;while(y.is.element(a)){if(a===t.element){b.cancel(o.i);o.active=false;t.simulation=null;t.updatePointer(n);y.setCoords(t.curCoords,t.pointers);var s={interaction:t};u.signals.fire("before-action-move",s);u.signals.fire("action-resume",s);var l=new v(t,i,t.prepared.name,"inertiaresume",t.element);t.target.fire(l);t.prevEvent=l;m.resetStatuses(t.modifierStatuses);y.copyCoords(t.prevCoords,t.curCoords);break}a=y.parentNode(a)}}});u.signals.on("up",function(e){var t=e.interaction,i=e.event;var n=t.inertiaStatus;if(!t.interacting()||n.active){return}var r=t.target;var o=r&&r.options;var a=o&&t.prepared.name&&o[t.prepared.name].inertia;var s=(new Date).getTime();var l={};var u=y.extend({},t.curCoords.page);var c=t.pointerDelta.client.speed;var d=false;var f=void 0;var p=a&&a.enabled&&t.prepared.name!=="gesture"&&i!==n.startEvent;var h=p&&s-t.curCoords.timeStamp<50&&c>a.minSpeed&&c>a.endSpeed;var g={interaction:t,pageCoords:u,statuses:l,preEnd:true,requireEndOnly:true};if(p&&!h){m.resetStatuses(l);f=m.setAll(g);if(f.shouldMove&&f.locked){d=true}}if(!(h||d)){return}y.copyCoords(n.upCoords,t.curCoords);t.pointers[0]=n.startEvent=new v(t,i,t.prepared.name,"inertiastart",t.element);n.t0=s;n.active=true;n.allowResume=a.allowResume;t.simulation=n;r.fire(n.startEvent);if(h){n.vx0=t.pointerDelta.client.vx;n.vy0=t.pointerDelta.client.vy;n.v0=c;_(t,n);y.extend(u,t.curCoords.page);u.x+=n.xe;u.y+=n.ye;m.resetStatuses(l);f=m.setAll(g);n.modifiedXe+=f.dx;n.modifiedYe+=f.dy;n.i=b.request(t.boundInertiaFrame)}else{n.smoothEnd=true;n.xe=f.dx;n.ye=f.dy;n.sx=n.sy=0;n.i=b.request(t.boundSmoothEndFrame)}});u.signals.on("stop-active",function(e){var t=e.interaction;var i=t.inertiaStatus;if(i.active){b.cancel(i.i);i.active=false;t.simulation=null}});function _(e,t){var i=e.target.options[e.prepared.name].inertia;var n=i.resistance;var r=-Math.log(i.endSpeed/t.v0)/n;t.x0=e.prevEvent.pageX;t.y0=e.prevEvent.pageY;t.t0=t.startEvent.timeStamp/1e3;t.sx=t.sy=0;t.modifiedXe=t.xe=(t.vx0-r)/n;t.modifiedYe=t.ye=(t.vy0-r)/n;t.te=r;t.lambda_v0=n/t.v0;t.one_ve_v0=1-i.endSpeed/t.v0}function n(){a(this);y.setCoordDeltas(this.pointerDelta,this.prevCoords,this.curCoords);var e=this.inertiaStatus;var t=this.target.options[this.prepared.name].inertia;var i=t.resistance;var n=(new Date).getTime()/1e3-e.t0;if(n<e.te){var r=1-(Math.exp(-i*n)-e.lambda_v0)/e.one_ve_v0;if(e.modifiedXe===e.xe&&e.modifiedYe===e.ye){e.sx=e.xe*r;e.sy=e.ye*r}else{var o=y.getQuadraticCurvePoint(0,0,e.xe,e.ye,e.modifiedXe,e.modifiedYe,r);e.sx=o.x;e.sy=o.y}this.doMove();e.i=b.request(this.boundInertiaFrame)}else{e.sx=e.modifiedXe;e.sy=e.modifiedYe;this.doMove();this.end(e.startEvent);e.active=false;this.simulation=null}y.copyCoords(this.prevCoords,this.curCoords)}function r(){a(this);var e=this.inertiaStatus;var t=(new Date).getTime()-e.t0;var i=this.target.options[this.prepared.name].inertia.smoothEndDuration;if(t<i){e.sx=y.easeOutQuad(t,0,e.xe,i);e.sy=y.easeOutQuad(t,0,e.ye,i);this.pointerMove(e.startEvent,e.startEvent);e.i=b.request(this.boundSmoothEndFrame)}else{e.sx=e.xe;e.sy=e.ye;this.pointerMove(e.startEvent,e.startEvent);this.end(e.startEvent);e.smoothEnd=e.active=false;this.simulation=null}}function a(e){var t=e.inertiaStatus;if(!t.active){return}var i=t.upCoords.page;var n=t.upCoords.client;y.setCoords(e.curCoords,[{pageX:i.x+t.sx,pageY:i.y+t.sy,clientX:n.x+t.sx,clientY:n.y+t.sy}])}},{"./InteractEvent":3,"./Interaction":5,"./modifiers/base":23,"./utils":44,"./utils/raf":50}],21:[function(e,t,i){"use strict";var n=e("./utils/browser");var l=e("./utils/events");var u=e("./utils");var c=e("./scope");var d=e("./Interactable");var r=e("./Interaction");var f={};function p(e,t){var i=c.interactables.get(e,t);if(!i){i=new d(e,t);i.events.global=f}return i}p.isSet=function(e,t){return c.interactables.indexOfElement(e,t&&t.context)!==-1};p.on=function(e,t,i){if(u.is.string(e)&&e.search(" ")!==-1){e=e.trim().split(/ +/)}if(u.is.array(e)){for(var n=0;n<e.length;n++){var r;r=e[n];var o=r;p.on(o,t,i)}return p}if(u.is.object(e)){for(var a in e){p.on(a,e[a],t)}return p}if(u.contains(d.eventTypes,e)){if(!f[e]){f[e]=[t]}else{f[e].push(t)}}else{l.add(c.document,e,t,{options:i})}return p};p.off=function(e,t,i){if(u.is.string(e)&&e.search(" ")!==-1){e=e.trim().split(/ +/)}if(u.is.array(e)){for(var n=0;n<e.length;n++){var r;r=e[n];var o=r;p.off(o,t,i)}return p}if(u.is.object(e)){for(var a in e){p.off(a,e[a],t)}return p}if(!u.contains(d.eventTypes,e)){l.remove(c.document,e,t,i)}else{var s=void 0;if(e in f&&(s=f[e].indexOf(t))!==-1){f[e].splice(s,1)}}return p};p.debug=function(){return c};p.getPointerAverage=u.pointerAverage;p.getTouchBBox=u.touchBBox;p.getTouchDistance=u.touchDistance;p.getTouchAngle=u.touchAngle;p.getElementRect=u.getElementRect;p.getElementClientRect=u.getElementClientRect;p.matchesSelector=u.matchesSelector;p.closest=u.closest;p.supportsTouch=function(){return n.supportsTouch};p.supportsPointerEvent=function(){return n.supportsPointerEvent};p.stop=function(e){for(var t=c.interactions.length-1;t>=0;t--){c.interactions[t].stop(e)}return p};p.pointerMoveTolerance=function(e){if(u.is.number(e)){r.pointerMoveTolerance=e;return p}return r.pointerMoveTolerance};p.addDocument=c.addDocument;p.removeDocument=c.removeDocument;c.interact=p;t.exports=p},{"./Interactable":4,"./Interaction":5,"./scope":33,"./utils":44,"./utils/browser":36,"./utils/events":40}],22:[function(e,t,i){"use strict";var n=e("./Interactable");var r=e("./Interaction");var o=e("./scope");var a=e("./utils/is");var s=e("./utils/events");var l=e("./utils/browser");var u=e("./utils/domUtils"),c=u.nodeContains,d=u.matchesSelector;n.prototype.preventDefault=function(e){if(/^(always|never|auto)$/.test(e)){this.options.preventDefault=e;return this}if(a.bool(e)){this.options.preventDefault=e?"always":"never";return this}return this.options.preventDefault};n.prototype.checkAndPreventDefault=function(e){var t=this.options.preventDefault;if(t==="never"){return}if(t==="always"){e.preventDefault();return}if(s.supportsPassive&&/^touch(start|move)$/.test(e.type)&&!l.isIOS){return}if(/^(mouse|pointer|touch)*(down|start)/i.test(e.type)){return}if(a.element(e.target)&&d(e.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")){return}e.preventDefault()};function f(e){var t=e.interaction,i=e.event;if(t.target){t.target.checkAndPreventDefault(i)}}var p=["down","move","up","cancel"];for(var h=0;h<p.length;h++){var g=p[h];r.signals.on(g,f)}r.docEvents.dragstart=function e(t){for(var i=0;i<o.interactions.length;i++){var n;n=o.interactions[i];var r=n;if(r.element&&(r.element===t.target||c(r.element,t.target))){r.target.checkAndPreventDefault(t);return}}}},{"./Interactable":4,"./Interaction":5,"./scope":33,"./utils/browser":36,"./utils/domUtils":39,"./utils/events":40,"./utils/is":46}],23:[function(e,t,i){"use strict";var n=e("../InteractEvent");var r=e("../Interaction");var f=e("../utils/extend");var p={names:[],setOffsets:function e(t){var i=t.interaction,n=t.pageCoords;var r=i.target,o=i.element,a=i.startOffset;var s=r.getRect(o);if(s){a.left=n.x-s.left;a.top=n.y-s.top;a.right=s.right-n.x;a.bottom=s.bottom-n.y;if(!("width"in s)){s.width=s.right-s.left}if(!("height"in s)){s.height=s.bottom-s.top}}else{a.left=a.top=a.right=a.bottom=0}t.rect=s;t.interactable=r;t.element=o;for(var l=0;l<p.names.length;l++){var u;u=p.names[l];var c=u;t.options=r.options[i.prepared.name][c];if(!t.options){continue}i.modifierOffsets[c]=p[c].setOffset(t)}},setAll:function e(t){var i=t.interaction,n=t.statuses,r=t.preEnd,o=t.requireEndOnly;var a={dx:0,dy:0,changed:false,locked:false,shouldMove:true};t.modifiedCoords=f({},t.pageCoords);for(var s=0;s<p.names.length;s++){var l;l=p.names[s];var u=l;var c=p[u];var d=i.target.options[i.prepared.name][u];if(!h(d,r,o)){continue}t.status=t.status=n[u];t.options=d;t.offset=t.interaction.modifierOffsets[u];c.set(t);if(t.status.locked){t.modifiedCoords.x+=t.status.dx;t.modifiedCoords.y+=t.status.dy;a.dx+=t.status.dx;a.dy+=t.status.dy;a.locked=true}}a.shouldMove=!t.status||!a.locked||t.status.changed;return a},resetStatuses:function e(t){for(var i=0;i<p.names.length;i++){var n;n=p.names[i];var r=n;var o=t[r]||{};o.dx=o.dy=0;o.modifiedX=o.modifiedY=NaN;o.locked=false;o.changed=true;t[r]=o}return t},start:function e(t,i){var n=t.interaction;var r={interaction:n,pageCoords:(i==="action-resume"?n.curCoords:n.startCoords).page,startOffset:n.startOffset,statuses:n.modifierStatuses,preEnd:false,requireEndOnly:false};p.setOffsets(r);p.resetStatuses(r.statuses);r.pageCoords=f({},n.startCoords.page);n.modifierResult=p.setAll(r)},beforeMove:function e(t){var i=t.interaction,n=t.preEnd,r=t.interactingBeforeMove;var o=p.setAll({interaction:i,preEnd:n,pageCoords:i.curCoords.page,statuses:i.modifierStatuses,requireEndOnly:false});if(!o.shouldMove&&r){i._dontFireMove=true}i.modifierResult=o},end:function e(t){var i=t.interaction,n=t.event;for(var r=0;r<p.names.length;r++){var o;o=p.names[r];var a=o;var s=i.target.options[i.prepared.name][a];if(h(s,true,true)){i.doMove({event:n,preEnd:true});break}}},setXY:function e(t){var i=t.iEvent,n=t.interaction;var r=f({},t);for(var o=0;o<p.names.length;o++){var a=p.names[o];r.options=n.target.options[n.prepared.name][a];if(!r.options){continue}var s=p[a];r.status=n.modifierStatuses[a];i[a]=s.modifyCoords(r)}}};r.signals.on("new",function(e){e.startOffset={left:0,right:0,top:0,bottom:0};e.modifierOffsets={};e.modifierStatuses=p.resetStatuses({});e.modifierResult=null});r.signals.on("action-start",p.start);r.signals.on("action-resume",p.start);r.signals.on("before-action-move",p.beforeMove);r.signals.on("action-end",p.end);n.signals.on("set-xy",p.setXY);function h(e,t,i){return e&&e.enabled&&(t||!e.endOnly)&&(!i||e.endOnly)}t.exports=p},{"../InteractEvent":3,"../Interaction":5,"../utils/extend":41}],24:[function(e,t,i){"use strict";var n=e("./base");var f=e("../utils");var r=e("../defaultOptions");var o={defaults:{enabled:false,endOnly:false,restriction:null,elementRect:null},setOffset:function e(t){var i=t.rect,n=t.startOffset,r=t.options;var o=r&&r.elementRect;var a={};if(i&&o){a.left=n.left-i.width*o.left;a.top=n.top-i.height*o.top;a.right=n.right-i.width*(1-o.right);a.bottom=n.bottom-i.height*(1-o.bottom)}else{a.left=a.top=a.right=a.bottom=0}return a},set:function e(t){var i=t.modifiedCoords,n=t.interaction,r=t.status,o=t.options;if(!o){return r}var a=r.useStatusXY?{x:r.x,y:r.y}:f.extend({},i);var s=p(o.restriction,n,a);if(!s){return r}r.dx=0;r.dy=0;r.locked=false;var l=s;var u=a.x;var c=a.y;var d=n.modifierOffsets.restrict;if("x"in s&&"y"in s){u=Math.max(Math.min(l.x+l.width-d.right,a.x),l.x+d.left);c=Math.max(Math.min(l.y+l.height-d.bottom,a.y),l.y+d.top)}else{u=Math.max(Math.min(l.right-d.right,a.x),l.left+d.left);c=Math.max(Math.min(l.bottom-d.bottom,a.y),l.top+d.top)}r.dx=u-a.x;r.dy=c-a.y;r.changed=r.modifiedX!==u||r.modifiedY!==c;r.locked=!!(r.dx||r.dy);r.modifiedX=u;r.modifiedY=c},modifyCoords:function e(t){var i=t.page,n=t.client,r=t.status,o=t.phase,a=t.options;var s=a&&a.elementRect;if(a&&a.enabled&&!(o==="start"&&s&&r.locked)){if(r.locked){i.x+=r.dx;i.y+=r.dy;n.x+=r.dx;n.y+=r.dy;return{dx:r.dx,dy:r.dy}}}},getRestrictionRect:p};function p(e,t,i){if(f.is.function(e)){return f.resolveRectLike(e,t.target,t.element,[i.x,i.y,t])}else{return f.resolveRectLike(e,t.target,t.element)}}n.restrict=o;n.names.push("restrict");r.perAction.restrict=o.defaults;t.exports=o},{"../defaultOptions":18,"../utils":44,"./base":23}],25:[function(e,t,i){"use strict";var n=e("./base");var p=e("../utils");var h=e("../utils/rect");var r=e("../defaultOptions");var o=e("../actions/resize");var a=e("./restrict"),g=a.getRestrictionRect;var v={top:+Infinity,left:+Infinity,bottom:-Infinity,right:-Infinity};var m={top:-Infinity,left:-Infinity,bottom:+Infinity,right:+Infinity};var s={defaults:{enabled:false,endOnly:false,min:null,max:null,offset:null},setOffset:function e(t){var i=t.interaction,n=t.startOffset,r=t.options;if(!r){return p.extend({},n)}var o=g(r.offset,i,i.startCoords.page);if(o){return{top:n.top+o.y,left:n.left+o.x,bottom:n.bottom+o.y,right:n.right+o.x}}return n},set:function e(t){var i=t.modifiedCoords,n=t.interaction,r=t.status,o=t.offset,a=t.options;var s=n.prepared.linkedEdges||n.prepared.edges;if(!n.interacting()||!s){return}var l=r.useStatusXY?{x:r.x,y:r.y}:p.extend({},i);var u=h.xywhToTlbr(g(a.inner,n,l))||v;var c=h.xywhToTlbr(g(a.outer,n,l))||m;var d=l.x;var f=l.y;r.dx=0;r.dy=0;r.locked=false;if(s.top){f=Math.min(Math.max(c.top+o.top,l.y),u.top+o.top)}else if(s.bottom){f=Math.max(Math.min(c.bottom-o.bottom,l.y),u.bottom-o.bottom)}if(s.left){d=Math.min(Math.max(c.left+o.left,l.x),u.left+o.left)}else if(s.right){d=Math.max(Math.min(c.right-o.right,l.x),u.right-o.right)}r.dx=d-l.x;r.dy=f-l.y;r.changed=r.modifiedX!==d||r.modifiedY!==f;r.locked=!!(r.dx||r.dy);r.modifiedX=d;r.modifiedY=f},modifyCoords:function e(t){var i=t.page,n=t.client,r=t.status,o=t.phase,a=t.options;if(a&&a.enabled&&!(o==="start"&&r.locked)){if(r.locked){i.x+=r.dx;i.y+=r.dy;n.x+=r.dx;n.y+=r.dy;return{dx:r.dx,dy:r.dy}}}},noInner:v,noOuter:m,getRestrictionRect:g};n.restrictEdges=s;n.names.push("restrictEdges");r.perAction.restrictEdges=s.defaults;o.defaults.restrictEdges=s.defaults;t.exports=s},{"../actions/resize":10,"../defaultOptions":18,"../utils":44,"../utils/rect":51,"./base":23,"./restrict":24}],26:[function(e,t,i){"use strict";var n=e("./base");var l=e("./restrictEdges");var u=e("../utils");var c=e("../utils/rect");var r=e("../defaultOptions");var o=e("../actions/resize");var d={width:-Infinity,height:-Infinity};var f={width:+Infinity,height:+Infinity};var a={defaults:{enabled:false,endOnly:false,min:null,max:null},setOffset:function e(t){var i=t.interaction;return i.startOffset},set:function e(t){var i=t.interaction,n=t.options;var r=i.prepared.linkedEdges||i.prepared.edges;if(!i.interacting()||!r){return}var o=c.xywhToTlbr(i.resizeRects.inverted);var a=c.tlbrToXywh(l.getRestrictionRect(n.min,i))||d;var s=c.tlbrToXywh(l.getRestrictionRect(n.max,i))||f;t.options={enabled:n.enabled,endOnly:n.endOnly,inner:u.extend({},l.noInner),outer:u.extend({},l.noOuter)};if(r.top){t.options.inner.top=o.bottom-a.height;t.options.outer.top=o.bottom-s.height}else if(r.bottom){t.options.inner.bottom=o.top+a.height;t.options.outer.bottom=o.top+s.height}if(r.left){t.options.inner.left=o.right-a.width;t.options.outer.left=o.right-s.width}else if(r.right){t.options.inner.right=o.left+a.width;t.options.outer.right=o.left+s.width}l.set(t)},modifyCoords:l.modifyCoords};n.restrictSize=a;n.names.push("restrictSize");r.perAction.restrictSize=a.defaults;o.defaults.restrictSize=a.defaults;t.exports=a},{"../actions/resize":10,"../defaultOptions":18,"../utils":44,"../utils/rect":51,"./base":23,"./restrictEdges":25}],27:[function(e,t,i){"use strict";var n=e("./base");var r=e("../interact");var O=e("../utils");var o=e("../defaultOptions");var a={defaults:{enabled:false,endOnly:false,range:Infinity,targets:null,offsets:null,relativePoints:null},setOffset:function e(t){var i=t.interaction,n=t.interactable,r=t.element,o=t.rect,a=t.startOffset,s=t.options;var l=[];var u=O.rectToXY(O.resolveRectLike(s.origin));var c=u||O.getOriginXY(n,r,i.prepared.name);s=s||n.options[i.prepared.name].snap||{};var d=void 0;if(s.offset==="startCoords"){d={x:i.startCoords.page.x-c.x,y:i.startCoords.page.y-c.y}}else{var f=O.resolveRectLike(s.offset,n,r,[i]);d=O.rectToXY(f)||{x:0,y:0}}if(o&&s.relativePoints&&s.relativePoints.length){for(var p=0;p<s.relativePoints.length;p++){var h;h=s.relativePoints[p];var g=h;var v=g.x;var m=g.y;l.push({x:a.left-o.width*v+d.x,y:a.top-o.height*m+d.y})}}else{l.push(d)}return l},set:function e(t){var i=t.interaction,n=t.modifiedCoords,r=t.status,o=t.options,a=t.offset;var s=[];var l=void 0;var u=void 0;var c=void 0;if(r.useStatusXY){u={x:r.x,y:r.y}}else{var d=O.getOriginXY(i.target,i.element,i.prepared.name);u=O.extend({},n);u.x-=d.x;u.y-=d.y}r.realX=u.x;r.realY=u.y;var f=o.targets?o.targets.length:0;for(var p=0;p<a.length;p++){var h;h=a[p];var g=h;var v=g.x;var m=g.y;var y=u.x-v;var b=u.y-m;for(var _=0;_<(o.targets||[]).length;_++){var w;w=(o.targets||[])[_];var C=w;if(O.is.function(C)){l=C(y,b,i)}else{l=C}if(!l){continue}s.push({x:O.is.number(l.x)?l.x+v:y,y:O.is.number(l.y)?l.y+m:b,range:O.is.number(l.range)?l.range:o.range})}}var A={target:null,inRange:false,distance:0,range:0,dx:0,dy:0};for(c=0,f=s.length;c<f;c++){l=s[c];var E=l.range;var x=l.x-u.x;var T=l.y-u.y;var S=O.hypot(x,T);var D=S<=E;if(E===Infinity&&A.inRange&&A.range!==Infinity){D=false}if(!A.target||(D?A.inRange&&E!==Infinity?S/E<A.distance/A.range:E===Infinity&&A.range!==Infinity||S<A.distance:!A.inRange&&S<A.distance)){A.target=l;A.distance=S;A.range=E;A.inRange=D;A.dx=x;A.dy=T;r.range=E}}var k=void 0;if(A.target){k=r.modifiedX!==A.target.x||r.modifiedY!==A.target.y;r.modifiedX=A.target.x;r.modifiedY=A.target.y}else{k=true;r.modifiedX=NaN;r.modifiedY=NaN}r.dx=A.dx;r.dy=A.dy;r.changed=k||A.inRange&&!r.locked;r.locked=A.inRange},modifyCoords:function e(t){var i=t.page,n=t.client,r=t.status,o=t.phase,a=t.options;var s=a&&a.relativePoints;if(a&&a.enabled&&!(o==="start"&&s&&s.length)){if(r.locked){i.x+=r.dx;i.y+=r.dy;n.x+=r.dx;n.y+=r.dy}return{range:r.range,locked:r.locked,x:r.modifiedX,y:r.modifiedY,realX:r.realX,realY:r.realY,dx:r.dx,dy:r.dy}}}};r.createSnapGrid=function(u){return function(e,t){var i=u.limits||{left:-Infinity,right:Infinity,top:-Infinity,bottom:Infinity};var n=0;var r=0;if(O.is.object(u.offset)){n=u.offset.x;r=u.offset.y}var o=Math.round((e-n)/u.x);var a=Math.round((t-r)/u.y);var s=Math.max(i.left,Math.min(i.right,o*u.x+n));var l=Math.max(i.top,Math.min(i.bottom,a*u.y+r));return{x:s,y:l,range:u.range}}};n.snap=a;n.names.push("snap");o.perAction.snap=a.defaults;t.exports=a},{"../defaultOptions":18,"../interact":21,"../utils":44,"./base":23}],28:[function(e,t,i){"use strict";var n=e("./base");var p=e("./snap");var r=e("../defaultOptions");var o=e("../actions/resize");var h=e("../utils/");var a={defaults:{enabled:false,endOnly:false,range:Infinity,targets:null,offsets:null},setOffset:function e(t){var i=t.interaction,n=t.options;var r=i.prepared.edges;if(!r){return}t.options={relativePoints:[{x:r.left?0:1,y:r.top?0:1}],origin:{x:0,y:0},offset:"self",range:n.range};var o=p.setOffset(t);t.options=n;return o},set:function e(t){var i=t.interaction,n=t.options,r=t.offset,o=t.modifiedCoords;var a=h.extend({},o);var s=a.x-r[0].x;var l=a.y-r[0].y;t.options=h.extend({},n);t.options.targets=[];for(var u=0;u<(n.targets||[]).length;u++){var c;c=(n.targets||[])[u];var d=c;var f=void 0;if(h.is.function(d)){f=d(s,l,i)}else{f=d}if(!f){continue}if("width"in f&&"height"in f){f.x=f.width;f.y=f.height}t.options.targets.push(f)}p.set(t)},modifyCoords:function e(t){var i=t.options;t.options=h.extend({},i);t.options.enabled=i.enabled;t.options.relativePoints=[null];p.modifyCoords(t)}};n.snapSize=a;n.names.push("snapSize");r.perAction.snapSize=a.defaults;o.defaults.snapSize=a.defaults;t.exports=a},{"../actions/resize":10,"../defaultOptions":18,"../utils/":44,"./base":23,"./snap":27}],29:[function(e,t,i){"use strict";function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=e("../utils/pointerUtils");t.exports=function(){function s(e,t,i,n,r){l(this,s);u.pointerExtend(this,i);if(i!==t){u.pointerExtend(this,t)}this.interaction=r;this.timeStamp=(new Date).getTime();this.originalEvent=i;this.type=e;this.pointerId=u.getPointerId(t);this.pointerType=u.getPointerType(t);this.target=n;this.currentTarget=null;if(e==="tap"){var o=r.getPointerIndex(t);this.dt=this.timeStamp-r.downTimes[o];var a=this.timeStamp-r.tapTime;this.double=!!(r.prevTap&&r.prevTap.type!=="doubletap"&&r.prevTap.target===this.target&&a<500)}else if(e==="doubletap"){this.dt=t.timeStamp-r.tapTime}}s.prototype.subtractOrigin=function e(t){var i=t.x,n=t.y;this.pageX-=i;this.pageY-=n;this.clientX-=i;this.clientY-=n;return this};s.prototype.addOrigin=function e(t){var i=t.x,n=t.y;this.pageX+=i;this.pageY+=n;this.clientX+=i;this.clientY+=n;return this};s.prototype.preventDefault=function e(){this.originalEvent.preventDefault()};s.prototype.stopPropagation=function e(){this.propagationStopped=true};s.prototype.stopImmediatePropagation=function e(){this.immediatePropagationStopped=this.propagationStopped=true};return s}()},{"../utils/pointerUtils":49}],30:[function(e,t,i){"use strict";var m=e("./PointerEvent");var n=e("../Interaction");var y=e("../utils");var r=e("../defaultOptions");var b=e("../utils/Signals").new();var o=["down","up","cancel"];var a=["down","up","cancel"];var s={PointerEvent:m,fire:_,collectEventTargets:w,signals:b,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:["down","move","up","cancel","tap","doubletap","hold"]};function _(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget,o=e.type,a=o===undefined?e.pointerEvent.type:o,s=e.targets,l=s===undefined?w(e):s,u=e.pointerEvent,c=u===undefined?new m(a,i,n,r,t):u;var d={interaction:t,pointer:i,event:n,eventTarget:r,targets:l,type:a,pointerEvent:c};for(var f=0;f<l.length;f++){var p=l[f];for(var h in p.props||{}){c[h]=p.props[h]}var g=y.getOriginXY(p.eventable,p.element);c.subtractOrigin(g);c.eventable=p.eventable;c.currentTarget=p.element;p.eventable.fire(c);c.addOrigin(g);if(c.immediatePropagationStopped||c.propagationStopped&&f+1<l.length&&l[f+1].element!==c.currentTarget){break}}b.fire("fired",d);if(a==="tap"){var v=c.double?_({interaction:t,pointer:i,event:n,eventTarget:r,type:"doubletap"}):c;t.prevTap=v;t.tapTime=v.timeStamp}return c}function w(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget,o=e.type;var a=t.getPointerIndex(i);if(o==="tap"&&(t.pointerWasMoved||!(t.downTargets[a]&&t.downTargets[a]===r))){return[]}var s=y.getPath(r);var l={interaction:t,pointer:i,event:n,eventTarget:r,type:o,path:s,targets:[],element:null};for(var u=0;u<s.length;u++){var c;c=s[u];var d=c;l.element=d;b.fire("collect-targets",l)}if(o==="hold"){l.targets=l.targets.filter(function(e){return e.eventable.options.holdDuration===t.holdTimers[a].duration})}return l.targets}n.signals.on("update-pointer-down",function(e){var t=e.interaction,i=e.pointerIndex;t.holdTimers[i]={duration:Infinity,timeout:null}});n.signals.on("remove-pointer",function(e){var t=e.interaction,i=e.pointerIndex;t.holdTimers.splice(i,1)});n.signals.on("move",function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget,o=e.duplicateMove;var a=t.getPointerIndex(i);if(!o&&(!t.pointerIsDown||t.pointerWasMoved)){if(t.pointerIsDown){clearTimeout(t.holdTimers[a].timeout)}_({interaction:t,pointer:i,event:n,eventTarget:r,type:"move"})}});n.signals.on("down",function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget,o=e.pointerIndex;var a=t.holdTimers[o];var s=y.getPath(r);var l={interaction:t,pointer:i,event:n,eventTarget:r,type:"hold",targets:[],path:s,element:null};for(var u=0;u<s.length;u++){var c;c=s[u];var d=c;l.element=d;b.fire("collect-targets",l)}if(!l.targets.length){return}var f=Infinity;for(var p=0;p<l.targets.length;p++){var h;h=l.targets[p];var g=h;var v=g.eventable.options.holdDuration;if(v<f){f=v}}a.duration=f;a.timeout=setTimeout(function(){_({interaction:t,eventTarget:r,pointer:i,event:n,type:"hold"})},f)});n.signals.on("up",function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget;if(!t.pointerWasMoved){_({interaction:t,eventTarget:r,pointer:i,event:n,type:"tap"})}});var l=["up","cancel"];for(var u=0;u<l.length;u++){var c=l[u];n.signals.on(c,function(e){var t=e.interaction,i=e.pointerIndex;if(t.holdTimers[i]){clearTimeout(t.holdTimers[i].timeout)}})}function d(o){return function(e){var t=e.interaction,i=e.pointer,n=e.event,r=e.eventTarget;_({interaction:t,eventTarget:r,pointer:i,event:n,type:o})}}for(var f=0;f<o.length;f++){n.signals.on(o[f],d(a[f]))}n.signals.on("new",function(e){e.prevTap=null;e.tapTime=0;e.holdTimers=[]});r.pointerEvents=s.defaults;t.exports=s},{"../Interaction":5,"../defaultOptions":18,"../utils":44,"../utils/Signals":34,"./PointerEvent":29}],31:[function(e,t,i){"use strict";var a=e("./base");var n=e("../Interaction");a.signals.on("new",l);a.signals.on("fired",u);var r=["move","up","cancel","endall"];for(var o=0;o<r.length;o++){var s=r[o];n.signals.on(s,c)}function l(e){var t=e.pointerEvent;if(t.type!=="hold"){return}t.count=(t.count||0)+1}function u(e){var t=e.interaction,i=e.pointerEvent,n=e.eventTarget,r=e.targets;if(i.type!=="hold"||!r.length){return}var o=r[0].eventable.options.holdRepeatInterval;if(o<=0){return}t.holdIntervalHandle=setTimeout(function(){a.fire({interaction:t,eventTarget:n,type:"hold",pointer:i,event:i})},o)}function c(e){var t=e.interaction;if(t.holdIntervalHandle){clearInterval(t.holdIntervalHandle);t.holdIntervalHandle=null}}a.defaults.holdRepeatInterval=0;a.types.push("holdrepeat");t.exports={onNew:l,onFired:u,endHoldRepeat:c}},{"../Interaction":5,"./base":30}],32:[function(e,t,i){"use strict";var n=e("./base");var r=e("../Interactable");var s=e("../utils/is");var l=e("../scope");var o=e("../utils/extend");var a=e("../utils/arr"),u=a.merge;n.signals.on("collect-targets",function(e){var n=e.targets,r=e.element,o=e.type,a=e.eventTarget;l.interactables.forEachMatch(r,function(e){var t=e.events;var i=t.options;if(t[o]&&s.element(r)&&e.testIgnoreAllow(i,r,a)){n.push({element:r,eventable:t,props:{interactable:e}})}})});r.signals.on("new",function(e){var t=e.interactable;t.events.getRect=function(e){return t.getRect(e)}});r.signals.on("set",function(e){var t=e.interactable,i=e.options;o(t.events.options,n.defaults);o(t.events.options,i)});u(r.eventTypes,n.types);r.prototype.pointerEvents=function(e){o(this.events.options,e);return this};var c=r.prototype._backCompatOption;r.prototype._backCompatOption=function(e,t){var i=c.call(this,e,t);if(i===this){this.events.options[e]=t}return i};r.settingsMethods.push("pointerEvents")},{"../Interactable":4,"../scope":33,"../utils/arr":35,"../utils/extend":41,"../utils/is":46,"./base":30}],33:[function(e,t,i){"use strict";var n=e("./utils");var r=e("./utils/events");var o=e("./utils/Signals").new();var a=e("./utils/window"),s=a.getWindow;var l={signals:o,events:r,utils:n,document:e("./utils/domObjects").document,documents:[],addDocument:function e(t,i){if(n.contains(l.documents,t)){return false}i=i||s(t);l.documents.push(t);r.documents.push(t);if(t!==l.document){r.add(i,"unload",l.onWindowUnload)}o.fire("add-document",{doc:t,win:i})},removeDocument:function e(t,i){var n=l.documents.indexOf(t);i=i||s(t);r.remove(i,"unload",l.onWindowUnload);l.documents.splice(n,1);r.documents.splice(n,1);o.fire("remove-document",{win:i,doc:t})},onWindowUnload:function e(){l.removeDocument(this.document,this)}};t.exports=l},{"./utils":44,"./utils/Signals":34,"./utils/domObjects":38,"./utils/events":40,"./utils/window":52}],34:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var r=function(){function e(){n(this,e);this.listeners={}}e.prototype.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[i];return}this.listeners[t].push(i)};e.prototype.off=function e(t,i){if(!this.listeners[t]){return}var n=this.listeners[t].indexOf(i);if(n!==-1){this.listeners[t].splice(n,1)}};e.prototype.fire=function e(t,i){var n=this.listeners[t];if(!n){return}for(var r=0;r<n.length;r++){var o;o=n[r];var a=o;if(a(i,t)===false){return}}};return e}();r.new=function(){return new r};t.exports=r},{}],35:[function(e,t,i){"use strict";function n(e,t){return e.indexOf(t)!==-1}function r(e,t){for(var i=0;i<t.length;i++){var n;n=t[i];var r=n;e.push(r)}return e}t.exports={contains:n,merge:r}},{}],36:[function(e,t,i){"use strict";var n=e("./window"),r=n.window;var o=e("./is");var a=e("./domObjects");var s=a.Element;var l=r.navigator;var u={supportsTouch:!!("ontouchstart"in r||o.function(r.DocumentTouch)&&a.document instanceof r.DocumentTouch),supportsPointerEvent:!!a.PointerEvent,isIOS:/iP(hone|od|ad)/.test(l.platform),isIOS7:/iP(hone|od|ad)/.test(l.platform)&&/OS 7[^\d]/.test(l.appVersion),isIe9:/MSIE 9/.test(l.userAgent),prefixedMatchesSelector:"matches"in s.prototype?"matches":"webkitMatchesSelector"in s.prototype?"webkitMatchesSelector":"mozMatchesSelector"in s.prototype?"mozMatchesSelector":"oMatchesSelector"in s.prototype?"oMatchesSelector":"msMatchesSelector",pEventTypes:a.PointerEvent?a.PointerEvent===r.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,wheelEvent:"onmousewheel"in a.document?"mousewheel":"wheel"};u.isOperaMobile=l.appName==="Opera"&&u.supportsTouch&&l.userAgent.match("Presto");t.exports=u},{"./domObjects":38,"./is":46,"./window":52}],37:[function(e,t,i){"use strict";var r=e("./is");t.exports=function e(t){var i={};for(var n in t){if(r.plainObject(t[n])){i[n]=e(t[n])}else{i[n]=t[n]}}return i}},{"./is":46}],38:[function(e,t,i){"use strict";var n={};var r=e("./window").window;function o(){}n.document=r.document;n.DocumentFragment=r.DocumentFragment||o;n.SVGElement=r.SVGElement||o;n.SVGSVGElement=r.SVGSVGElement||o;n.SVGElementInstance=r.SVGElementInstance||o;n.Element=r.Element||o;n.HTMLElement=r.HTMLElement||n.Element;n.Event=r.Event;n.Touch=r.Touch||o;n.PointerEvent=r.PointerEvent||r.MSPointerEvent;t.exports=n},{"./window":52}],39:[function(e,t,i){"use strict";var r=e("./window");var o=e("./browser");var a=e("./is");var f=e("./domObjects");var s={nodeContains:function e(t,i){while(i){if(i===t){return true}i=i.parentNode}return false},closest:function e(t,i){while(a.element(t)){if(s.matchesSelector(t,i)){return t}t=s.parentNode(t)}return null},parentNode:function e(t){var i=t.parentNode;if(a.docFrag(i)){while((i=i.host)&&a.docFrag(i)){continue}return i}return i},matchesSelector:function e(t,i){if(r.window!==r.realWindow){i=i.replace(/\/deep\//g," ")}return t[o.prefixedMatchesSelector](i)},indexOfDeepestElement:function e(t){var i=[];var n=[];var r=void 0;var o=t[0];var a=o?0:-1;var s=void 0;var l=void 0;var u=void 0;var c=void 0;for(u=1;u<t.length;u++){r=t[u];if(!r||r===o){continue}if(!o){o=r;a=u;continue}if(r.parentNode===r.ownerDocument){continue}else if(o.parentNode===r.ownerDocument){o=r;a=u;continue}if(!i.length){s=o;while(s.parentNode&&s.parentNode!==s.ownerDocument){i.unshift(s);s=s.parentNode}}if(o instanceof f.HTMLElement&&r instanceof f.SVGElement&&!(r instanceof f.SVGSVGElement)){if(r===o.parentNode){continue}s=r.ownerSVGElement}else{s=r}n=[];while(s.parentNode!==s.ownerDocument){n.unshift(s);s=s.parentNode}c=0;while(n[c]&&n[c]===i[c]){c++}var d=[n[c-1],n[c],i[c]];l=d[0].lastChild;while(l){if(l===d[1]){o=r;a=u;i=[];break}else if(l===d[2]){break}l=l.previousSibling}}return a},matchesUpTo:function e(t,i,n){while(a.element(t)){if(s.matchesSelector(t,i)){return true}t=s.parentNode(t);if(t===n){return s.matchesSelector(t,i)}}return false},getActualElement:function e(t){return t instanceof f.SVGElementInstance?t.correspondingUseElement:t},getScrollXY:function e(t){t=t||r.window;return{x:t.scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop}},getElementClientRect:function e(t){var i=t instanceof f.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return i&&{left:i.left,right:i.right,top:i.top,bottom:i.bottom,width:i.width||i.right-i.left,height:i.height||i.bottom-i.top}},getElementRect:function e(t){var i=s.getElementClientRect(t);if(!o.isIOS7&&i){var n=s.getScrollXY(r.getWindow(t));i.left+=n.x;i.right+=n.x;i.top+=n.y;i.bottom+=n.y}return i},getPath:function e(t){var i=[];while(t){i.push(t);t=s.parentNode(t)}return i},trySelector:function e(t){if(!a.string(t)){return false}f.document.querySelector(t);return true}};t.exports=s},{"./browser":36,"./domObjects":38,"./is":46,"./window":52}],40:[function(e,t,i){"use strict";var m=e("./is");var y=e("./domUtils");var b=e("./pointerUtils");var _=e("./pointerExtend");var n=e("./window"),r=n.window;var o=e("./arr"),s=o.contains;var c=[];var d=[];var w={};var f=[];var p=function(){var e=false;r.document.createElement("div").addEventListener("test",null,{get capture(){e=true}});return e}();function h(e,t,i,n){var r=E(n);var o=c.indexOf(e);var a=d[o];if(!a){a={events:{},typeCount:0};o=c.push(e)-1;d.push(a)}if(!a.events[t]){a.events[t]=[];a.typeCount++}if(!s(a.events[t],i)){e.addEventListener(t,i,p?r:!!r.capture);a.events[t].push(i)}}function g(e,t,i,n){var r=E(n);var o=c.indexOf(e);var a=d[o];if(!a||!a.events){return}if(t==="all"){for(t in a.events){if(a.events.hasOwnProperty(t)){g(e,t,"all")}}return}if(a.events[t]){var s=a.events[t].length;if(i==="all"){for(var l=0;l<s;l++){g(e,t,a.events[t][l],r)}return}else{for(var u=0;u<s;u++){if(a.events[t][u]===i){e.removeEventListener("on"+t,i,p?r:!!r.capture);a.events[t].splice(u,1);break}}}if(a.events[t]&&a.events[t].length===0){a.events[t]=null;a.typeCount--}}if(!a.typeCount){d.splice(o,1);c.splice(o,1)}}function a(e,t,i,n,r){var o=E(r);if(!w[i]){w[i]={selectors:[],contexts:[],listeners:[]};for(var a=0;a<f.length;a++){var s=f[a];h(s,i,v);h(s,i,C,true)}}var l=w[i];var u=void 0;for(u=l.selectors.length-1;u>=0;u--){if(l.selectors[u]===e&&l.contexts[u]===t){break}}if(u===-1){u=l.selectors.length;l.selectors.push(e);l.contexts.push(t);l.listeners.push([])}l.listeners[u].push([n,!!o.capture,o.passive])}function l(e,t,i,n,r){var o=E(r);var a=w[i];var s=false;var l=void 0;if(!a){return}for(l=a.selectors.length-1;l>=0;l--){if(a.selectors[l]===e&&a.contexts[l]===t){var u=a.listeners[l];for(var c=u.length-1;c>=0;c--){var d=u[c],f=d[0],p=d[1],h=d[2];if(f===n&&p===!!o.capture&&h===o.passive){u.splice(c,1);if(!u.length){a.selectors.splice(l,1);a.contexts.splice(l,1);a.listeners.splice(l,1);g(t,i,v);g(t,i,C,true);if(!a.selectors.length){w[i]=null}}s=true;break}}if(s){break}}}}function v(e,t){var i=E(t);var n={};var r=w[e.type];var o=b.getEventTargets(e),a=o[0];var s=a;_(n,e);n.originalEvent=e;n.preventDefault=A;while(m.element(s)){for(var l=0;l<r.selectors.length;l++){var u=r.selectors[l];var c=r.contexts[l];if(y.matchesSelector(s,u)&&y.nodeContains(c,a)&&y.nodeContains(c,s)){var d=r.listeners[l];n.currentTarget=s;for(var f=0;f<d.length;f++){var p=d[f],h=p[0],g=p[1],v=p[2];if(g===!!i.capture&&v===i.passive){h(n)}}}}s=y.parentNode(s)}}function C(e){return v.call(this,e,true)}function A(){this.originalEvent.preventDefault()}function E(e){return m.object(e)?e:{capture:e}}t.exports={add:h,remove:g,addDelegate:a,removeDelegate:l,delegateListener:v,delegateUseCapture:C,delegatedEvents:w,documents:f,supportsOptions:p,_elements:c,_targets:d}},{"./arr":35,"./domUtils":39,"./is":46,"./pointerExtend":48,"./pointerUtils":49,"./window":52}],41:[function(e,t,i){"use strict";t.exports=function e(t,i){for(var n in i){t[n]=i[n]}return t}},{}],42:[function(e,t,i){"use strict";var n=e("./rect"),s=n.resolveRectLike,l=n.rectToXY;t.exports=function(e,t,i){var n=e.options[i];var r=n&&n.origin;var o=r||e.options.origin;var a=s(o,e,t,[e&&t]);return l(a)||{x:0,y:0}}},{"./rect":51}],43:[function(e,t,i){"use strict";t.exports=function(e,t){return Math.sqrt(e*e+t*t)}},{}],44:[function(e,t,i){"use strict";var n=e("./extend");var r=e("./window");var l={warnOnce:function e(t,i){var n=false;return function(){if(!n){r.window.console.warn(i);n=true}return t.apply(this,arguments)}},_getQBezierValue:function e(t,i,n,r){var o=1-t;return o*o*i+2*o*t*n+t*t*r},getQuadraticCurvePoint:function e(t,i,n,r,o,a,s){return{x:l._getQBezierValue(s,t,n,o),y:l._getQBezierValue(s,i,r,a)}},easeOutQuad:function e(t,i,n,r){t/=r;return-n*t*(t-2)+i},copyAction:function e(t,i){t.name=i.name;t.axis=i.axis;t.edges=i.edges;return t},is:e("./is"),extend:n,hypot:e("./hypot"),getOriginXY:e("./getOriginXY")};n(l,e("./arr"));n(l,e("./domUtils"));n(l,e("./pointerUtils"));n(l,e("./rect"));t.exports=l},{"./arr":35,"./domUtils":39,"./extend":41,"./getOriginXY":42,"./hypot":43,"./is":46,"./pointerUtils":49,"./rect":51,"./window":52}],45:[function(e,t,i){"use strict";var f=e("../scope");var p=e("./index");var d={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function e(t,i,n){var r=p.getPointerType(t);var o=p.getPointerId(t);var a={pointer:t,pointerId:o,pointerType:r,eventType:i,eventTarget:n};for(var s=0;s<d.methodOrder.length;s++){var l;l=d.methodOrder[s];var u=l;var c=d[u](a);if(c){return c}}},simulationResume:function e(t){var i=t.pointerType,n=t.eventType,r=t.eventTarget;if(!/down|start/i.test(n)){return null}for(var o=0;o<f.interactions.length;o++){var a;a=f.interactions[o];var s=a;var l=r;if(s.simulation&&s.simulation.allowResume&&s.pointerType===i){while(l){if(l===s.element){return s}l=p.parentNode(l)}}}return null},mouseOrPen:function e(t){var i=t.pointerId,n=t.pointerType,r=t.eventType;if(n!=="mouse"&&n!=="pen"){return null}var o=void 0;for(var a=0;a<f.interactions.length;a++){var s;s=f.interactions[a];var l=s;if(l.pointerType===n){if(l.simulation&&!p.contains(l.pointerIds,i)){continue}if(l.interacting()){return l}else if(!o){o=l}}}if(o){return o}for(var u=0;u<f.interactions.length;u++){var c;c=f.interactions[u];var d=c;if(d.pointerType===n&&!(/down/i.test(r)&&d.simulation)){return d}}return null},hasPointer:function e(t){var i=t.pointerId;for(var n=0;n<f.interactions.length;n++){var r;r=f.interactions[n];var o=r;if(p.contains(o.pointerIds,i)){return o}}},idle:function e(t){var i=t.pointerType;for(var n=0;n<f.interactions.length;n++){var r;r=f.interactions[n];var o=r;if(o.pointerIds.length===1){var a=o.target;if(a&&!a.options.gesture.enabled){continue}}else if(o.pointerIds.length>=2){continue}if(!o.interacting()&&i===o.pointerType){return o}}return null}};t.exports=d},{"../scope":33,"./index":44}],46:[function(e,t,i){"use strict";var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var r=e("./window");var o=e("./isWindow");var a={array:function e(){},window:function e(t){return t===r.window||o(t)},docFrag:function e(t){return a.object(t)&&t.nodeType===11},object:function e(t){return!!t&&(typeof t==="undefined"?"undefined":n(t))==="object"},function:function e(t){return typeof t==="function"},number:function e(t){return typeof t==="number"},bool:function e(t){return typeof t==="boolean"},string:function e(t){return typeof t==="string"},element:function e(t){if(!t||(typeof t==="undefined"?"undefined":n(t))!=="object"){return false}var i=r.getWindow(t)||r.window;return/object|function/.test(n(i.Element))?t instanceof i.Element:t.nodeType===1&&typeof t.nodeName==="string"},plainObject:function e(t){return a.object(t)&&t.constructor.name==="Object"}};a.array=function(e){return a.object(e)&&typeof e.length!=="undefined"&&a.function(e.splice)};t.exports=a},{"./isWindow":47,"./window":52}],47:[function(e,t,i){"use strict";t.exports=function(e){return!!(e&&e.Window)&&e instanceof e.Window}},{}],48:[function(e,a,t){"use strict";function i(e,t){for(var i in t){var n=a.exports.prefixedPropREs;var r=false;for(var o in n){if(i.indexOf(o)===0&&n[o].test(i)){r=true;break}}if(!r&&typeof t[i]!=="function"){e[i]=t[i]}}return e}i.prefixedPropREs={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/};a.exports=i},{}],49:[function(e,t,i){"use strict";var l=e("./hypot");var n=e("./browser");var r=e("./domObjects");var o=e("./domUtils");var a=e("./domObjects");var s=e("./is");var u=e("./pointerExtend");var c={copyCoords:function e(t,i){t.page=t.page||{};t.page.x=i.page.x;t.page.y=i.page.y;t.client=t.client||{};t.client.x=i.client.x;t.client.y=i.client.y;t.timeStamp=i.timeStamp},setCoordDeltas:function e(t,i,n){t.page.x=n.page.x-i.page.x;t.page.y=n.page.y-i.page.y;t.client.x=n.client.x-i.client.x;t.client.y=n.client.y-i.client.y;t.timeStamp=n.timeStamp-i.timeStamp;var r=Math.max(t.timeStamp/1e3,.001);t.page.speed=l(t.page.x,t.page.y)/r;t.page.vx=t.page.x/r;t.page.vy=t.page.y/r;t.client.speed=l(t.client.x,t.page.y)/r;t.client.vx=t.client.x/r;t.client.vy=t.client.y/r},isNativePointer:function e(t){return t instanceof r.Event||t instanceof r.Touch},getXY:function e(t,i,n){n=n||{};t=t||"page";n.x=i[t+"X"];n.y=i[t+"Y"];return n},getPageXY:function e(t,i){i=i||{};if(n.isOperaMobile&&c.isNativePointer(t)){c.getXY("screen",t,i);i.x+=window.scrollX;i.y+=window.scrollY}else{c.getXY("page",t,i)}return i},getClientXY:function e(t,i){i=i||{};if(n.isOperaMobile&&c.isNativePointer(t)){c.getXY("screen",t,i)}else{c.getXY("client",t,i)}return i},getPointerId:function e(t){return s.number(t.pointerId)?t.pointerId:t.identifier},setCoords:function e(t,i,n){var r=i.length>1?c.pointerAverage(i):i[0];var o={};c.getPageXY(r,o);t.page.x=o.x;t.page.y=o.y;c.getClientXY(r,o);t.client.x=o.x;t.client.y=o.y;t.timeStamp=s.number(n)?n:(new Date).getTime()},pointerExtend:u,getTouchPair:function e(t){var i=[];if(s.array(t)){i[0]=t[0];i[1]=t[1]}else{if(t.type==="touchend"){if(t.touches.length===1){i[0]=t.touches[0];i[1]=t.changedTouches[0]}else if(t.touches.length===0){i[0]=t.changedTouches[0];i[1]=t.changedTouches[1]}}else{i[0]=t.touches[0];i[1]=t.touches[1]}}return i},pointerAverage:function e(t){var i={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0};for(var n=0;n<t.length;n++){var r;r=t[n];var o=r;for(var a in i){i[a]+=o[a]}}for(var s in i){i[s]/=t.length}return i},touchBBox:function e(t){if(!t.length&&!(t.touches&&t.touches.length>1)){return}var i=c.getTouchPair(t);var n=Math.min(i[0].pageX,i[1].pageX);var r=Math.min(i[0].pageY,i[1].pageY);var o=Math.max(i[0].pageX,i[1].pageX);var a=Math.max(i[0].pageY,i[1].pageY);return{x:n,y:r,left:n,top:r,width:o-n,height:a-r}},touchDistance:function e(t,i){var n=i+"X";var r=i+"Y";var o=c.getTouchPair(t);var a=o[0][n]-o[1][n];var s=o[0][r]-o[1][r];return l(a,s)},touchAngle:function e(t,i,n){var r=n+"X";var o=n+"Y";var a=c.getTouchPair(t);var s=a[1][r]-a[0][r];var l=a[1][o]-a[0][o];var u=180*Math.atan2(l,s)/Math.PI;return u},getPointerType:function e(t){return s.string(t.pointerType)?t.pointerType:s.number(t.pointerType)?[undefined,undefined,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type)||t instanceof a.Touch?"touch":"mouse"},getEventTargets:function e(t){var i=s.function(t.composedPath)?t.composedPath():t.path;return[o.getActualElement(i?i[0]:t.target),o.getActualElement(t.currentTarget)]}};t.exports=c},{"./browser":36,"./domObjects":38,"./domUtils":39,"./hypot":43,"./is":46,"./pointerExtend":48}],50:[function(e,t,i){"use strict";var n=e("./window"),r=n.window;var o=["ms","moz","webkit","o"];var a=0;var s=void 0;var l=void 0;for(var u=0;u<o.length&&!r.requestAnimationFrame;u++){s=r[o[u]+"RequestAnimationFrame"];l=r[o[u]+"CancelAnimationFrame"]||r[o[u]+"CancelRequestAnimationFrame"]}if(!s){s=function e(t){var i=(new Date).getTime();var n=Math.max(0,16-(i-a));var r=setTimeout(function(){t(i+n)},n);a=i+n;return r}}if(!l){l=function e(t){clearTimeout(t)}}t.exports={request:s,cancel:l}},{"./window":52}],51:[function(e,t,i){"use strict";var n=e("./extend");var o=e("./is");var r=e("./domUtils"),a=r.closest,s=r.parentNode,l=r.getElementRect;var u={getStringOptionResult:function e(t,i,n){if(!o.string(t)){return null}if(t==="parent"){t=s(n)}else if(t==="self"){t=i.getRect(n)}else{t=a(n,t)}return t},resolveRectLike:function e(t,i,n,r){t=u.getStringOptionResult(t,i,n)||t;if(o.function(t)){t=t.apply(null,r)}if(o.element(t)){t=l(t)}return t},rectToXY:function e(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}},xywhToTlbr:function e(t){if(t&&!("left"in t&&"top"in t)){t=n({},t);t.left=t.x||0;t.top=t.y||0;t.right=t.right||t.left+t.width;t.bottom=t.bottom||t.top+t.height}return t},tlbrToXywh:function e(t){if(t&&!("x"in t&&"y"in t)){t=n({},t);t.x=t.left||0;t.top=t.top||0;t.width=t.width||t.right-t.x;t.height=t.height||t.bottom-t.y}return t}};t.exports=u},{"./domUtils":39,"./extend":41,"./is":46}],52:[function(e,t,i){"use strict";var n=t.exports;var r=e("./isWindow");function o(e){n.realWindow=e;var t=e.document.createTextNode("");if(t.ownerDocument!==e.document&&typeof e.wrap==="function"&&e.wrap(t)===t){e=e.wrap(e)}n.window=e}if(typeof window==="undefined"){n.window=undefined;n.realWindow=undefined}else{o(window)}n.getWindow=function e(t){if(r(t)){return t}var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||n.window};n.init=o},{"./isWindow":47}]},{},[1])(1)});"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var i=/^(\d+)\.(\d+)\.(\d+)/,n=i.exec(e)||[],r=i.exec(t)||[],o=1;o<=3;o++){if(+r[o]<+n[o])return 1;if(+n[o]<+r[o])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.3.2",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var i={};function l(e){var t=n.console;s.migrateDeduplicateWarnings&&i[e]||(i[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,i,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return l(n),i},set:function(e){l(n),i=e}})}function r(e,t,i,n){e[t]=function(){return l(n),i.apply(this,arguments)}}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){i={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&l("jQuery is not compatible with Quirks Mode");var o,a,u,c={},d=s.fn.init,f=s.find,p=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,g=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(o in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(l("jQuery( '#' ) is not a valid selector"),t[0]=[]),d.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var i=Array.prototype.slice.call(arguments);if("string"==typeof t&&p.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(h,function(e,t,i,n){return"["+t+i+'"'+n+'"]'});try{n.document.querySelector(t),l("Attribute selector with '#' must be quoted: "+i[0]),i[0]=t}catch(e){l("Attribute selector with '#' was not fixed: "+i[0])}}return f.apply(this,i)},f)Object.prototype.hasOwnProperty.call(f,o)&&(s.find[o]=f[o]);r(s.fn,"size",function(){return this.length},"jQuery.fn.size() is deprecated and removed; use the .length property"),r(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"jQuery.parseJSON is deprecated; use JSON.parse"),r(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),r(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&r(s,"trim",function(e){return null==e?"":(e+"").replace(g,"")},"jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(r(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"jQuery.nodeName is deprecated"),r(s,"isArray",Array.isArray,"jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(r(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()}),r(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[Object.prototype.toString.call(e)]||"object":typeof e},"jQuery.type is deprecated"),r(s,"isFunction",function(e){return"function"==typeof e},"jQuery.isFunction() is deprecated"),r(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated")),s.ajax&&(a=s.ajax,u=/(=)\?(?=&|$)|\?\?/,s.ajax=function(){var e=a.apply(this,arguments);return e.promise&&(r(e,"success",e.done,"jQXHR.success is deprecated and removed"),r(e,"error",e.fail,"jQXHR.error is deprecated and removed"),r(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e},e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(u.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&u.test(e.data))&&l("JSON-to-JSONP auto-promotion is deprecated")}));var v=s.fn.removeAttr,m=s.fn.toggleClass,y=/\S+/g;function b(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}s.fn.removeAttr=function(e){var i=this;return s.each(e.match(y),function(e,t){s.expr.match.bool.test(t)&&(l("jQuery.fn.removeAttr no longer sets boolean properties: "+t),i.prop(t,!1))}),v.apply(this,arguments)};var _,w=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?m.apply(this,arguments):(l("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))}),C=/^[a-z]/,A=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var i=s.cssHooks[t]&&s.cssHooks[t].get;i&&(s.cssHooks[t].get=function(){var e;return w=!0,e=i.apply(this,arguments),w=!1,e})}),s.swap=function(e,t,i,n){var r,o,a={};for(o in w||l("jQuery.swap() is undocumented and deprecated"),t)a[o]=e.style[o],e.style[o]=t[o];for(o in r=i.apply(e,n||[]),t)e.style[o]=a[o];return r},e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return l("JQMIGRATE: jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),s.cssNumber||(s.cssNumber={}),_=s.fn.css,s.fn.css=function(e,t){var i,n,r=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(r,e,t)}),this):("number"==typeof t&&(i=b(e),n=i,C.test(n)&&A.test(n[0].toUpperCase()+n.slice(1))||s.cssNumber[i]||l('Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),_.apply(this,arguments))};var E,x,T,S,D=s.data;s.data=function(e,t,i){var n,r,o;if(t&&"object"==typeof t&&2===arguments.length){for(o in n=s.hasData(e)&&D.call(this,e),r={},t)o!==b(o)?(l("jQuery.data() always sets/gets camelCased names: "+o),n[o]=t[o]):r[o]=t[o];return D.call(this,e,r),t}return t&&"string"==typeof t&&t!==b(t)&&(n=s.hasData(e)&&D.call(this,e))&&t in n?(l("jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=i),n[t]):D.apply(this,arguments)},s.fx&&(T=s.Tween.prototype.run,S=function(e){return e},s.Tween.prototype.run=function(){1<s.easing[this.easing].length&&(l("'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=S),T.apply(this,arguments)},E=s.fx.interval||13,x="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||l(x),E},set:function(e){l(x),E=e}}));var k=s.fn.load,L=s.event.add,F=s.event.fix;s.event.props=[],s.event.fixHooks={},t(s.event.props,"concat",s.event.props.concat,"jQuery.event.props.concat() is deprecated and removed"),s.event.fix=function(e){var t,i=e.type,n=this.fixHooks[i],r=s.event.props;if(r.length){l("jQuery.event.props are deprecated and removed: "+r.join());while(r.length)s.event.addProp(r.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,l("jQuery.event.fixHooks are deprecated and removed: "+i),(r=n.props)&&r.length))while(r.length)s.event.addProp(r.pop());return t=F.call(this,e),n&&n.filter?n.filter(t,e):t},s.event.add=function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&l("jQuery(window).on('load'...) called after load event occurred"),L.apply(this,arguments)},s.each(["load","unload","error"],function(e,t){s.fn[t]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?k.apply(this,e):(l("jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,i){s.fn[i]=function(e,t){return l("jQuery.fn."+i+"() event shorthand is deprecated"),0<arguments.length?this.on(i,null,e,t):this.trigger(i)}}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&l("'ready' event is deprecated")}},s.fn.extend({bind:function(e,t,i){return l("jQuery.fn.bind() is deprecated"),this.on(e,null,t,i)},unbind:function(e,t){return l("jQuery.fn.unbind() is deprecated"),this.off(e,null,t)},delegate:function(e,t,i,n){return l("jQuery.fn.delegate() is deprecated"),this.on(t,e,i,n)},undelegate:function(e,t,i){return l("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},hover:function(e,t){return l("jQuery.fn.hover() is deprecated"),this.on("mouseenter",e).on("mouseleave",t||e)}});function O(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}function R(e){var t=e.replace(N,"<$1></$2>");t!==e&&O(e)!==O(t)&&l("HTML tags must be properly nested and closed: "+e)}var N=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,G=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return R(e),e.replace(N,"<$1></$2>")}},s.htmlPrefilter=function(e){return R(e),G(e)};var I,$=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?$.apply(this,arguments):(l("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(I=s.param,s.param=function(e,t){var i=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&i&&(l("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=i),I.call(this,e,t)});var P,M,W=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return l("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),W.apply(this,arguments)},s.Deferred&&(P=s.Deferred,M=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var o=P(),a=o.promise();return o.pipe=a.pipe=function(){var r=arguments;return l("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(M,function(e,t){var i="function"==typeof r[e]&&r[e];o[t[1]](function(){var e=i&&i.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,i?[e]:arguments)})}),r=null}).promise()},e&&e.call(o,o),o},s.Deferred.exceptionHook=P.exceptionHook),s});