/* js bundle for tags

<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw">//<![CDATA[
window.CKEDITOR_BASEPATH = "/js/lib/ckeditor/";
//]]></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/jquery.js?v=36837c12"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw">//<![CDATA[
jQuery.noConflict();
//]]></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/jquery-migrate-mute.js?v=58e01b12"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/jquery-migrate.js?v=3f1f3f6e"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/jquery-ui.js?v=d961c98f"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/stacktrace/stacktrace.js?v=b0b8ab14"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/error_reporter.js?v=9ecc9ff3"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/loadtime_tracker.js?v=73fd0722"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/backbone/underscore.js?v=2781eeee"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/backbone/underscore.string.js?v=d2ca80db"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/backbone/backbone.js?v=e62b5c5a"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/backbone/backbone.epoxy.js?v=e5af041c"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/main.js?v=ad19ff96"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/backbone_sync.js?v=3a930cd3"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lang/en_AU.js?v=0df0dd3f"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/model.js?v=a39753b9"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/commonutils.js?v=8aa61ded"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/commonui.js?v=10c005eb"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/decimaljs/decimal.js?v=3e9986b6"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/ejs/ejs.js?v=db577997"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/httpreq.js?v=391ca090"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/popup.js?v=d0c51f96"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/usermsg.js?v=010bb60c"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/framemain.js?v=2dab1347"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/slidemenu.js?v=6e8318c6"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/datelocales.js?v=ccf58acf"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/commondates.js?v=d66a68f4"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/moment/moment.js?v=4a35c82f"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/datefield.js?v=6f77859f"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/table.js?v=988072e7"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/ajax.js?v=930348e3"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/event_handler.js?v=02400890"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/multicurrency/currency_code_controller.js?v=9f5d0a62"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/invoicing/multicurrency.js?v=5768f697"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/multicurrency.js?v=4fb07e0f"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/jumpback.js?v=2153d67e"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xcampaign.js?v=0ca9b360"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/factfind_entity_search.js?v=dfd71b51"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/params.js?v=f83aab8a"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/item_dialog.js?v=35ce655e"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/column_config.js?v=3c8706ef"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/item_list.js?v=d1e618cd"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docnote_product_list.js?v=4a2e8629"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/container.js?v=6747eac5"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/dependency.js?v=829f8d1b"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docpriv.js?v=5e816acf"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/templates.js?v=1d2f7a48"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/diary_schedule.js?v=d80ab501"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/summary_panel.js?v=9a3ba530"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/tooltip.js?v=0239c43c"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/managed_content/content.js?v=b3b4127d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/task/thread.js?v=a6113393"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/diary.js?v=3c2d190d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docnote_diary.js?v=65e422ff"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/dependency.js?v=4b83ed8d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/link_listitem.js?v=423bf7c4"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/assert.js?v=325f790d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/plugins/select2/select2.js?v=55e9eaa8"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/backbone/util/autocomplete.js?v=51d25249"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/resourceful/portfolio/group.js?v=97ce5297"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/portfolio/groups/search/autocomplete.js?v=874d784d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/portfolio_account_group.js?v=d2bd1441"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docnote_preview.js?v=6f46d808"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docnote_attachment_list.js?v=57a976e5"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/docnote_preview_container.js?v=4e1d8863"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/ckeditor/ckeditor.js?v=cc1c8809"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/ckeditor/adapters/jquery.js?v=cb682e94"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/fileuploader/fileuploader.js?v=5cb2ec39"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/ejs/view.js?v=0ecce728"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/template.js?v=ec7e699c"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/tpl_bank/ejs/portfolio/search/portfolio_account_search.js?v=30a09765"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/xpt/portfolio/search/portfolio_account_search.js?v=fdb8e578"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/plugins/chosen/jquery.chosen.js?v=d05282e9"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/plugins/dialogextend/jquery.dialogextend.js?v=b4822ba2"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/jquery/plugins/tablesorter/jquery.tablesorter.js?v=361b8b21"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/docnote/ajax_edit.js?v=9a7212b9"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ufield_depend.js?v=a30cb6ab"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/ajax/div_panel.js?v=2b770013"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/factfind/ajax/entity_summary.js?v=3ae4b32d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/factfind.js?v=315709d2"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/highcharts/highstock.js?v=26d20704"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/highcharts/highcharts-more.js?v=7211bf3d"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/format2.js?v=a7cc81a9"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/charting/donut.js?v=acb84fbe"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/chart.js?v=1905901a"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/benchmarks.js?v=23d6c2a8"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/lib/mousetrap.js?v=1c0c22ed"></script>
<script type="text/javascript" nonce="i8_imV5P-6IFpcn5BlQh17tj0Jy558IoXxxAm6I97Tw" src="<activebaseurl>/js/instasearch.js?v=75e77cdc"></script>

*/


if(!window.Dependency){Dependency={_js:{},_css:{}}}window.CKEDITOR_BASEPATH = "/js/lib/ckeditor/";
;
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e){var t=!!e&&"length"in e&&e.length,n=Z.type(e);return"function"!==n&&!Z.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Z.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(le.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return Y.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(){X.removeEventListener("DOMContentLoaded",o),e.removeEventListener("load",o),Z.ready()}function s(){this.expando=Z.expando+s.uid++}function a(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(we,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:be.test(n)?Z.parseJSON(n):n)}catch(e){}xe.set(e,t,n)}else n=void 0;return n}function u(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return Z.css(e,t,"")},u=a(),l=n&&n[3]||(Z.cssNumber[t]?"":"px"),c=(Z.cssNumber[t]||"px"!==l&&+u)&&Ce.exec(Z.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{c/=o=o||".5",Z.style(e,t,c+l)}while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function l(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function c(e,t){for(var n=0,r=e.length;n<r;n++)ye.set(e[n],"globalEval",!t||ye.get(t[n],"globalEval"))}function f(e,t,n,r,i){for(var o,s,a,u,f,p,d=t.createDocumentFragment(),h=[],g=0,m=e.length;g<m;g++)if((o=e[g])||0===o)if("object"===Z.type(o))Z.merge(h,o.nodeType?[o]:o);else if(Le.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Se.exec(o)||["",""])[1].toLowerCase(),u=je[a]||je._default,s.innerHTML=u[1]+Z.htmlPrefilter(o)+u[2],p=u[0];p--;)s=s.lastChild;Z.merge(h,s.childNodes),(s=d.firstChild).textContent=""}else h.push(t.createTextNode(o));for(d.textContent="",g=0;o=h[g++];)if(r&&Z.inArray(o,r)>-1)i&&i.push(o);else if(f=Z.contains(o.ownerDocument,o),s=l(d.appendChild(o),"script"),f&&c(s),n)for(p=0;o=s[p++];)De.test(o.type||"")&&n.push(o);return d}function p(){return!0}function d(){return!1}function h(){try{return X.activeElement}catch(e){}}function g(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)g(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=d;else if(!i)return e;return 1===o&&(s=i,(i=function(e){return Z().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=Z.guid++)),e.each(function(){Z.event.add(this,t,i,r,n)})}function m(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=Ie.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function x(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(ye.hasData(e)&&(o=ye.access(e),s=ye.set(t,o),l=o.events))for(i in delete s.handle,s.events={},l)for(n=0,r=l[i].length;n<r;n++)Z.event.add(t,i,l[i][n]);xe.hasData(e)&&(a=xe.access(e),u=Z.extend({},a),xe.set(t,u))}}function b(e,t,n,r){t=U.apply([],t);var i,o,s,a,u,c,p=0,d=e.length,h=d-1,g=t[0],m=Z.isFunction(g);if(m||d>1&&"string"==typeof g&&!K.checkClone&&Me.test(g))return e.each(function(i){var o=e.eq(i);m&&(t[0]=g.call(this,i,o.html())),b(o,t,n,r)});if(d&&(o=(i=f(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=Z.map(l(i,"script"),v)).length;p<d;p++)u=i,p!==h&&(u=Z.clone(u,!0,!0),a&&Z.merge(s,l(u,"script"))),n.call(e[p],u,p);if(a)for(c=s[s.length-1].ownerDocument,Z.map(s,y),p=0;p<a;p++)u=s[p],De.test(u.type||"")&&!ye.access(u,"globalEval")&&Z.contains(c,u)&&(u.src?Z._evalUrl&&Z._evalUrl(u.src):Z.DOMEval(u.textContent,u))}return e}function w(e,t,n){for(var r,i=t?Z.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||Z.cleanData(l(r)),r.parentNode&&(n&&Z.contains(r.ownerDocument,r)&&c(l(r,"script")),r.parentNode.removeChild(r));return e}function T(e,t){var n=Z(t.createElement(e)).appendTo(t.body),r=Z.css(n[0],"display");return n.detach(),r}function C(e){var t=X,n=$e[e];return n||("none"!==(n=T(e,t))&&n||((t=(We=(We||Z("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=T(e,t),We.detach()),$e[e]=n),n}function k(e,t,n){var r,i,o,s,a=e.style;return""!==(s=(n=n||Xe(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==s||Z.contains(e.ownerDocument,e)||(s=Z.style(e,t)),n&&!K.pixelMarginRight()&&_e.test(s)&&Be.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o),void 0!==s?s+"":s}function E(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function N(e){if(e in Je)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;n--;)if((e=Qe[n]+t)in Je)return e}function S(e,t,n){var r=Ce.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function D(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=Z.css(e,n+ke[o],!0,i)),r?("content"===n&&(s-=Z.css(e,"padding"+ke[o],!0,i)),"margin"!==n&&(s-=Z.css(e,"border"+ke[o]+"Width",!0,i))):(s+=Z.css(e,"padding"+ke[o],!0,i),"padding"!==n&&(s+=Z.css(e,"border"+ke[o]+"Width",!0,i)));return s}function j(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Xe(e),s="border-box"===Z.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=k(e,t,o))<0||null==i)&&(i=e.style[t]),_e.test(i))return i;r=s&&(K.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+D(e,t,n||(s?"border":"content"),r,o)+"px"}function A(e,t){for(var n,r,i,o=[],s=0,a=e.length;s<a;s++)(r=e[s]).style&&(o[s]=ye.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Ee(r)&&(o[s]=ye.access(r,"olddisplay",C(r.nodeName)))):(i=Ee(r),"none"===n&&i||ye.set(r,"olddisplay",i?n:Z.css(r,"display"))));for(s=0;s<a;s++)(r=e[s]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}function q(e,t,n,r,i){return new q.prototype.init(e,t,n,r,i)}function L(){return e.setTimeout(function(){Ke=void 0}),Ke=Z.now()}function H(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ke[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function O(e,t,n){for(var r,i=(F.tweeners[t]||[]).concat(F.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function F(e,t,n){var r,i,o=0,s=F.prefilters.length,a=Z.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Ke||L(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(r);return a.notifyWith(e,[l,r,n]),r<1&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Z.extend({},t),opts:Z.extend(!0,{specialEasing:{},easing:Z.easing._default},n),originalProperties:t,originalOptions:n,startTime:Ke||L(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Z.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l,t])):a.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=Z.camelCase(n)],o=e[n],Z.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=Z.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<s;o++)if(r=F.prefilters[o].call(l,e,c,l.opts))return Z.isFunction(r.stop)&&(Z._queueHooks(l.elem,l.opts.queue).stop=Z.proxy(r.stop,r)),r;return Z.map(c,O,l),Z.isFunction(l.opts.start)&&l.opts.start.call(e,l),Z.fx.timer(Z.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function P(e){return e.getAttribute&&e.getAttribute("class")||""}function R(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(ge)||[];if(Z.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function M(e,t,n,r){function i(a){var u;return o[a]=!0,Z.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||s||o[l]?s?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},s=e===xt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function I(e,t){var n,r,i=Z.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&Z.extend(!0,e,r),e}function W(e,t,n,r){var i;if(Z.isArray(t))Z.each(t,function(t,i){n||Ct.test(e)?r(e,i):W(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==Z.type(t))r(e,t);else for(i in t)W(e+"["+i+"]",t[i],n,r)}function $(e){return Z.isWindow(e)?e:9===e.nodeType&&e.defaultView}var B={type:!0,nonce:!0},_=[],X=e.document,z=_.slice,U=_.concat,V=_.push,Y=_.indexOf,G={},Q=G.toString,J=G.hasOwnProperty,K={},Z=function(e,t){return new Z.fn.init(e,t)},ee=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,te=/^-ms-/,ne=/-([\da-z])/gi,re=function(e,t){return t.toUpperCase()};Z.fn=Z.prototype={jquery:"2.2.4",constructor:Z,selector:"",length:0,toArray:function(){return z.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:z.call(this)},pushStack:function(e){var t=Z.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return Z.each(this,e)},map:function(e){return this.pushStack(Z.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(z.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:V,sort:_.sort,splice:_.splice},Z.extend=Z.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||Z.isFunction(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],s!==(r=e[t])&&(l&&r&&(Z.isPlainObject(r)||(i=Z.isArray(r)))?(i?(i=!1,o=n&&Z.isArray(n)?n:[]):o=n&&Z.isPlainObject(n)?n:{},s[t]=Z.extend(l,o,r)):void 0!==r&&(s[t]=r));return s},Z.extend({expando:"jQuery"+("2.2.4"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===Z.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!Z.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==Z.type(e)||e.nodeType||Z.isWindow(e))return!1;if(e.constructor&&!J.call(e,"constructor")&&!J.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||J.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?G[Q.call(e)]||"object":typeof e},DOMEval:function(e,t,n){var r,i=(n=n||X).createElement("script");for(r in i.text=e,B)t&&t[r]&&(i[r]=t[r]);n.head.appendChild(i).parentNode&&i.parentNode.removeChild(i)},globalEval:function(e,t,n){Z.DOMEval(e,{nonce:t&&t.nonce},n)},camelCase:function(e){return e.replace(te,"ms-").replace(ne,re)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;i<r&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:function(e){return null==e?"":(e+"").replace(ee,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?Z.merge(r,"string"==typeof e?[e]:e):V.call(r,e)),r},inArray:function(e,t,n){return null==t?-1:Y.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,r){var i,o,s=0,a=[];if(n(e))for(i=e.length;s<i;s++)null!=(o=t(e[s],s,r))&&a.push(o);else for(s in e)null!=(o=t(e[s],s,r))&&a.push(o);return U.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),Z.isFunction(e))return r=z.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(z.call(arguments)))}).guid=e.guid=e.guid||Z.guid++,i},now:Date.now,support:K}),"function"==typeof Symbol&&(Z.fn[Symbol.iterator]=_[Symbol.iterator]),Z.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){G["[object "+t+"]"]=t.toLowerCase()});var ie=function(e){function t(e,t,n,r){var i,o,s,a,u,l,f,d,h=t&&t.ownerDocument,g=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==g&&9!==g&&11!==g)return n;if(!r&&((t?t.ownerDocument||t:M)!==A&&j(t),t=t||A,L)){if(11!==g&&(l=ge.exec(e)))if(i=l[1]){if(9===g){if(!(s=t.getElementById(i)))return n;if(s.id===i)return n.push(s),n}else if(h&&(s=h.getElementById(i))&&P(t,s)&&s.id===i)return n.push(s),n}else{if(l[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&x.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(i)),n}if(x.qsa&&!_[e+" "]&&(!H||!H.test(e))){if(1!==g)h=t,d=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(ve,"\\$&"):t.setAttribute("id",a=R),o=(f=C(e)).length,u=ce.test(a)?"#"+a:"[id='"+a+"']";o--;)f[o]=u+" "+p(f[o]);d=f.join(","),h=me.test(e)&&c(t.parentNode)||t}if(d)try{return Q.apply(n,h.querySelectorAll(d)),n}catch(e){}finally{a===R&&t.removeAttribute("id")}}}return E(e.replace(oe,"$1"),t,n,r)}function n(){var e=[];return function t(n,r){return e.push(n+" ")>b.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function r(e){return e[R]=!0,e}function i(e){var t=A.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||z)-(~e.sourceIndex||z);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,s){var a,u,l,c=[I,o];if(s){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((a=(u=(l=t[R]||(t[R]={}))[t.uniqueID]||(l[t.uniqueID]={}))[r])&&a[0]===I&&a[1]===o)return c[2]=a[2];if(u[r]=c,c[2]=e(t,n,s))return!0}}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),l&&t.push(a)));return s}function m(e,n,i,o,s,a){return o&&!o[R]&&(o=m(o)),s&&!s[R]&&(s=m(s,a)),r(function(r,a,u,l){var c,f,p,d=[],h=[],m=a.length,v=r||function(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}(n||"*",u.nodeType?[u]:u,[]),y=!e||!r&&n?v:g(v,d,e,u,l),x=i?s||(r?e:m||o)?[]:a:y;if(i&&i(y,x,u,l),o)for(c=g(x,h),o(c,[],u,l),f=c.length;f--;)(p=c[f])&&(x[h[f]]=!(y[h[f]]=p));if(r){if(s||e){if(s){for(c=[],f=x.length;f--;)(p=x[f])&&c.push(y[f]=p);s(null,x=[],c,l)}for(f=x.length;f--;)(p=x[f])&&(c=s?K(r,p):d[f])>-1&&(r[c]=!(a[c]=p))}}else x=g(x===a?x.splice(m,x.length):x),s?s(null,a,x,l):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],s=o||b.relative[" "],a=o?1:0,u=d(function(e){return e===t},s,!0),l=d(function(e){return K(t,e)>-1},s,!0),c=[function(e,n,r){var i=!o&&(r||n!==N)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];a<i;a++)if(n=b.relative[e[a].type])c=[d(h(c),n)];else{if((n=b.filter[e[a].type].apply(null,e[a].matches))[R]){for(r=++a;r<i&&!b.relative[e[r].type];r++);return m(a>1&&h(c),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(oe,"$1"),n,a<r&&v(e.slice(a,r)),r<i&&v(e=e.slice(r)),r<i&&p(e))}c.push(n)}return h(c)}var y,x,b,w,T,C,k,E,N,S,D,j,A,q,L,H,O,F,P,R="sizzle"+1*new Date,M=e.document,I=0,W=0,$=n(),B=n(),_=n(),X=function(e,t){return e===t&&(D=!0),0},z=1<<31,U={}.hasOwnProperty,V=[],Y=V.pop,G=V.push,Q=V.push,J=V.slice,K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},Z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ne="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",re=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ne+")*)|.*)\\)|)",ie=new RegExp(ee+"+","g"),oe=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),se=new RegExp("^"+ee+"*,"+ee+"*"),ae=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),ue=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),le=new RegExp(re),ce=new RegExp("^"+te+"$"),fe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,de=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ve=/'|\\/g,ye=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},be=function(){j()};try{Q.apply(V=J.call(M.childNodes),M.childNodes),V[M.childNodes.length].nodeType}catch(e){Q={apply:V.length?function(e,t){G.apply(e,J.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}for(y in x=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},j=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:M;return r!==A&&9===r.nodeType&&r.documentElement?(q=(A=r).documentElement,L=!T(A),(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",be,!1):n.attachEvent&&n.attachEvent("onunload",be)),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(A.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=he.test(A.getElementsByClassName),x.getById=i(function(e){return q.appendChild(e).id=R,!A.getElementsByName||!A.getElementsByName(R).length}),x.getById?(b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&L){var n=t.getElementById(e);return n?[n]:[]}},b.filter.ID=function(e){var t=e.replace(ye,xe);return function(e){return e.getAttribute("id")===t}}):(delete b.find.ID,b.filter.ID=function(e){var t=e.replace(ye,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),b.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=x.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&L)return t.getElementsByClassName(e)},O=[],H=[],(x.qsa=he.test(A.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="<a id='"+R+"'></a><select id='"+R+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&H.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||H.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+R+"-]").length||H.push("~="),e.querySelectorAll(":checked").length||H.push(":checked"),e.querySelectorAll("a#"+R+"+*").length||H.push(".#.+[+~]")}),i(function(e){var t=A.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&H.push("name"+ee+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),H.push(",.*:")})),(x.matchesSelector=he.test(F=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){x.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),O.push("!=",re)}),H=H.length&&new RegExp(H.join("|")),O=O.length&&new RegExp(O.join("|")),t=he.test(q.compareDocumentPosition),P=t||he.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===M&&P(M,e)?-1:t===A||t.ownerDocument===M&&P(M,t)?1:S?K(S,e)-K(S,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===A?-1:t===A?1:i?-1:o?1:S?K(S,e)-K(S,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===M?-1:u[r]===M?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&j(e),n=n.replace(ue,"='$1']"),x.matchesSelector&&L&&!_[n+" "]&&(!O||!O.test(n))&&(!H||!H.test(n)))try{var r=F.call(e,n);if(r||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&j(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&j(e);var n=b.attrHandle[t.toLowerCase()],r=n&&U.call(b.attrHandle,t.toLowerCase())?n(e,t,!L):void 0;return void 0!==r?r:x.attributes||!L?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!x.detectDuplicates,S=!x.sortStable&&e.slice(0),e.sort(X),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return S=null,e},w=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=w(t);return n},(b=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ye,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ye,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&le.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ye,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(x=(d=(l=(c=(f=(p=m)[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===I&&l[1])&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[I,d,x];break}}else if(y&&(x=d=(l=(c=(f=(p=t)[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===I&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&((c=(f=p[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[I,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=b.pseudos[e]||b.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[R]?o(n):o.length>1?(i=[e,e,"",n],b.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)e[r=K(e,i[s])]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(oe,"$1"));return i[R]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ye,xe),function(t){return(t.textContent||t.innerText||w(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ye,xe).toLowerCase(),function(t){var n;do{if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return de.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[y]=a(y);for(y in{submit:!0,reset:!0})b.pseudos[y]=u(y);return f.prototype=b.filters=b.pseudos,b.setFilters=new f,C=t.tokenize=function(e,n){var r,i,o,s,a,u,l,c=B[e+" "];if(c)return n?0:c.slice(0);for(a=e,u=[],l=b.preFilter;a;){for(s in r&&!(i=se.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),r=!1,(i=ae.exec(a))&&(r=i.shift(),o.push({value:r,type:i[0].replace(oe," ")}),a=a.slice(r.length)),b.filter)!(i=fe[s].exec(a))||l[s]&&!(i=l[s](i))||(r=i.shift(),o.push({value:r,type:s,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?t.error(e):B(e,u).slice(0)},k=t.compile=function(e,n){var i,o=[],s=[],a=_[e+" "];if(!a){for(n||(n=C(e)),i=n.length;i--;)(a=v(n[i]))[R]?o.push(a):s.push(a);(a=_(e,function(e,n){var i=n.length>0,o=e.length>0,s=function(r,s,a,u,l){var c,f,p,d=0,h="0",m=r&&[],v=[],y=N,x=r||o&&b.find.TAG("*",l),w=I+=null==y?1:Math.random()||.1,T=x.length;for(l&&(N=s===A||s||l);h!==T&&null!=(c=x[h]);h++){if(o&&c){for(f=0,s||c.ownerDocument===A||(j(c),a=!L);p=e[f++];)if(p(c,s||A,a)){u.push(c);break}l&&(I=w)}i&&((c=!p&&c)&&d--,r&&m.push(c))}if(d+=h,i&&h!==d){for(f=0;p=n[f++];)p(m,v,s,a);if(r){if(d>0)for(;h--;)m[h]||v[h]||(v[h]=Y.call(u));v=g(v)}Q.apply(u,v),l&&!r&&v.length>0&&d+n.length>1&&t.uniqueSort(u)}return l&&(I=w,N=y),m};return i?r(s):s}(s,o))).selector=e}return a},E=t.select=function(e,t,n,r){var i,o,s,a,u,l="function"==typeof e&&e,f=!r&&C(e=l.selector||e);if(n=n||[],1===f.length){if((o=f[0]=f[0].slice(0)).length>2&&"ID"===(s=o[0]).type&&x.getById&&9===t.nodeType&&L&&b.relative[o[1].type]){if(!(t=(b.find.ID(s.matches[0].replace(ye,xe),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(s=o[i],!b.relative[a=s.type]);)if((u=b.find[a])&&(r=u(s.matches[0].replace(ye,xe),me.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&p(o)))return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!L,n,!t||me.test(e)&&c(t.parentNode)||t),n},x.sortStable=R.split("").sort(X).join("")===R,x.detectDuplicates=!!D,j(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(A.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(Z,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);Z.find=ie,Z.expr=ie.selectors,Z.expr[":"]=Z.expr.pseudos,Z.uniqueSort=Z.unique=ie.uniqueSort,Z.text=ie.getText,Z.isXMLDoc=ie.isXML,Z.contains=ie.contains;var oe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&Z(e).is(n))break;r.push(e)}return r},se=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},ae=Z.expr.match.needsContext,ue=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,le=/^.[^:#\[\.,]*$/;Z.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?Z.find.matchesSelector(r,e)?[r]:[]:Z.find.matches(e,Z.grep(t,function(e){return 1===e.nodeType}))},Z.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(Z(e).filter(function(){for(t=0;t<n;t++)if(Z.contains(i[t],this))return!0}));for(t=0;t<n;t++)Z.find(e,i[t],r);return(r=this.pushStack(n>1?Z.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&ae.test(e)?Z(e):e||[],!1).length}});var ce,fe=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(Z.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||ce,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:fe.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof Z?t[0]:t,Z.merge(this,Z.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:X,!0)),ue.test(r[1])&&Z.isPlainObject(t))for(r in t)Z.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=X.getElementById(r[2]))&&i.parentNode&&(this.length=1,this[0]=i),this.context=X,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):Z.isFunction(e)?void 0!==n.ready?n.ready(e):e(Z):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),Z.makeArray(e,this))}).prototype=Z.fn,ce=Z(X);var pe=/^(?:parents|prev(?:Until|All))/,de={children:!0,contents:!0,next:!0,prev:!0};Z.fn.extend({has:function(e){var t=Z(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(Z.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],s=ae.test(e)||"string"!=typeof e?Z(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&Z.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?Z.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?Y.call(Z(e),this[0]):Y.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(Z.uniqueSort(Z.merge(this.get(),Z(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Z.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return oe(e,"parentNode")},parentsUntil:function(e,t,n){return oe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return oe(e,"nextSibling")},prevAll:function(e){return oe(e,"previousSibling")},nextUntil:function(e,t,n){return oe(e,"nextSibling",n)},prevUntil:function(e,t,n){return oe(e,"previousSibling",n)},siblings:function(e){return se((e.parentNode||{}).firstChild,e)},children:function(e){return se(e.firstChild)},contents:function(e){return e.contentDocument||Z.merge([],e.childNodes)}},function(e,t){Z.fn[e]=function(n,r){var i=Z.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=Z.filter(r,i)),this.length>1&&(de[e]||Z.uniqueSort(i),pe.test(e)&&i.reverse()),this.pushStack(i)}});var he,ge=/\S+/g;Z.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return Z.each(e.match(ge)||[],function(e,n){t[n]=!0}),t}(e):Z.extend({},e);var t,n,r,i,o=[],s=[],a=-1,u=function(){for(i=e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){Z.each(n,function(n,r){Z.isFunction(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==Z.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return Z.each(arguments,function(e,t){for(var n;(n=Z.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?Z.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},Z.extend({Deferred:function(e){var t=[["resolve","done",Z.Callbacks("once memory"),"resolved"],["reject","fail",Z.Callbacks("once memory"),"rejected"],["notify","progress",Z.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Z.Deferred(function(n){Z.each(t,function(t,o){var s=Z.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&Z.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?Z.extend(e,r):r}},i={};return r.pipe=r.then,Z.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=z.call(arguments),s=o.length,a=1!==s||e&&Z.isFunction(e.promise)?s:0,u=1===a?e:Z.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?z.call(arguments):i,r===t?u.notifyWith(n,r):--a||u.resolveWith(n,r)}};if(s>1)for(t=new Array(s),n=new Array(s),r=new Array(s);i<s;i++)o[i]&&Z.isFunction(o[i].promise)?o[i].promise().progress(l(i,n,t)).done(l(i,r,o)).fail(u.reject):--a;return a||u.resolveWith(r,o),u.promise()}}),Z.fn.ready=function(e){return Z.ready.promise().done(e),this},Z.extend({isReady:!1,readyWait:1,holdReady:function(e){e?Z.readyWait++:Z.ready(!0)},ready:function(e){(!0===e?--Z.readyWait:Z.isReady)||(Z.isReady=!0,!0!==e&&--Z.readyWait>0||(he.resolveWith(X,[Z]),Z.fn.triggerHandler&&(Z(X).triggerHandler("ready"),Z(X).off("ready"))))}}),Z.ready.promise=function(t){return he||(he=Z.Deferred(),"complete"===X.readyState||"loading"!==X.readyState&&!X.documentElement.doScroll?e.setTimeout(Z.ready):(X.addEventListener("DOMContentLoaded",o),e.addEventListener("load",o))),he.promise(t)},Z.ready.promise();var me=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===Z.type(n))for(a in i=!0,n)me(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,Z.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(Z(e),n)})),t))for(;a<u;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},ve=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};s.uid=1,s.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!ve(e))return{};var t=e[this.expando];return t||(t={},ve(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[t]=n;else for(r in t)i[r]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(r=this.get(e,t))?r:this.get(e,Z.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=e[this.expando];if(void 0!==o){if(void 0===t)this.register(e);else{Z.isArray(t)?r=t.concat(t.map(Z.camelCase)):(i=Z.camelCase(t),r=t in o?[t,i]:(r=i)in o?[r]:r.match(ge)||[]),n=r.length;for(;n--;)delete o[r[n]]}(void 0===t||Z.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!Z.isEmptyObject(t)}};var ye=new s,xe=new s,be=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,we=/[A-Z]/g;Z.extend({hasData:function(e){return xe.hasData(e)||ye.hasData(e)},data:function(e,t,n){return xe.access(e,t,n)},removeData:function(e,t){xe.remove(e,t)},_data:function(e,t,n){return ye.access(e,t,n)},_removeData:function(e,t){ye.remove(e,t)}}),Z.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=xe.get(o),1===o.nodeType&&!ye.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=Z.camelCase(r.slice(5)),a(o,r,i[r]));ye.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){xe.set(this,e)}):me(this,function(t){var n,r;if(o&&void 0===t)return void 0!==(n=xe.get(o,e)||xe.get(o,e.replace(we,"-$&").toLowerCase()))?n:(r=Z.camelCase(e),void 0!==(n=xe.get(o,r))?n:void 0!==(n=a(o,r,void 0))?n:void 0);r=Z.camelCase(e),this.each(function(){var n=xe.get(this,r);xe.set(this,r,t),e.indexOf("-")>-1&&void 0!==n&&xe.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){xe.remove(this,e)})}}),Z.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ye.get(e,t),n&&(!r||Z.isArray(n)?r=ye.access(e,t,Z.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Z.queue(e,t),r=n.length,i=n.shift(),o=Z._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){Z.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ye.get(e,n)||ye.access(e,n,{empty:Z.Callbacks("once memory").add(function(){ye.remove(e,[t+"queue",n])})})}}),Z.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?Z.queue(this[0],e):void 0===t?this:this.each(function(){var n=Z.queue(this,e,t);Z._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&Z.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Z.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=Z.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=ye.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var Te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ce=new RegExp("^(?:([+-])=|)("+Te+")([a-z%]*)$","i"),ke=["Top","Right","Bottom","Left"],Ee=function(e,t){return e=t||e,"none"===Z.css(e,"display")||!Z.contains(e.ownerDocument,e)},Ne=/^(?:checkbox|radio)$/i,Se=/<([\w:-]+)/,De=/^$|\/(?:java|ecma)script/i,je={option:[1,"<select multiple='multiple'>","</select>"],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,"",""]};je.optgroup=je.option,je.tbody=je.tfoot=je.colgroup=je.caption=je.thead,je.th=je.td;var Ae,qe,Le=/<|&#?\w+;/;Ae=X.createDocumentFragment().appendChild(X.createElement("div")),(qe=X.createElement("input")).setAttribute("type","radio"),qe.setAttribute("checked","checked"),qe.setAttribute("name","t"),Ae.appendChild(qe),K.checkClone=Ae.cloneNode(!0).cloneNode(!0).lastChild.checked,Ae.innerHTML="<textarea>x</textarea>",K.noCloneChecked=!!Ae.cloneNode(!0).lastChild.defaultValue;var He=/^key/,Oe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Fe=/^([^.]*)(?:\.(.+)|)/;Z.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=ye.get(e);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),n.guid||(n.guid=Z.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return"undefined"!=typeof Z&&Z.event.triggered!==t.type?Z.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(ge)||[""]).length;l--;)d=g=(a=Fe.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d&&(f=Z.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=Z.event.special[d]||{},c=Z.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&Z.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(d,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),Z.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=ye.hasData(e)&&ye.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(ge)||[""]).length;l--;)if(d=g=(a=Fe.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d){for(f=Z.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||Z.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)Z.event.remove(e,d+t[l],n,r,!0);Z.isEmptyObject(u)&&ye.remove(e,"handle events")}},dispatch:function(e){e=Z.event.fix(e);var t,n,r,i,o,s,a=z.call(arguments),u=(ye.get(this,"events")||{})[e.type]||[],l=Z.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,e)){for(s=Z.event.handlers.call(this,e,u),t=0;(i=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,void 0!==(r=((Z.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==e.type)){for(r=[],n=0;n<a;n++)void 0===r[i=(o=t[n]).selector+" "]&&(r[i]=o.needsContext?Z(i,this).index(u)>-1:Z.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(r=(n=e.target.ownerDocument||X).documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[Z.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=Oe.test(i)?this.mouseHooks:He.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new Z.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=X),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===h()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&Z.nodeName(this,"input"))return this.click(),!1},_default:function(e){return Z.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},Z.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},Z.Event=function(e,t){if(!(this instanceof Z.Event))return new Z.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?p:d):this.type=e,t&&Z.extend(this,t),this.timeStamp=e&&e.timeStamp||Z.now(),this[Z.expando]=!0},Z.Event.prototype={constructor:Z.Event,isDefaultPrevented:d,isPropagationStopped:d,isImmediatePropagationStopped:d,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=p,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=p,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=p,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},Z.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){Z.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||Z.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),Z.fn.extend({on:function(e,t,n,r){return g(this,e,t,n,r)},one:function(e,t,n,r){return g(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,Z(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=d),this.each(function(){Z.event.remove(this,e,n,t)})}});var Pe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Re=/<script|<style|<link/i,Me=/checked\s*(?:[^=]|=\s*.checked.)/i,Ie=/^true\/(.*)/;Z.extend({htmlPrefilter:function(e){return e.replace(Pe,"<$1></$2>")},clone:function(e,t,n){var r,i,o,s,a,u,f,p=e.cloneNode(!0),d=Z.contains(e.ownerDocument,e);if(!(K.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Z.isXMLDoc(e)))for(s=l(p),r=0,i=(o=l(e)).length;r<i;r++)a=o[r],u=s[r],void 0,"input"===(f=u.nodeName.toLowerCase())&&Ne.test(a.type)?u.checked=a.checked:"input"!==f&&"textarea"!==f||(u.defaultValue=a.defaultValue);if(t)if(n)for(o=o||l(e),s=s||l(p),r=0,i=o.length;r<i;r++)x(o[r],s[r]);else x(e,p);return(s=l(p,"script")).length>0&&c(s,!d&&l(e,"script")),p},cleanData:function(e){for(var t,n,r,i=Z.event.special,o=0;void 0!==(n=e[o]);o++)if(ve(n)){if(t=n[ye.expando]){if(t.events)for(r in t.events)i[r]?Z.event.remove(n,r):Z.removeEvent(n,r,t.handle);n[ye.expando]=void 0}n[xe.expando]&&(n[xe.expando]=void 0)}}}),Z.fn.extend({domManip:b,detach:function(e){return w(this,e,!0)},remove:function(e){return w(this,e)},text:function(e){return me(this,function(e){return void 0===e?Z.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return b(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||m(this,e).appendChild(e)})},prepend:function(){return b(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=m(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return b(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return b(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(Z.cleanData(l(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return Z.clone(this,e,t)})},html:function(e){return me(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Re.test(e)&&!je[(Se.exec(e)||["",""])[1].toLowerCase()]){e=Z.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(Z.cleanData(l(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return b(this,arguments,function(t){var n=this.parentNode;Z.inArray(this,e)<0&&(Z.cleanData(l(this)),n&&n.replaceChild(t,this))},e)}}),Z.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Z.fn[e]=function(e){for(var n,r=[],i=Z(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),Z(i[s])[t](n),V.apply(r,n.get());return this.pushStack(r)}});var We,$e={HTML:"block",BODY:"block"},Be=/^margin/,_e=new RegExp("^("+Te+")(?!px)[a-z%]+$","i"),Xe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},ze=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=s[o];return i},Ue=X.documentElement;!function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",Ue.appendChild(s);var t=e.getComputedStyle(a);n="1%"!==t.top,o="2px"===t.marginLeft,r="4px"===t.width,a.style.marginRight="50%",i="4px"===t.marginRight,Ue.removeChild(s)}var n,r,i,o,s=X.createElement("div"),a=X.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",K.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),Z.extend(K,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==r&&t(),r},pixelMarginRight:function(){return null==r&&t(),i},reliableMarginLeft:function(){return null==r&&t(),o},reliableMarginRight:function(){var t,n=a.appendChild(X.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",Ue.appendChild(s),t=!parseFloat(e.getComputedStyle(n).marginRight),Ue.removeChild(s),a.removeChild(n),t}}))}();var Ve=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"},Qe=["Webkit","O","Moz","ms"],Je=X.createElement("div").style;Z.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=k(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=Z.camelCase(t),l=e.style;if(t=Z.cssProps[a]||(Z.cssProps[a]=N(a)||a),s=Z.cssHooks[t]||Z.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Ce.exec(n))&&i[1]&&(n=u(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(Z.cssNumber[a]?"":"px")),K.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l[t]=n))}},css:function(e,t,n,r){var i,o,s,a=Z.camelCase(t);return t=Z.cssProps[a]||(Z.cssProps[a]=N(a)||a),(s=Z.cssHooks[t]||Z.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=k(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),Z.each(["height","width"],function(e,t){Z.cssHooks[t]={get:function(e,n,r){if(n)return Ve.test(Z.css(e,"display"))&&0===e.offsetWidth?ze(e,Ye,function(){return j(e,t,r)}):j(e,t,r)},set:function(e,n,r){var i,o=r&&Xe(e),s=r&&D(e,t,r,"border-box"===Z.css(e,"boxSizing",!1,o),o);return s&&(i=Ce.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=Z.css(e,t)),S(0,n,s)}}}),Z.cssHooks.marginLeft=E(K.reliableMarginLeft,function(e,t){if(t)return(parseFloat(k(e,"marginLeft"))||e.getBoundingClientRect().left-ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),Z.cssHooks.marginRight=E(K.reliableMarginRight,function(e,t){if(t)return ze(e,{display:"inline-block"},k,[e,"marginRight"])}),Z.each({margin:"",padding:"",border:"Width"},function(e,t){Z.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ke[r]+t]=o[r]||o[r-2]||o[0];return i}},Be.test(e)||(Z.cssHooks[e+t].set=S)}),Z.fn.extend({css:function(e,t){return me(this,function(e,t,n){var r,i,o={},s=0;if(Z.isArray(t)){for(r=Xe(e),i=t.length;s<i;s++)o[t[s]]=Z.css(e,t[s],!1,r);return o}return void 0!==n?Z.style(e,t,n):Z.css(e,t)},e,t,arguments.length>1)},show:function(){return A(this,!0)},hide:function(){return A(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ee(this)?Z(this).show():Z(this).hide()})}}),Z.Tween=q,q.prototype={constructor:q,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||Z.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Z.cssNumber[n]?"":"px")},cur:function(){var e=q.propHooks[this.prop];return e&&e.get?e.get(this):q.propHooks._default.get(this)},run:function(e){var t,n=q.propHooks[this.prop];return this.options.duration?this.pos=t=Z.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):q.propHooks._default.set(this),this}},q.prototype.init.prototype=q.prototype,q.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=Z.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){Z.fx.step[e.prop]?Z.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[Z.cssProps[e.prop]]&&!Z.cssHooks[e.prop]?e.elem[e.prop]=e.now:Z.style(e.elem,e.prop,e.now+e.unit)}}},q.propHooks.scrollTop=q.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Z.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},Z.fx=q.prototype.init,Z.fx.step={};var Ke,Ze,et=/^(?:toggle|show|hide)$/,tt=/queueHooks$/;Z.Animation=Z.extend(F,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return u(n.elem,e,Ce.exec(t),n),n}]},tweener:function(e,t){Z.isFunction(e)?(t=e,e=["*"]):e=e.match(ge);for(var n,r=0,i=e.length;r<i;r++)n=e[r],F.tweeners[n]=F.tweeners[n]||[],F.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,u,l,c=this,f={},p=e.style,d=e.nodeType&&Ee(e),h=ye.get(e,"fxshow");for(r in n.queue||(null==(a=Z._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,Z.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===("none"===(l=Z.css(e,"display"))?ye.get(e,"olddisplay")||C(e.nodeName):l)&&"none"===Z.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",c.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),t)if(i=t[r],et.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(d?"hide":"show")){if("show"!==i||!h||void 0===h[r])continue;d=!0}f[r]=h&&h[r]||Z.style(e,r)}else l=void 0;if(Z.isEmptyObject(f))"inline"===("none"===l?C(e.nodeName):l)&&(p.display=l);else for(r in h?"hidden"in h&&(d=h.hidden):h=ye.access(e,"fxshow",{}),o&&(h.hidden=!d),d?Z(e).show():c.done(function(){Z(e).hide()}),c.done(function(){var t;for(t in ye.remove(e,"fxshow"),f)Z.style(e,t,f[t])}),f)s=O(d?h[r]:0,r,c),r in h||(h[r]=s.start,d&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}],prefilter:function(e,t){t?F.prefilters.unshift(e):F.prefilters.push(e)}}),Z.speed=function(e,t,n){var r=e&&"object"==typeof e?Z.extend({},e):{complete:n||!n&&t||Z.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Z.isFunction(t)&&t};return r.duration=Z.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Z.fx.speeds?Z.fx.speeds[r.duration]:Z.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){Z.isFunction(r.old)&&r.old.call(this),r.queue&&Z.dequeue(this,r.queue)},r},Z.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Z.isEmptyObject(e),o=Z.speed(t,n,r),s=function(){var t=F(this,Z.extend({},e),o);(i||ye.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=Z.timers,s=ye.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&tt.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||Z.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=ye.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=Z.timers,s=r?r.length:0;for(n.finish=!0,Z.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),Z.each(["toggle","show","hide"],function(e,t){var n=Z.fn[t];Z.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(H(t,!0),e,r,i)}}),Z.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Z.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Z.timers=[],Z.fx.tick=function(){var e,t=0,n=Z.timers;for(Ke=Z.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||Z.fx.stop(),Ke=void 0},Z.fx.timer=function(e){Z.timers.push(e),e()?Z.fx.start():Z.timers.pop()},Z.fx.interval=13,Z.fx.start=function(){Ze||(Ze=e.setInterval(Z.fx.tick,Z.fx.interval))},Z.fx.stop=function(){e.clearInterval(Ze),Ze=null},Z.fx.speeds={slow:600,fast:200,_default:400},Z.fn.delay=function(t,n){return t=Z.fx&&Z.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=X.createElement("input"),t=X.createElement("select"),n=t.appendChild(X.createElement("option"));e.type="checkbox",K.checkOn=""!==e.value,K.optSelected=n.selected,t.disabled=!0,K.optDisabled=!n.disabled,(e=X.createElement("input")).value="t",e.type="radio",K.radioValue="t"===e.value}();var nt,rt=Z.expr.attrHandle;Z.fn.extend({attr:function(e,t){return me(this,Z.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Z.removeAttr(this,e)})}}),Z.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?Z.prop(e,t,n):(1===o&&Z.isXMLDoc(e)||(t=t.toLowerCase(),i=Z.attrHooks[t]||(Z.expr.match.bool.test(t)?nt:void 0)),void 0!==n?null===n?void Z.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=Z.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!K.radioValue&&"radio"===t&&Z.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ge);if(o&&1===e.nodeType)for(;n=o[i++];)r=Z.propFix[n]||n,Z.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),nt={set:function(e,t,n){return!1===t?Z.removeAttr(e,n):e.setAttribute(n,n),n}},Z.each(Z.expr.match.bool.source.match(/\w+/g),function(e,t){var n=rt[t]||Z.find.attr;rt[t]=function(e,t,r){var i,o;return r||(o=rt[t],rt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,rt[t]=o),i}});var it=/^(?:input|select|textarea|button)$/i,ot=/^(?:a|area)$/i;Z.fn.extend({prop:function(e,t){return me(this,Z.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[Z.propFix[e]||e]})}}),Z.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&Z.isXMLDoc(e)||(t=Z.propFix[t]||t,i=Z.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=Z.find.attr(e,"tabindex");return t?parseInt(t,10):it.test(e.nodeName)||ot.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),K.optSelected||(Z.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),Z.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Z.propFix[this.toLowerCase()]=this});var st=/[\t\r\n\f]/g;Z.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(Z.isFunction(e))return this.each(function(t){Z(this).addClass(e.call(this,t,P(this)))});if("string"==typeof e&&e)for(t=e.match(ge)||[];n=this[u++];)if(i=P(n),r=1===n.nodeType&&(" "+i+" ").replace(st," ")){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=Z.trim(r))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(Z.isFunction(e))return this.each(function(t){Z(this).removeClass(e.call(this,t,P(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(ge)||[];n=this[u++];)if(i=P(n),r=1===n.nodeType&&(" "+i+" ").replace(st," ")){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=Z.trim(r))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):Z.isFunction(e)?this.each(function(n){Z(this).toggleClass(e.call(this,n,P(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=Z(this),o=e.match(ge)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=P(this))&&ye.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":ye.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+P(n)+" ").replace(st," ").indexOf(t)>-1)return!0;return!1}});var at=/\r/g,ut=/[\x20\t\r\n\f]+/g;Z.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=Z.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,Z(this).val()):e)?i="":"number"==typeof i?i+="":Z.isArray(i)&&(i=Z.map(i,function(e){return null==e?"":e+""})),(t=Z.valHooks[this.type]||Z.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=Z.valHooks[i.type]||Z.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(at,""):null==n?"":n:void 0}}),Z.extend({valHooks:{option:{get:function(e){var t=Z.find.attr(e,"value");return null!=t?t:Z.trim(Z.text(e)).replace(ut," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,u=i<0?a:o?i:0;u<a;u++)if(((n=r[u]).selected||u===i)&&(K.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!Z.nodeName(n.parentNode,"optgroup"))){if(t=Z(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=Z.makeArray(t),s=i.length;s--;)((r=i[s]).selected=Z.inArray(Z.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),Z.each(["radio","checkbox"],function(){Z.valHooks[this]={set:function(e,t){if(Z.isArray(t))return e.checked=Z.inArray(Z(e).val(),t)>-1}},K.checkOn||(Z.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var lt=/^(?:focusinfocus|focusoutblur)$/;Z.extend(Z.event,{trigger:function(t,n,r,i){var o,s,a,u,l,c,f,p=[r||X],d=J.call(t,"type")?t.type:t,h=J.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||X,3!==r.nodeType&&8!==r.nodeType&&!lt.test(d+Z.event.triggered)&&(d.indexOf(".")>-1&&(d=(h=d.split(".")).shift(),h.sort()),l=d.indexOf(":")<0&&"on"+d,(t=t[Z.expando]?t:new Z.Event(d,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:Z.makeArray(n,[t]),f=Z.event.special[d]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!Z.isWindow(r)){for(u=f.delegateType||d,lt.test(u+d)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||X)&&p.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||d,(c=(ye.get(s,"events")||{})[t.type]&&ye.get(s,"handle"))&&c.apply(s,n),(c=l&&s[l])&&c.apply&&ve(s)&&(t.result=c.apply(s,n),!1===t.result&&t.preventDefault());return t.type=d,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),n)||!ve(r)||l&&Z.isFunction(r[d])&&!Z.isWindow(r)&&((a=r[l])&&(r[l]=null),Z.event.triggered=d,r[d](),Z.event.triggered=void 0,a&&(r[l]=a)),t.result}},simulate:function(e,t,n){var r=Z.extend(new Z.Event,n,{type:e,isSimulated:!0});Z.event.trigger(r,null,t)}}),Z.fn.extend({trigger:function(e,t){return this.each(function(){Z.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return Z.event.trigger(e,t,n,!0)}}),Z.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Z.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),Z.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),K.focusin="onfocusin"in e,K.focusin||Z.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){Z.event.simulate(t,e.target,Z.event.fix(e))};Z.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ye.access(r,t);i||r.addEventListener(e,n,!0),ye.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ye.access(r,t)-1;i?ye.access(r,t,i):(r.removeEventListener(e,n,!0),ye.remove(r,t))}}});var ct=e.location,ft=Z.now(),pt=/\?/;Z.parseJSON=function(e){return JSON.parse(e+"")},Z.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||Z.error("Invalid XML: "+t),n};var dt=/#.*$/,ht=/([?&])_=[^&]*/,gt=/^(.*?):[ \t]*([^\r\n]*)$/gm,mt=/^(?:GET|HEAD)$/,vt=/^\/\//,yt={},xt={},bt="*/".concat("*"),wt=X.createElement("a");wt.href=ct.href,Z.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":bt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Z.parseJSON,"text xml":Z.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?I(I(e,Z.ajaxSettings),t):I(Z.ajaxSettings,e)},ajaxPrefilter:R(yt),ajaxTransport:R(xt),ajax:function(t,n){function r(t,n,r,a){var l,f,y,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),i=void 0,s=a||"",T.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(x=function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,T,r)),x=function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,x,T,l),l?(p.ifModified&&((w=T.getResponseHeader("Last-Modified"))&&(Z.lastModified[o]=w),(w=T.getResponseHeader("etag"))&&(Z.etag[o]=w)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,l=!(y=x.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",l?g.resolveWith(d,[f,C,T]):g.rejectWith(d,[T,C,y]),T.statusCode(v),v=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[T,p,l?f:y]),m.fireWith(d,[T,C]),c&&(h.trigger("ajaxComplete",[T,p]),--Z.active||Z.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,u,l,c,f,p=Z.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?Z(d):Z.event,g=Z.Deferred(),m=Z.Callbacks("once memory"),v=p.statusCode||{},y={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=gt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)v[t]=[v[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return i&&i.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,p.url=((t||p.url||ct.href)+"").replace(dt,"").replace(vt,ct.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=Z.trim(p.dataType||"*").toLowerCase().match(ge)||[""],null==p.crossDomain){l=X.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=wt.protocol+"//"+wt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=Z.param(p.data,p.traditional)),M(yt,p,n,T),2===b)return T;for(f in(c=Z.event&&p.global)&&0==Z.active++&&Z.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!mt.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(pt.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(p.url=ht.test(o)?o.replace(ht,"$1_="+ft++):o+(pt.test(o)?"&":"?")+"_="+ft++)),p.ifModified&&(Z.lastModified[o]&&T.setRequestHeader("If-Modified-Since",Z.lastModified[o]),Z.etag[o]&&T.setRequestHeader("If-None-Match",Z.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+bt+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(d,T,p)||2===b))return T.abort();for(f in w="abort",{success:1,error:1,complete:1})T[f](p[f]);if(i=M(xt,p,n,T)){if(T.readyState=1,c&&h.trigger("ajaxSend",[T,p]),2===b)return T;p.async&&p.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},p.timeout));try{b=1,i.send(y,r)}catch(e){if(!(b<2))throw e;r(-1,e)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return Z.get(e,t,n,"json")},getScript:function(e,t){return Z.get(e,void 0,t,"script")}}),Z.each(["get","post"],function(e,t){Z[t]=function(e,n,r,i){return Z.isFunction(n)&&(i=i||r,r=n,n=void 0),Z.ajax(Z.extend({url:e,type:t,dataType:i,data:n,success:r},Z.isPlainObject(e)&&e))}}),Z._evalUrl=function(e){return Z.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},Z.fn.extend({wrapAll:function(e){var t;return Z.isFunction(e)?this.each(function(t){Z(this).wrapAll(e.call(this,t))}):(this[0]&&(t=Z(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return Z.isFunction(e)?this.each(function(t){Z(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Z(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Z.isFunction(e);return this.each(function(n){Z(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Z.nodeName(this,"body")||Z(this).replaceWith(this.childNodes)}).end()}}),Z.expr.filters.hidden=function(e){return!Z.expr.filters.visible(e)},Z.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var Tt=/%20/g,Ct=/\[\]$/,kt=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;Z.param=function(e,t){var n,r=[],i=function(e,t){t=Z.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=Z.ajaxSettings&&Z.ajaxSettings.traditional),Z.isArray(e)||e.jquery&&!Z.isPlainObject(e))Z.each(e,function(){i(this.name,this.value)});else for(n in e)W(n,e[n],t,i);return r.join("&").replace(Tt,"+")},Z.fn.extend({serialize:function(){return Z.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=Z.prop(this,"elements");return e?Z.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!Z(this).is(":disabled")&&Nt.test(this.nodeName)&&!Et.test(e)&&(this.checked||!Ne.test(e))}).map(function(e,t){var n=Z(this).val();return null==n?null:Z.isArray(n)?Z.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}}),Z.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var St={0:200,1223:204},Dt=Z.ajaxSettings.xhr();K.cors=!!Dt&&"withCredentials"in Dt,K.ajax=Dt=!!Dt,Z.ajaxTransport(function(t){var n,r;if(K.cors||Dt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(St[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),Z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return Z.globalEval(e),e}}}),Z.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Z.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(r,i){t=Z("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),X.head.appendChild(t[0])},abort:function(){n&&n()}}});var jt=[],At=/(=)\?(?=&|$)|\?\?/;Z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jt.pop()||Z.expando+"_"+ft++;return this[e]=!0,e}}),Z.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(At.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&At.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=Z.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(At,"$1"+i):!1!==t.jsonp&&(t.url+=(pt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||Z.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){void 0===o?Z(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,jt.push(i)),s&&Z.isFunction(o)&&o(s[0]),s=o=void 0}),"script"}),Z.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||X;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f([e],t,i),i&&i.length&&Z(i).remove(),Z.merge([],r.childNodes))};var qt=Z.fn.load;Z.fn.load=function(e,t,n){if("string"!=typeof e&&qt)return qt.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=Z.trim(e.slice(a)),e=e.slice(0,a)),Z.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&Z.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?Z("<div>").append(Z.parseHTML(e)).find(r):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},Z.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){Z.fn[t]=function(e){return this.on(t,e)}}),Z.expr.filters.animated=function(e){return Z.grep(Z.timers,function(t){return e===t.elem}).length},Z.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l=Z.css(e,"position"),c=Z(e),f={};"static"===l&&(e.style.position="relative"),a=c.offset(),o=Z.css(e,"top"),u=Z.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),Z.isFunction(t)&&(t=t.call(e,n,Z.extend({},a))),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):c.css(f)}},Z.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){Z.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;return o?(t=o.documentElement,Z.contains(t,r)?(i=r.getBoundingClientRect(),n=$(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===Z.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),Z.nodeName(e[0],"html")||(r=e.offset()),r.top+=Z.css(e[0],"borderTopWidth",!0),r.left+=Z.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-Z.css(n,"marginTop",!0),left:t.left-r.left-Z.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===Z.css(e,"position");)e=e.offsetParent;return e||Ue})}}),Z.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;Z.fn[e]=function(r){return me(this,function(e,r,i){var o=$(e);if(void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),Z.each(["top","left"],function(e,t){Z.cssHooks[t]=E(K.pixelPosition,function(e,n){if(n)return n=k(e,t),_e.test(n)?Z(e).position()[t]+"px":n})}),Z.each({Height:"height",Width:"width"},function(e,t){Z.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){Z.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===i?"margin":"border");return me(this,function(t,n,r){var i;return Z.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?Z.css(t,n,s):Z.style(t,n,r,s)},t,o?r:void 0,o,null)}})}),Z.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),Z.fn.andSelf=Z.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return Z});var Lt=e.jQuery,Ht=e.$;return Z.noConflict=function(t){return e.$===Z&&(e.$=Ht),t&&e.jQuery===Z&&(e.jQuery=Lt),Z},t||(e.jQuery=e.$=Z),Z});
;Dependency._js['lib/jquery/jquery']=true;

;
jQuery.noConflict();
;
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0);
;Dependency._js['lib/jquery/jquery-migrate-mute']=true;

;
!function(e,t,n){"use strict";function r(n){var r=t.console;a[n]||(a[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(e(this).migrate_warn.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function o(t,n,o,a){if(Object.defineProperty)try{return void Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){return r(a),o},set:function(e){r(a),o=e}})}catch(e){}e._definePropertyBroken=!0,t[n]=o}e.migrateVersion="1.4.1",e.fn.migrate_warn={warning_count:0,$warning_banner:null,warn:function(n){console.warn(n);var r=t.location.origin?t.location.origin:t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:""),o=new XMLHttpRequest;"undefined"==typeof baseurl&&"undefined"==typeof getBaseURL||(o.open("POST",r+("undefined"==typeof baseurl?getBaseURL():baseurl)+"/RPC2/",!0),o.setRequestHeader("Content-Type","application/json"),o.send(JSON.stringify({id:1,method:"response.report_jswarning",params:[n,t.location.href,new Error("jQuery Migrate:").stack]})));var a=this;e(document).ready(function(){if(a.$warning_banner=e("body>#jquery-warning-banner"),a.$warning_banner.length){var t=a.$warning_banner.find("#jquery-migrate-issue-count");a.$warning_banner.find("ul").append("<li>"+n+"</li>"),a.warning_count+=1,t.text(a.warning_count)}else a.warning_count=1,e("<div id='jquery-warning-banner' style='padding:10px;width:100%;background-color:#ffff99;font-size:13px;'><b>jQuery Migrate: <span id='jquery-migrate-issue-count'>"+a.warning_count+"</span> issue(s) found, please check console log and fix them.</b><ul><li>"+n+"</li></ul></div>").prependTo(document.body)})}};var a={};e.migrateWarnings=[],t.console&&t.console.log&&t.console.log("JQMIGRATE: Migrate is installed"+(e.migrateMute?"":" with logging active")+", version "+e.migrateVersion),void 0===e.migrateTrace&&(e.migrateTrace=!0),e.migrateReset=function(){a={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,c=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},u=e.attrHooks.value&&e.attrHooks.value.set||function(){},d=/^[238]$/,l=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,p=/^(?:checked|selected)$/i;o(e,"attrFn",i||{},"jQuery.attrFn is deprecated"),e.attr=function(t,n,o,a){var c=n.toLowerCase(),u=t&&t.nodeType;return a&&(s.length<4&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(u)&&(i?n in i:e.isFunction(e.fn[n])))?e(t)[n](o):(!e.attrHooks[c]&&l.test(c)&&(e.attrHooks[c]={get:function(t,n){var r,o=e.prop(t,n);return!0===o||"boolean"!=typeof o&&(r=t.getAttributeNode(n))&&!1!==r.nodeValue?n.toLowerCase():void 0},set:function(t,n,r){var o;return!1===n?e.removeAttr(t,r):((o=e.propFix[r]||r)in t&&(t[o]=!0),t.setAttribute(r,r.toLowerCase())),r}},p.test(c)&&r("jQuery.fn.attr('"+c+"') might use property instead of attribute")),s.call(e,t,n,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?c.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var n=(e.nodeName||"").toLowerCase();if("button"===n)return u.apply(this,arguments);"input"!==n&&"option"!==n&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t}};var f,g,h,v=e.fn.init,y=e.find,m=e.parseJSON,b=/^\s*</,w=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,j=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,x=/^([^<]*)(<[\w\W]+>)([^>]*)$/;for(h in e.fn.init=function(t,n,o){var a,i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(a=x.exec(e.trim(t)))&&a[0]&&(b.test(t)||r("$(html) HTML strings must start with '<' character"),a[3]&&r("$(html) HTML text after last tag is ignored"),"#"===a[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&n.context.nodeType&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(a[2],n&&n.ownerDocument||n||document,!0),n,o):(i=v.apply(this,arguments),t&&void 0!==t.selector?(i.selector=t.selector,i.context=t.context):(i.selector="string"==typeof t?t:"",t&&(i.context=t.nodeType?t:n||document)),i)},e.fn.init.prototype=e.fn,e.find=function(e){var t=Array.prototype.slice.call(arguments);if("string"==typeof e&&w.test(e))try{document.querySelector(e)}catch(n){e=e.replace(j,function(e,t,n,r){return"["+t+n+'"'+r+'"]'});try{document.querySelector(e),r("Attribute selector with '#' must be quoted: "+t[0]),t[0]=e}catch(e){r("Attribute selector with '#' was not fixed: "+t[0])}}return y.apply(this,t)},y)Object.prototype.hasOwnProperty.call(y,h)&&(e.find[h]=y[h]);e.parseJSON=function(e){return e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g={},(f=e.uaMatch(navigator.userAgent)).browser&&(g[f.browser]=!0,g.version=f.version),g.chrome?g.webkit=!0:g.webkit&&(g.safari=!0),e.browser=g),o(e,"browser",e.browser,"jQuery.browser is deprecated"),e.boxModel=e.support.boxModel="CSS1Compat"===document.compatMode,o(e,"boxModel",e.boxModel,"jQuery.boxModel is deprecated"),o(e.support,"boxModel",e.support.boxModel,"jQuery.support.boxModel is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,o){var a=e.fn.init.call(this,r,o,n);return a instanceof t?a:t(a)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.fn.size=function(){return r("jQuery.fn.size() is deprecated; use the .length property"),this.length};var k=!1;e.swap&&e.each(["height","width","reliableMarginRight"],function(t,n){var r=e.cssHooks[n]&&e.cssHooks[n].get;r&&(e.cssHooks[n].get=function(){var e;return k=!0,e=r.apply(this,arguments),k=!1,e})}),e.swap=function(e,t,n,o){var a,i,s={};for(i in k||r("jQuery.swap() is undocumented and deprecated"),t)s[i]=e.style[i],e.style[i]=t[i];for(i in a=n.apply(e,o||[]),t)e.style[i]=s[i];return a},e.ajaxSetup({converters:{"text json":e.parseJSON}});var Q=e.fn.data;e.fn.data=function(t){var n,o,a=this[0];return!a||"events"!==t||1!==arguments.length||(n=e.data(a,t),o=e._data(a,t),void 0!==n&&n!==o||void 0===o)?Q.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var M=/\/(java|ecma)script/i;e.clean||(e.clean=function(t,n,o,a){n=(n=!(n=n||document).nodeType&&n[0]||n).ownerDocument||n,r("jQuery.clean() is deprecated");var i,s,c,u,d=[];if(e.merge(d,e.buildFragment(t,n).childNodes),o)for(c=function(e){if(!e.type||M.test(e.type))return a?a.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e)},i=0;null!=(s=d[i]);i++)e.nodeName(s,"script")&&c(s)||(o.appendChild(s),"undefined"!=typeof s.getElementsByTagName&&(u=e.grep(e.merge([],s.getElementsByTagName("script")),c),d.splice.apply(d,[i+1,0].concat(u)),i+=u.length));return d});var C=e.event.add,S=e.event.remove,T=e.event.trigger,_=e.fn.toggle,H=e.fn.live,N=e.fn.die,A=e.fn.load,R="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",$=new RegExp("\\b(?:"+R+")\\b"),L=/(?:^|\s)hover(\.\S+|)\b/,O=function(t){return"string"!=typeof t||e.event.special.hover?t:(L.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(L,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&o(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,o,a){e!==document&&$.test(t)&&r("AJAX events should be attached to document: "+t),C.call(this,e,O(t||""),n,o,a)},e.event.remove=function(e,t,n,r,o){S.call(this,e,O(t)||"",n,r,o)},e.each(["load","unload","error"],function(t,n){e.fn[n]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===n&&"string"==typeof e[0]?A.apply(this,e):(r("jQuery.fn."+n+"() is deprecated"),e.splice(0,0,n),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return _.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var o=arguments,a=t.guid||e.guid++,i=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),o[r].apply(this,arguments)||!1};for(s.guid=a;i<o.length;)o[i++].guid=a;return this.click(s)},e.fn.live=function(t,n,o){return r("jQuery.fn.live() is deprecated"),H?H.apply(this,arguments):(e(this.context).on(t,this.selector,n,o),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),N?N.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,o){return n||$.test(e)||r("Global events are undocumented and deprecated"),T.call(this,e,t,n||document,o)},e.each(R.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,Array.prototype.slice.call(arguments,1),t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}}),e.event.special.ready={setup:function(){this===document&&r("'ready' event is deprecated")}};var q=e.fn.andSelf||e.fn.addBack,F=e.fn.find;if(e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),q.apply(this,arguments)},e.fn.find=function(e){var t=F.apply(this,arguments);return t.context=this.context,t.selector=this.selector?this.selector+" "+e:e,t},e.Callbacks){var J=e.Deferred,E=[["resolve","done",e.Callbacks("once memory"),e.Callbacks("once memory"),"resolved"],["reject","fail",e.Callbacks("once memory"),e.Callbacks("once memory"),"rejected"],["notify","progress",e.Callbacks("memory"),e.Callbacks("memory")]];e.Deferred=function(t){var n=J(),o=n.promise();return n.pipe=o.pipe=function(){var t=arguments;return r("deferred.pipe() is deprecated"),e.Deferred(function(r){e.each(E,function(a,i){var s=e.isFunction(t[a])&&t[a];n[i[1]](function(){var t=s&&s.apply(this,arguments);t&&e.isFunction(t.promise)?t.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[i[0]+"With"](this===o?r.promise():this,s?[t]:arguments)})}),t=null}).promise()},n.isResolved=function(){return r("deferred.isResolved is deprecated"),"resolved"===n.state()},n.isRejected=function(){return r("deferred.isRejected is deprecated"),"rejected"===n.state()},t&&t.call(n,n),n}}}(jQuery,window);
;Dependency._js['lib/jquery/jquery-migrate']=true;

;
!function(t,e){function i(e,i){var n,a,o,r=e.nodeName.toLowerCase();return"area"===r?(a=(n=e.parentNode).name,!(!e.href||!a||"map"!==n.nodeName.toLowerCase())&&(!!(o=t("img[usemap=#"+a+"]")[0])&&s(o))):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r&&e.href||i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n,a,o=0,r=/^ui-id-\d+$/;(t.uiBackCompat=!1,t.ui=t.ui||{},t.ui.version)||(t.extend(t.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,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,SPACE:32,TAB:9,UP:38}}),t.fn.extend({_focus:t.fn.focus,focus:function(e,i){return"number"==typeof e?this.each(function(){var s=this;setTimeout(function(){t(s).focus(),i&&i.call(s)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var i,s,n=t(this[0]);n.length&&n[0]!==document;){if(("absolute"===(i=n.css("position"))||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t(function(){var e=document.body,i=e.appendChild(i=document.createElement("div"));i.offsetHeight,t.extend(i.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===i.offsetHeight,t.support.selectstart="onselectstart"in i,e.removeChild(i).style.display="none"}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(e,i){function s(e,i,s,a){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),a&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?o["inner"+i].call(this):this.each(function(){t(this).css(a,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?o["outer"+i].call(this,e):this.each(function(){t(this).css(a,s(this,e,!0,n)+"px")})}}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=(n=t.fn.removeData,function(e){return arguments.length?n.call(this,t.camelCase(e)):n.call(this)})),a=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],t.ui.ie=!!a.length,t.ui.ie6=6===parseFloat(a[1],10),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,a=t.ui[e].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;s<n.length;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},contains:t.contains,hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s,n=i&&"left"===i?"scrollLeft":"scrollTop";return e[n]>0||(e[n]=1,s=e[n]>0,e[n]=0,s)},isOverAxis:function(t,e,i){return t>e&&t<e+i},isOver:function(e,i,s,n,a,o){return t.ui.isOverAxis(e,s,a)&&t.ui.isOverAxis(i,n,o)}}))}(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(t){}n(e)},t.widget=function(e,i,s){var n,a,o,r,h=e.split(".")[0];e=e.split(".")[1],n=h+"-"+e,s||(s=i,i=t.Widget),t.expr[":"][n.toLowerCase()]=function(e){return!!t.data(e,n)},t[h]=t[h]||{},a=t[h][e],o=t[h][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,a,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),(r=new i).options=t.widget.extend({},r.options),t.each(s,function(e,n){var a,o;t.isFunction(n)&&(s[e]=(a=function(){return i.prototype[e].apply(this,arguments)},o=function(t){return i.prototype[e].apply(this,t)},function(){var t,e=this._super,i=this._superApply;return this._super=a,this._superApply=o,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}))}),o.prototype=t.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix:e},s,{constructor:o,namespace:h,widgetName:e,widgetBaseClass:n,widgetFullName:n}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o)},t.widget.extend=function(e){for(var i,n,a=s.call(arguments,1),o=0,r=a.length;o<r;o++)for(i in a[o])n=a[o][i],a[o].hasOwnProperty(i)&&void 0!==n&&(t.isPlainObject(n)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):e[i]=n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(a){var o="string"==typeof a,r=s.call(arguments,1),h=this;return a=!o&&r.length?t.widget.extend.apply(null,[a].concat(r)):a,o?this.each(function(){var i,s=t.data(this,n);return s?t.isFunction(s[a])&&"_"!==a.charAt(0)?(i=s[a].apply(s,r))!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0:t.error("no such method '"+a+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,n);e?e.option(a||{})._init():t.data(this,n,new i(a,this))}),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetName,this),t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,a,o=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(o={},e=(s=e.split(".")).shift(),s.length){for(n=o[e]=t.widget.extend({},this.options[e]),a=0;a<s.length-1;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(e=s.pop(),void 0===i)return void 0===n[e]?null:n[e];n[e]=i}else{if(void 0===i)return void 0===this.options[e]?null:this.options[e];o[e]=i}return this._setOptions(o),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,i,s){var n,a=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,o){function r(){if(e||!0!==a.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof o?a[o]:o).apply(a,arguments)}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||t.guid++);var h=s.match(/^(\w+)\s*(.*)$/),l=h[1]+a.eventNamespace,c=h[2];c?n.delegate(c,l,r):i.bind(l,r)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,a,o=this.options[e];if(s=s||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(t.isFunction(o)&&!1===o.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?!0===n||"number"==typeof n?i:n.effect||i:e;"number"==typeof(n=n||{})&&(n={duration:n}),o=!t.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&t.effects&&(t.effects.effect[r]||!1!==t.uiBackCompat&&t.effects[r])?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){t(this)[e](),a&&a.call(s[0]),i()})}}),!1!==t.uiBackCompat&&(t.Widget.prototype._getCreateOptions=function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]})}(jQuery),function(t,e){var i=!1;t(document).mouseup(function(t){i=!1}),t.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!i){this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var s=this,n=1===e.which,a=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(n&&!a&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),i=!0,!0))}},_mouseMove:function(e){return!t.ui.ie||document.documentMode>=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(t,e){function i(t,e,i){return[parseInt(t[0],10)*(d.test(t[0])?e/100:1),parseInt(t[1],10)*(d.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}t.ui=t.ui||{};var n,a=Math.max,o=Math.abs,r=Math.round,h=/left|center|right/,l=/top|center|bottom/,c=/[\+\-]\d+%?/,u=/^\w+/,d=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return t("body").append(s),e=a.offsetWidth,s.css("overflow","scroll"),e===(i=a.offsetWidth)&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:n?t.position.scrollbarWidth():0,height:a?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return p.apply(this,arguments);e=t.extend({},e);var n,d,f,g,m,v=t(e.of),_=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(_),y=v[0],w=(e.collision||"flip").split(" "),x={};return 9===y.nodeType?(d=v.width(),f=v.height(),g={top:0,left:0}):t.isWindow(y)?(d=v.width(),f=v.height(),g={top:v.scrollTop(),left:v.scrollLeft()}):y.preventDefault?(e.at="left top",d=f=0,g={top:y.pageY,left:y.pageX}):(d=v.outerWidth(),f=v.outerHeight(),g=v.offset()),m=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):l.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=l.test(s[1])?s[1]:"center",t=c.exec(s[0]),i=c.exec(s[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[u.exec(s[0])[0],u.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?m.left+=d:"center"===e.at[0]&&(m.left+=d/2),"bottom"===e.at[1]?m.top+=f:"center"===e.at[1]&&(m.top+=f/2),n=i(x.at,d,f),m.left+=n[0],m.top+=n[1],this.each(function(){var h,l,c=t(this),u=c.outerWidth(),p=c.outerHeight(),y=s(this,"marginLeft"),k=s(this,"marginTop"),C=u+y+s(this,"marginRight")+b.width,D=p+k+s(this,"marginBottom")+b.height,P=t.extend({},m),I=i(x.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?P.left-=u:"center"===e.my[0]&&(P.left-=u/2),"bottom"===e.my[1]?P.top-=p:"center"===e.my[1]&&(P.top-=p/2),P.left+=I[0],P.top+=I[1],t.support.offsetFractions||(P.left=r(P.left),P.top=r(P.top)),h={marginLeft:y,marginTop:k},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](P,{targetWidth:d,targetHeight:f,elemWidth:u,elemHeight:p,collisionPosition:h,collisionWidth:C,collisionHeight:D,offset:[n[0]+I[0],n[1]+I[1]],my:e.my,at:e.at,within:_,elem:c})}),t.fn.bgiframe&&c.bgiframe(),e.using&&(l=function(t){var i=g.left-P.left,s=i+d-u,n=g.top-P.top,r=n+f-p,h={target:{element:v,left:g.left,top:g.top,width:d,height:f},element:{element:c,left:P.left,top:P.top,width:u,height:p},horizontal:s<0?"left":i>0?"right":"center",vertical:r<0?"top":n>0?"bottom":"middle"};d<u&&o(i+s)<d&&(h.horizontal="center"),f<p&&o(n+r)<f&&(h.vertical="middle"),a(o(i),o(s))>a(o(n),o(r))?h.important="horizontal":h.important="vertical",e.using.call(this,t,h)}),c.offset(t.extend(P,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-o-n;e.collisionWidth>o?h>0&&l<=0?(i=t.left+h+e.collisionWidth-o-n,t.left+=h-i):t.left=l>0&&h<=0?n:h>l?n+o-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-o-n;e.collisionHeight>o?h>0&&l<=0?(i=t.top+h+e.collisionHeight-o-n,t.top+=h-i):t.top=l>0&&h<=0?n:h>l?n+o-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];c<0?((i=t.left+d+p+f+e.collisionWidth-r-a)<0||i<o(c))&&(t.left+=d+p+f):u>0&&((s=t.left-e.collisionPosition.marginLeft+d+p+f-h)>0||o(s)<u)&&(t.left+=d+p+f)},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];c<0?(s=t.top+d+p+f+e.collisionHeight-r-a,t.top+d+p+f>c&&(s<0||s<o(c))&&(t.top+=d+p+f)):u>0&&(i=t.top-e.collisionPosition.marginTop+d+p+f-h,t.top+d+p+f>u&&(i>0||o(i)<u)&&(t.top+=d+p+f))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");for(a in e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"}),s)e.style[a]=s[a];e.appendChild(r),(i=o||document.documentElement).insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&n<11,e.innerHTML="",i.removeChild(e)}(),!1!==t.uiBackCompat&&function(t){var e=t.fn.position;t.fn.position=function(i){if(!i||!i.offset)return e.call(this,i);var s=i.offset.split(" "),n=i.at.split(" ");return 1===s.length&&(s[1]=s[0]),/^\d/.test(s[0])&&(s[0]="+"+s[0]),/^\d/.test(s[1])&&(s[1]="+"+s[1]),1===n.length&&(/left|center|right/.test(n[0])?n[1]="center":(n[1]=n[0],n[0]="center")),e.call(this,t.extend(i,{at:n[0]+s[0]+" "+n[1]+s[1],offset:void 0}))}}(jQuery)}(jQuery),function(t,e){t.widget("ui.draggable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).is(".ui-resizable-handle"))&&(this.handle=this._getHandle(e),!!this.handle&&(t(!0===i.iframeFix?"iframe":i.iframeFix).each(function(){t('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(i=t.ui.ddmanager.drop(this,e)),this.dropped&&(i=this.dropped,this.dropped=!1);for(var s=this.element[0],n=!1;s&&(s=s.parentNode);)s==document&&(n=!0);if(!n&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!i||"valid"==this.options.revert&&i||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){var a=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==a._trigger("stop",e)&&a._clear()})}else!1!==this._trigger("stop",e)&&this._clear();return!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var i=!this.options.handle||!t(this.options.handle,this.element).length;return t(this.options.handle,this.element).find("*").addBack().each(function(){this==e.target&&(i=!0)}),i},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"==i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"==i.appendTo?this.element[0].parentNode:i.appendTo),s[0]==this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"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();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left: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=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var i=t(e.containment),s=i[0];if(!s)return;i.offset();var n="hidden"!=t(s).css("overflow");this.containment=[(parseInt(t(s).css("borderLeftWidth"),10)||0)+(parseInt(t(s).css("paddingLeft"),10)||0),(parseInt(t(s).css("borderTopWidth"),10)||0)+(parseInt(t(s).css("paddingTop"),10)||0),(n?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(t(s).css("borderLeftWidth"),10)||0)-(parseInt(t(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(n?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(t(s).css("borderTopWidth"),10)||0)-(parseInt(t(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"==e?1:-1,n=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i=this.options,s="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(s[0].tagName),a=e.pageX,o=e.pageY;if(this.originalPosition){var r;if(this.containment){if(this.relative_container){var h=this.relative_container.offset();r=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]}else r=this.containment;e.pageX-this.offset.click.left<r[0]&&(a=r[0]+this.offset.click.left),e.pageY-this.offset.click.top<r[1]&&(o=r[1]+this.offset.click.top),e.pageX-this.offset.click.left>r[2]&&(a=r[2]+this.offset.click.left),e.pageY-this.offset.click.top>r[3]&&(o=r[3]+this.offset.click.top)}if(i.grid){var l=i.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1]:this.originalPageY;o=r&&(l-this.offset.click.top<r[1]||l-this.offset.click.top>r[3])?l-this.offset.click.top<r[1]?l+i.grid[1]:l-i.grid[1]:l;var c=i.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0]:this.originalPageX;a=r&&(c-this.offset.click.left<r[0]||c-this.offset.click.left>r[2])?c-this.offset.click.left<r[0]?c+i.grid[0]:c-i.grid[0]:c}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():n?0:s.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():n?0:s.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]==this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"==e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(t){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"==s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("draggable"),n=this;t.each(s.sortables,function(a){var o=!1,r=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!=r&&this.instance._intersectsWith(this.instance.containerCache)&&t.ui.contains(r.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i){var s=t("body"),n=t(this).data("draggable").options;s.css("cursor")&&(n._cursor=s.css("cursor")),s.css("cursor",n.cursor)},stop:function(e,i){var s=t(this).data("draggable").options;s._cursor&&t("body").css("cursor",s._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(e,i){var s=t(this).data("draggable");s.scrollParent[0]!=document&&"HTML"!=s.scrollParent[0].tagName&&(s.overflowOffset=s.scrollParent.offset())},drag:function(e,i){var s=t(this).data("draggable"),n=s.options,a=!1;s.scrollParent[0]!=document&&"HTML"!=s.scrollParent[0].tagName?(n.axis&&"x"==n.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-e.pageY<n.scrollSensitivity?s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"==n.axis||(s.overflowOffset.left+s.scrollParent[0].offsetWidth-e.pageX<n.scrollSensitivity?s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"==n.axis||(e.pageY-t(document).scrollTop()<n.scrollSensitivity?a=t(document).scrollTop(t(document).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<n.scrollSensitivity&&(a=t(document).scrollTop(t(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"==n.axis||(e.pageX-t(document).scrollLeft()<n.scrollSensitivity?a=t(document).scrollLeft(t(document).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<n.scrollSensitivity&&(a=t(document).scrollLeft(t(document).scrollLeft()+n.scrollSpeed)))),!1!==a&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i){var s=t(this).data("draggable"),n=s.options;s.snapElements=[],t(n.snap.constructor!=String?n.snap.items||":data(draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!=s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i){for(var s=t(this).data("draggable"),n=s.options,a=n.snapTolerance,o=i.offset.left,r=o+s.helperProportions.width,h=i.offset.top,l=h+s.helperProportions.height,c=s.snapElements.length-1;c>=0;c--){var u=s.snapElements[c].left,d=u+s.snapElements[c].width,p=s.snapElements[c].top,f=p+s.snapElements[c].height;if(u-a<o&&o<d+a&&p-a<h&&h<f+a||u-a<o&&o<d+a&&p-a<l&&l<f+a||u-a<r&&r<d+a&&p-a<h&&h<f+a||u-a<r&&r<d+a&&p-a<l&&l<f+a){if("inner"!=n.snapMode){var g=Math.abs(p-l)<=a,m=Math.abs(f-h)<=a,v=Math.abs(u-r)<=a,_=Math.abs(d-o)<=a;g&&(i.position.top=s._convertPositionTo("relative",{top:p-s.helperProportions.height,left:0}).top-s.margins.top),m&&(i.position.top=s._convertPositionTo("relative",{top:f,left:0}).top-s.margins.top),v&&(i.position.left=s._convertPositionTo("relative",{top:0,left:u-s.helperProportions.width}).left-s.margins.left),_&&(i.position.left=s._convertPositionTo("relative",{top:0,left:d}).left-s.margins.left)}var b=g||m||v||_;if("outer"!=n.snapMode){g=Math.abs(p-h)<=a,m=Math.abs(f-l)<=a,v=Math.abs(u-o)<=a,_=Math.abs(d-r)<=a;g&&(i.position.top=s._convertPositionTo("relative",{top:p,left:0}).top-s.margins.top),m&&(i.position.top=s._convertPositionTo("relative",{top:f-s.helperProportions.height,left:0}).top-s.margins.top),v&&(i.position.left=s._convertPositionTo("relative",{top:0,left:u}).left-s.margins.left),_&&(i.position.left=s._convertPositionTo("relative",{top:0,left:d-s.helperProportions.width}).left-s.margins.left)}!s.snapElements[c].snapping&&(g||m||v||_||b)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=g||m||v||_||b}else s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1}}}),t.ui.plugin.add("draggable","stack",{start:function(e,i){var s=t(this).data("draggable").options,n=t.makeArray(t(s.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(n.length){var a=parseInt(n[0].style.zIndex)||0;t(n).each(function(t){this.style.zIndex=a+t}),this[0].style.zIndex=a+n.length}}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t,e){t.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var e=this.options,i=e.accept;this.isover=0,this.isout=1,this.accept=t.isFunction(i)?i:function(t){return t.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},t.ui.ddmanager.droppables[e.scope]=t.ui.ddmanager.droppables[e.scope]||[],t.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=t.ui.ddmanager.droppables[this.options.scope],i=0;i<e.length;i++)e[i]==this&&e.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"==e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!=this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!=this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current;if(!s||(s.currentItem||s.element)[0]==this.element[0])return!1;var n=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"droppable");if(e.options.greedy&&!e.options.disabled&&e.options.scope==s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance))return n=!0,!1}),!n&&(!!this.accept.call(this.element[0],s.currentItem||s.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n=(e.positionAbs||e.position.absolute).left,a=n+e.helperProportions.width,o=(e.positionAbs||e.position.absolute).top,r=o+e.helperProportions.height,h=i.offset.left,l=h+i.proportions.width,c=i.offset.top,u=c+i.proportions.height;switch(s){case"fit":return h<=n&&a<=l&&c<=o&&r<=u;case"intersect":return h<n+e.helperProportions.width/2&&a-e.helperProportions.width/2<l&&c<o+e.helperProportions.height/2&&r-e.helperProportions.height/2<u;case"pointer":var d=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,p=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top;return t.ui.isOver(p,d,c,h,i.proportions.height,i.proportions.width);case"touch":return(o>=c&&o<=u||r>=c&&r<=u||o<c&&r>u)&&(n>=h&&n<=l||a>=h&&a<=l||n<h&&a>l);default:return!1}},t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var s=t.ui.ddmanager.droppables[e.options.scope]||[],n=i?i.type:null,a=(e.currentItem||e.element).find(":data(droppable)").addBack();t:for(var o=0;o<s.length;o++)if(!(s[o].options.disabled||e&&!s[o].accept.call(s[o].element[0],e.currentItem||e.element))){for(var r=0;r<a.length;r++)if(a[r]==s[o].element[0]){s[o].proportions.height=0;continue t}s[o].visible="none"!=s[o].element.css("display"),s[o].visible&&("mousedown"==n&&s[o]._activate.call(s[o],i),s[o].offset=s[o].element.offset(),s[o].proportions={width:s[o].element[0].offsetWidth,height:s[o].element[0].offsetHeight})}},drop:function(e,i){var s=!1;return t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s=t.ui.intersect(e,this,this.options.tolerance),n=s||1!=this.isover?s&&0==this.isover?"isover":null:"isout";if(n){var a;if(this.options.greedy){var o=this.options.scope,r=this.element.parents(":data(droppable)").filter(function(){return t.data(this,"droppable").options.scope===o});r.length&&((a=t.data(r[0],"droppable")).greedyChild="isover"==n?1:0)}a&&"isover"==n&&(a.isover=0,a.isout=1,a._out.call(a,i)),this[n]=1,this["isout"==n?"isover":"isout"]=0,this["isover"==n?"_over":"_out"].call(this,i),a&&"isout"==n&&(a.isout=0,a.isover=1,a._over.call(a,i))}}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t,e){t.widget("ui.resizable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,i=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({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("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom: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({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=i.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var s=this.handles.split(",");this.handles={};for(var n=0;n<s.length;n++){var a=t.trim(s[n]),o=t('<div class="ui-resizable-handle '+("ui-resizable-"+a)+'"></div>');o.css({zIndex:i.zIndex}),"se"==a&&o.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[a]=".ui-resizable-"+a,this.element.append(o)}}this._renderAxis=function(e){for(var i in e=e||this.element,this.handles){if(this.handles[i].constructor==String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var s,n=t(this.handles[i],this.element);s=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth();var a=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");e.css(a,s),this._proportionallyResize()}t(this.handles[i]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=t&&t[1]?t[1]:"se"}}),i.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){i.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}).mouseleave(function(){i.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var i=this.element;this.originalElement.css({position:i.css("position"),width:i.outerWidth(),height:i.outerHeight(),top:i.css("top"),left:i.css("left")}).insertAfter(i),i.remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var i=!1;for(var s in this.handles)t(this.handles[s])[0]==e.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(e){var s=this.options,n=this.element.position(),a=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(a.is(".ui-draggable")||/absolute/.test(a.css("position")))&&a.css({position:"absolute",top:n.top,left:n.left}),this._renderProxy();var o=i(this.helper.css("left")),r=i(this.helper.css("top"));s.containment&&(o+=t(s.containment).scrollLeft()||0,r+=t(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:r},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:o,top:r},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1;var h=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==h?this.axis+"-resize":h),a.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,i=(this.options,this.originalMousePosition),s=this.axis,n=t.pageX-i.left||0,a=t.pageY-i.top||0,o=this._change[s];if(!o)return!1;var r=o.apply(this,[t,n,a]);return this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(r=this._updateRatio(r,t)),r=this._respectSize(r,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(r),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var i=this.options;if(this._helper){var s=this._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),a=n&&t.ui.hasScroll(s[0],"left")?0:this.sizeDiff.height,o=n?0:this.sizeDiff.width,r={width:this.helper.width()-o,height:this.helper.height()-a},h=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,l=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;i.animate||this.element.css(t.extend(r,{top:l,left:h})),this.helper.height(this.size.height),this.helper.width(this.size.width),this._helper&&!i.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,n,a,o,r=this.options;o={minWidth:s(r.minWidth)?r.minWidth:0,maxWidth:s(r.maxWidth)?r.maxWidth:1/0,minHeight:s(r.minHeight)?r.minHeight:0,maxHeight:s(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),i<o.maxWidth&&(o.maxWidth=i),a<o.maxHeight&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.options;this.offset=this.helper.offset(),s(t.left)&&(this.position.left=t.left),s(t.top)&&(this.position.top=t.top),s(t.height)&&(this.size.height=t.height),s(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){this.options;var i=this.position,n=this.size,a=this.axis;return s(t.height)?t.width=t.height*this.aspectRatio:s(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==a&&(t.left=i.left+(n.width-t.width),t.top=null),"nw"==a&&(t.top=i.top+(n.height-t.height),t.left=i.left+(n.width-t.width)),t},_respectSize:function(t,e){this.helper;var i=this._vBoundaries,n=(this._aspectRatio||e.shiftKey,this.axis),a=s(t.width)&&i.maxWidth&&i.maxWidth<t.width,o=s(t.height)&&i.maxHeight&&i.maxHeight<t.height,r=s(t.width)&&i.minWidth&&i.minWidth>t.width,h=s(t.height)&&i.minHeight&&i.minHeight>t.height;r&&(t.width=i.minWidth),h&&(t.height=i.minHeight),a&&(t.width=i.maxWidth),o&&(t.height=i.maxHeight);var l=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,u=/sw|nw|w/.test(n),d=/nw|ne|n/.test(n);r&&u&&(t.left=l-i.minWidth),a&&u&&(t.left=l-i.maxWidth),h&&d&&(t.top=c-i.minHeight),o&&d&&(t.top=c-i.maxHeight);var p=!t.width&&!t.height;return p&&!t.left&&t.top?t.top=null:p&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,i=0;i<this._proportionallyResizeElements.length;i++){var s=this._proportionallyResizeElements[i];if(!this.borderDif){var n=[s.css("borderTopWidth"),s.css("borderRightWidth"),s.css("borderBottomWidth"),s.css("borderLeftWidth")],a=[s.css("paddingTop"),s.css("paddingRight"),s.css("paddingBottom"),s.css("paddingLeft")];this.borderDif=t.map(n,function(t,e){return(parseInt(t,10)||0)+(parseInt(a[e],10)||0)})}s.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.element,i=this.options;if(this.elementOffset=e.offset(),this._helper){this.helper=this.helper||t('<div style="overflow:hidden;"></div>');var s=t.ui.ie6?1:0,n=t.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+n,height:this.element.outerHeight()+n,position:"absolute",left:this.elementOffset.left-s+"px",top:this.elementOffset.top-s+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,i){return{width:this.originalSize.width+e}},w:function(t,e,i){this.options;var s=this.originalSize;return{left:this.originalPosition.left+e,width:s.width-e}},n:function(t,e,i){this.options;var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!=e&&this._trigger(e,i,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}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,i){var s=t(this).data("resizable").options,n=function(e){t(e).each(function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof s.alsoResize||s.alsoResize.parentNode?n(s.alsoResize):s.alsoResize.length?(s.alsoResize=s.alsoResize[0],n(s.alsoResize)):t.each(s.alsoResize,function(t){n(t)})},resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(e,i){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s._proportionallyResizeElements,o=a.length&&/textarea/i.test(a[0].nodeName),r=o&&t.ui.hasScroll(a[0],"left")?0:s.sizeDiff.height,h=o?0:s.sizeDiff.width,l={width:s.size.width-h,height:s.size.height-r},c=parseInt(s.element.css("left"),10)+(s.position.left-s.originalPosition.left)||null,u=parseInt(s.element.css("top"),10)+(s.position.top-s.originalPosition.top)||null;s.element.animate(t.extend(l,u&&c?{top:u,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var i={width:parseInt(s.element.css("width"),10),height:parseInt(s.element.css("height"),10),top:parseInt(s.element.css("top"),10),left:parseInt(s.element.css("left"),10)};a&&a.length&&t(a[0]).css({width:i.width,height:i.height}),s._updateCache(i),s._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,s){var n=t(this).data("resizable"),a=n.options,o=n.element,r=a.containment,h=r instanceof t?r.get(0):/parent/.test(r)?o.parent().get(0):r;if(h)if(n.containerElement=t(h),/document/.test(r)||r==document)n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var l=t(h),c=[];t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=i(l.css("padding"+e))}),n.containerOffset=l.offset(),n.containerPosition=l.position(),n.containerSize={height:l.innerHeight()-c[3],width:l.innerWidth()-c[1]};var u=n.containerOffset,d=n.containerSize.height,p=n.containerSize.width,f=t.ui.hasScroll(h,"left")?h.scrollWidth:p,g=t.ui.hasScroll(h)?h.scrollHeight:d;n.parentData={element:h,left:u.left,top:u.top,width:f,height:g}}},resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=(s.containerSize,s.containerOffset),o=(s.size,s.position),r=s._aspectRatio||e.shiftKey,h={top:0,left:0},l=s.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(h=a),o.left<(s._helper?a.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-a.left:s.position.left-h.left),r&&(s.size.height=s.size.width/s.aspectRatio),s.position.left=n.helper?a.left:0),o.top<(s._helper?a.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-a.top:s.position.top),r&&(s.size.width=s.size.height*s.aspectRatio),s.position.top=s._helper?a.top:0),s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top;var c=Math.abs((s._helper,s.offset.left-h.left+s.sizeDiff.width)),u=Math.abs((s._helper?s.offset.top-h.top:s.offset.top-a.top)+s.sizeDiff.height),d=s.containerElement.get(0)==s.element.parent().get(0),p=/relative|absolute/.test(s.containerElement.css("position"));d&&p&&(c-=s.parentData.left),c+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-c,r&&(s.size.height=s.size.width/s.aspectRatio)),u+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-u,r&&(s.size.width=s.size.height*s.aspectRatio))},stop:function(e,i){var s=t(this).data("resizable"),n=s.options,a=(s.position,s.containerOffset),o=s.containerPosition,r=s.containerElement,h=t(s.helper),l=h.offset(),c=h.outerWidth()-s.sizeDiff.width,u=h.outerHeight()-s.sizeDiff.height;s._helper&&!n.animate&&/relative/.test(r.css("position"))&&t(this).css({left:l.left-o.left-a.left,width:c,height:u}),s._helper&&!n.animate&&/static/.test(r.css("position"))&&t(this).css({left:l.left-o.left-a.left,width:c,height:u})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.size;s.ghost=s.originalElement.clone(),s.ghost.css({opacity:.25,display:"block",position:"relative",height:a.height,width:a.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof n.ghost?n.ghost:""),s.ghost.appendTo(s.helper)},resize:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.ghost.css({position:"relative",height:s.size.height,width:s.size.width})},stop:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.helper&&s.helper.get(0).removeChild(s.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.size,o=s.originalSize,r=s.originalPosition,h=s.axis;n._aspectRatio||e.shiftKey;n.grid="number"==typeof n.grid?[n.grid,n.grid]:n.grid;var l=Math.round((a.width-o.width)/(n.grid[0]||1))*(n.grid[0]||1),c=Math.round((a.height-o.height)/(n.grid[1]||1))*(n.grid[1]||1);/^(se|s|e)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c):/^(ne)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c,s.position.top=r.top-c):/^(sw)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c,s.position.left=r.left-l):(s.size.width=o.width+l,s.size.height=o.height+c,s.position.top=r.top-c,s.position.left=r.left-l)}});var i=function(t){return parseInt(t,10)||0},s=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){(e=t(i.options.filter,i.element[0])).addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this;if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var s=this.options;this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s=t.data(this,"selectable-item");if(s){var n=!e.metaKey&&!e.ctrlKey||!s.$element.hasClass("ui-selected");return s.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),s.unselecting=!n,s.selecting=n,s.selected=n,n?i._trigger("selecting",e,{selecting:s.element}):i._trigger("unselecting",e,{unselecting:s.element}),!1}})}},_mouseDrag:function(e){var i=this;if(this.dragged=!0,!this.options.disabled){var s=this.options,n=this.opos[0],a=this.opos[1],o=e.pageX,r=e.pageY;if(n>o){var h=o;o=n,n=h}if(a>r){h=r;r=a,a=h}return this.helper.css({left:n,top:a,width:o-n,height:r-a}),this.selectees.each(function(){var h=t.data(this,"selectable-item");if(h&&h.element!=i.element[0]){var l=!1;"touch"==s.tolerance?l=!(h.left>o||h.right<n||h.top>r||h.bottom<a):"fit"==s.tolerance&&(l=h.left>n&&h.right<o&&h.top>a&&h.bottom<r),l?(h.selected&&(h.$element.removeClass("ui-selected"),h.selected=!1),h.unselecting&&(h.$element.removeClass("ui-unselecting"),h.unselecting=!1),h.selecting||(h.$element.addClass("ui-selecting"),h.selecting=!0,i._trigger("selecting",e,{selecting:h.element}))):(h.selecting&&((e.metaKey||e.ctrlKey)&&h.startselected?(h.$element.removeClass("ui-selecting"),h.selecting=!1,h.$element.addClass("ui-selected"),h.selected=!0):(h.$element.removeClass("ui-selecting"),h.selecting=!1,h.startselected&&(h.$element.addClass("ui-unselecting"),h.unselecting=!0),i._trigger("unselecting",e,{unselecting:h.element}))),h.selected&&(e.metaKey||e.ctrlKey||h.startselected||(h.$element.removeClass("ui-selected"),h.selected=!1,h.$element.addClass("ui-unselecting"),h.unselecting=!0,i._trigger("unselecting",e,{unselecting:h.element}))))}}),!1}},_mouseStop:function(e){var i=this;this.dragged=!1;this.options;return t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t,e){t.widget("ui.sortable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var n=null;t(e.target).parents().each(function(){if(t.data(this,s.widgetName+"-item")==s)return n=t(this),!1});if(t.data(e.target,s.widgetName+"-item")==s&&(n=t(e.target)),!n)return!1;if(this.options.handle&&!i){var a=!1;if(t(this.options.handle,n).find("*").addBack().each(function(){this==e.target&&(a=!0)}),!a)return!1}return this.currentItem=n,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,i,s){var n=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),n.containment&&this._setContainment(),n.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",n.cursor)),n.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",n.opacity)),n.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",n.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(var a=this.containers.length-1;a>=0;a--)this.containers[a]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var i=this.options,s=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+i.scrollSpeed:e.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+i.scrollSpeed:e.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(e.pageY-t(document).scrollTop()<i.scrollSensitivity?s=t(document).scrollTop(t(document).scrollTop()-i.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<i.scrollSensitivity&&(s=t(document).scrollTop(t(document).scrollTop()+i.scrollSpeed)),e.pageX-t(document).scrollLeft()<i.scrollSensitivity?s=t(document).scrollLeft(t(document).scrollLeft()-i.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<i.scrollSensitivity&&(s=t(document).scrollLeft(t(document).scrollLeft()+i.scrollSpeed))),!1!==s&&t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(var n=this.items.length-1;n>=0;n--){var a=this.items[n],o=a.item[0],r=this._intersectsWithPointer(a);if(r&&(a.instance===this.currentContainer&&!(o==this.currentItem[0]||this.placeholder[1==r?"next":"prev"]()[0]==o||t.contains(this.placeholder[0],o)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],o)))){if(this.direction=1==r?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(a))break;this._rearrange(e,a),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset();this.reverting=!0,t(this.helper).animate({left:n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&s+l<h&&e+c>a&&e+c<o;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:a<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<o&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<h},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),s="y"===this.options.axis||t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!n&&(this.floating?o&&"right"==o||"down"==a?2:1:a&&("down"==a?2:1))},_intersectsWithSides:function(e){var i=t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),s=t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"==a&&s||"left"==a&&!s:n&&("down"==n&&i||"up"==n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i=[],s=[],n=this._connectWith();if(n&&e)for(var a=n.length-1;a>=0;a--)for(var o=t(n[a]),r=o.length-1;r>=0;r--){var h=t.data(o[r],this.widgetName);h&&h!=this&&!h.options.disabled&&s.push([t.isFunction(h.options.items)?h.options.items.call(h.element):t(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}s.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=s.length-1;a>=0;a--)s[a][0].each(function(){i.push(this)});return t(i)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++)if(e[i]==t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i=this.items,s=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],n=this._connectWith();if(n&&this.ready)for(var a=n.length-1;a>=0;a--)for(var o=t(n[a]),r=o.length-1;r>=0;r--){var h=t.data(o[r],this.widgetName);h&&h!=this&&!h.options.disabled&&(s.push([t.isFunction(h.options.items)?h.options.items.call(h.element[0],e,{item:this.currentItem}):t(h.options.items,h.element),h]),this.containers.push(h))}for(a=s.length-1;a>=0;a--)for(var l=s[a][1],c=s[a][0],u=(r=0,c.length);r<u;r++){var d=t(c[r]);d.data(this.widgetName+"-item",l),i.push({item:d,instance:l,width:0,height:0,left:0,top:0})}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var i=this.items.length-1;i>=0;i--){var s=this.items[i];if(s.instance==this.currentContainer||!this.currentContainer||s.item[0]==this.currentItem[0]){var n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item;e||(s.width=n.outerWidth(),s.height=n.outerHeight());var a=n.offset();s.left=a.left,s.top=a.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--){a=this.containers[i].element.offset();this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}return this},_createPlaceholder:function(e){var i=(e=e||this).options;if(!i.placeholder||i.placeholder.constructor==String){var s=i.placeholder;i.placeholder={element:function(){var i=t(document.createElement(e.currentItem[0].nodeName)).addClass(s||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return s||(i.style.visibility="hidden"),i},update:function(t,n){s&&!i.forcePlaceholderSize||(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),i.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var i=null,s=null,n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(i&&t.contains(this.containers[n].element[0],i.element[0]))continue;i=this.containers[n],s=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(i)if(1===this.containers.length)this.containers[s]._trigger("over",e,this._uiHash(this)),this.containers[s].containerCache.over=1;else{for(var a=1e4,o=null,r=this.containers[s].floating?"left":"top",h=this.containers[s].floating?"width":"height",l=this.positionAbs[r]+this.offset.click[r],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[s].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var u=this.items[c].item.offset()[r],d=!1;Math.abs(u-l)>Math.abs(u+this.items[c][h]-l)&&(d=!0,u+=this.items[c][h]),Math.abs(u-l)<a&&(a=Math.abs(u-l),o=this.items[c],this.direction=d?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[s],o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[s].element,!0),this._trigger("change",e,this._uiHash()),this.containers[s]._trigger("change",e,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[s]._trigger("over",e,this._uiHash(this)),this.containers[s].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"==i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!=i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[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")}),(""==s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(""==s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"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();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}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=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(e.containment)){var i=t(e.containment)[0],s=t(e.containment).offset(),n="hidden"!=t(i).css("overflow");this.containment=[s.left+(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0)-this.margins.left,s.top+(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0)-this.margins.top,s.left+(n?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,s.top+(n?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"==e?1:-1,n=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i=this.options,s="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(s[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var a=e.pageX,o=e.pageY;if(this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid)){var r=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1];o=this.containment&&(r-this.offset.click.top<this.containment[1]||r-this.offset.click.top>this.containment[3])?r-this.offset.click.top<this.containment[1]?r+i.grid[1]:r-i.grid[1]:r;var h=this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0];a=this.containment&&(h-this.offset.click.left<this.containment[0]||h-this.offset.click.left>this.containment[2])?h-this.offset.click.left<this.containment[0]?h+i.grid[0]:h-i.grid[0]:h}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():n?0:s.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():n?0:s.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n==this.counter&&this.refreshPositions(!s)})},_clear:function(e,i){this.reverting=!1;var s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]==this.currentItem[0]){for(var n in this._storedCSS)"auto"!=this._storedCSS[n]&&"static"!=this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!i&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent==this.currentItem.parent()[0]||i||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(i||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))));for(n=this.containers.length-1;n>=0;n--)i||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!i){this._trigger("beforeStop",e,this._uiHash());for(n=0;n<s.length;n++)s[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(i||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null,!i){for(n=0;n<s.length;n++)s[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i=0,s={},n={};s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="hide",n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.accordionId="ui-accordion-"+(this.element.attr("id")||++i),s=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(s.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),s.collapsible||!1!==s.active&&null!=s.active||(s.active=0),s.active<0&&(s.active+=this.headers.length),this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(i){var s=t(this),n=s.attr("id"),a=s.next(),o=a.attr("id");n||(n=e+"-header-"+i,s.attr("id",n)),o||(o=e+"-panel-"+i,a.attr("id",o)),s.attr("aria-controls",o),a.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(s.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e)):this._activate(e)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e,i,s=this.options.heightStyle,n=this.element.parent();"fill"===s?(t.support.minHeight||(i=n.css("overflow"),n.css("overflow","hidden")),e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),i&&n.css("overflow",i),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={};e&&(t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._on(this.headers,i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h={oldHeader:s,oldPanel:s.next(),newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||!1===this._trigger("beforeActivate",e,h)||(i.active=!o&&this.headers.index(n),this.active=a?t():n,this._toggle(h),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,i){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(i)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(s,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(n,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}})):e.animate(s,r,o,p):t.animate(n,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),!1!==t.uiBackCompat&&(function(t,e){t.extend(e.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var i=e._create;e._create=function(){if(this.options.navigation){var e=this,s=this.element.find(this.options.header),n=s.next(),a=s.add(n).find("a").filter(this.options.navigationFilter)[0];a&&s.add(n).each(function(i){if(t.contains(this,a))return e.options.active=Math.floor(i/2),!1})}i.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var i=e._create,s=e._setOption;t.extend(e,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),i.call(this)},_setOption:function(t){"autoHeight"!==t&&"clearStyle"!==t&&"fillSpace"!==t||(this.options.heightStyle=this._mergeHeightStyle()),s.apply(this,arguments)},_mergeHeightStyle:function(){var t=this.options;return t.fillSpace?"fill":t.clearStyle?"content":t.autoHeight?"auto":void 0}})}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var i=e._createIcons;e._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),i.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){e.activate=e._activate;var i=e._findActive;e._findActive=function(t){return-1===t&&(t=!1),t&&"number"!=typeof t&&-1===(t=this.headers.index(this.headers.filter(t)))&&(t=!1),i.call(this,t)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(t,e){t.extend(e.options,{change:null,changestart:null});var i=e._trigger;e._trigger=function(t,e,s){var n=i.apply(this,arguments);return!!n&&("beforeActivate"===t?n=i.call(this,"changestart",e,{oldHeader:s.oldHeader,oldContent:s.oldPanel,newHeader:s.newHeader,newContent:s.newPanel}):"activate"===t&&(n=i.call(this,"change",e,{oldHeader:s.oldHeader,oldContent:s.oldPanel,newHeader:s.newHeader,newContent:s.newPanel})),n)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options,{animate:null,animated:"slide"});var i=e._create;e._create=function(){var t=this.options;null===t.animate&&(t.animated?"slide"===t.animated?t.animate=300:"bounceslide"===t.animated?t.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:t.animate=t.animated:t.animate=!1),i.call(this)}}(jQuery,jQuery.ui.accordion.prototype))}(jQuery),function(t,e){var i=0;t.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,i,s;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,void(i=!0);e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,void s.preventDefault();if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){if(s)return s=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:t(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});var s=i.item.data("ui-autocomplete-item")||i.item.data("item.autocomplete");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item")||e.item.data("item.autocomplete"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),t.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this.document.find(e||"body")[0]),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return!!this.element.is("textarea")||!this.element.is("input")&&this.element.prop("isContentEditable")},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,e=++i;return function(s){e===i&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(i,e),this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=new RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t,e){var i,s,n,a,o="ui-button ui-widget ui-state-default ui-corner-all",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var e=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===i&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){e.buttonElement.addClass("ui-state-focus")}).bind("blur"+this.eventNamespace,function(){e.buttonElement.removeClass("ui-state-focus")}),c&&(this.element.bind("change"+this.eventNamespace,function(){a||e.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(a=!1,s=t.pageX,n=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||s===t.pageX&&n===t.pageY||(a=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||a)return!1;t(this).toggleClass("ui-state-active"),e.buttonElement.attr("aria-pressed",e.element[0].checked)}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||a)return!1;t(this).addClass("ui-state-active"),e.buttonElement.attr("aria-pressed","true");var i=e.element[0];l(i).not(i).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(r.disabled)return!1;t(this).addClass("ui-state-active"),i=this,e.document.one("mouseup",function(){i=null})}).bind("mouseup"+this.eventNamespace,function(){if(r.disabled)return!1;t(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(e){if(r.disabled)return!1;e.keyCode!==t.ui.keyCode.SPACE&&e.keyCode!==t.ui.keyCode.ENTER||t(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),(i=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" ui-state-hover ui-state-active  "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){this._super(t,e),"disabled"!==t?this._resetButton():e?this.element.prop("disabled",!0):this.element.prop("disabled",!1)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"!==this.type){var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}else this.options.label&&this.element.val(this.options.label)}}),t.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(e,"mouseout",function(){$(this).removeClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&$(this).removeClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(e,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?t.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&$(this).addClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(t,e){for(var i in $.extend(t,e),e)null!=e[i]&&e[i]!=undefined||(t[i]=e[i]);return t}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return extendRemove(this._defaults,t||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(t){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline="div"==nodeName||"span"==nodeName;target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),"input"==nodeName?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(t,e){var i=$(t);e.append=$([]),e.trigger=$([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(t,i,s){e.settings[i]=s}).bind("getData.datepicker",function(t,i){return this._get(e,i)}),this._autoSize(e),$.data(t,PROP_NAME,e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i=this._get(e,"appendText"),s=this._get(e,"isRTL");e.append&&e.append.remove(),i&&(e.append=$('<span class="'+this._appendClass+'">'+i+"</span>"),t[s?"before":"after"](e.append)),t.unbind("focus",this._showDatepicker),e.trigger&&e.trigger.remove();var n=this._get(e,"showOn");if("focus"!=n&&"both"!=n||t.focus(this._showDatepicker),"button"==n||"both"==n){var a=this._get(e,"buttonText"),o=this._get(e,"buttonImage");e.trigger=$(this._get(e,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:a,title:a}):$('<button type="button"></button>').addClass(this._triggerClass).html(""==o?a:$("<img/>").attr({src:o,alt:a,title:a}))),t[s?"before":"after"](e.trigger),e.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==t[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=t[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(t[0])):$.datepicker._showDatepicker(t[0]),!1})}},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e=new Date(2009,11,20),i=this._get(t,"dateFormat");if(i.match(/[DM]/)){var s=function(t){for(var e=0,i=0,s=0;s<t.length;s++)t[s].length>e&&(e=t[s].length,i=s);return i};e.setMonth(s(this._get(t,i.match(/MM/)?"monthNames":"monthNamesShort"))),e.setDate(s(this._get(t,i.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}t.input.attr("size",this._formatDate(t,e).length)}},_inlineDatepicker:function(t,e){var i=$(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(t,i,s){e.settings[i]=s}).bind("getData.datepicker",function(t,i){return this._get(e,i)}),$.data(t,PROP_NAME,e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var a=this._dialogInst;if(!a){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},$.data(this._dialogInput[0],PROP_NAME,a)}if(extendRemove(a.settings,s||{}),e=e&&e.constructor==Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,!this._pos){var r=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[r/2-100+l,h/2-150+c]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,a),this},_destroyDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();$.removeData(t,PROP_NAME),"input"==s?(i.append.remove(),i.trigger.remove(),e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=s&&"span"!=s||e.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();if("input"==s)t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==s||"span"==s){var n=e.children("."+this._inlineClass);n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(e){return e==t?null:e})}},_disableDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();if("input"==s)t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==s||"span"==s){var n=e.children("."+this._inlineClass);n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(e){return e==t?null:e}),this._disabledInputs[this._disabledInputs.length]=t}},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]==t)return!0;return!1},_getInst:function(t){try{return $.data(t,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s=this._getInst(t);if(2==arguments.length&&"string"==typeof e)return"defaults"==e?$.extend({},$.datepicker._defaults):s?"all"==e?$.extend({},s.settings):this._get(s,e):null;var n=e||{};if("string"==typeof e&&((n={})[e]=i),s){this._curInst==s&&this._hideDatepicker();var a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(s,"min"),r=this._getMinMaxDate(s,"max");extendRemove(s.settings,n),null!==o&&n.dateFormat!==undefined&&n.minDate===undefined&&(s.settings.minDate=this._formatDate(s,o)),null!==r&&n.dateFormat!==undefined&&n.maxDate===undefined&&(s.settings.maxDate=this._formatDate(s,r)),this._attachments($(t),s),this._autoSize(s),this._setDate(s,a),this._updateAlternate(s),this._updateDatepicker(s)}},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(t){var e=$.datepicker._getInst(t.target),i=!0,s=e.dpDiv.is(".ui-datepicker-rtl");if(e._keyEvent=!0,$.datepicker._datepickerShowing)switch(t.keyCode){case 9:$.datepicker._hideDatepicker(),i=!1;break;case 13:var n=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",e.dpDiv);n[0]&&$.datepicker._selectDay(t.target,e.selectedMonth,e.selectedYear,n[0]);var a=$.datepicker._get(e,"onSelect");if(a){var o=$.datepicker._formatDate(e);a.apply(e.input?e.input[0]:null,[o,e])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(t.target,t.ctrlKey?-$.datepicker._get(e,"stepBigMonths"):-$.datepicker._get(e,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(t.target,t.ctrlKey?+$.datepicker._get(e,"stepBigMonths"):+$.datepicker._get(e,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&$.datepicker._clearDate(t.target),i=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&$.datepicker._gotoToday(t.target),i=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,s?1:-1,"D"),i=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&$.datepicker._adjustDate(t.target,t.ctrlKey?-$.datepicker._get(e,"stepBigMonths"):-$.datepicker._get(e,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,-7,"D"),i=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,s?-1:1,"D"),i=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&$.datepicker._adjustDate(t.target,t.ctrlKey?+$.datepicker._get(e,"stepBigMonths"):+$.datepicker._get(e,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,7,"D"),i=t.ctrlKey||t.metaKey;break;default:i=!1}else 36==t.keyCode&&t.ctrlKey?$.datepicker._showDatepicker(this):i=!1;i&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e=$.datepicker._getInst(t.target);if($.datepicker._get(e,"constrainInput")){var i=$.datepicker._possibleChars($.datepicker._get(e,"dateFormat")),s=String.fromCharCode(t.charCode==undefined?t.keyCode:t.charCode);return t.ctrlKey||t.metaKey||s<" "||!i||i.indexOf(s)>-1}},_doKeyUp:function(t){var e=$.datepicker._getInst(t.target);if(e.input.val()!=e.lastVal)try{$.datepicker.parseDate($.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,$.datepicker._getFormatConfig(e))&&($.datepicker._setDateFromField(e),$.datepicker._updateAlternate(e),$.datepicker._updateDatepicker(e))}catch(t){$.datepicker.log(t)}return!0},_showDatepicker:function(t){if("input"!=(t=t.target||t).nodeName.toLowerCase()&&(t=$("input",t.parentNode)[0]),!$.datepicker._isDisabledDatepicker(t)&&$.datepicker._lastInput!=t){var e=$.datepicker._getInst(t);$.datepicker._curInst&&$.datepicker._curInst!=e&&($.datepicker._curInst.dpDiv.stop(!0,!0),e&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var i=$.datepicker._get(e,"beforeShow"),s=i?i.apply(t,[t,e]):{};if(!1!==s){extendRemove(e.settings,s),e.lastVal=null,$.datepicker._lastInput=t,$.datepicker._setDateFromField(e),$.datepicker._inDialog&&(t.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(t),$.datepicker._pos[1]+=t.offsetHeight);var n=!1;$(t).parents().each(function(){return!(n|="fixed"==$(this).css("position"))});var a={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};if($.datepicker._pos=null,e.dpDiv.empty(),e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(e),a=$.datepicker._checkOffset(e,a,n),e.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":n?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),!e.inline){var o=$.datepicker._get(e,"showAnim"),r=$.datepicker._get(e,"duration"),h=function(){var t=e.dpDiv.find("iframe.ui-datepicker-cover");if(t.length){var i=$.datepicker._getBorders(e.dpDiv);t.css({left:-i[0],top:-i[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})}};e.dpDiv.zIndex($(t).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?e.dpDiv.show(o,$.datepicker._get(e,"showOptions"),r,h):e.dpDiv[o||"show"](o?r:null,h),o&&r||h(),e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus(),$.datepicker._curInst=e}}}},_updateDatepicker:function(t){this.maxRows=4;var e=$.datepicker._getBorders(t.dpDiv);instActive=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i=t.dpDiv.find("iframe.ui-datepicker-cover");i.length&&i.css({left:-e[0],top:-e[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()}),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var s=this._getNumberOfMonths(t),n=s[1];if(t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",17*n+"em"),t.dpDiv[(1!=s[0]||1!=s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t==$.datepicker._curInst&&$.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!=document.activeElement&&t.input.focus(),t.yearshtml){var a=t.yearshtml;setTimeout(function(){a===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),a=t.yearshtml=null},0)}},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),a=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:$(document).scrollLeft()),h=document.documentElement.clientHeight+(i?0:$(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-a:0,e.left-=i&&e.left==t.input.offset().left?$(document).scrollLeft():0,e.top-=i&&e.top==t.input.offset().top+o?$(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&r>s?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>h&&h>n?Math.abs(n+o):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"==t.type||1!=t.nodeType||$.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];var s=$(t).offset();return[s.left,s.top]},_hideDatepicker:function(t){var e=this._curInst;if(e&&(!t||e==$.data(t,PROP_NAME))&&this._datepickerShowing){var i=this._get(e,"showAnim"),s=this._get(e,"duration"),n=function(){$.datepicker._tidyDialog(e)};$.effects&&($.effects.effect[i]||$.effects[i])?e.dpDiv.hide(i,$.datepicker._get(e,"showOptions"),s,n):e.dpDiv["slideDown"==i?"slideUp":"fadeIn"==i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1;var a=this._get(e,"onClose");a&&a.apply(e.input?e.input[0]:null,[e.input?e.input.val():"",e]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if($.datepicker._curInst){var e=$(t.target),i=$.datepicker._getInst(e[0]);(e[0].id==$.datepicker._mainDivId||0!=e.parents("#"+$.datepicker._mainDivId).length||e.hasClass($.datepicker.markerClassName)||e.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!e.hasClass($.datepicker.markerClassName)||$.datepicker._curInst==i)||$.datepicker._hideDatepicker()}},_adjustDate:function(t,e,i){var s=$(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,e+("M"==i?this._get(n,"showCurrentAtPos"):0),i),this._updateDatepicker(n))},_gotoToday:function(t){var e=$(t),i=this._getInst(e[0]);if(this._get(i,"gotoCurrent")&&i.currentDay)i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear;else{var s=new Date;i.selectedDay=s.getDate(),i.drawMonth=i.selectedMonth=s.getMonth(),i.drawYear=i.selectedYear=s.getFullYear()}this._notifyChange(i),this._adjustDate(e),this._selectDate(t,this._formatDate(i,i.selectedDay,i.drawMonth,i.drawYear))},_selectMonthYear:function(t,e,i){var s=$(t),n=this._getInst(s[0]);n["selected"+("M"==i?"Month":"Year")]=n["draw"+("M"==i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=$(t);if(!$(s).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(n[0])){var a=this._getInst(n[0]);a.selectedDay=a.currentDay=$("a",s).html(),a.selectedMonth=a.currentMonth=e,a.selectedYear=a.currentYear=i,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear))}},_clearDate:function(t){var e=$(t);this._getInst(e[0]);this._selectDate(e,"")},_selectDate:function(t,e){var i=$(t),s=this._getInst(i[0]);e=null!=e?e:this._formatDate(s),s.input&&s.input.val(e),this._updateAlternate(s);var n=this._get(s,"onSelect");n?n.apply(s.input?s.input[0]:null,[e,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],"object"!=typeof s.input[0]&&s.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var e=this._get(t,"altField");if(e){var i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t));$(e).each(function(){$(this).val(n)})}},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));var i=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((i-e)/864e5)/7)+1},parseDate:function(t,e,i){if(null==t||null==e)throw"Invalid arguments";if(""==(e="object"==typeof e?e.toString():e+""))return null;var s=(i?i.shortYearCutoff:null)||this._defaults.shortYearCutoff;s="string"!=typeof s?s:(new Date).getFullYear()%100+parseInt(s,10);for(var n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=-1,l=-1,c=-1,u=-1,d=!1,p=function(e){var i=_+1<t.length&&t.charAt(_+1)==e;return i&&_++,i},f=function(t){var i=p(t),s=new RegExp("^\\d{1,"+("@"==t?14:"!"==t?20:"y"==t&&i?4:"o"==t?3:2)+"}"),n=e.substring(v).match(s);if(!n)throw"Missing number at position "+v;return v+=n[0].length,parseInt(n[0],10)},g=function(t,i,s){var n=$.map(p(t)?s:i,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)}),a=-1;if($.each(n,function(t,i){var s=i[1];if(e.substr(v,s.length).toLowerCase()==s.toLowerCase())return a=i[0],v+=s.length,!1}),-1!=a)return a+1;throw"Unknown name at position "+v},m=function(){if(e.charAt(v)!=t.charAt(_))throw"Unexpected literal at position "+v;v++},v=0,_=0;_<t.length;_++)if(d)"'"!=t.charAt(_)||p("'")?m():d=!1;else switch(t.charAt(_)){case"d":c=f("d");break;case"D":g("D",n,a);break;case"o":u=f("o");break;case"m":l=f("m");break;case"M":l=g("M",o,r);break;case"y":h=f("y");break;case"@":h=(b=new Date(f("@"))).getFullYear(),l=b.getMonth()+1,c=b.getDate();break;case"!":var b;h=(b=new Date((f("!")-this._ticksTo1970)/1e4)).getFullYear(),l=b.getMonth()+1,c=b.getDate();break;case"'":p("'")?m():d=!0;break;default:m()}if(v<e.length){var y=e.substr(v);if(!/^\s+/.test(y))throw"Extra/unparsed characters found in date: "+y}if(-1==h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=s?0:-100)),u>-1)for(l=1,c=u;;){var w=this._getDaysInMonth(h,l-1);if(c<=w)break;l++,c-=w}if((b=this._daylightSavingAdjust(new Date(h,l-1,c))).getFullYear()!=h||b.getMonth()+1!=l||b.getDate()!=c)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,i){if(!e)return"";var s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,r=function(e){var i=d+1<t.length&&t.charAt(d+1)==e;return i&&d++,i},h=function(t,e,i){var s=""+e;if(r(t))for(;s.length<i;)s="0"+s;return s},l=function(t,e,i,s){return r(t)?s[e]:i[e]},c="",u=!1;if(e)for(var d=0;d<t.length;d++)if(u)"'"!=t.charAt(d)||r("'")?c+=t.charAt(d):u=!1;else switch(t.charAt(d)){case"d":c+=h("d",e.getDate(),2);break;case"D":c+=l("D",e.getDay(),s,n);break;case"o":c+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=h("m",e.getMonth()+1,2);break;case"M":c+=l("M",e.getMonth(),a,o);break;case"y":c+=r("y")?e.getFullYear():(e.getYear()%100<10?"0":"")+e.getYear()%100;break;case"@":c+=e.getTime();break;case"!":c+=1e4*e.getTime()+this._ticksTo1970;break;case"'":r("'")?c+="'":u=!0;break;default:c+=t.charAt(d)}return c},_possibleChars:function(t){for(var e="",i=!1,s=function(e){var i=n+1<t.length&&t.charAt(n+1)==e;return i&&n++,i},n=0;n<t.length;n++)if(i)"'"!=t.charAt(n)||s("'")?e+=t.charAt(n):i=!1;else switch(t.charAt(n)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":s("'")?e+="'":i=!0;break;default:e+=t.charAt(n)}return e},_get:function(t,e){return t.settings[e]!==undefined?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!=t.lastVal){var i,s,n=this._get(t,"dateFormat"),a=t.lastVal=t.input?t.input.val():null;i=s=this._getDefaultDate(t);var o=this._getFormatConfig(t);try{i=this.parseDate(n,a,o)||s}catch(t){this.log(t),a=e?"":a}t.selectedDay=i.getDate(),t.drawMonth=t.selectedMonth=i.getMonth(),t.drawYear=t.selectedYear=i.getFullYear(),t.currentDay=a?i.getDate():0,t.currentMonth=a?i.getMonth():0,t.currentYear=a?i.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(t,e,i){var s=null==e||""===e?i:"string"==typeof e?function(e){try{return $.datepicker.parseDate($.datepicker._get(t,"dateFormat"),e,$.datepicker._getFormatConfig(t))}catch(t){}for(var i=(e.toLowerCase().match(/^c/)?$.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),n=i.getMonth(),a=i.getDate(),o=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=o.exec(e);r;){switch(r[2]||"d"){case"d":case"D":a+=parseInt(r[1],10);break;case"w":case"W":a+=7*parseInt(r[1],10);break;case"m":case"M":n+=parseInt(r[1],10),a=Math.min(a,$.datepicker._getDaysInMonth(s,n));break;case"y":case"Y":s+=parseInt(r[1],10),a=Math.min(a,$.datepicker._getDaysInMonth(s,n))}r=o.exec(e)}return new Date(s,n,a)}(e):"number"==typeof e?isNaN(e)?i:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(e):new Date(e.getTime());return(s=s&&"Invalid Date"==s.toString()?i:s)&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,o=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=o.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=o.getMonth(),t.drawYear=t.selectedYear=t.currentYear=o.getFullYear(),n==t.selectedMonth&&a==t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""==t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(i,-e,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(i,+e,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(i)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(i,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var i=this._get(t,"isRTL"),s=this._get(t,"showButtonPanel"),n=this._get(t,"hideIfNoPrevNext"),a=this._get(t,"navigationAsDateFormat"),o=this._getNumberOfMonths(t),r=this._get(t,"showCurrentAtPos"),h=this._get(t,"stepMonths"),l=1!=o[0]||1!=o[1],c=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),u=this._getMinMaxDate(t,"min"),d=this._getMinMaxDate(t,"max"),p=t.drawMonth-r,f=t.drawYear;if(p<0&&(p+=12,f--),d){var g=this._daylightSavingAdjust(new Date(d.getFullYear(),d.getMonth()-o[0]*o[1]+1,d.getDate()));for(g=u&&g<u?u:g;this._daylightSavingAdjust(new Date(f,p,1))>g;)--p<0&&(p=11,f--)}t.drawMonth=p,t.drawYear=f;var m=this._get(t,"prevText");m=a?this.formatDate(m,this._daylightSavingAdjust(new Date(f,p-h,1)),this._getFormatConfig(t)):m;var v=this._canAdjustMonth(t,-1,f,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"e":"w")+'">'+m+"</span></a>":n?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"e":"w")+'">'+m+"</span></a>",_=this._get(t,"nextText");_=a?this.formatDate(_,this._daylightSavingAdjust(new Date(f,p+h,1)),this._getFormatConfig(t)):_;var b=this._canAdjustMonth(t,1,f,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+_+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"w":"e")+'">'+_+"</span></a>":n?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+_+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"w":"e")+'">'+_+"</span></a>",y=this._get(t,"currentText"),w=this._get(t,"gotoCurrent")&&t.currentDay?c:e;y=a?this.formatDate(y,w,this._getFormatConfig(t)):y;var x=t.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(t,"closeText")+"</button>",k=s?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(i?x:"")+(this._isInRange(t,w)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+y+"</button>":"")+(i?"":x)+"</div>":"",C=parseInt(this._get(t,"firstDay"),10);C=isNaN(C)?0:C;for(var D=this._get(t,"showWeek"),P=this._get(t,"dayNames"),I=(this._get(t,"dayNamesShort"),this._get(t,"dayNamesMin")),M=this._get(t,"monthNames"),T=this._get(t,"monthNamesShort"),S=this._get(t,"beforeShowDay"),A=this._get(t,"showOtherMonths"),z=this._get(t,"selectOtherMonths"),H=(this._get(t,"calculateWeek")||this.iso8601Week,this._getDefaultDate(t)),N="",E=0;E<o[0];E++){var W="";this.maxRows=4;for(var O=0;O<o[1];O++){var F=this._daylightSavingAdjust(new Date(f,p,t.selectedDay)),R=" ui-corner-all",j="";if(l){if(j+='<div class="ui-datepicker-group',o[1]>1)switch(O){case 0:j+=" ui-datepicker-group-first",R=" ui-corner-"+(i?"right":"left");break;case o[1]-1:j+=" ui-datepicker-group-last",R=" ui-corner-"+(i?"left":"right");break;default:j+=" ui-datepicker-group-middle",R=""}j+='">'}j+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&0==E?i?b:v:"")+(/all|right/.test(R)&&0==E?i?v:b:"")+this._generateMonthYearHeader(t,p,f,u,d,E>0||O>0,M,T)+'</div><table class="ui-datepicker-calendar"><thead><tr>';for(var L=D?'<th class="ui-datepicker-week-col">'+this._get(t,"weekHeader")+"</th>":"",Y=0;Y<7;Y++){var B=(Y+C)%7;L+="<th"+((Y+C+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+P[B]+'">'+I[B]+"</span></th>"}j+=L+"</tr></thead><tbody>";var K=this._getDaysInMonth(f,p);f==t.selectedYear&&p==t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,K));var q=(this._getFirstDayOfMonth(f,p)-C+7)%7,Q=Math.ceil((q+K)/7),U=l&&this.maxRows>Q?this.maxRows:Q;this.maxRows=U;for(var V=this._daylightSavingAdjust(new Date(f,p,1-q)),X=0;X<U;X++){j+="<tr>";var G=D?'<td class="ui-datepicker-week-col">'+this._get(t,"calculateWeek")(V)+"</td>":"";for(Y=0;Y<7;Y++){var Z=S?S.apply(t.input?t.input[0]:null,[V]):[!0,""],J=V.getMonth()!=p,tt=J&&!z||!Z[0]||u&&V<u||d&&V>d;G+='<td class="'+((Y+C+6)%7>=5?" ui-datepicker-week-end":"")+(J?" ui-datepicker-other-month":"")+(V.getTime()==F.getTime()&&p==t.selectedMonth&&t._keyEvent||H.getTime()==V.getTime()&&H.getTime()==F.getTime()?" "+this._dayOverClass:"")+(tt?" "+this._unselectableClass+" ui-state-disabled":"")+(J&&!A?"":" "+Z[1]+(V.getTime()==c.getTime()?" "+this._currentClass:"")+(V.getTime()==e.getTime()?" ui-datepicker-today":""))+'"'+(J&&!A||!Z[2]?"":' title="'+Z[2]+'"')+(tt?"":' data-handler="selectDay" data-event="click" data-month="'+V.getMonth()+'" data-year="'+V.getFullYear()+'"')+">"+(J&&!A?"&#xa0;":tt?'<span class="ui-state-default">'+V.getDate()+"</span>":'<a class="ui-state-default'+(V.getTime()==e.getTime()?" ui-state-highlight":"")+(V.getTime()==c.getTime()?" ui-state-active":"")+(J?" ui-priority-secondary":"")+'" href="#">'+V.getDate()+"</a>")+"</td>",V.setDate(V.getDate()+1),V=this._daylightSavingAdjust(V)}j+=G+"</tr>"}++p>11&&(p=0,f++),W+=j+="</tbody></table>"+(l?"</div>"+(o[0]>0&&O==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"")}N+=W}return N+=k+($.ui.ie6&&!t.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),t._keyEvent=!1,N},_generateMonthYearHeader:function(t,e,i,s,n,a,o,r){var h=this._get(t,"changeMonth"),l=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),u='<div class="ui-datepicker-title">',d="";if(a||!h)d+='<span class="ui-datepicker-month">'+o[e]+"</span>";else{var p=s&&s.getFullYear()==i,f=n&&n.getFullYear()==i;d+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var g=0;g<12;g++)(!p||g>=s.getMonth())&&(!f||g<=n.getMonth())&&(d+='<option value="'+g+'"'+(g==e?' selected="selected"':"")+">"+r[g]+"</option>");d+="</select>"}if(c||(u+=d+(!a&&h&&l?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!l)u+='<span class="ui-datepicker-year">'+i+"</span>";else{var m=this._get(t,"yearRange").split(":"),v=(new Date).getFullYear(),_=function(t){var e=t.match(/c[+-].*/)?i+parseInt(t.substring(1),10):t.match(/[+-].*/)?v+parseInt(t,10):parseInt(t,10);return isNaN(e)?v:e},b=_(m[0]),y=Math.max(b,_(m[1]||""));for(b=s?Math.max(b,s.getFullYear()):b,y=n?Math.min(y,n.getFullYear()):y,t.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';b<=y;b++)t.yearshtml+='<option value="'+b+'"'+(b==i?' selected="selected"':"")+">"+b+"</option>";t.yearshtml+="</select>",u+=t.yearshtml,t.yearshtml=null}return u+=this._get(t,"yearSuffix"),c&&(u+=(!a&&h&&l?"":"&#xa0;")+d),u+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"==i?e:0),n=t.drawMonth+("M"==i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"==i?e:0),o=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),"M"!=i&&"Y"!=i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&e<i?i:e;return n=s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max");return(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var e=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!=t&&"getDate"!=t&&"widget"!=t?"option"==t&&2==arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this].concat(e)):$.datepicker._attachDatepicker(this,t)}):$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var i="ui-dialog ui-widget ui-widget-content ui-corner-all ",s={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},n={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),"string"!=typeof this.originalTitle&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var e,s,n,a,o,r=this,h=this.options,l=h.title||"&#160;";e=(this.uiDialog=t("<div>")).addClass(i+h.dialogClass).css({display:"none",outline:0,zIndex:h.zIndex}).attr("tabIndex",-1).keydown(function(e){h.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE&&(r.close(e),e.preventDefault())}).mousedown(function(t){r.moveToTop(!1,t)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e),s=(this.uiDialogTitlebar=t("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").bind("mousedown",function(){e.focus()}).prependTo(e),n=t("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),r.close(t)}).appendTo(s),(this.uiDialogTitlebarCloseText=t("<span>")).addClass("ui-icon ui-icon-closethick").text(h.closeText).appendTo(n),a=t("<span>").uniqueId().addClass("ui-dialog-title").html(l).prependTo(s),o=(this.uiDialogButtonPane=t("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("<div>")).addClass("ui-dialog-buttonset").appendTo(o),e.attr({role:"dialog","aria-labelledby":a.attr("id")}),s.find("*").add(s).disableSelection(),this._hoverable(n),this._focusable(n),h.draggable&&t.fn.draggable&&this._makeDraggable(),h.resizable&&t.fn.resizable&&this._makeResizable(),this._createButtons(h.buttons),this._isOpen=!1,t.fn.bgiframe&&e.bgiframe(),this._on(e,{keydown:function(i){if(h.modal&&i.keyCode===t.ui.keyCode.TAB){var s=t(":tabbable",e),n=s.filter(":first"),a=s.filter(":last");return i.target!==a[0]||i.shiftKey?i.target===n[0]&&i.shiftKey?(a.focus(1),!1):void 0:(n.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var i,s,n=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",e)}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(i=0,t(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(s=t(this).css("z-index"),isNaN(s)||(i=Math.max(i,s)))}),t.ui.dialog.maxZ=i),this},isOpen:function(){return this._isOpen},moveToTop:function(e,i){var s,n=this.options;return n.modal&&!e||!n.stack&&!n.modal?this._trigger("focus",i):(n.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=n.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)),s={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(s),this._trigger("focus",i),this)},open:function(){if(!this._isOpen){var e,i=this.options,s=this.uiDialog;return this._size(),this._position(i.position),s.show(i.show),this.overlay=i.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),(e=this.element.find(":tabbable")).length||(e=this.uiDialogButtonPane.find(":tabbable")).length||(e=s),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var i=this,s=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(s=!0)}),s?(t.each(e,function(e,s){var n,a;s=t.isFunction(s)?{click:s,text:e}:s,s=t.extend({type:"button"},s),a=s.click,s.click=function(){a.apply(i.element[0],arguments)},n=t("<button></button>",s).appendTo(i.uiButtonSet),t.fn.button&&n.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._trigger("dragStop",n,e(a)),t.ui.dialog.overlay.resize()}})},_makeResizable:function(e){function i(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}e=void 0===e?this.options.resizable:e;var s=this,n=this.options,a=this.uiDialog.css("position"),o="string"==typeof e?e:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:o,start:function(e,n){t(this).addClass("ui-dialog-resizing"),s._trigger("resizeStart",e,i(n))},resize:function(t,e){s._trigger("resize",t,i(e))},stop:function(e,a){t(this).removeClass("ui-dialog-resizing"),n.height=t(this).height(),n.width=t(this).width(),s._trigger("resizeStop",e,i(a)),t.ui.dialog.overlay.resize()}}).css("position",a).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var i,s=[],n=[0,0];e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(1===(s=e.split?e.split(" "):[e[0],e[1]]).length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),e={my:s[0]+(n[0]<0?n[0]:"+"+n[0])+" "+s[1]+(n[1]<0?n[1]:"+"+n[1]),at:s.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,(i=this.uiDialog.is(":visible"))||this.uiDialog.show(),this.uiDialog.position(e),i||this.uiDialog.hide()},_setOptions:function(e){var i=this,a={},o=!1;t.each(e,function(t,e){i._setOption(t,e),t in s&&(o=!0),t in n&&(a[t]=e)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(e,s){var n,a,o=this.uiDialog;switch(e){case"buttons":this._createButtons(s);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+s);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(i+s);break;case"disabled":s?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":(n=o.is(":data(draggable)"))&&!s&&o.draggable("destroy"),!n&&s&&this._makeDraggable();break;case"position":this._position(s);break;case"resizable":(a=o.is(":data(resizable)"))&&!s&&o.resizable("destroy"),a&&"string"==typeof s&&o.resizable("option","handles",s),a||!1===s||this._makeResizable(s);break;case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(s||"&#160;"))}this._super(e,s)},_size:function(){var e,i,s,n=this.options,a=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),i=Math.max(0,n.minHeight-e),"auto"===n.height?t.support.minHeight?this.element.css({minHeight:i,height:"auto"}):(this.uiDialog.show(),s=this.element.css("height","auto").height(),a||this.uiDialog.hide(),this.element.height(Math.max(s,i))):this.element.height(Math.max(n.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(t){var e=t.attr("id");return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=t.ui.dialog.overlay.create(e)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(t){return t+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(e){if(t(e.target).zIndex()<t.ui.dialog.overlay.maxZ)return!1})},1),t(window).bind("resize.dialog-overlay",t.ui.dialog.overlay.resize));var i=this.oldInstances.pop()||t("<div>").addClass("ui-widget-overlay");return t(document).bind("keydown.dialog-overlay",function(s){var n=t.ui.dialog.overlay.instances;0!==n.length&&n[n.length-1]===i&&e.options.closeOnEscape&&!s.isDefaultPrevented()&&s.keyCode&&s.keyCode===t.ui.keyCode.ESCAPE&&(e.close(s),s.preventDefault())}),i.appendTo(document.body).css({width:this.width(),height:this.height()}),t.fn.bgiframe&&i.bgiframe(),this.instances.push(i),i},destroy:function(e){var i=t.inArray(e,this.instances),s=0;-1!==i&&this.oldInstances.push(this.instances.splice(i,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){s=Math.max(s,this.css("z-index"))}),this.maxZ=s},height:function(){var e;return t.ui.ie?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight))<Math.max(document.documentElement.offsetHeight,document.body.offsetHeight)?t(window).height()+"px":e+"px":t(document).height()+"px"},width:function(){var e;return t.ui.ie?(e=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth))<Math.max(document.documentElement.offsetWidth,document.body.offsetWidth)?t(window).width()+"px":e+"px":t(document).width()+"px"},resize:function(){var e=t([]);t.each(t.ui.dialog.overlay.instances,function(){e=e.add(this)}),e.css({width:0,height:0}).css({width:t.ui.dialog.overlay.width(),height:t.ui.dialog.overlay.height()})}}),t.extend(t.ui.dialog.overlay.prototype,{destroy:function(){t.ui.dialog.overlay.destroy(this.$el)}})}(jQuery),function(t,e){var i=!1;t.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var s=t(e.target).closest(".ui-menu-item");!i&&s.not(".ui-state-disabled").length&&(i=!0,this.select(e),s.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),i=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=new RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),(s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s).length||(a=String.fromCharCode(e.keyCode),r=new RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),(e=s.add(this.element)).children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-—–\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),n<0?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.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(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;this.active?this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s-n<0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var i,s,n;this.active?this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this._value():(this._setOption("value",t),this)},_setOption:function(t,e){"value"===t&&(this.options.value=e,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(t,e)},_value:function(){var t=this.options.value;return"number"!=typeof t&&(t=0),Math.min(this.options.max,Math.max(this.min,t))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var t=this.value(),e=this._percentage();this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),this.valueDiv.toggle(t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(e.toFixed(0)+"%"),this.element.attr("aria-valuenow",t)}})}(jQuery),function(t,e){t.widget("ui.slider",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a=[];for(this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(s.disabled?" ui-slider-disabled ui-disabled":"")),this.range=t([]),s.range&&(!0===s.range&&(s.values||(s.values=[this._valueMin(),this._valueMin()]),s.values.length&&2!==s.values.length&&(s.values=[s.values[0],s.values[0]])),this.range=t("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===s.range||"max"===s.range?" ui-slider-range-"+s.range:""))),i=s.values&&s.values.length||1,e=n.length;e<i;e++)a.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(t){t.preventDefault()}).mouseenter(function(){s.disabled||t(this).addClass("ui-state-hover")}).mouseleave(function(){t(this).removeClass("ui-state-hover")}).focus(function(){s.disabled?t(this).blur():(t(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),t(this).addClass("ui-state-focus"))}).blur(function(){t(this).removeClass("ui-state-focus")}),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)}),this._on(this.handles,{keydown:function(e){var i,s,n,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),!1===this._start(e,a)))return}switch(n=this.options.step,i=s=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:s=this._valueMin();break;case t.ui.keyCode.END:s=this._valueMax();break;case t.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+n);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-n)}this._slide(e,a,s)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-l.values(e));n>i&&(n=i,a=t(this),o=e)}),!0===c.range&&this.values(1)===c.min&&(o+=1,a=t(this.handles[o])),!1!==this._start(e,o)&&(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),r=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-r.left-a.width()/2,top:e.pageY-r.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(s=i/e)>1&&(s=1),s<0&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&!0===this.options.range&&(0===e&&i>s||1===e&&i<s)&&(i=s),i!==this.values(e)&&((n=this.values())[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),!1!==a&&this.values(e,i,!0))):i!==this.value()&&!1!==(a=this._trigger("slide",t,{handle:this.handles[e],value:i}))&&this.value(i)},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;a<s.length;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch(t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"disabled":i?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;s<n;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=!this._animateOff&&r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=(h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())*100,c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),!0===h.options.range&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?(s-n)/(a-n)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){this.element[0]===this.document[0].activeElement||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return i=t-(e=null!==s.min?s.min:0),t=e+(i=Math.round(i/s.step)*s.step),t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&t<s.min?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,void this.element.val(this._format(i))}"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._spin((t||1)*this.options.step)},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._spin((t||1)*-this.options.step)},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());e(this._value).call(this,t)},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(){return++a}function s(t){return t.hash.length>1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")}var n,a=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options,s=i.active,n=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),null===s&&(n&&this.tabs.each(function(e,i){if(t(i).attr("aria-controls")===n)return s=e,!1}),null===s&&(s=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==s&&-1!==s||(s=!!this.tabs.length&&0)),!1!==s&&-1===(s=this.tabs.index(this.tabs.eq(s)))&&(s=!i.collapsible&&0),i.active=s,!i.collapsible&&!1===i.active&&this.anchors.length&&(i.active=0),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=t(),this._refresh(),this.active.length&&this.load(i.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s!==this.options.active&&s);default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){for(var s=this.tabs.length-1;-1!==t.inArray((e>s&&(e=0),e<0&&(e=s),e),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,e){"active"!==t?"disabled"!==t?(this._super(t,e),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._setupDisabled(e):this._activate(e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(a="#"+(r=e._tabId(l)),(o=e.element.find(a)).length||(o=e._createPanel(r)).insertAfter(e.panels[i-1]||e.tablist),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)!0===e||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),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,s,n=this.element.parent();"fill"===e?(t.support.minHeight||(s=n.css("overflow"),n.css("overflow","hidden")),i=n.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),s&&n.css("overflow",s),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget).closest("li"),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():this._getPanelForTab(n),h=s.length?this._getPanelForTab(s):t(),l={oldTab:s,oldPanel:h,newTab:o?t():n,newPanel:r};e.preventDefault(),n.hasClass("ui-state-disabled")||n.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||!1===this._trigger("beforeActivate",e,l)||(i.active=!o&&this.tabs.index(n),this.active=a?t():n,this.xhr&&this.xhr.abort(),h.length||r.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(n),e),this._toggle(e,l))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return!1===e?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;!1!==i&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setupDisabled(i))},disable:function(e){var i=this.options.disabled;if(!0!==i){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setupDisabled(i)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),!1!==t.uiBackCompat&&(t.ui.tabs.prototype._ui=function(t,e){return{tab:t,panel:e,index:this.anchors.index(t)}},t.widget("ui.tabs",t.ui.tabs,{url:function(t,e){this.anchors.eq(t).attr("href",e)}}),t.widget("ui.tabs",t.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var e=this;this._on({tabsbeforeload:function(i,s){t.data(s.tab[0],"cache.tabs")?i.preventDefault():s.jqXHR.success(function(){e.options.cache&&t.data(s.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,i,s){var n=this.options.ajaxOptions;return t.extend({},n,{error:function(t,e){try{n.error(t,e,s.tab.closest("li").index(),s.tab[0])}catch(t){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&!1===e&&this.anchors.removeData("cache.tabs"),this._super(t,e)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(t){this.anchors.eq(t).removeData("cache.tabs"),this._superApply(arguments)}}),t.widget("ui.tabs",t.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),t.widget("ui.tabs",t.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(t,e){if(t.target===this.element[0]&&this.options.spinner){var i=e.tab.find("span"),s=i.html();i.html(this.options.spinner),e.jqXHR.complete(function(){i.html(s)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var i,s=this.options;(e&&!0===s.disabled||t.isArray(s.disabled)&&-1!==t.inArray(e,s.disabled))&&(i=!0),this._superApply(arguments),i&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var i,s=this.options;(e&&!1===s.disabled||t.isArray(s.disabled)&&-1===t.inArray(e,s.disabled))&&(i=!0),this._superApply(arguments),i&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(e,i,s){void 0===s&&(s=this.anchors.length);var n,a,o=this.options,r=t(o.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,i)),h=e.indexOf("#")?this._tabId(r):e.replace("#","");return r.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),r.attr("aria-controls",h),n=s>=this.tabs.length,(a=this.element.find("#"+h)).length||(a=this._createPanel(h),n?s>0?a.insertAfter(this.panels.eq(-1)):a.appendTo(this.element):a.insertBefore(this.panels[s])),a.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),n?r.appendTo(this.tablist):r.insertBefore(this.tabs[s]),o.disabled=t.map(o.disabled,function(t){return t>=s?++t:t}),this.refresh(),1===this.tabs.length&&!1===o.active&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[s],this.panels[s])),this},remove:function(e){e=this._getIndex(e);var i=this.options,s=this.tabs.eq(e).remove(),n=this._getPanelForTab(s).remove();return s.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1<this.anchors.length?1:-1)),i.disabled=t.map(t.grep(i.disabled,function(t){return t!==e}),function(t){return t>=e?--t:t}),this.refresh(),this._trigger("remove",null,this._ui(s.find("a")[0],n[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(e){var s=e.is("li")?e.find("a[href]"):e;return s=s[0],t(s).closest("li").attr("aria-controls")||s.title&&s.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(e){return t(this.options.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),t.widget("ui.tabs",t.ui.tabs,{_create:function(){var t=this.options;null===t.active&&void 0!==t.selected&&(t.active=-1!==t.selected&&t.selected),this._super(),t.selected=t.active,!1===t.selected&&(t.selected=-1)},_setOption:function(t,e){if("selected"!==t)return this._super(t,e);var i=this.options;this._super("active",-1!==e&&e),i.selected=i.active,!1===i.selected&&(i.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,!1===this.options.selected&&(this.options.selected=-1)}}),t.widget("ui.tabs",t.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),!1!==this.options.active&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(t,e,i){var s,n,a=this._superApply(arguments);return!!a&&("beforeActivate"===t?(s=i.newTab.length?i.newTab:i.oldTab,n=i.newPanel.length?i.newPanel:i.oldPanel,a=this._super("select",e,{tab:s.find(".ui-tabs-anchor")[0],panel:n[0],index:s.closest("li").index()})):"activate"===t&&i.newTab.length&&(a=this._super("show",e,{tab:i.newTab.find(".ui-tabs-anchor")[0],panel:i.newPanel[0],index:i.newTab.closest("li").index()})),a)}}),t.widget("ui.tabs",t.ui.tabs,{select:function(t){if(-1===(t=this._getIndex(t))){if(!this.options.collapsible||-1===this.options.selected)return;t=this.options.selected}this.anchors.eq(t).trigger(this.options.event+this.eventNamespace)}}),n=0,t.widget("ui.tabs",t.ui.tabs,{options:{cookie:null},_create:function(){var t,e=this.options;null==e.active&&e.cookie&&(-1===(t=parseInt(this._cookie(),10))&&(t=!1),e.active=t),this._super()},_cookie:function(e){var i=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++n)];return arguments.length&&(i.push(!1===e?-1:e),i.push(this.options.cookie)),t.cookie.apply(null,i)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}}),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,i,s){var n=t.extend({},s);return"load"===e&&(n.panel=n.panel[0],n.tab=n.tab.find(".ui-tabs-anchor")[0]),this._super(e,i,n)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,i,s=this.options.fx;return s&&(t.isArray(s)?(e=s[0],i=s[1]):e=i=s),s?{show:i,hide:e}:null},_toggle:function(t,e){function i(){n.running=!1,n._trigger("activate",t,e)}function s(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&r.show?a.animate(r.show,r.show.duration,function(){i()}):(a.show(),i())}var n=this,a=e.newPanel,o=e.oldPanel,r=this._getFx();if(!r)return this._super(t,e);n.running=!0,o.length&&r.hide?o.animate(r.hide,r.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),o.hide(),s())}}))}(jQuery),function(t){var e=0;t.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return t(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;if("disabled"===e)return this[i?"_disable":"_enable"](),void(this.options[e]=i);this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)})},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&((e=t.Event("blur")).target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;if("string"==typeof s)return this._open(e,t,s);(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}))&&this._open(e,t,i)},_open:function(e,i,s){function n(t){u.of=t,a.is(":hidden")||a.position(u)}var a,o,r,h,l,c,u=t.extend({},this.options.position);s&&((a=this._find(i)).length?a.find(".ui-tooltip-content").html(s):(i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),h=i,l=a.attr("id"),(c=(h.attr("aria-describedby")||"").split(/\s+/)).push(l),h.data("ui-tooltip-id",l).attr("aria-describedby",t.trim(c.join(" "))),a.find(".ui-tooltip-content").html(s),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=setInterval(function(){a.is(":visible")&&(n(u.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a}),o={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}},remove:function(){this._removeTooltip(a)}},e&&"mouseover"!==e.type||(o.mouseleave="close"),e&&"focusin"!==e.type||(o.focusout="close"),this._on(!0,i,o)))},close:function(e){var i,s,n,a,o=this,r=t(e?e.currentTarget:this.element),h=this._find(r);this.closing||(r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),s=(i=r).data("ui-tooltip-id"),n=(i.attr("aria-describedby")||"").split(/\s+/),-1!==(a=t.inArray(s,n))&&n.splice(a,1),i.removeData("ui-tooltip-id"),(n=t.trim(n.join(" ")))?i.attr("aria-describedby",n):i.removeAttr("aria-describedby"),h.stop(!0),this._hide(h,this.options.hide,function(){o._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete o.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:h}),this.closing=!1)},_tooltip:function(i){var s="ui-tooltip-"+e++,n=t("<div>").attr({id:s,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),t.fn.bgiframe&&n.bgiframe(),this.tooltips[s]=i,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery),jQuery.effects||function(t,e){var i,s=!1!==t.uiBackCompat;t.effects={effect:{}},function(e,i){function s(t,e,i){var s=d[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:s.max<t?s.max:t)}function n(t){var i=c(),s=i._rgba=[];return t=t.toLowerCase(),g(l,function(e,n){var a,o=n.re.exec(t),r=o&&n.parse(o),h=n.space||"rgba";if(r)return a=i[h](r),i[u[h].cache]=a[u[h].cache],s=i._rgba=a._rgba,!1}),s.length?("0,0,0,0"===s.join()&&e.extend(s,o.transparent),i):o[t]}function a(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}var o,r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),h=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],c=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={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"}}}},d={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},p=c.support={},f=e("<p>")[0],g=e.each;f.style.cssText="background-color:rgba(1,1,1,.5)",p.rgba=f.style.backgroundColor.indexOf("rgba")>-1,g(u,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),c.fn=e.extend(c.prototype,{parse:function(i,a,r,h){if(void 0===i)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=e(i).css(a),a=void 0);var l=this,d=e.type(i),p=this._rgba=[];return void 0!==a&&(i=[i,a,r,h],d="array"),"string"===d?this.parse(n(i)||o._default):"array"===d?(g(u.rgba.props,function(t,e){p[e.idx]=s(i[e.idx],e)}),this):"object"===d?(g(u,i instanceof c?function(t,e){i[e.cache]&&(l[e.cache]=i[e.cache].slice())}:function(e,n){var a=n.cache;g(n.props,function(t,e){if(!l[a]&&n.to){if("alpha"===t||null==i[t])return;l[a]=n.to(l._rgba)}l[a][e.idx]=s(i[t],e,!0)}),l[a]&&t.inArray(null,l[a].slice(0,3))<0&&(l[a][3]=1,n.from&&(l._rgba=n.from(l[a])))}),this):void 0},is:function(t){var e=c(t),i=!0,s=this;return g(u,function(t,n){var a,o=e[n.cache];return o&&(a=s[n.cache]||n.to&&n.to(s._rgba)||[],g(n.props,function(t,e){if(null!=o[e.idx])return i=o[e.idx]===a[e.idx]})),i}),i},_space:function(){var t=[],e=this;return g(u,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var i=c(t),n=i._space(),a=u[n],o=0===this.alpha()?c("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return i=i[a.cache],g(a.props,function(t,n){var a=n.idx,o=r[a],l=i[a],c=d[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=s((l-o)*e+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=c(t)._rgba;return c(e.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),c.fn.parse.prototype=c.fn,u.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===u||1===u?u:u<=.5?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},u.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],n=t[3],o=s<=.5?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*a(r,o,e+1/3)),Math.round(255*a(r,o,e)),Math.round(255*a(r,o,e-1/3)),n]},g(u,function(t,i){var n=i.props,a=i.cache,o=i.to,r=i.from;c.fn[t]=function(t){if(o&&!this[a]&&(this[a]=o(this._rgba)),void 0===t)return this[a].slice();var i,h=e.type(t),l="array"===h||"object"===h?t:arguments,u=this[a].slice();return g(n,function(t,e){var i=l["object"===h?t:e.idx];null==i&&(i=u[e.idx]),u[e.idx]=s(i,e)}),r?((i=c(r(u)))[a]=u,i):c(u)},g(n,function(i,s){c.fn[i]||(c.fn[i]=function(n){var a,o=e.type(n),r="alpha"===i?this._hsla?"hsla":"rgba":t,l=this[r](),c=l[s.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=e.type(n)),null==n&&s.empty?this:("string"===o&&(a=h.exec(n))&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1)),l[s.idx]=n,this[r](l)))})})}),g(r,function(t,i){e.cssHooks[i]={set:function(t,s){var a,o,r="";if("string"!==e.type(s)||(a=n(s))){if(s=c(a||s),!p.rgba&&1!==s._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(t){}s=s.blend(r&&"transparent"!==r?r:"_default")}s=s.toRgbaString()}try{t.style[i]=s}catch(t){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=c(t.elem,i),t.end=c(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}}),e.cssHooks.borderColor={expand:function(t){var e={};return g(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=e.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"}}(jQuery),function(){function e(){var e,i,s=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[t.camelCase(e)]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}var i=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.effects.animateClass=function(n,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){return{el:t(this),start:e.call(this)}}),(a=function(){t.each(i,function(t,e){n[e]&&o[e+"Class"](n[e])})})(),l=l.map(function(){return this.end=e.call(this.el[0]),this.diff=function(e,i){var n,a,o={};for(n in i)a=i[n],e[n]!==a&&(s[n]||!t.fx.step[n]&&isNaN(parseFloat(a))||(o[n]=a));return o}(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=jQuery.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,i,s,n){return i?t.effects.animateClass.call(this,{add:e},i,s,n):this._addClass(e)},_removeClass:t.fn.removeClass,removeClass:function(e,i,s,n){return i?t.effects.animateClass.call(this,{remove:e},i,s,n):void 0!==e?this._removeClass(e):this._removeClass()},_toggleClass:t.fn.toggleClass,toggleClass:function(e,i,s,n,a){return"boolean"==typeof i||void 0===i?s?t.effects.animateClass.call(this,i?{add:e}:{remove:e},s,n,a):this._toggleClass(e,i):t.effects.animateClass.call(this,{toggle:e},i,s,n)},switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects.effect[e]&&(!s||!t.effects[e])}t.extend(t.effects,{version:"1.9.2",save:function(t,e){for(var i=0;i<e.length;i++)null!==e[i]&&t.data("ui-effects-"+e[i],t[0].style[e[i]])},restore:function(t,e){var i,s;for(s=0;s<e.length;s++)null!==e[s]&&(void 0===(i=t.data("ui-effects-"+e[s]))&&(i=""),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(t){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){t.isFunction(a)&&a.call(s[0]),t.isFunction(e)&&e()}var s=t(this),a=n.complete,o=n.mode;(s.is(":hidden")?"hide"===o:"show"===o)?i():r.call(s[0],n,i)}var n=e.apply(this,arguments),a=n.mode,o=n.queue,r=t.effects.effect[n.effect],h=!r&&s&&t.effects[n.effect];return t.fx.off||!r&&!h?a?this[a](n.duration,n.complete):this.each(function(){n.complete&&n.complete.call(this)}):r?!1===o?this.each(i):this.queue(o||"fx",i):h.call(this,{options:n,duration:n.duration,callback:n.complete,mode:n.mode})},_show:t.fn.show,show:function(t){if(i(t))return this._show.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="show",this.effect.call(this,s)},_hide:t.fn.hide,hide:function(t){if(i(t))return this._hide.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="hide",this.effect.call(this,s)},__toggle:t.fn.toggle,toggle:function(s){if(i(s)||"boolean"==typeof s||t.isFunction(s))return this.__toggle.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),i={},t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,e){i[e]=function(e){return Math.pow(e,t+2)}}),t.extend(i,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(i,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?i(2*t)/2:1-i(-2*t+2)/2}})}(jQuery),function(t,e){var i=/up|down|vertical/,s=/up|left|vertical|horizontal/;t.effects.effect.blind=function(e,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,e.mode||"hide"),u=e.direction||"up",d=i.test(u),p=d?"height":"width",f=d?"top":"left",g=s.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),o=(a=t.effects.createWrapper(h).css({overflow:"hidden"}))[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&((a={opacity:1})[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),l&&(d/=Math.pow(2,p-1)),(a={})[v]=0,s=0;s<p;s++)(n={})[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=l?2*d:d/2;l&&((n={opacity:0})[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}}(jQuery),function(t,e){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h="show"===t.effects.setMode(o,e.mode||"hide"),l="vertical"===(e.direction||"vertical"),c=l?"height":"width",u=l?"top":"left",d={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),a=(n="IMG"===o[0].tagName?s:o)[c](),h&&(n.css(c,0),n.css(u,a/2)),d[c]=h?a:0,d[u]=h?0:a/2,n.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,i){function s(){v.push(this),v.length===c*u&&function(){d.css({visibility:"visible"}),t(v).remove(),p||d.hide();i()}()}var n,a,o,r,h,l,c=e.pieces?Math.round(Math.sqrt(e.pieces)):3,u=c,d=t(this),p="show"===t.effects.setMode(d,e.mode||"hide"),f=d.show().css("visibility","hidden").offset(),g=Math.ceil(d.outerWidth()/u),m=Math.ceil(d.outerHeight()/c),v=[];for(n=0;n<c;n++)for(r=f.top+n*m,l=n-(c-1)/2,a=0;a<u;a++)o=f.left+a*g,h=a-(u-1)/2,d.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*g,top:-n*m}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:m,left:o+(p?h*g:0),top:r+(p?l*m:0),opacity:p?0:1}).animate({left:o+(p?0:h*g),top:r+(p?0:l*m),opacity:p?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t,e){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}}(jQuery),function(t,e){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for(!o&&n.is(":visible")||(n.css("opacity",0).show(),u=1),s=1;s<l;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c="horizontal"!==r?o/100:1,u="vertical"!==r?o/100:1;n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c,width:l.width*u,outerHeight:l.outerHeight*c,outerWidth:l.outerWidth*u},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],d=t.effects.setMode(o,e.mode||"effect"),p=e.restore||"effect"!==d,f=e.scale||"both",g=e.origin||["middle","center"],m=o.css("position"),v=p?r:["position","top","bottom","left","right","overflow","opacity"],_={height:0,width:0,outerHeight:0,outerWidth:0};"show"===d&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===d?(o.from=e.to||_,o.to=e.from||s):(o.from=e.from||("show"===d?_:s),o.to=e.to||("hide"===d?_:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},"box"!==f&&"both"!==f||(a.from.y!==a.to.y&&(v=v.concat(c),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),a.from.x!==a.to.x&&(v=v.concat(u),o.from=t.effects.setTransition(o,u,a.from.x,o.from),o.to=t.effects.setTransition(o,u,a.to.x,o.to))),"content"!==f&&"both"!==f||a.from.y!==a.to.y&&(v=v.concat(l).concat(h),o.from=t.effects.setTransition(o,l,a.from.y,o.from),o.to=t.effects.setTransition(o,l,a.to.y,o.to)),t.effects.save(o,v),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),"content"!==f&&"both"!==f||(c=c.concat(["marginTop","marginBottom"]).concat(l),u=u.concat(["marginLeft","marginRight"]),h=r.concat(c).concat(u),o.find("*[width]").each(function(){var i=t(this),s=i.height(),n=i.width(),o=i.outerHeight(),r=i.outerWidth();p&&t.effects.save(i,h),i.from={height:s*a.from.y,width:n*a.from.x,outerHeight:o*a.from.y,outerWidth:r*a.from.x},i.to={height:s*a.to.y,width:n*a.to.x,outerHeight:s*a.to.y,outerWidth:n*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,c,a.from.y,i.from),i.to=t.effects.setTransition(i,c,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,u,a.from.x,i.from),i.to=t.effects.setTransition(i,u,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){p&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===d&&o.hide(),t.effects.restore(o,v),p||("static"===m?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;s<l;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t,e){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery);
;Dependency._js['lib/jquery/jquery-ui']=true;

;
!function(n,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):n.printStackTrace=e()}(this,function(){function n(e){var t=(e=e||{guess:!0}).e||null,r=!!e.guess,o=e.mode||null,c=new n.implementation,s=c.run(t,o);return r?c.guessAnonymousFunctions(s):s}return n.implementation=function(){},n.implementation.prototype={run:function(n,e){return n=n||this.createException(),"other"===(e=e||this.mode(n))?this.other(arguments.callee):this[e](n)},createException:function(){try{this.undef()}catch(n){return n}},mode:function(n){return"undefined"!=typeof window&&window.navigator.userAgent.indexOf("PhantomJS")>-1?"phantomjs":n.arguments&&n.stack?"chrome":n.stack&&n.sourceURL?"safari":n.stack&&n.number?"ie":n.stack&&n.fileName?"firefox":n.message&&n["opera#sourceloc"]?n.stacktrace?n.message.indexOf("\n")>-1&&n.message.split("\n").length>n.stacktrace.split("\n").length?"opera9":"opera10a":"opera9":n.message&&n.stack&&n.stacktrace?n.stacktrace.indexOf("called from line")<0?"opera10b":"opera11":n.stack&&!n.fileName?"chrome":"other"},instrumentFunction:function(e,t,r){var o=(e=e||window)[t];e[t]=function(){return r.call(this,n().slice(4)),e[t]._instrumented.apply(this,arguments)},e[t]._instrumented=o},deinstrumentFunction:function(n,e){n[e].constructor===Function&&n[e]._instrumented&&n[e]._instrumented.constructor===Function&&(n[e]=n[e]._instrumented)},chrome:function(n){return(n.stack+"\n").replace(/^[\s\S]+?\s+at\s+/," at ").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}() ($1)$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}() ($1)").replace(/^(.+) \((.+)\)$/gm,"$1@$2").split("\n").slice(0,-1)},safari:function(n){return n.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},ie:function(n){return n.stack.replace(/^\s*at\s+(.*)$/gm,"$1").replace(/^Anonymous function\s+/gm,"{anonymous}() ").replace(/^(.+)\s+\((.+)\)$/gm,"$1@$2").split("\n").slice(1)},firefox:function(n){return n.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^(?:\((\S*)\))?@/gm,"{anonymous}($1)@").split("\n")},opera11:function(n){for(var e=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o+=2){var s=e.exec(t[o]);if(s){var i=s[4]+":"+s[1]+":"+s[2],a=s[3]||"global code";a=a.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,"{anonymous}"),r.push(a+"@"+i+" -- "+t[o+1].replace(/^\s+/,""))}}return r},opera10b:function(n){for(var e=/^(.*)@(.+):(\d+)$/,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o++){var s=e.exec(t[o]);if(s){var i=s[1]?s[1]+"()":"global code";r.push(i+"@"+s[2]+":"+s[3])}}return r},opera10a:function(n){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o+=2){var s=e.exec(t[o]);if(s){var i=s[3]||"{anonymous}";r.push(i+"()@"+s[2]+":"+s[1]+" -- "+t[o+1].replace(/^\s+/,""))}}return r},opera9:function(n){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,t=n.message.split("\n"),r=[],o=2,c=t.length;o<c;o+=2){var s=e.exec(t[o]);s&&r.push("{anonymous}()@"+s[2]+":"+s[1]+" -- "+t[o+1].replace(/^\s+/,""))}return r},phantomjs:function(n){for(var e=/(\S+) \((\S+)\)/i,t=n.stack.split("\n"),r=[],o=1,c=t.length;o<c;o++){t[o]=t[o].replace(/^\s+at\s+/gm,"");var s=e.exec(t[o]);s?r.push(s[1]+"()@"+s[2]):r.push("{anonymous}()@"+t[o])}return r},other:function(n){for(var e,t,r=/function(?:\s+([\w$]+))?\s*\(/,o=[],c=Array.prototype.slice;n&&o.length<10;){e=r.test(n.toString())&&RegExp.$1||"{anonymous}";try{t=c.call(n.arguments||[])}catch(n){t=["Cannot access arguments: "+n]}o[o.length]=e+"("+this.stringifyArguments(t)+")";try{n=n.caller}catch(n){o[o.length]="Cannot access caller: "+n;break}}return o},stringifyArguments:function(n){for(var e=[],t=Array.prototype.slice,r=0;r<n.length;++r){var o=n[r];void 0===o?e[r]="undefined":null===o?e[r]="null":o.constructor&&(o.constructor===Array?o.length<3?e[r]="["+this.stringifyArguments(o)+"]":e[r]="["+this.stringifyArguments(t.call(o,0,1))+"..."+this.stringifyArguments(t.call(o,-1))+"]":o.constructor===Object?e[r]="#object":o.constructor===Function?e[r]="#function":o.constructor===String?e[r]='"'+o+'"':o.constructor===Number?e[r]=o:e[r]="?")}return e.join(",")},sourceCache:{},ajax:function(n){var e=this.createXMLHTTPObject();if(e)try{return e.open("GET",n,!1),e.send(null),e.responseText}catch(n){}return""},createXMLHTTPObject:function(){for(var n,e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=0;t<e.length;t++)try{return n=e[t](),this.createXMLHTTPObject=e[t],n}catch(n){}},isSameDomain:function(n){return"undefined"!=typeof location&&-1!==n.indexOf(location.hostname)},getSource:function(n){return n in this.sourceCache||(this.sourceCache[n]=this.ajax(n).split("\n")),this.sourceCache[n]},guessAnonymousFunctions:function(n){for(var e=0;e<n.length;++e){var t=n[e],r=/\{anonymous\}\(.*\)@(.*)/.exec(t);if(r){var o=/^(.*?)(?::(\d+))(?::(\d+))?(?: -- .+)?$/.exec(r[1]);if(o){var c=o[1],s=o[2],i=o[3]||0;if(c&&this.isSameDomain(c)&&s){var a=this.guessAnonymousFunction(c,s,i);n[e]=t.replace("{anonymous}",a)}}}}return n},guessAnonymousFunction:function(n,e,t){var r;try{r=this.findFunctionName(this.getSource(n),e)}catch(e){r="getSource failed with url: "+n+", exception: "+e.toString()}return r},findFunctionName:function(n,e){for(var t,r,o,c=/function\s+([^(]*?)\s*\(([^)]*)\)/,s=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,a="",u=Math.min(e,20),l=0;l<u;++l)if((o=(t=n[e-l-1]).indexOf("//"))>=0&&(t=t.substr(0,o)),t){if(a=t+a,(r=s.exec(a))&&r[1])return r[1];if((r=c.exec(a))&&r[1])return r[1];if((r=i.exec(a))&&r[1])return r[1]}return"(?)"}},n});
;Dependency._js['lib/stacktrace/stacktrace']=true;

;
"undefined"!=typeof Dependency&&"function"==typeof Dependency.addJS&&Dependency.addJS("lib/stacktrace/stacktrace"),function(){var e=window.onerror;window.onerror=function(r,t,n,a,o){window.printStackTrace=window.printStackTrace||function(e){return o.stack?o.stack.split("\n"):[]};var i=window.printStackTrace({e:o});if((window.XPLAN.debugmode||window.XPLAN.errormode)&&function(e){var r=jQuery.map(e,function(e){return jQuery("<div>").text(e)[0].outerHTML}).join("");this.$warning_banner=jQuery("#jquery-error-banner"),this.$warning_banner.length?this.$warning_banner.find("ul").append("<li>"+r+"</li>"):jQuery(function(e){return"<div id='jquery-error-banner'><div class='container'><div class='col col-8 float-left'><p class='title'>&gt;_&lt;</p><p class='sub-title'>JavaScript errors were detected when rendering this page.</p><p class='comment'>You are seeing this because there are errors either in relevant javascript code, or in backend code that supports and renders the current page.</p><p class='comment'>Please take time to read through the traceback and report errors accordingly.</p><p class='sub-title'>Tracebacks:</p><ul class='traceback'><li>"+e+"</li></ul></div><div class='col col-2 float-right'><div class='sub-title'>Report to JIRA</div><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51528'>Create a Client Focus Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51529'>Create a Portfolio Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51530'>Create an eApps Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51533'>I am not sure</a></div></div></div>"}(r)).prependTo(document.body)}(i),window.XMLRPC&&XMLRPC.call("response.report_jserror",[r,t,n,a,navigator.userAgent,i.join("\n"),function(){var e=[],r=window;try{for(;r.parent.document&&r.parent!=r;)e.unshift(r.location.href),r=r.parent;return e.unshift(r.location.href),e}catch(e){return r.location.href}}()]),e&&e(r,t,n),window.console&&window.console.log){if(window.console.log("reporting unhandled error",r,t,n),window.XPLAN.debugmode)throw o;return!0}return!1}}();
;Dependency._js['error_reporter']=true;

;
jQuery(window).on("load",function(o){if(window.flightcontrol_Load_Start_Time){var t=(new Date).getTime()-window.flightcontrol_Load_Start_Time.getTime();window.setTimeout(function(){window.XMLRPC&&XMLRPC.call("response.report_loadtime",[t,window.location.pathname],function(){})},20)}});
;Dependency._js['loadtime_tracker']=true;

;
(function(){function n(n,r,t){for(var e=(t||0)-1,u=n?n.length:0;++e<u;)if(n[e]===r)return e;return-1}function r(n,r){for(var t=n.criteria,e=r.criteria,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||"undefined"==typeof i)return 1;if(i<f||"undefined"==typeof f)return-1}}return n.index-r.index}function t(n){return"\\"+yn[n]}function e(n,r,t){r||(r=0),"undefined"==typeof t&&(t=n?n.length:0);for(var e=-1,u=t-r||0,o=Array(u<0?0:u);++e<u;)o[e]=n[r+e];return o}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n}function i(n){var r=n[0],t=n[2],u=n[4];return function n(){if(t){var o=e(t);Nn.apply(o,arguments)}if(this instanceof n){var i=f(r.prototype),a=r.apply(i,o||arguments);return S(a)?a:i}return r.apply(u,o||arguments)}}function f(n,r){return S(n)?kn(n):{}}function a(n,r,t){if("function"!=typeof n)return X;if("undefined"==typeof r||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return K(n,r)}function l(n){var r=n[0],t=n[1],u=n[2],o=n[3],i=n[4],a=n[5],c=1&t,p=2&t,s=4&t,v=8&t,h=r;return function n(){var y=c?i:this;if(u){var g=e(u);Nn.apply(g,arguments)}if((o||s)&&(g||(g=e(arguments)),o&&Nn.apply(g,o),s&&g.length<a))return t|=16,l([r,v?t:-4&t,g,null,i,a]);if(g||(g=arguments),p&&(r=y[h]),this instanceof n){y=f(r.prototype);var _=r.apply(y,g);return S(_)?_:y}return r.apply(y,g)}}function c(n,r){for(var t=-1,e=_(),u=n?n.length:0,o=[];++t<u;){var i=n[t];e(r,i)<0&&o.push(i)}return o}function p(n,r,t,e){for(var u=(e||0)-1,o=n?n.length:0,i=[];++u<o;){var f=n[u];if(f&&"object"==typeof f&&"number"==typeof f.length&&(Cn(f)||b(f))){r||(f=p(f,r,t));var a=-1,l=f.length,c=i.length;for(i.length+=l;++a<l;)i[c++]=f[a]}else t||i.push(f)}return i}function s(n,r){return n+Sn($n()*(r-n+1))}function v(n,r,t){for(var e=-1,u=_(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:u(f,l)<0)&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Q(t,e,3);var o=-1,i=r?r.length:0;if("number"==typeof i)for(;++o<i;){var f=r[o];n(u,f,t(f,o,r),r)}else Kn(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function y(n,r,t,e,u,o){var f=16&r,a=32&r;if(!(2&r)&&!A(n))throw new TypeError;return f&&!t.length&&(r&=-17,f=t=!1),a&&!e.length&&(r&=-33,a=e=!1),(1==r||17===r?i:l)([n,r,t,e,u,o])}function g(n){return Un[n]}function _(){var r=(r=u.indexOf)===V?n:r;return r}function d(n){return"function"==typeof n&&En.test(n)}function m(n){return Vn[n]}function b(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Tn.call(n)==on||!1}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function j(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function x(n){var r=[];return Jn(n,function(n,t){A(n)&&r.push(t)}),r.sort()}function T(n){for(var r=-1,t=Pn(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function E(n){if(!n)return!0;if(Cn(n)||N(n))return!n.length;for(var r in n)if(On.call(n,r))return!1;return!0}function A(n){return"function"==typeof n}function S(n){return!(!n||!hn[typeof n])}function O(n){return"number"==typeof n||n&&"object"==typeof n&&Tn.call(n)==cn||!1}function N(n){return"string"==typeof n||n&&"object"==typeof n&&Tn.call(n)==vn||!1}function R(n){for(var r=-1,t=Pn(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function k(n,r){var t=_(),e=n?n.length:0,u=!1;return e&&"number"==typeof e?u=t(n,r)>-1:Kn(n,function(n){return(u=n===r)&&rn}),u}function B(n,r,t){var e=!0;r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&(e=!!r(n[u],u,n)););else Kn(n,function(n,t,u){return!(e=!!r(n,t,u))&&rn});return e}function F(n,r,t){var e=[];r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o;){var i=n[u];r(i,u,n)&&e.push(i)}else Kn(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function q(n,r,t){r=Q(r,t,3);var e,u=-1,o=n?n.length:0;if("number"!=typeof o)return Kn(n,function(n,t,u){if(r(n,t,u))return e=n,rn}),e;for(;++u<o;){var i=n[u];if(r(i,u,n))return i}}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&"undefined"==typeof t?r:a(r,t,3),"number"==typeof u)for(;++e<u&&r(n[e],e,n)!==rn;);else Kn(n,r)}function I(n,r,t){var e=-1,u=n?n.length:0;if(r=Q(r,t,3),"number"==typeof u)for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Kn(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function M(n,r,t){var e=-1/0,u=e;"function"!=typeof r&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&"number"==typeof i)for(;++o<i;){var f=n[o];f>u&&(u=f)}else r=Q(r,t,3),D(n,function(n,t,o){var i=r(n,t,o);i>e&&(e=i,u=n)});return u}function $(n,r,t,e){if(!n)return t;var u=arguments.length<3;r=Q(r,e,4);var o=-1,i=n.length;if("number"==typeof i)for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Kn(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function W(n,r,t,e){var u=arguments.length<3;return r=Q(r,e,4),function(n,r){var t=n?n.length:0;if("number"==typeof t)for(;t--&&!1!==r(n[t],t,n););else{var e=Pn(n);t=e.length,Kn(n,function(n,u,o){return u=e?e[--t]:--t,!1===r(o[u],u,o)&&rn})}}(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function z(n){var r=-1,t=n?n.length:0,e=Array("number"==typeof t?t:0);return D(n,function(n){var t=s(0,++r);e[r]=e[t],e[t]=n}),e}function C(n,r,t){var e;r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&!(e=r(n[u],u,n)););else Kn(n,function(n,t,u){return(e=r(n,t,u))&&rn});return!!e}function P(n,r,t){return t&&E(r)?Z:(t?q:F)(n,r)}function U(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=-1;for(r=Q(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(null==(u=r)||t)return n?n[0]:Z;return e(n,0,Mn(In(0,u),o))}function V(r,t,e){if("number"==typeof e){var u=r?r.length:0;e=e<0?In(0,u+e):e||0}else if(e){var o=H(r,t);return r[o]===t?o:-1}return n(r,t,e)}function G(n,r,t){if("number"!=typeof r&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:In(0,r);return e(n,u)}function H(n,r,t,e){var u=0,o=n?n.length:u;for(r=(t=t?Q(t,e,1):X)(r);u<o;){var i=u+o>>>1;t(n[i])<r?u=i+1:o=i}return u}function J(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(t=Q(t,e,3)),v(n,r,t)}function K(n,r){return arguments.length>2?y(n,17,e(arguments,2),null,r):y(n,1,null,null,r)}function L(n,r,t){var e,u,o,i,f,a,l,c=0,p=!1,s=!0;if(!A(n))throw new TypeError;if(r=In(0,r)||0,!0===t){var v=!0;s=!1}else S(t)&&(v=t.leading,p="maxWait"in t&&(In(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(Zn()-i);if(t<=0){u&&clearTimeout(u);var p=l;u=a=l=Z,p&&(c=Zn(),o=n.apply(f,e),a||u||(e=f=null))}else a=setTimeout(h,t)},y=function(){a&&clearTimeout(a),u=a=l=Z,(s||p!==r)&&(c=Zn(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=Zn(),f=this,l=s&&(a||!v),!1===p)var t=v&&!a;else{u||v||(c=i);var g=p-(i-c),_=g<=0;_?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(y,g))}return _&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(_=!0,o=n.apply(f,e)),!_||a||u||(e=f=null),o}}function Q(n,r,t){var e,u=typeof n;if(null==n||"function"==u)return a(n,r,t);if("object"!=u)return e=n,function(n){return n[e]};var o=Pn(n);return function(r){for(var t=o.length,e=!1;t--&&(e=r[o[t]]===n[o[t]]););return e}}function X(n){return n}function Y(n){D(x(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];Nn.apply(n,arguments);var r=t.apply(u,n);return this.__chain__?new o(r,!0):r}})}var Z,nn=0,rn={},tn=+new Date+"",en=/($^)/,un=/['\n\r\t\u2028\u2029\\]/g,on="[object Arguments]",fn="[object Array]",an="[object Boolean]",ln="[object Date]",cn="[object Number]",pn="[object Object]",sn="[object RegExp]",vn="[object String]",hn={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},yn={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},gn=hn[typeof window]&&window||this,_n=hn[typeof exports]&&exports&&!exports.nodeType&&exports,dn=hn[typeof module]&&module&&!module.nodeType&&module,mn=dn&&dn.exports===_n&&_n,bn=hn[typeof global]&&global;!bn||bn.global!==bn&&bn.window!==bn||(gn=bn);var wn=[],jn=Object.prototype,xn=gn._,Tn=jn.toString,En=RegExp("^"+String(Tn).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),An=Math.ceil,Sn=Math.floor,On=jn.hasOwnProperty,Nn=wn.push,Rn=jn.propertyIsEnumerable,kn=d(kn=Object.create)&&kn,Bn=d(Bn=Array.isArray)&&Bn,Fn=gn.isFinite,qn=gn.isNaN,Dn=d(Dn=Object.keys)&&Dn,In=Math.max,Mn=Math.min,$n=Math.random;o.prototype=u.prototype;var Wn,zn={};Wn={0:1,length:1},zn.spliceObjects=(wn.splice.call(Wn,0,1),!Wn[0]),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},kn||(f=function(){function n(){}return function(r){if(S(r)){n.prototype=r;var t=new n;n.prototype=null}return t||gn.Object()}}()),b(arguments)||(b=function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&On.call(n,"callee")&&!Rn.call(n,"callee")||!1});var Cn=Bn||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Tn.call(n)==fn||!1},Pn=Dn?function(n){return S(n)?Dn(n):[]}:function(n){var r,t=n,e=[];if(!t)return e;if(!hn[typeof n])return e;for(r in t)On.call(t,r)&&e.push(r);return e},Un={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Vn=T(Un),Gn=RegExp("("+Pn(Vn).join("|")+")","g"),Hn=RegExp("["+Pn(Un).join("")+"]","g"),Jn=function(n,r){var t,e=n,u=e;if(!e)return u;if(!hn[typeof e])return u;for(t in e)if(r(e[t],t,n)===rn)return u;return u},Kn=function(n,r){var t,e=n,u=e;if(!e)return u;if(!hn[typeof e])return u;for(t in e)if(On.call(e,t)&&r(e[t],t,n)===rn)return u;return u};A(/x/)&&(A=function(n){return"function"==typeof n&&"[object Function]"==Tn.call(n)});var Ln=h(function(n,r,t){On.call(n,t)?n[t]++:n[t]=1}),Qn=h(function(n,r,t){(On.call(n,t)?n[t]:n[t]=[]).push(r)}),Xn=h(function(n,r,t){n[t]=r}),Yn=I,Zn=d(Zn=Date.now)&&Zn||function(){return(new Date).getTime()};u.after=function(n,r){if(!A(r))throw new TypeError;return function(){if(--n<1)return r.apply(this,arguments)}},u.bind=K,u.bindAll=function(n){for(var r=arguments.length>1?p(arguments,!0,!1,1):x(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=y(n[u],1,null,null,n)}return n},u.chain=function(n){return(n=new o(n)).__chain__=!0,n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!A(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Ln,u.debounce=L,u.defaults=j,u.defer=function(n){if(!A(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(Z,r)},1)},u.delay=function(n,r){if(!A(n))throw new TypeError;var t=e(arguments,2);return setTimeout(function(){n.apply(Z,t)},r)},u.difference=function(n){return c(n,p(arguments,!0,!0,1))},u.filter=F,u.flatten=function(n,r){return p(n,r)},u.forEach=D,u.functions=x,u.groupBy=Qn,u.indexBy=Xn,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,Mn(In(0,o-u),o))},u.intersection=function(){for(var n=[],r=-1,t=arguments.length;++r<t;){var e=arguments[r];(Cn(e)||b(e))&&n.push(e)}var u=n[0],o=-1,i=_(),f=u?u.length:0,a=[];n:for(;++o<f;)if(i(a,e=u[o])<0){for(r=t;--r;)if(i(n[r],e)<0)continue n;a.push(e)}return a},u.invert=T,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o="function"==typeof r,i=n?n.length:0,f=Array("number"==typeof i?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Pn,u.map=I,u.max=M,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):tn+arguments[0];return On.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;"function"!=typeof r&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&"number"==typeof i)for(;++o<i;){var f=n[o];f<u&&(u=f)}else r=Q(r,t,3),D(n,function(n,t,o){var i=r(n,t,o);i<e&&(e=i,u=n)});return u},u.omit=function(n){var r=[];Jn(n,function(n,t){r.push(t)});for(var t=-1,e=(r=c(r,p(arguments,!0,!1,1))).length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!A(n))throw new TypeError;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},u.pairs=function(n){for(var r=-1,t=Pn(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return y(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,!0,!1,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=Yn,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);for(var e=-1,u=In(0,An((r-n)/t)),o=Array(u);++e<u;)o[e]=n,n+=t;return o},u.reject=function(n,r,t){return r=Q(r,t,3),F(n,function(n,t,e){return!r(n,t,e)})},u.rest=G,u.shuffle=z,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array("number"==typeof o?o:0);for(t=Q(t,e,3),D(n,function(n,r,e){i[++u]={criteria:[t(n,r,e)],index:u,value:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].value;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=!0,u=!0;if(!A(n))throw new TypeError;return!1===t?e=!1:S(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),(t={}).leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},u.times=function(n,r,t){n=(n=+n)>-1?n:0;var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cn(n)?e(n):n&&"number"==typeof n.length?I(n):R(n)},u.union=function(){return v(p(arguments,!0,!0))},u.uniq=J,u.values=R,u.where=P,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return y(r,16,[n])},u.zip=function(){for(var n=-1,r=M(Yn(arguments,"length")),t=Array(r<0?0:r);++n<r;)t[n]=Yn(arguments,n);return t},u.collect=I,u.drop=G,u.each=D,u.extend=w,u.methods=x,u.object=function(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Cn(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=F,u.tail=G,u.unique=J,u.clone=function(n){return S(n)?Cn(n)?e(n):w({},n):n},u.contains=k,u.escape=function(n){return null==n?"":String(n).replace(Hn,g)},u.every=B,u.find=q,u.has=function(n,r){return!!n&&On.call(n,r)},u.identity=X,u.indexOf=V,u.isArguments=b,u.isArray=Cn,u.isBoolean=function(n){return!0===n||!1===n||n&&"object"==typeof n&&Tn.call(n)==an||!1},u.isDate=function(n){return n&&"object"==typeof n&&Tn.call(n)==ln||!1},u.isElement=function(n){return n&&1===n.nodeType||!1},u.isEmpty=E,u.isEqual=function(n,r){return function n(r,t,e,o){if(r===t)return 0!==r||1/r==1/t;var i=typeof t;if(!(r!=r||r&&hn[typeof r]||t&&hn[i]))return!1;if(null==r||null==t)return r===t;var f=Tn.call(r);if(f!=Tn.call(t))return!1;switch(f){case an:case ln:return+r==+t;case cn:return r!=+r?t!=+t:0==r?1/r==1/t:r==+t;case sn:case vn:return r==String(t)}var a=f==fn;if(!a){var l=r instanceof u,c=t instanceof u;if(l||c)return n(l?r.__wrapped__:r,c?t.__wrapped__:t,e,o);if(f!=pn)return!1;var p=r.constructor,s=t.constructor;if(p!=s&&!(A(p)&&p instanceof p&&A(s)&&s instanceof s)&&"constructor"in r&&"constructor"in t)return!1}e||(e=[]),o||(o=[]);for(var v=e.length;v--;)if(e[v]==r)return o[v]==t;var h=!0,y=0;if(e.push(r),o.push(t),a){if(y=t.length,h=y==r.length)for(;y--&&(h=n(r[y],t[y],e,o)););}else Jn(t,function(t,u,i){if(On.call(i,u))return y++,!(h=On.call(r,u)&&n(r[u],t,e,o))&&rn}),h&&Jn(r,function(n,r,t){if(On.call(t,r))return!(h=--y>-1)&&rn});return e.pop(),o.pop(),h}(n,r)},u.isFinite=function(n){return Fn(n)&&!qn(parseFloat(n))},u.isFunction=A,u.isNaN=function(n){return O(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=O,u.isObject=S,u.isRegExp=function(n){return n&&hn[typeof n]&&Tn.call(n)==sn||!1},u.isString=N,u.isUndefined=function(n){return"undefined"==typeof n},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for("number"==typeof t&&(e=(t<0?In(0,e+t):Mn(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=Y,u.noConflict=function(){return gn._=xn,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Sn($n()*(r-n+1))},u.reduce=$,u.reduceRight=W,u.result=function(n,r){if(n){var t=n[r];return A(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return"number"==typeof r?r:Pn(n).length},u.some=C,u.sortedIndex=H,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=String(n||"");var f=0,a="__p += '",l=(e=j({},e,i)).variable,c=RegExp((e.escape||en).source+"|"+(e.interpolate||en).source+"|"+(e.evaluate||en).source+"|$","g");n.replace(c,function(r,e,u,o,i){return a+=n.slice(f,i).replace(un,t),e&&(a+="' +\n_.escape("+e+") +\n'"),o&&(a+="';\n"+o+";\n__p += '"),u&&(a+="' +\n((__t = ("+u+")) == null ? '' : __t) +\n'"),f=i+r.length,r}),a+="';\n",l||(a="with ("+(l="obj")+" || {}) {\n"+a+"\n}\n"),a="function("+l+") {\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n"+a+"return __p\n}";try{var p=Function("_","return "+a)(o)}catch(n){throw n.source=a,n}return r?p(r):(p.source=a,p)},u.unescape=function(n){return null==n?"":String(n).replace(Gn,m)},u.uniqueId=function(n){var r=++nn+"";return n?n+r:r},u.all=B,u.any=C,u.detect=q,u.findWhere=function(n,r){return P(n,r,!0)},u.foldl=$,u.foldr=W,u.include=k,u.inject=$,u.first=U,u.last=function(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else if(null==(u=r)||t)return n?n[o-1]:Z;return e(n,In(0,o-u))},u.sample=function(n,r,t){if(n&&"number"!=typeof n.length&&(n=R(n)),null==r||t)return n?n[s(0,n.length-1)]:Z;var e=z(n);return e.length=Mn(In(0,r),e.length),e},u.take=U,u.head=U,Y(u),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=!0,this},u.prototype.value=function(){return this.__wrapped__},D(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=wn[n];u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zn.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=wn[n];u.prototype[n]=function(){var n=this.__wrapped__,t=r.apply(n,arguments);return this.__chain__&&((t=new o(t)).__chain__=!0),t}}),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(gn._=u,define(function(){return u})):_n&&dn?mn?(dn.exports=u)._=u:_n._=u:gn._=u}).call(this);
;Dependency._js['lib/backbone/underscore']=true;

;
!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;r<n.length;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(n<1)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;l<g;l++)if("string"===(d=e(t[l])))m.push(t[l]);else if("array"===d){if((a=t[l])[2])for(i=u[p],o=0;o<a[2].length;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return(e=null==e?"":n(e)).charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),(r=~~r)>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e);for(var t=0,u=0,i=(r=n(r)).length;-1!==(u=e.indexOf(r,u));)t++,u+=i;return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r||null!=e&&-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r||null!=e&&null!=r&&(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r||null!=e&&null!=r&&(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e)).slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1)},titleize:function(e){return null==e?"":(e=n(e).toLowerCase()).replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()})},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",e.length<=r)return e;var u=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "});return((u=u.slice(u.length-2).match(/\w\w/)?u.replace(/\s*\S+$/,""):g.rtrim(u.slice(0,u.length-1)))+t).length>e.length?e:e.slice(0,u.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e)).match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):NaN:0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(t,function(e){var n=r.indexOf(e);return"aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz".charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;o<l;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return a<c?-1:1}}return u.length===i.length?u.length-i.length:e<r?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;l<=r.length;l++)for(var o=0;o<=e.length;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:!!r(e=g.trim(e),n||["true","1"])||!r(e,t||["false","0"])&&void 0}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String);
;Dependency._js['lib/backbone/underscore.string']=true;

;
!function(t,e){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(i,n,s){t.Backbone=e(t,s,i,n)});else if("undefined"!=typeof exports){var i,n=require("underscore");try{i=require("jquery")}catch(t){}e(t,exports,n,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,n){var s=t.Backbone,r=[],a=r.slice;e.VERSION="1.1.2",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o=e.Events={on:function(t,e,i){return c(this,"on",t,[e,i])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this}),this):this},once:function(t,e,n){if(!c(this,"once",t,[e,n])||!e)return this;var s=this,r=i.once(function(){s.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,n)},off:function(t,e,n){var s,r,a,o,h,u,l,d;if(!this._events||!c(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events=void 0,this;for(h=0,u=(o=t?[t]:i.keys(this._events)).length;h<u;h++)if(t=o[h],a=this._events[t]){if(this._events[t]=s=[],e||n)for(l=0,d=a.length;l<d;l++)r=a[l],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&s.push(r);s.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=a.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t],n=this._events.all;return i&&u(i,e),n&&u(n,arguments),this},stopListening:function(t,e,n){var s=this._listeningTo;if(!s)return this;var r=!e&&!n;for(var a in n||"object"!=typeof e||(n=this),t&&((s={})[t._listenId]=t),s)(t=s[a]).off(e,n,this),(r||i.isEmpty(t._events))&&delete this._listeningTo[a];return this}},h=/\s+/,c=function(t,e,i,n){if(!i)return!0;if("object"==typeof i){for(var s in i)t[e].apply(t,[s,i[s]].concat(n));return!1}if(h.test(i)){for(var r=i.split(h),a=0,o=r.length;a<o;a++)t[e].apply(t,[r[a]].concat(n));return!1}return!0},u=function(t,e){var i,n=-1,s=t.length,r=e[0],a=e[1],o=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a,o);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}};i.each({listenTo:"on",listenToOnce:"once"},function(t,e){o[e]=function(e,n,s){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=i.uniqueId("l"))]=e,s||"object"!=typeof n||(s=this),e[t](n,s,this),this}}),o.bind=o.on,o.unbind=o.off,i.extend(e,o);var l=e.Model=function(t,e){var n=t||{};e||(e={}),this.cid=i.uniqueId("c"),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{}),n=i.defaults({},n,i.result(this,"defaults")),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(l.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,n){var s,r,a,o,h,c,u,l;if(null==t)return this;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;for(s in a=n.unset,h=n.silent,o=[],c=this._changing,this._changing=!0,c||(this._previousAttributes=i.clone(this.attributes),this.changed={}),l=this.attributes,u=this._previousAttributes,this.idAttribute in r&&(this.id=r[this.idAttribute]),r)e=r[s],i.isEqual(l[s],e)||o.push(s),i.isEqual(u[s],e)?delete this.changed[s]:this.changed[s]=e,a?delete l[s]:l[s]=e;if(!h){o.length&&(this._pending=n);for(var d=0,f=o.length;d<f;d++)this.trigger("change:"+o[d],this,l[o[d]],n)}if(c)return this;if(!h)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&i.clone(this.changed);var e,n=!1,s=this._changing?this._previousAttributes:this.attributes;for(var r in t)i.isEqual(s[r],e=t[r])||((n||(n={}))[r]=e);return n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){void 0===(t=t?i.clone(t):{}).parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){if(!e.set(e.parse(i,t),t))return!1;n&&n(e,i,t),e.trigger("sync",e,i,t)},R(this,t),this.sync("read",this,t)},save:function(t,e,n){var s,r,a,o=this.attributes;if(null==t||"object"==typeof t?(s=t,n=e):(s={})[t]=e,n=i.extend({validate:!0},n),s&&!n.wait){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;s&&n.wait&&(this.attributes=i.extend({},o,s)),void 0===n.parse&&(n.parse=!0);var h=this,c=n.success;return n.success=function(t){h.attributes=o;var e=h.parse(t,n);if(n.wait&&(e=i.extend(s||{},e)),i.isObject(e)&&!h.set(e,n))return!1;c&&c(h,t,n),h.trigger("sync",h,t,n)},R(this,n),"patch"===(r=this.isNew()?"create":n.patch?"patch":"update")&&(n.attrs=s),a=this.sync(r,this,n),s&&n.wait&&(this.attributes=o),a},destroy:function(t){var e=this,n=(t=t?i.clone(t):{}).success,s=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(i){(t.wait||e.isNew())&&s(),n&&n(e,i,t),e.isNew()||e.trigger("sync",e,i,t)},this.isNew())return t.success(),!1;R(this,t);var r=this.sync("delete",this,t);return t.wait||s(),r},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||N();return this.isNew()?t:t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1)}});i.each(["keys","values","pairs","invert","pick","omit"],function(t){l.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.attributes),i[t].apply(i,e)}});var d=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},f={add:!0,remove:!0,merge:!0},p={add:!0,remove:!1};i.extend(d.prototype,o,{model:l,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,p))},remove:function(t,e){var n,s,r,a,o=!i.isArray(t);for(t=o?[t]:i.clone(t),e||(e={}),n=0,s=t.length;n<s;n++)(a=t[n]=this.get(t[n]))&&(delete this._byId[a.id],delete this._byId[a.cid],r=this.indexOf(a),this.models.splice(r,1),this.length--,e.silent||(e.index=r,a.trigger("remove",a,this,e)),this._removeReference(a,e));return o?t[0]:t},set:function(t,e){(e=i.defaults({},e,f)).parse&&(t=this.parse(t,e));var n,s,r,a,o,h,c,u=!i.isArray(t);t=u?t?[t]:[]:i.clone(t);var d=e.at,p=this.model,g=this.comparator&&null==d&&!1!==e.sort,v=i.isString(this.comparator)?this.comparator:null,m=[],y=[],_={},b=e.add,w=e.merge,x=e.remove,E=!(g||!b||!x)&&[];for(n=0,s=t.length;n<s;n++){if(r=(o=t[n]||{})instanceof l?a=o:o[p.prototype.idAttribute||"id"],h=this.get(r))x&&(_[h.cid]=!0),w&&(o=o===a?a.attributes:o,e.parse&&(o=h.parse(o,e)),h.set(o,e),g&&!c&&h.hasChanged(v)&&(c=!0)),t[n]=h;else if(b){if(!(a=t[n]=this._prepareModel(o,e)))continue;m.push(a),this._addReference(a,e)}a=h||a,!E||!a.isNew()&&_[a.id]||E.push(a),_[a.id]=!0}if(x){for(n=0,s=this.length;n<s;++n)_[(a=this.models[n]).cid]||y.push(a);y.length&&this.remove(y,e)}if(m.length||E&&E.length)if(g&&(c=!0),this.length+=m.length,null!=d)for(n=0,s=m.length;n<s;n++)this.models.splice(d+n,0,m[n]);else{E&&(this.models.length=0);var k=E||m;for(n=0,s=k.length;n<s;n++)this.models.push(k[n])}if(c&&this.sort({silent:!0}),!e.silent){for(n=0,s=m.length;n<s;n++)(a=m[n]).trigger("add",a,this,e);(c||E&&E.length)&&this.trigger("sort",this,e)}return u?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,s=this.models.length;n<s;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return a.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){return i.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var i in t)if(t[i]!==e.get(i))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),i.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){void 0===(t=t?i.clone(t):{}).parse&&(t.parse=!0);var e=t.success,n=this;return t.success=function(i){var s=t.reset?"reset":"set";n[s](i,t),e&&e(n,i,t),n.trigger("sync",n,i,t)},R(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?i.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var n=this,s=e.success;return e.success=function(t,i){e.wait&&n.add(t,e),s&&s(t,i,e)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof l)return t;(e=e?i.clone(e):{}).collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_addReference:function(t,e){this._byId[t.cid]=t,null!=t.id&&(this._byId[t.id]=t),t.collection||(t.collection=this),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){("add"!==t&&"remove"!==t||i===this)&&("destroy"===t&&this.remove(e,n),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});i.each(["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"],function(t){d.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.models),i[t].apply(i,e)}});i.each(["groupBy","countBy","sortBy","indexBy"],function(t){d.prototype[t]=function(e,n){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,n)}});var g=e.View=function(t){this.cid=i.uniqueId("view"),t||(t={}),i.extend(this,i.pick(t,m)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},v=/^(\S+)\s*(.*)$/,m=["model","collection","el","id","attributes","className","tagName","events"];i.extend(g.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],!1!==i&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=i.result(this,"events")))return this;for(var e in this.undelegateEvents(),t){var n=t[e];if(i.isFunction(n)||(n=this[t[e]]),n){var s=e.match(v),r=s[1],a=s[2];n=i.bind(n,this),r+=".delegateEvents"+this.cid,""===a?this.$el.on(r,n):this.$el.on(r,a,n)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"),!1);else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t.class=i.result(this,"className"));var n=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(n,!1)}}}),e.sync=function(t,n,s){var r=_[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||N()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1),"PATCH"===a.type&&y&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var h=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,h,s),h};var y=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),_={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var b=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},w=/\((.*?)\)/g,x=/(\(\?)?:\w+/g,E=/\*\w+/g,k=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(b.prototype,o,{initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,function(i){var a=r._extractParameters(t,i);r.execute(s,a),r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(k,"\\$&").replace(w,"(?:$1)?").replace(x,function(t,e){return e?t:"([^/?]+)"}).replace(E,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var T=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},$=/^[#\/]|\s+$/g,S=/^\/+|\/+$/g,H=/msie [\w.]+/,A=/\/$/,I=/#.*$/;T.started=!1,i.extend(T.prototype,o,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(A,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace($,"")},start:function(t){if(T.started)throw new Error("Backbone.history has already been started");T.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),s=document.documentMode,r=H.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);if(this.root=("/"+this.root+"/").replace(S,"/"),r&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow,this.navigate(n)}this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=n;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&o.hash&&(this.fragment=this.getHash().replace($,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),T.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return t=this.fragment=this.getFragment(t),i.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0})},navigate:function(t,e){if(!T.started)return!1;e&&!0!==e||(e={trigger:!!e});var i=this.root+(t=this.getFragment(t||""));if(t=t.replace(I,""),this.fragment!==t){if(this.fragment=t,""===t&&"/"!==i&&(i=i.slice(0,-1)),this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new T;l.extend=d.extend=b.extend=g.extend=T.extend=function(t,e){var n,s=this;n=t&&i.has(t,"constructor")?t.constructor:function(){return s.apply(this,arguments)},i.extend(n,s,e);var r=function(){this.constructor=n};return r.prototype=s.prototype,n.prototype=new r,t&&i.extend(n.prototype,t),n.__super__=s.prototype,n};var N=function(){throw new Error('A "url" property or function must be specified')},R=function(t,e){var i=e.error;e.error=function(n){i&&i(t,n,e),t.trigger("error",t,n,e)}};return e});
;Dependency._js['lib/backbone/backbone']=true;

;
!function(t,e){"undefined"!=typeof exports?module.exports=e(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],e):e(t._,t.Backbone)}(this,function(t,e){function n(t,e,n){return t._super.prototype[e].apply(t,n)}function i(e,n,i,o){(i=i||{}).get&&v(i.get)&&(i._get=i.get),i.set&&v(i.set)&&(i._set=i.set),delete i.get,delete i.set,t.extend(this,i),this.model=e,this.name=n,this.deps=this.deps||[],o||this.init()}function o(e){return v(e)?e():(m(e)&&(e=t.clone(e),t.each(e,function(t,n){e[n]=o(t)})),e)}function r(t){return v(t)?{set:t}:t}function s(e){return function(){var n=arguments,i=v(e)?e:e.get,r=e.set;return function(e){return g(e)?i.apply(this,t.map(n,o)):n[0]((r||i).call(this,e))}}}function c(e,n,i,o,r){if(e=t.result(e,o))return y(e)?(r=r?r+"_":"",n["$"+o]=function(){return $&&$.push([e,"change"]),e},t.each(e.toJSON({computed:!0}),function(o,s){n[r+s]=function(n){return function(e,n,i,o){if($&&$.push([e,"change:"+n]),!g(i)){if(!m(i)||w(i)||t.isDate(i)){var r=i;(i={})[n]=r}return o&&o.save?e.save(i,o):e.set(i,o)}return e.get(n)}(e,s,n,i)}})):b(e)&&(n["$"+o]=function(){return $&&$.push([e,"reset add remove sort update"]),e}),e}function u(t,e){if(":el"===e)return t.$el;var n=t.$(e);return t.$el.is(e)&&(n=n.add(t.$el)),n}function h(e,n,i,o,r,s){try{var c=(V[i]||(V[i]=new Function("$f","$c","with($f){with($c){return{"+i+"}}}")))(s,o)}catch(t){throw'Error parsing bindings: "'+i+'"\n>> '+t}var u=t.map(t.union(c.events||[],["change"]),function(t){return t+".epoxy"}).join(" ");t.each(c,function(t,i){if(r.hasOwnProperty(i))e.b().push(new l(e,n,r[i],t,u,o,c));else if(!B.hasOwnProperty(i))throw'binding handler "'+i+'" is not defined.'})}function a(t,e,n){if(t&&t.hasOwnProperty(e))return g(n)?o(t[e]):t[e](n)}function l(e,n,i,r,s,c,u){var h=this,a=n[0].tagName.toLowerCase(),l="input"==a||"select"==a||"textarea"==a||"true"==n.prop("contenteditable"),f=[],d=function(t){h.$el&&h.set(h.$el,o(r),t)};if(h.view=e,h.$el=n,h.evt=s,t.extend(h,i),r=h.init(h.$el,o(r),c,u)||r,$=f,d(),$=null,l&&i.get&&v(r)&&h.$el.on(s,function(t){r(h.get(h.$el,o(r),t))}),f.length)for(var p=0,g=f.length;p<g;p++)h.listenTo(f[p][0],f[p][1],d)}var f,d=e.Epoxy={},p=Array.prototype,g=t.isUndefined,v=t.isFunction,m=t.isObject,w=t.isArray,y=function(t){return t instanceof e.Model},b=function(t){return t instanceof e.Collection},_=function(){},C={mixin:function(t){for(var e in t=t||{},this.prototype)"bindings"===e&&t.bindings||this.prototype.hasOwnProperty(e)&&"constructor"!==e&&(t[e]=this.prototype[e]);return t}},x=["computeds"];d.Model=e.Model.extend({_super:e.Model,constructor:function(e,i){t.extend(this,t.pick(i||{},x)),n(this,"constructor",arguments),this.initComputeds(e,i)},getCopy:function(e){return t.clone(this.get(e))},get:function(t){return f&&f.push(["change:"+t,this]),this.hasComputed(t)?this.c()[t].get():n(this,"get",arguments)},set:function(e,i,o){var r=e;r&&!m(r)?(r={})[e]=i:o=i,o=o||{};var s=this._setting=[];o.unset||(r=function e(n,i,o,r){for(var s in i)if(i.hasOwnProperty(s)){var c=i[s];if(n.hasComputed(s)){if(r.length&&t.contains(r,s))throw"Recursive setter: "+r.join(" > ");(c=n.c()[s].set(c))&&m(c)&&(o=e(n,c,o,r.concat(s)))}else o[s]=c}return o}(this,r,{},[])),delete this._setting;var c=n(this,"set",[r,o]);return o.silent||(!this.hasChanged()&&s.length&&this.trigger("change",this),t.each(s,function(t){this.trigger.apply(this,t)},this)),c},toJSON:function(e){var i=n(this,"toJSON",arguments);return e&&e.computed&&t.each(this.c(),function(t,e){i[e]=t.value}),i},destroy:function(){return this.clearComputeds(),n(this,"destroy",arguments)},c:function(){return this._c||(this._c={})},initComputeds:function(e,n){this.clearComputeds();var i=t.result(this,"computeds")||{};i=t.extend(i,t.pick(e||{},t.keys(i))),t.each(i,function(t,e){t._init=1,this.addComputed(e,t)},this),t.invoke(this.c(),"init")},addComputed:function(t,e,n){this.removeComputed(t);var o=e,r=o._init;if(v(e)){var s=2;(o={})._get=e,v(n)&&(o._set=n,s++),o.deps=p.slice.call(arguments,s)}return this.c()[t]=new i(this,t,o,r),this},hasComputed:function(t){return this.c().hasOwnProperty(t)},removeComputed:function(t){return this.hasComputed(t)&&(this.c()[t].dispose(),delete this.c()[t]),this},clearComputeds:function(){for(var t in this.c())this.removeComputed(t);return this},modifyArray:function(t,e,n){var i=this.get(t);if(w(i)&&v(p[e])){var o=p.slice.call(arguments,2),r=p[e].apply(i,o);return(n=n||{}).silent||this.trigger("change:"+t+" change",this,p,n),r}return null},modifyObject:function(t,e,n,i){var o=this.get(t),r=!1;return m(o)?(i=i||{},g(n)&&o.hasOwnProperty(e)?(delete o[e],r=!0):o[e]!==n&&(o[e]=n,r=!0),r&&!i.silent&&this.trigger("change:"+t+" change",this,o,i),o):null}},C),t.extend(i.prototype,e.Events,{init:function(){var e={},n=f=[];this.get(!0),f=null,n.length&&(t.each(n,function(n){var i=n[0],o=n[1];e[i]?t.contains(e[i],o)||e[i].push(o):e[i]=[o]}),t.each(e,function(e,n){for(var i=0,o=e.length;i<o;i++)this.listenTo(e[i],n,t.bind(this.get,this,!0))},this))},val:function(t){return this.model.get(t)},get:function(e){if(!0===e&&this._get){var n=this._get.apply(this.model,t.map(this.deps,this.val,this));this.change(n)}return this.value},set:function(t){if(this._get){if(this._set)return this._set.apply(this.model,arguments);throw"Cannot set read-only computed attribute."}return this.change(t),null},change:function(e){if(!t.isEqual(e,this.value)){this.value=e;var n=["change:"+this.name,this.model,e];this.model._setting?this.model._setting.push(n):(n[0]+=" change",this.model.trigger.apply(this.model,n))}},dispose:function(){this.stopListening(),this.off(),this.model=this.value=null}});var $,O={optionText:"label",optionValue:"value"},V={},k={attr:r(function(t,e){t.attr(e)}),checked:r({get:function(e,n){var i=!!e.prop("checked"),o=e.val();if(this.isRadio(e))return o;if(w(n)){n=n.slice();var r=t.indexOf(n,o);return i&&r<0?n.push(o):!i&&r>-1&&n.splice(r,1),n}return i},set:function(e,n){var i=!!n;this.isRadio(e)?i=n==e.val():w(n)&&(i=t.contains(n,e.val())),e.prop("checked",i)},isRadio:function(t){return"radio"===t.attr("type").toLowerCase()}}),classes:r(function(e,n){t.each(n,function(t,n){e.toggleClass(n,!!t)})}),collection:r({init:function(t,e,n,i){if(this.i=i.itemView?this.view[i.itemView]:this.view.itemView,!b(e))throw'Binding "collection" requires a Collection.';if(!v(this.i))throw'Binding "collection" requires an itemView.';this.v={}},set:function(e,n,i){var o,r=this.v,s=this.i,c=n.models,u=$;if($=null,y(i=i||n))if(r.hasOwnProperty(i.cid))r[i.cid].remove(),delete r[i.cid];else{r[i.cid]=o=new s({model:i,collectionView:this.view});var h=t.indexOf(c,i),a=e.children();h<a.length?a.eq(h).before(o.$el):e.append(o.$el)}else if(b(i)){var l=c.length===t.size(r)&&n.every(function(t){return r.hasOwnProperty(t.cid)});e.children().detach();var f=document.createDocumentFragment();l?n.each(function(t){f.appendChild(r[t.cid].el)}):(this.clean(),n.each(function(t){r[t.cid]=o=new s({model:t,collectionView:this.view}),f.appendChild(o.el)},this)),e.append(f)}$=u},clean:function(){for(var t in this.v)this.v.hasOwnProperty(t)&&(this.v[t].remove(),delete this.v[t])}}),css:r(function(t,e){t.css(e)}),disabled:r(function(t,e){t.prop("disabled",!!e)}),enabled:r(function(t,e){t.prop("disabled",!e)}),html:r(function(t,e){t.html(e)}),options:r({init:function(t,e,n,i){this.e=i.optionsEmpty,this.d=i.optionsDefault,this.v=i.value},set:function(e,n){var i=this,r=o(i.e),s=o(i.d),c=o(i.v),u=b(n)?n.models:n,h=u.length,a=!0,l="";h||s||!r?(s&&(u=[s].concat(u)),t.each(u,function(t,e){l+=i.opt(t,h)})):(l+=i.opt(r,h),a=!1),e.html(l).prop("disabled",!a).val(c);var f=e.val();i.v&&!t.isEqual(c,f)&&i.v(f)},opt:function(t,e){var n=t,i=t,o=O.optionText,r=O.optionValue;return m(t)&&(n=y(t)?t.get(o):t[o],i=y(t)?t.get(r):t[r]),['<option value="',i,'">',n,"</option>"].join("")},clean:function(){this.d=this.e=this.v=0}}),template:r({init:function(e,n,i){var o=e.find("script,template");if(this.t=t.template(o.length?o.html():e.html()),w(n))return t.pick(i,n)},set:function(t,e){e=y(e)?e.toJSON({computed:!0}):e,t.html(this.t(e))},clean:function(){this.t=null}}),text:r({get:function(t){return t.text()},set:function(t,e){t.text(e)}}),toggle:r(function(t,e){t.toggle(!!e)}),value:r({get:function(t){return t.val()},set:function(t,e){try{t.val()+""!=e+""&&t.val(e)}catch(t){}}})},P={all:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(!t[e])return!1;return!0}),any:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(t[e])return!0;return!1}),length:s(function(t){return t.length||0}),none:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(t[e])return!1;return!0}),not:s(function(t){return!t}),format:s(function(t){for(var e=arguments,n=1,i=e.length;n<i;n++)t=t.replace(new RegExp("\\$"+n,"g"),e[n]);return t}),select:s(function(t,e,n){return t?e:n}),csv:s({get:function(t){return(t=String(t))?t.split(","):[]},set:function(t){return w(t)?t.join(","):t}}),integer:s(function(t){return t?parseInt(t,10):0}),decimal:s(function(t){return t?parseFloat(t):0})},B={events:1,itemView:1,optionsDefault:1,optionsEmpty:1};d.binding={allowedParams:B,addHandler:function(t,e){k[t]=r(e)},addFilter:function(t,e){P[t]=s(e)},config:function(e){t.extend(O,e)},emptyCache:function(){V={}}};var E=["viewModel","bindings","bindingFilters","bindingHandlers","bindingSources","computeds"];return d.View=e.View.extend({_super:e.View,constructor:function(e){t.extend(this,t.pick(e||{},E)),n(this,"constructor",arguments),this.applyBindings()},b:function(){return this._b||(this._b=[])},bindings:"data-bind",setterOptions:null,applyBindings:function(){this.removeBindings();var n=this,i=t.clone(t.result(n,"bindingSources")),o=n.bindings,a=n.setterOptions,l=t.clone(k),f=t.clone(P),d=n._c={};t.each(t.result(n,"bindingHandlers")||{},function(t,e){l[e]=r(t)}),t.each(t.result(n,"bindingFilters")||{},function(t,e){f[e]=s(t)}),n.model=c(n,d,a,"model"),n.viewModel=c(n,d,a,"viewModel"),n.collection=c(n,d,a,"collection"),n.collection&&n.collection.view&&(n.itemView=n.collection.view),i&&(t.each(i,function(t,e){i[e]=c(i,d,a,e,e)}),n.bindingSources=i),t.each(t.result(n,"computeds")||{},function(t,e){var i=v(t)?t:t.get,o=t.set,r=t.deps;d[e]=function(t){return!g(t)&&o?o.call(n,t):i.apply(n,function(t,e){var n=[];if(e&&t)for(var i=0,o=e.length;i<o;i++)n.push(e[i]in t?t[e[i]]():null);return n}(n._c,r))}}),m(o)?t.each(o,function(t,e){var i=u(n,e);i.length&&h(n,i,t,d,l,f)}):u(n,"["+o+"]").each(function(){var t=e.$(this);h(n,t,t.attr(o),d,l,f)})},getBinding:function(t){return a(this._c,t)},setBinding:function(t,e){return a(this._c,t,e)},removeBindings:function(){if(this._c=null,this._b)for(;this._b.length;)this._b.pop().dispose()},remove:function(){this.removeBindings(),n(this,"remove",arguments)}},C),t.extend(l.prototype,e.Events,{init:_,get:_,set:_,clean:_,dispose:function(){this.clean(),this.stopListening(),this.$el.off(this.evt),this.$el=this.view=null}}),d});
;Dependency._js['lib/backbone/backbone.epoxy']=true;

;
function getMainFrame(e){return e&&XPLAN.util.change_top_url(e,!0),XPLAN.util.get_top_frame()}function getHiddenFrame(e){var t=getMainFrame(),n=t.frames.xplanhidden;return n?(e&&(n.location.href=e),n):(jQuery('<iframe name="xplanhidden" />',getFrameDoc(t)).attr("src",e||getBaseURL()+"/static/dummy.html").css({display:"none",width:"100%",height:"500px"}).bind("load",function(){XPLAN.onloadhidden(this)}).appendTo(getFrameDoc(t).body),t.frames.xplanhidden)}function $(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if("string"==typeof n&&(n=document.getElementById(n)),1==arguments.length)return n;e.push(n)}return e}function $form(e,t){if(e)return"string"!=typeof e&&"number"!=typeof e||(e=document.forms[e]),e.elements[t];for(var n=0;n<document.forms.length;n++){var r=document.forms[n];if(r.elements[t])return r.elements[t]}return null}function $F(e){return $form(null,e)}function $FV(e,t){var n,r=$form(null,e);if(r){if(null!==t&&void 0!==t){if("SELECT"==r.tagName){for(n=0;n<r.options.length;n++)if(r.options[n].value==t){r.options[n].selected=!0,r.value=t;break}}else if(r.length){for(n=0;n<r.length;n++)if(r[n].value==t){r[n].checked=!0;break}}else r.value=t;return t}if("SELECT"==r.tagName){for(n=0;n<r.options.length;n++)if(r.options[n].selected)return r[n].value}else{if(!r.length)return r.value;for(n=0;n<r.length;n++)if(r[n].checked)return r[n].value}}}function getBaseURL(){if("string"==typeof baseurl)return baseurl;var e=window.frames.top;return e&&"string"==typeof e.baseurl?e.baseurl:e&&e.opener&&(e=e.opener.frames.top)&&"string"==typeof e.baseurl?e.baseurl:""}function getDocFrame(e){if(e){if(e.defaultView)return e.defaultView;if(e.parentWindow)return e.parentWindow}return null}function getFrameDoc(e){var t=jQuery(e).get(0),n=null;if(t){try{n=t.contentDocument}catch(e){}if(!n)try{n=t.contentWindow?t.contentWindow.document:t.document}catch(e){}}else n=null;return n}function openMarketData(){var e=getBaseURL()+"/portfolio/marketdata/market_overview",t=640,n=480,r=0,i=0;window.screen&&(t=80*jQuery(window).width()/100,n=80*jQuery(window).height()/100,i=(jQuery(window).width()-t)/2,r=(jQuery(window).height()-n)/2),window.open(e,"","height="+n+",width="+t+",top="+r+",left="+i+",location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,border=no,heading=no,topbar=no").focus()}function setPDFImage(e){var t=getMainFrame();t&&(t.XPLAN.framemain.printpdf=e)}function getFormPostData(e,t,n,r,i,a){function o(e){var t=e.name.split(":");return"speedgroup"!=t[0]&&(t.length>=4&&"0"==t[3]&&(t[3]="1"),3==t.length&&t.push("1")),t.join(":")}var u=e.elements,s=t?{}:[];jQuery.watermark&&jQuery.watermark.hideAll();for(var l=0;l<u.length;l++){var c,d=u[l];if((n||!d.disabled)&&(("checkbox"!=d.type&&"radio"!=d.type||d.checked)&&"file"!=d.type&&!(r&&jQuery(d).parents(".exclude_from_form:first").length>0))){var f;try{f=d.value}catch(e){continue}if("textarea"===d.tagName.toLowerCase()&&(f=jQuery(d).val()),"SELECT"==d.tagName&&d.multiple){for(var p=[],h=0;h<d.options.length;h++)d.options[h].selected&&p.push(d.options[h].value);f=p}if(i){var g;if("none"===(g=jQuery(d).parents("tr:first")).css("display"))continue;if("none"===g.parents("tbody:first").css("display"))continue}if(c=d.name,a)"none"===(g=jQuery(d,jQuery(e)).parents("tr:first")).css("display")&&(c=o(d));if(t)if(s[d.name]){var m=s[d.name];"array"==XPLAN.util.getType(m)?m.push(f):s[c]=[m,f]}else s[c]=f;else s.push([c,f])}}return s}function getFormPostDataExclHidden(e,t,n,r){return getFormPostData(e,t,n,r,!0)}function getFormPostDataAdjustRequired(e,t,n,r){return getFormPostData(e,t,n,r,!1,!0)}function setFormPostData(e,t){var n;for(var r in t){var i=e.elements[r],a=t[r];if(i){var o=XPLAN.util.getType(i),u=XPLAN.util.getType(a);if("array"!=u||"array"!=o&&i.length!=a.length)if("array"==u&&"SELECT"==i.tagName&&i.multiple)for(n=0;n<a.length;n++)for(var s=a[n],l=0;l<i.options.length;l++)i.options[l].value==s&&(i.options[l].selected=!0);else i.value=a;else for(n=0;n<i.length;n++)i[n].value=a[n]}}}function palert(e){var t=XPLAN.util.pretty_print(e);alert(t)}function dalert(e){XPLAN.debug?XPLAN.debug.dalert(e):palert(e)}function openIOSPlusOrders(e){1==e&&1==XPLAN.cache.get("embedded",!1)?openIRESSCommand("OPAD1",""):XPLAN.util.form_redirect(getBaseURL()+"/portfolio/iosplus/orderpad")}function openIOSPlusOrderEntry(e,t,n){1==t&&1==XPLAN.cache.get("embedded",!1)?openIRESSCommand("IOSRAOE",""):Dependency.addJS("xpt/portfolio/iosplus/orderentry",function(){XPLAN.iosplus.orderentry.init(e,null),XPLAN.iosplus.orderentry.onOrderCreate=function(e){window.location=getBaseURL()+"/portfolio/iosplus/orderpad?from_order_entry=1&iosaccount="+e},XPLAN.iosplus.orderentry.openIOSPlusOrderEntry(n)})}function openIOSOrders(){XPLAN.util.form_redirect(getBaseURL()+"/portfolio/iosorders/orderpad")}function openIOSOrderEntry(e){Dependency.addJS("xpt/portfolio/ios/orderentry",function(){XPLAN.ios.orderentry.init(),XPLAN.ios.orderentry.onOrderCreate=function(e,t){window.location=getBaseURL()+"/portfolio/iosorders/orderpad?from_order_entry=1&iosname="+e+"&iosaccount="+t},XPLAN.ios.orderentry.openIOSOrderEntry(e)})}function openIRESSCommand(e,t){var n="iress:cmd="+e;t.length>0&&(n=n+"&"+t),window.location=n}function fixIE10_getElementsByName(){10===XPLAN.util.getIEVersion()&&(document._getElementsByName=document.getElementsByName,document.getElementsByName=function(e){var t=[];return jQuery(document).find('[name="%s"]'.replace("%s",e)).each(function(){t.push(this)}),t})}var underscore=window._?_:null;jQuery.ajaxSetup({cache:!0});var XPLAN=window.XPLAN||{debugmode:!1,errormode:!1};XPLAN.test_language_util={tag_start:'<del xplan="">',tag_end:"</del >",tag_escape_start:"~",tag_escape_end:"~",test_language:!1,prepare_escape:function(e){if(!XPLAN.util.isString(e))return e;var t=e;return this.test_language&&(t=(t=t.replace(this.tag_start,this.tag_escape_start)).replace(this.tag_end,this.tag_escape_end)),t},translate:function(e){return this.test_language?this.tag_start+e+this.tag_end:e},set_test_lanuage:function(e){this.test_language=e,e&&(jQuery.fn.extend({text:function(e){return e=XPLAN.test_language_util.prepare_escape(e),jQuery.access(this,function(e){return void 0===e?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(e))},null,e,arguments.length)}}),window._confirm=window.confirm,window.confirm=function(e){return e=XPLAN.test_language_util.prepare_escape(e),window._confirm(e)},window._alert=window.alert,window.alert=function(e){return e=XPLAN.test_language_util.prepare_escape(e),window._alert(e)})}},XPLAN.namespace=function(e,t){var n,r=t?getMainFrame().XPLAN:XPLAN;for(n="XPLAN"==(e=e.split("."))[0]?1:0;n<e.length;n++)r=r[e[n]]=r[e[n]]||{};if(t){var i=XPLAN;for(n="XPLAN"==e[0]?1:0;n<e.length-1;n++)i=i[e[n]]=i[e[n]]||{};i[e[e.length-1]]=r}return r},XPLAN.require=XPLAN.namespace,XPLAN.onloadhidden=function(e){if(XPLAN.onloadhidden_loaded){if("undefined"!=typeof onHiddenFrameLoad){var t=jQuery(getFrameDoc(e.contentWindow).body).html();t&&"&nbsp;"!=t&&onHiddenFrameLoad(t)}}else XPLAN.onloadhidden_loaded=!0};var DUMMY_RESPONSE="SUCCESS",True=!0,False=!1;XplanFrameCache=function(){},XplanFrameCache.prototype._getStorage=function(){return window.sessionStorage?window.sessionStorage.getItem("__pre_20")||"<D></D>":getMainFrame().window.name},XplanFrameCache.prototype._setStorage=function(e){window.sessionStorage?window.sessionStorage.setItem("__pre_20",e):getMainFrame().window.name=e},XplanFrameCache.prototype._getCache=function(){if(!this.cache){var e=this._getStorage(),t="string"==typeof e&&"<D>"==e.substr(0,3);this.cache=t?XMLiser.loadXML(e):{}}return this.cache},XplanFrameCache.prototype._setCache=function(e){this.cache=e,this._setStorage(XMLiser.dumpXML(e))},XplanFrameCache.prototype.del=function(e){var t=this._getCache();delete t[e],this._setCache(t)},XplanFrameCache.prototype.set=function(e,t){var n=this._getCache();n[e]=t,this._setCache(n)},XplanFrameCache.prototype.get=function(e,t){var n=this._getCache();try{var r=n[e];return void 0===r&&(r=t),r}catch(e){return t}},XPLAN.cache=new XplanFrameCache,XPLAN.getHiddenFrame=getHiddenFrame,XPLAN.postToHiddenFrame=function(e,t){var n=getHiddenFrame();return XPLAN.postWithPageNav(e,t,n.name),n},XPLAN.postWithPageNav=function(e,t,n){var r=document.createElement("form");jQuery(r).attr({action:e,method:"POST",target:n||"_self",style:"display:none"}),jQuery.each(t,function(e,t){jQuery(r).append(jQuery(document.createElement("input")).attr({name:e,value:t}))}),jQuery("body").append(r),jQuery(r).submit(),jQuery(r).remove()},XPLAN.serveTabularCSV=function(e,t){var n=XPLAN.createCsvContent(t);XPLAN.serveFile(e,n)},XPLAN.createCsvContent=function(e){var t="";return e.forEach(function(e){t+='"'+e.join('","')+'"\n'}),jQuery.trim(t)},XPLAN.serveFile=function(e,t,n){if(n="undefined"!=typeof n?n:"text/csv",window.navigator.msSaveOrOpenBlob){var r=new Blob([t],{type:n});window.navigator.msSaveOrOpenBlob(r,e)}else{const r="data:"+n+";charset=utf-8,"+encodeURIComponent(t);var i=document.createElement("a");i.setAttribute("href",r),i.setAttribute("download",e),i.setAttribute("hidden","hidden"),XPLAN.util.isBrowser("chrome")?i.click():(document.body.appendChild(i),i.click(),document.body.removeChild(i))}},XPLAN.namespace("data"),XPLAN.namespace("event"),XPLAN.event.connect=function(e,t,n){return(e=$(e)).addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n),[e,t,n]},XPLAN.event.dispatch=function(e,t){if(document.createEvent){var n=e.ownerDocument.createEvent("HTMLEvents");n.initEvent(t,!1,!1),e.dispatchEvent(n)}else e.fireEvent&&e.fireEvent("on"+t)},XPLAN.event.disconnect=function(){var e;switch(arguments.length){case 1:if(!arguments[0].length)return!1;e=arguments[0];break;case 3:e=arguments;break;default:return!1}var t=$(e[0]),n=e[1],r=e[2];return t.removeEventListener?t.removeEventListener(n,r,!1):t.detachEvent("on"+n,r),!0},XPLAN.event.handlers={},XPLAN.event.listen=function(e,t,n){return n&&(XPLAN.event.handlers[e]=[]),XPLAN.event.handlers[e]||(XPLAN.event.handlers[e]=[]),XPLAN.event.handlers[e].push(t),t.senderId=XPLAN.util.get_guid(),t.senderId},XPLAN.event.send=function(e,t,n){if(XPLAN.event.handlers[e])for(var r=XPLAN.event.handlers[e],i=0;i<r.length;i++){var a=r[i];void 0!==n&&a.senderId===n||a(t)}},XPLAN.event.process=function(e){if(XPLAN.event.handlers[e]&&"DONE"!=XPLAN.event.handlers[e])for(var t=XPLAN.event.handlers[e],n=0;n<t.length;n++)t[n]();XPLAN.event.handlers[e]="DONE"},XPLAN.event.queue=function(e,t){return XPLAN.event.handlers[e]||(XPLAN.event.handlers[e]=[]),"DONE"==XPLAN.event.handlers[e]?(t(),!0):(XPLAN.event.handlers[e].push(t),!1)},XPLAN.namespace("json"),XPLAN.json.keyExists=function(e,t){t=t.split(".");for(var n=0;n<t.length;n++){var r=t[n];if(void 0===e[r])return!1;e=e[r]}return!0},XPLAN.json.decode=function(e){if(e instanceof Object)return e;try{return JSON.parse(e,XPLAN.json._reviver)}catch(e){return null}},XPLAN.json._reviver=function(e,t){if("undefined"==typeof t)return t=XPLAN.json._reviver_walk(this,e),void(this[e]=t);if(!(t instanceof Object&&"_type"in t))return t;switch(t._type){case"Date":return"Z"==(r=t._val.match(/(\d{4})-(\d{2})-(\d{2})(T(\d{2}):(\d{2}):(\d{2})(\.\d+|)(Z?)|)/))[9]?((n=new Date).setUTCFullYear(r[1],Number(r[2])-1,r[3]),r[4]?(n.setUTCHours(r[5],r[6],r[7],0),r[8]&&n.setUTCMilliseconds(1e3*Number(r[8]))):n.setUTCHours(12,0,0,0),n):r[4]?new Date(r[1],Number(r[2])-1,r[3],r[5],r[6],r[7],r[8]?1e3*Number(r[8]):0):new Date(r[1],Number(r[2])-1,r[3]);case"Time":var n,r=t._val.match(/(\d{2}):(\d{2}):(\d{2})(\.\d+|)/);return(n=new Date(0)).setUTCFullYear(-1),n.setHours(r[1],r[2],r[3],0),r[4]&&n.setMilliseconds(1e3*Number(r[4])),n;case"BigDecimal":case"Decimal":return new Decimal(t._val);case"Currency":return new XPLAN.MultiCurrency.Currency(t._val.code,t._val.value);case"Error":return Error(t._val);default:return t}},XPLAN.json._reviver_walk=function(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.hasOwnProperty.call(i,n)&&(void 0!==(r=XPLAN.json._reviver_walk(i,n))?i[n]=r:delete i[n]);return XPLAN.json._reviver.call(e,t,i)},XPLAN.json.encode=function(e){return JSON.stringify(e)},void 0===Date.prototype._orig_toJSON&&(Date.prototype._orig_toJSON=Date.prototype.toJSON,Date.prototype.toJSON=function(e){function t(e){return e<10?"0"+e:e}return{_type:"Date",_val:isFinite(this.valueOf())?(n=this.getFullYear(),"0000".slice((n+"").length)+n+"-"+t(this.getMonth()+1)+"-"+t(this.getDate())+"T"+t(this.getHours())+":"+t(this.getMinutes())+":"+t(this.getSeconds())):null};var n}),Error.toJSON=function(e){return{_type:"Error",_val:this.message}},XPLAN.namespace("util"),XPLAN.util.validate_form=function(e,t){var n={messages:{required:_("This field is required."),remote:_("Please fix this field."),email:_("Please enter a valid email address."),url:_("Please enter a valid URL."),date:_("Please enter a valid date."),dateISO:_("Please enter a valid date (ISO)."),number:_("Please enter a valid number."),digits:_("Please enter only digits."),creditcard:_("Please enter a valid credit card number."),equalTo:_("Please enter the same value again."),accept:_("Please enter a value with a valid extension."),maxlength:jQuery.validator.format(_("Please enter no more than {0} characters.")),minlength:jQuery.validator.format(_("Please enter at least {0} characters.")),rangelength:jQuery.validator.format(_("Please enter a value between {0} and {1} characters long.")),range:jQuery.validator.format(_("Please enter a value between {0} and {1}.")),max:jQuery.validator.format(_("Please enter a value less than or equal to {0}.")),min:jQuery.validator.format(_("Please enter a value greater than or equal to {0}."))}};jQuery.extend(!0,n,t),jQuery(e).validate(t)},XPLAN.util.getFunctionName=function(e){var t=e.toString();return t=(t=t.substr("function ".length)).substr(0,t.indexOf("("))},XPLAN.util.getBrowser=function(){return navigator.appVersion.search("Chrome")>=0?"chrome":navigator.appVersion.search("Safari")>=0?"safari":underscore.isNumber(XPLAN.util.getIEVersion())?"ie":"Netscape"==navigator.appName?"firefox":"unknown"},XPLAN.util.isBrowser=function(e){return XPLAN.util.getBrowser()===e},XPLAN.util.getIEVersion=function(){var e=navigator.userAgent.match(/MSIE (\d+\.\d+)/);if(null!==e&&2===e.length)return parseInt(e[1],10);var t=navigator.userAgent.match(/Trident\/7.*rv\:(\d+\.\d+)/);return null!==t&&2===t.length?parseInt(t[1],10):void 0},XPLAN.util.isIE8=function(){return 8===XPLAN.util.getIEVersion()},XPLAN.util.isAppleMobileDevice=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())||/ipod/i.test(navigator.userAgent.toLowerCase())},XPLAN.util.stripIXNP=function(e){var t=new RegExp("^.+:f="),n={};for(var r in e)n[r.replace(t,"")]=e[r];return n},XPLAN.util.first=function(e,t,n){var r=n;if(XPLAN.util.isArray(e))for(var i=0;i<e.length;i++)if(t(e[i]))return e[i];return r},XPLAN.util.elem2value=function(e){var t=jQuery(e);if(t.length>1){var n=[];return t.each(function(){n.push(jQuery(this).val())}),n}return t.val()},XPLAN.util.object2elem=function(e,t,n){function r(e,t){void 0===t||null===t?t=[]:XPLAN.util.isArray(t)||(t=[t]),e.val(t)}var i=jQuery(e);if(n){var a={};i.find(":input").each(function(){var e=jQuery(this).attr("name");e&&(a[e]=e)})}underscore.each(t,function(e,t,o){var u=i.find(':input[name="'+t+'"]');if(u.length>0){if(u.filter(":radio,select,:checkbox").length<u.length&&XPLAN.util.isArray(e)){var s=[],l=[];underscore.each(e,function(e,t){var n=jQuery(u[t]);n.is(":radio,select,:checkbox")?(s.push(n),l.push(e)):r(n,e)}),u=jQuery(s),e=l}r(u,e),n&&delete a[t]}}),n&&underscore.each(a,function(e,t,n){var r=i.find(':input[name="'+t+'"]');r.each(function(){r.val([])})})},XPLAN.util.elem2object=function(e,t,n){var r,i=jQuery(e);n&&(r=i.find("input:disabled,select:disabled,textarea:disabled").removeAttr("disabled"));var a=i.find(":input").serialize();n&&r.attr("disabled","disabled"),a=XPLAN.util.decodeQS(a);var o=XPLAN.util.qs2object(a);if(void 0!==t&&t)for(var u in o)""===o[u]&&delete o[u];return o},XPLAN.util.elemChange=function(e,t){var n=jQuery(e);n.data("__elem_old_value",XPLAN.util.elem2object(n)),jQuery(n).on("change",function(r){var i={old_data:n.data("__elem_old_value"),data:XPLAN.util.elem2object(n),changed_field:r&&r.target&&r.target.name,elem:n},a=t(i);a&&(a.updated_data&&XPLAN.util.object2elem(e,a.updated_data),a.field_changed&&jQuery(':input[name="'+a.field_changed+'"]').change()),n.data("__elem_old_value",XPLAN.util.elem2object(n))})},XPLAN.util.elemShowHide=function(e,t){var n=jQuery(e),r=n.data("__elemShowHide_rules");r||(r={}),jQuery.extend(r,t),n.data("__elemShowHide_rules",r),XPLAN.util.elemChange(e,function(e){for(var t in r){jQuery('[data-xpt-fieldholder="'+t+'"]',n).toggle(r[t](e))}}),n.change()},XPLAN.util.decodeQS=function(e){var t,n;if(!e){if(!((t=(e=""+document.location.href).indexOf("?"))>=0))return{};e=e.substring(t+1)}e=(e=e.replace(/&amp;/g,"&")).replace(/\+/g," ");var r=[];for(t=0,n=0;t>=0&&(n=e.indexOf("=",t))>=0;){var i,a;i=e.substring(t,n),(t=e.indexOf("&",n))<0?a=e.substring(n+1):(a=e.substring(n+1,t),t++),r.push([decodeURIComponent(i),decodeURIComponent(a)])}return r},XPLAN.util.encodeQS=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n][0],i=e[n][1];if(i instanceof Array)for(var a=encodeURIComponent(e[n][0]),o=0;o<i.length;o++)t.push(a+"="+encodeURIComponent(i[o]));else t.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}return t.join("&")},XPLAN.util.object2QS=function(e){var t=[];if(e)for(var n in e)t.push([n,e[n]]);return t},XPLAN.util.encodeObject=function(e){var t=XPLAN.util.object2QS(e);return XPLAN.util.encodeQS(t)},XPLAN.util.appendUrl=function(e,t){var n=e.search(/\?/)>=0?"&":"?";return XPLAN.util.endswith(e,"#")&&(e=e.substring(0,e.length-1)),e+n+t},XPLAN.util._unescape_xml=function(e){return e.replace(/&#(x?)([\da-f]+);/gi,function(e,t,n){return String.fromCharCode(parseInt(n,t?16:10))})},XPLAN.util._unescape_jsq=function(e){return e.replace(/\\x([\da-f]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},XPLAN.util._unescape_css=function(e){return e.replace(/\\([\da-f]+) /gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},XPLAN.util.escape_modes={xml:{re:/[^\w\d\. \n]/g,pre:"&#x",post:";",unescaper:XPLAN.util._unescape_xml},xmlq:{re:/[^\w\d\.]/g,pre:"&#x",post:";",unescaper:XPLAN.util._unescape_xml},jsq:{re:/[^\w\d\.]/g,pre:"\\x",post:"",unescaper:XPLAN.util._unescape_jsq},css:{re:/[^\w\d]/g,pre:"\\",post:" ",unescaper:XPLAN.util._unescape_css},uri:{unescaper:decodeURI},url:{unescaper:decodeURI},query:{unescaper:decodeURIComponent},jquery:{re:/(:|\.|\[|\]|,|=|@|\+|>)/g}},XPLAN.util.escape=function(e,t){t=t||"xml","string"!=typeof e&&(e=""+e),t=t.split("+");for(var n=0;n<t.length;n++){var r=t[n],i=XPLAN.util.escape_modes[r];if(i&&void 0!==i.re)e="jquery"==r?e.replace(i.re,"\\$1"):(e=XPLAN.test_language_util.prepare_escape(e)).replace(i.re,function(e){var t=e.charCodeAt(0).toString(16);return 2==t.length?i.pre+t+i.post:1==t.length?i.pre+"0"+t+i.post:e});else if("url"==r||"uri"==r)e=encodeURI(e);else{if("query"!=r)throw new Error(_("Unknown escape type:")+" "+r);e=encodeURIComponent(e)}}return e},XPLAN.util.unescape=function(e,t){t=t||"xml","string"!=typeof e&&(e=""+e),t=t.split("+");for(var n=0;n<t.length;n++){var r=t[n],i=XPLAN.util.escape_modes[r];if(!i||void 0===i.unescaper)throw new Error(_("Un-escape mode '%a' is not supported.").replace("%a",r));e=i.unescaper(e)}return e},XPLAN.util.getMaxZIndex=function(){var e=1e3;return XPLAN.util.isLogin()&&(e=XPLAN.util.hasFeature("xplan_ids_theme")?1e3:100),jQuery("body > *:visible, div.zindex-important:visible").each(function(){var t=jQuery(this),n=parseInt(t.css("z-index"),10);n&&n>e&&2147483647!==n&&(e=n)}),e},XPLAN.util.getType=function(e){var t=typeof e;switch(t=t.toLowerCase()){case"number":return Math.round(e)==e?"int":"float";case"object":return null===e?"null":XPLAN.util.isArray(e)?"array":XPLAN.util.isDate(e)?"date":void 0!==window.Decimal&&e instanceof Decimal?"decimal":"object";default:return t}},XPLAN.util.getScroll=function(e){var t=e==window||e==document?self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop;return{l:e==window||e==document?self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft:e.scrollLeft,t:t}},XPLAN.util.scrollPageToTop=function(){jQuery("html, body").prop("scrollTop","0px")},XPLAN.util.getXY=function(e){var t,n,r,i=!1;if(e.tagName)r={x:(t=jQuery(e).offset()).left,y:t.top},i=!0;else{if(void 0===e.pageX)throw"Unknown element "+e;r={x:e.pageX,y:e.pageY},e=e.target}for(n=getDocFrame(e.ownerDocument);n.frameElement;){var a=n.frameElement;t=jQuery(a).offset(),r.x+=t.left,r.y+=t.top;var o=jQuery(getFrameDoc(n));r.x-=o.scrollLeft()||0,r.y-=o.scrollTop()||0,i&&(r.x-=n.pageXOffset||0,r.y-=n.pageYOffset||0),n=getDocFrame(a.ownerDocument)}return r.x=Math.floor(r.x),r.y=Math.floor(r.y),r},XPLAN.util.inArray=function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1},XPLAN.util.isArray=function(e){return jQuery.isArray(e)},XPLAN.util.isDate=function(e){return e instanceof Date||e.getFullYear&&e.getMonth&&e.getDate},XPLAN.util.isTrue=function(e){switch(XPLAN.util.getType(e)){case"array":case"string":return e.length>0;case"object":for(var t in e)return!0;return!1;default:return e}},XPLAN.util.isString=function(e){return"string"==XPLAN.util.getType(e)},XPLAN.util.getStringInbetween=function(e,t,n){return e.substring(e.indexOf(t)+t.length,e.indexOf(n))},XPLAN.util.getInts=function(e,t){return XPLAN.util.isString(e)&&void 0!==t&&(e=e.split(t)),e=underscore.map(e,function(e){return parseInt(e,10)}),e=underscore.filter(e,function(e){return!isNaN(e)})},XPLAN.util.hasFeature=function(e){var t;try{t=getMainFrame()}catch(e){return!1}var n=t.XPLAN.util.session_features||{},r=n[e];return void 0===r&&(r=XMLRPC.callGET("today.hasFeature",[e]),n[e]=r,t.XPLAN.util.session_features=n),r},XPLAN.util.hasFeatures=function(e){var t;try{t=getMainFrame()}catch(e){return!1}var n=t.XPLAN.util.session_features||{},r=underscore.difference(e,underscore.keys(n)),i=XMLRPC.callGET("today.hasFeatures",[r]);return jQuery.each(i,function(e,t){n[e]=t}),t.XPLAN.util.session_features=n,n},XPLAN.util.isCapable=function(e){var t;try{t=getMainFrame()}catch(e){return!1}if(t){var n=t.XPLAN.util.capabilities;if(n||(n=t.XPLAN.util.capabilities=XMLRPC.callGET("today.getCapabilities",[])),n&&n[e])return!0}return!1},XPLAN.util.SECTOR_MGT_TYPE_GICS=1,XPLAN.util.SECTOR_MGT_TYPE_FTSE=2,XPLAN.util.get_sector_type_title=function(e){var t;try{t=getMainFrame()}catch(e){return!1}if(t){var n=t.XPLAN.util.sector_type_titles;if(n||(n=t.XPLAN.util.sector_type_titles=XMLRPC.callGET("portfolio.get_sector_type_titles",[])),n&&e in n&&void 0!==n[e])return n[e]}return _("Undefined")},XPLAN.util.isRole=function(e){return getMainFrame().XPLAN.login_role==e},XPLAN.util.isLogin=function(){var e=getMainFrame();return!(!e||!e.XPLAN.login_role)},XPLAN.util.onCapabilitiesLoaded=function(e){var t;try{t=getMainFrame()}catch(e){return}t&&(t.XPLAN.util.capabilities?e():XMLRPC.callGET("today.getCapabilities",[],function(n){t.XPLAN.util.capabilities=n,e()}))},XPLAN.util.object2qs=function(e){var t=[];for(var n in e){var r=e[n];if(XPLAN.util.isArray(r))for(var i=0;i<r.length;i++)t.push([n,r[i]]);else t.push([n,r])}return t},XPLAN.util.parseXML=function(e){var t;document.all?((t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml");return t},XPLAN.util.qs2object=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n][0],i=e[n][1];if(void 0!==t[r]){var a=t[r];XPLAN.util.isArray(a)?a.push(i):t[r]=[a,i]}else t[r]=i}return t},XPLAN.util.setdefault=function(e){null!==e&&void 0!==e||(e={});for(var t=1;t<arguments.length;t++){var n=arguments[t];if(void 0!==n&&null!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r])}return e},XPLAN.util.update=function(e){null!==e&&void 0!==e||(e={});for(var t=1;t<arguments.length;t++){var n=arguments[t];if("undefined"!=typeof n&&null!==n)for(var r in n)e[r]=n[r]}return e},XPLAN.util.alertAndThrow=function(e){throw("string"==typeof e||"object"==typeof e&&e instanceof String)&&(e=new Error(e)),alert(e.message),e},XPLAN.util.showObject=function(e,t){var n="";for(var r in e)n+=r+":",t&&(n+=""+e[r]),n+="\n";return n},XPLAN.util.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},XPLAN.util.startswith=function(e,t){return e.match("^"+t)==t},XPLAN.util.endswith=function(e,t){return e.match(t+"$")==t},XPLAN.util.get_row_class=function(e){return e%2==0?"item_even":"item_odd"},XPLAN.util.resolveCSSExt=function(e){return e.match(/[.](css|less)$/)?(e.match(/[.]less$/)&&!XPLAN.dont_compact_js&&(e=e.replace(/[.]less$/,".css")),e):e+".css"},XPLAN.util.resolveJSName=function(e){return e.match(/ckeditor\/ckeditor(.js|)$/)&&(window.CKEDITOR_BASEPATH=getBaseURL()+"/js/lib/ckeditor/"),e},XPLAN.util.cssLoaded=[],XPLAN.util.loadCSS=function(e){var t=(e=XPLAN.util.resolveCSSExt(e)).match(/[.]less$/);if(void 0===XPLAN.util.cssLoaded[e]){XPLAN.util.cssLoaded[e]=!0;var n=document.createElement("link");if(n.type="text/css",n.rel=t?"stylesheet/less":"stylesheet",n.href=getBaseURL()+e,t)window.less||(window.less={env:"development"}),Dependency.addJS("lib/less",function(){less.sheets.push(n),less.refresh()});else{var r=document.getElementsByTagName("head");(r=r.length>0?r[0]:document.documentElement.firstChild).appendChild(n)}XPLAN.util.cssLoaded[e]=!0;var i=getMainFrame();i&&i!=window&&i.XPLAN&&i.XPLAN.util&&i.XPLAN.util.loadCSS&&i.XPLAN.util.loadCSS(e)}},XPLAN.util.scriptLoaded={},XPLAN.util.loadScript=function(e,t){var n=jQuery.Deferred();e=XPLAN.util.resolveJSName(e);var r=XPLAN.util.scriptLoaded[e];if(void 0!==r)null!==r.onload?(t&&r.onload.push(t),r.onload.push(n.resolve)):(t&&t(),n.resolve());else{r=XPLAN.util.scriptLoaded[e]={loaded:!1,onload:[]},t&&r.onload.push(t),r.onload.push(n.resolve);var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.onload=function(){XPLAN.util.onScriptLoaded(e)},i.src=getBaseURL()+e;var a=document.getElementsByTagName("script");a.length>0?a[0].parentNode.insertBefore(i,a[0]):document.documentElement.firstChild.appendChild(i)}return n},XPLAN.util.onScriptLoaded=function(e){var t=XPLAN.util.scriptLoaded[e];for(var n in t&&(t.loaded=!0),XPLAN.util.scriptLoaded)if(!0!==XPLAN.util.scriptLoaded[n].loaded)return;var r=[];for(var n in XPLAN.util.scriptLoaded){null!==(t=XPLAN.util.scriptLoaded[n]).onload&&r.push.apply(r,t.onload),t.onload=null}for(var i=0;i<r.length;++i)r[i]()},XPLAN.util.deviceSpecificDownload=function(e){XPLAN.util.isAppleMobileDevice()?XPLAN.util.download(e):getHiddenFrame(e)},XPLAN.namespace("help"),XPLAN.help.index="",XPLAN.help.setHelp=function(e){XPLAN.help.index=e[0];var t=getMainFrame();if(t){var n=getFrameDoc(t).getElementById("helpimg");n&&(n.style.display=e[1]?"inline":"none")}},XPLAN.help.show=function(e){e.preventDefault();var t=XPLAN.help.index;if(!t){var n=""+getMainFrame().location.href,r=n.split("framemain");if(2==r.length)n=r[1];else{if(1!=r.length)return;2==(r=n.split("//")).length&&(n=r[1].substring(r[1].indexOf("/"),r[1].length))}(r=n.split("?")).length>1&&(n=r[0]),(r=n.split(getBaseURL())).length>1&&(n=r[1]),t=n}window.open(getBaseURL()+"/help/_check?index="+encodeURIComponent(t),"xplan_help","toolbar=no,scrollbars=yes,resizable=yes,top=0,height=420,width=600,left="+(window.screen?screen.availWidth-615:0)).focus()},XMLiser={},XMLiser.isTime=function(e){return 1970===e.getFullYear()&&0===e.getMonth()&&1===e.getDate()},XMLiser.isDate=function(e){return!XMLiser.isTime(e)&&0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds()},XMLiser.dumpTime=function(e){return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},XMLiser.dumpDate=function(e){return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},XMLiser.dumpXML=function(e){var t,n,r=XPLAN.util.getType(e),i=r;switch(r){case"array":for(n=[],t=0;t<e.length;t++)n.push(XMLiser.dumpXML(e[t]));i="L",e=n.join("");break;case"boolean":i="b",e=e?"1":"0";break;case"object":for(t in n=[],e)n.push(XMLiser.dumpXML(t)),n.push(XMLiser.dumpXML(e[t]));i="D",e=n.join("");break;case"date":XMLiser.isTime(e)?(i="Time",e=XMLiser.dumpTime(e)):XMLiser.isDate(e)?(i="Date",e=XMLiser.dumpDate(e)):(i="DateTime",e=XMLiser.dumpDate(e)+" "+XMLiser.dumpTime(e));break;case"float":i="f";break;case"int":i="i";break;case"string":i="s",e=XPLAN.util.escape(e,"xml");break;case"null":case"undefined":i="n",e="";break;default:throw new Error(_("Invalid data type for XMLiser:")+" "+r)}return"<"+i+">"+e+"</"+i+">"},XMLiser.loadXML=function(e){var t=XPLAN.util.parseXML(e);return XMLiser.loadXMLElement(t.documentElement)},XMLiser.zeroParseInt=function(e){for(;e.length>0&&"0"==e.charAt(0);)e=e.substr(1,e.length);return e?parseInt(e,10):0},XMLiser.parseTime=function(e){var t=new Date;if(e){var n=e.split(":");t.setHours(XMLiser.zeroParseInt(n[0])),t.setMinutes(XMLiser.zeroParseInt(n[1])),t.setSeconds(XMLiser.zeroParseInt(n[2])),t.setMilliseconds(0)}return t},XMLiser.parseDate=function(e){var t=new Date;if(e){var n=e.split("-");t.setFullYear(XMLiser.zeroParseInt(n[0])),t.setMonth(XMLiser.zeroParseInt(n[1])-1),t.setDate(XMLiser.zeroParseInt(n[2]))}return t},XMLiser.parseDateTime=function(e){var t=new Date;if(t.setFullYear(1970),t.setMonth(0),t.setDate(1),e){var n=e.split(" ");if(n.length>=1&&(t=XMLiser.parseDate(n[0])),2==n.length){var r=XMLiser.parseTime(n[1]);t.setHours(r.getHours()),t.setMinutes(r.getMinutes()),t.setSeconds(r.getSeconds()),t.setMilliseconds(r.getMilliseconds())}}return t},XMLiser.loadXMLElement=function(e){var t,n;switch(e.tagName){case"b":return t=parseInt(e.firstChild.data,10),isNaN(t)?"true"==e.firstChild.data:0!==t;case"s":case"u":return e.firstChild?e.firstChild.data:"";case"d":case"f":return e.firstChild?parseFloat(e.firstChild.data):0;case"i":case"l":return e.firstChild?parseInt(e.firstChild.data,10):0;case"L":for(n=[],t=e.firstChild;t;)n.push(XMLiser.loadXMLElement(t)),t=t.nextSibling;return n;case"D":n={};for(var r=e.firstChild;r;){var i=XMLiser.loadXMLElement(r);(r=r.nextSibling)&&(t=XMLiser.loadXMLElement(r),n[i]=t,r=r.nextSibling)}return n;case"n":return null;case"DateTime":return XMLiser.parseDateTime(e.firstChild?e.firstChild.data:"");case"Date":return XMLiser.parseDate(e.firstChild?e.firstChild.data:"");case"Time":return XMLiser.parseTime(e.firstChild?e.firstChild.data:"");case"Currency":var a=XMLiser.loadXMLElement(e.firstChild),o=XMLiser.loadXMLElement(e.firstChild.nextSibling);return new XPLAN.MultiCurrency.Currency(a,o);default:return!1}},function(){var e={reference_count:0,eggtimer_id:"xplan_eggtimer",eggtimer_model_id:"xplan_eggtimer_modal",hide:function(e,t){if(getMainFrame().EggTimer.globalReferenceCount&&getMainFrame().EggTimer.globalReferenceCount--,t&&this.reference_count--,!t||this.reference_count<=0){var n=e||getFrameDoc(getMainFrame());jQuery("#"+this.eggtimer_id,n).hide(),jQuery("#"+this.eggtimer_model_id,n).hide()}},options:{positionElement:null,position:"center",height:null,width:null,timeout:null,modal:!1,html:null,doc:null,addClass:null},show:function(e,t){if(null===e||void 0===e)e=this.options;else for(var n in this.options)n in e&&(this.options[n]=e[n]);var r=e.doc||getFrameDoc(getMainFrame()),i=e.doc?jQuery:getMainFrame().jQuery;if(this.options.modal){var a=i("#"+this.eggtimer_model_id,r.body);a.length||(a=i('<div id="'+this.eggtimer_model_id+'" class="xplan_eggtimer_modal modaloverlay">&nbsp;</div>').appendTo(r.body)),a.show()}var o=i("#"+this.eggtimer_id,r),u=this.options.html?this.options.html:"<b>"+XPLAN.util.escape(_("Loading"))+"</b>";if(o.length)o.html(u);else try{o=i('<div id="'+this.eggtimer_id+'" class="xplan_eggtimer" style="display: none;">'+u+"</div>").appendTo(r.body)}catch(e){(o=r.createElement("div")).id=this.eggtimer_id,(o=i("#"+this.eggtimer_id,r)).css("display","none"),o.html(u)}var s=[],l=this.options.position;null!==this.options.positionElement?(elem=i(this.options.positionElement),"center"==l?(s[0]=elem.offset().top+(elem.outerHeight()/2-o.outerHeight()/2)-i(window).scrollTop(),s[1]=elem.offset().left+(elem.outerWidth()/2-o.outerWidth()/2)):(s[0]=elem.offset().top+l[0],s[1]=elem.offset().left+l[1])):"center"!=l&&(s=l),s.length>1&&(o.css("top",s[0]),o.css("left",s[1])),this.options.addClass&&o.addClass(this.options.addClass),this.options.timeout&&setTimeout(this.hide,this.options.timeout),t&&(this.reference_count=(this.reference_count||0)+1),o.show(),getMainFrame().EggTimer.globalReferenceCount=(getMainFrame().EggTimer.globalReferenceCount||0)+1},getNewTimer:function(t){void 0===t&&(t=XPLAN.util.get_html_random_id());var n={};return jQuery.extend(!0,n,e),n.eggtimer_id=t,n.eggtimer_model_id=t+"_modal",n}};window.jQuery?window.EggTimer=e.getNewTimer("xplan_eggtimer"):window.EggTimer=e}(),window.Dependency||(Dependency={}),underscore.defaults(Dependency,{_js:{},_css:{},_css_root:"/css/",_deferred_pool:[]}),Dependency.addCSS=function(e){if(e=XPLAN.util.resolveCSSExt(e),!Dependency._css[e]){Dependency._css[e]=!0;var t=Dependency._css_root+e;0!==jQuery('link[href^="'+getBaseURL()+t+'"]').length||XPLAN.util.loadCSS(t)}},Dependency._js_root="/js/",Dependency.addJS=function(e,t){if(e=XPLAN.util.resolveJSName(e),!Dependency._js[e]){Dependency._js[e]=!0;var n=Dependency._js_root+e+".js";if(0===jQuery('script[src^="'+getBaseURL()+n+'"]').length){var r=XPLAN.util.loadScript(n,t);return void Dependency._deferred_pool.push(r)}}t&&t()},Dependency._callback_stack=[],Dependency.load_dependencies=function(e){var t=jQuery.when.apply(jQuery,Dependency._deferred_pool);null!=e&&(Dependency._callback_stack.push(e),t.then(function(){for(;Dependency._callback_stack.length;)Dependency._callback_stack.shift()()}))},Dependency.registerJS=function(e){Dependency._js[e]=!0},Dependency.addJQueryPlugin=function(e,t){Dependency.addJS("lib/jquery/plugins/"+e+"/jquery."+e),t&&Dependency.addCSS("jquery/plugins/"+e+"/jquery."+e)},Dependency.addTemplate=function(e){XPLAN.debugmode||Dependency.addJS("tpl_bank/ejs/"+e)},XPLAN.util.log=function(e){if(XPLAN.debugmode){var t=window.console&&console.log?console.log:function(e){window.status=e};try{t(e)}catch(e){}}},XPLAN.util.openWindow=function(e,t){var n=window.open.apply(window,e);null!==n?t(n):alert(_("Unable to open a popup. Please ensure popup is allowed for this browser."))},XPLAN.util.download=function(e){window.open(e,"download","height=580,width=800,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,border=no")},XPLAN.util.pretty_print=function(e,t,n){if(n=n||[],null===e||void 0===e)return"null";t=t||"";Boolean,Date,Function,Math,Number,RegExp,Error,String;var r=0;try{switch(typeof e){case"object":for(r=0;r<n.length;r++)if(e==n[r])return"circular reference...";var i,a,o;if(e instanceof Array){for((i=n.slice()).push(e),a=t+"    ",o=[],r=0;r<e.length;r++)try{o.push(XPLAN.util.pretty_print(e[r],a,i))}catch(e){o.push(_("ERROR, unable to pretty print this data"))}return"[\n"+a+o.join(",\n"+a)+"\n"+t+"]"}if(e instanceof Boolean)return e.toString();if(e instanceof Date)return e.toString();if(e instanceof Function)return e.toString();if(e instanceof Number)return e.toString();if(e instanceof RegExp)return e.toString();if(e instanceof Error)return e.toString();if(e instanceof String)return e.toString();if(e instanceof Decimal)return e.toString();for(r in(i=n.slice()).push(e),a=t+"    ",o=[],e)try{o.push(r+" : "+XPLAN.util.pretty_print(e[r],a,i))}catch(e){o.push(r+" : "+_("ERROR, unable to pretty print this data"))}return"{\n"+a+o.join(",\n"+a)+"\n"+t+"}";case"undefined":return"undefined";default:return e.toString()}}catch(e){return _("ERROR, unable to pretty print this data")}},XPLAN.util.fix_iframe_scrolling_for_ipad=function(){navigator.userAgent.match(/ipad/i)&&jQuery(function(){if(window!=window.parent){var e=parent.document.getElementById("mf-page");if(e){var t=jQuery(e).height();jQuery("#pagecontent").css({"max-height":t,overflow:"auto","-webkit-overflow-scrolling":"touch"})}}})};try{jQuery&&jQuery.fn.extend({getXY:function(){return this.length?XPLAN.util.getXY(this.get(0)):null},center:function(){return this.css("position","absolute"),this.css("top",(jQuery(window).height()-this.outerHeight())/2+jQuery(window).scrollTop()+"px"),this.css("left",(jQuery(window).width()-this.outerWidth())/2+jQuery(window).scrollLeft()+"px"),this},centerOn:function(e){var t=e.offset();return this.css("position","absolute"),this.css("top",(jQuery(e).outerHeight()-this.outerHeight())/2+t.top+"px"),this.css("left",(jQuery(e).outerWidth()-this.outerWidth())/2+t.left+"px"),this},displayOver:function(e){var t=e.offset();return this.css("position","absolute"),this.css("top",t.top+"px"),this.css("left",t.left+"px"),this.css("width",e.outerWidth()+"px"),this.css("height",e.outerHeight()+"px"),this},validateChart:function(e){var t=this.attr("data");return new HttpRequest(t).doGET("").indexOf(e)>=0}})}catch(e){}XPLAN.addjQueryUIDialogButtonPlugin=function(){try{if(jQuery.ui&&jQuery.ui.dialog&&void 0===jQuery.ui.dialog.prototype._original_createButtons)try{jQuery.fn.extend(jQuery.ui.dialog.prototype,{_original_createButtons:jQuery.ui.dialog.prototype._createButtons,_createButtons:function(e){this._original_createButtons(e);for(var t=0;t<jQuery(".ui-dialog-buttonpane button").length;t++){var n=jQuery(jQuery(".ui-dialog-buttonpane button > span")[t]).text();"^"==n.substring(0,1)&&(jQuery(jQuery(".ui-dialog-buttonpane button > span")[t]).text(n.substring(1)),jQuery(".ui-dialog-buttonpane button")[t].className="primary")}}})}catch(e){}}catch(e){}},XPLAN.addjQueryUIDialogButtonPlugin(),XPLAN.util.update_select_all_checkbox=function(e,t,n){try{t||(t=e+"_all"),n||(n=document);var r=jQuery(n),i=r.find('input[name="'+e+'"][type="checkbox"]'),a=r.find('input[name="'+e+'"][type="checkbox"]:checked'),o=a.length,u=r.find('input[id="'+t+'"][type="checkbox"]');o==i.length?u.prop("checked",!0):u.prop("checked",!1);var s=jQuery.map(a,function(e){return e.value});r.trigger("xevent_OnCheckboxSelect",{values:s,name:e})}catch(e){}},XPLAN.util.toggle_all_checkboxes=function(e,t,n){n||(n=document);var r=jQuery(n),i=r.find('input[name="'+t+'"][type="checkbox"]:visible'),a=0;i.each(function(){this.checked&&(a+=1)});var o=a===i.length;i.prop("checked",!o),i.trigger("toggle_content");var u=r.find('input[name="'+t+'"][type="checkbox"]:checked'),s=jQuery.map(u,function(e){return e.value});r.trigger("xevent_OnSelectAllCheckboxes",{values:s,name:t})},XPLAN.util.compare_array=function(e,t){if(e.length!=t.length)return!1;for(var n=e.sort(),r=t.sort(),i=0;t[i];i++)if(n[i]!==r[i])return!1;return!0},XPLAN.util.fix_dialog_auto_width=function(e,t){var n=jQuery(window).width()-50;(e=jQuery(e)).outerWidth(!0)>n?(e.dialog("option","width",n),e.css("overflow","auto")):"auto"!==e.dialog("option","width")&&e.dialog("option","width","auto"),e.dialog("option","position",e.dialog("option","position"))},XPLAN.util.appendOrFindDiv=function(e){return jQuery("#"+e).length||jQuery("body").append(jQuery("<div id='"+e+"' />")),jQuery("#"+e)},XPLAN.util.replace_url_params=function(e,t){var n=function(e,n,r){var i=t[e];return i?(r&&(i=i[r]),i||n):n},r=XPLAN.util.get_qs_from_url(e);if(!r)return e;var i=r.qs,a=[];for(var o in i){var u=i[o],s=u[1],l=u[0];if("[]"==l.slice(-2)){f=[];for(var c=0;c<s.length;c++){var d=n(l,s[c],c);f.push(d)}a.push([l,f])}else{var f=n(l,s);a.push([l,f])}}return"".concat(r.base,"?",XPLAN.util.encodeQS(a))},XPLAN.util.get_qs_from_url=function(e){var t;if((t=e.indexOf("?")+1)>=1){var n,r=e.substring(0,t-1),i=e.substring(t);return(n=i.indexOf("#"))>=1&&(r+=i.substring(n),i=i.substring(0,n)),{base:r,qs:XPLAN.util.decodeQS(i)}}return!1},XPLAN.util.form_submit=function(e){var t=[];e.fields&&(t=[].concat(e.fields));var n=jQuery.extend({method:"get",target:"_self"},e.form_options);if(void 0===n.action)throw _("Action not specified");var r,i,a=XPLAN.util.get_qs_from_url(n.action);for(var o in!1!==a&&(t=[].concat(t,a.qs),n.action=a.base),void 0===(r=XPLAN.util.form_submit.form)?(r=jQuery("<form />").appendTo(jQuery("body")),XPLAN.util.form_submit.form=r):r.html(""),n)r.attr(o,n[o]);for(var u in t){var s=t[u],l=s[1];if(void 0!==l&&!1!==l&&null!==l&&l!==Number.NaN)if("[]"==s[0].slice(-2))for(var c=0;c<s[1].length;c++)i=jQuery('<input type="hidden" />').attr("name",s[0]).val(l[c]),r.append(i);else i=jQuery('<input type="hidden" />').attr("name",s[0]).val(l),r.append(i)}return r.submit(),r},XPLAN.util.form_redirect=function(e,t){var n={form_options:{action:e}};t&&(n=jQuery.extend(!0,n,t)),XPLAN.util.form_submit(n)},XPLAN.util.reload=function(){XPLAN.util.form_redirect(window.location.href)},XPLAN.util.reload_iframe=function(e,t){jQuery('iframe[name="'+e+'"]').each(function(){t=t||jQuery(this).attr("src"),jQuery(this).attr("src",t)})},XPLAN.util.get_html_random_id=function(){return"a"+parseInt(1e10*Math.random(),10)},XPLAN.util.get_guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},XPLAN.util.getWindowEvent=function(e,t){var n=t||window.event;return e&&(n=jQuery.event.fix(n)),n},XPLAN.util.serializeForm=function(e){var t=jQuery(e).serializeArray(),n={};return jQuery.map(t,function(e,t){n[e.name]=e.value}),n},XPLAN.util.capitalize=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e},XPLAN.util.lookup_function=function(e){var t=window;ns=e.split(".");for(var n=0;n<ns.length&&void 0!==(t=t[ns[n]]||void 0);n++);return t},XPLAN.util.top_frame=null,XPLAN.util.get_top_frame=function(){if(null!==XPLAN.util.top_frame)return XPLAN.util.top_frame;for(var e=function(e){return"xplan_mainframe"===e.name||void 0!==e.Cypress},t=window;t.parent&&t.parent!=t&&!e(t);)t=t.parent;return XPLAN.util.top_frame=t,t},XPLAN.util.get_top_frame_target=function(){var e=XPLAN.util.get_top_frame();return window.top==e?"_top":e.name},XPLAN.util.change_top_url=function(e,t){if(!t){var n="/"==e.charAt(0)?"":"/";e=getBaseURL()+n+e}XPLAN.util.get_top_frame().location.href=e},XPLAN.util.notify_report_generated_background=function(){PopupMsgBox.show_bgtask_notification()},XPLAN.util.adjustContainerDivZIndex=function(e){if(void 0!==e){var t=underscore,n=jQuery,r=t.max(n(e).find("div").map(function(){var e=parseInt(n(this).css("z-index"),10);return isNaN(e)?0:e}).get());t.each(n(e),function(e){-1===t.indexOf(["relative","absolute","fixed"],n(e).css("position"))&&n(e).css("position","relative");var i=parseInt(n(e).css("z-index"),10);(isNaN(i)||i<r)&&n(e).css("z-index",r)})}},XPLAN.util.getURL=function(e,t,n){if(t&&!jQuery.isEmptyObject(t)){var r=e.split("?"),i=r[0],a={};r[1]&&(a=XPLAN.util.qs2object(XPLAN.util.decodeQS(r[1]))),XPLAN.util.update(a,t),(t=XPLAN.util.encodeQS(XPLAN.util.object2qs(a)))&&(e=XPLAN.util.appendUrl(i,t))}if(n){var o=getBaseURL();o&&XPLAN.util.startswith(e,o)||(e=o.replace(/\/$/,"")+"/"+e.replace(/^\//,""))}return e},XPLAN.util.getXPLANRelativeURL=function(e,t){var n=window.location.protocol+"//"+window.location.host,r=getBaseURL(),i=t?n.length:n.length+r.length;return XPLAN.util.startswith(e,n+r)?e.substring(i):e},fixIE10_getElementsByName(),XPLAN.namespace("attach"),XPLAN.attach.download=function(e,t){var n=getBaseURL()+"/attach/download/"+e+"/"+t;XPLAN.util.deviceSpecificDownload(n)},XPLAN.attach.download_docpart=function(e,t,n){var r=getBaseURL()+"/docnote/files/"+e+"/"+t+"?download=1";XPLAN.util.deviceSpecificDownload(r)},XPLAN.attach.download_multi=function(e){var t="",n=XPLAN.util.isArray(e),r=XPLAN.util.isString(e);if(n||r)if(n){if(e.length>0){for(var i=[],a=0;a<e.length;a++){var o=e[a];i.push(["i",o[0]]),i.push(["v",o[1]])}t=XPLAN.util.encodeQS(i)}}else t=e;if(t){var u=getBaseURL()+"/attach/download_multi?"+t;XPLAN.util.deviceSpecificDownload(u)}},XPLAN.util.isTextNode=function(){return 3===this.nodeType},XPLAN.util.countCSSRules=function(){function e(t){var n=0;if(t&&t.cssRules){for(var r=0,i=t.cssRules.length;r<i;r++){var a=t.cssRules[r];a instanceof CSSImportRule&&e(a.styleSheet),a.selectorText&&(n+=a.selectorText.split(",").length)}"\nFile: "+(t.href?t.href:"inline <style> tag"),"\nRules: "+t.cssRules.length,"\nSelectors: "+n,"\n--------------------------",n>=4096&&"\n********************************\nWARNING:\n There are "+n+" CSS rules in the stylesheet "+t.href+" - IE9 will ignore the last "+(n-4096)+" rules!\n"}}if(document.styleSheets){"\nTotal: "+document.styleSheets.length+" imported files","\n--------------------------";for(var t=0;t<document.styleSheets.length;t++)e(document.styleSheets[t])}},String.prototype.includes||(String.prototype.includes=function(e,t){"use strict";return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),Math.trunc=Math.trunc||function(e){return isNaN(e)?NaN:e>0?Math.floor(e):Math.ceil(e)},String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t}),XPLAN.util.is_positive_integer=function(e){return!isNaN(parseInt(e,10))&&Number(e)%1==0&&Number(e)>0},XPLAN.util.get_tab_index_by_href=function(e,t){return jQuery("a.ui-tabs-anchor",e).index(jQuery("a.ui-tabs-anchor",e).filter("[href='#"+t+"']"))},XPLAN.util.activate_tab_by_href=function(e,t){var n=XPLAN.util.get_tab_index_by_href(e,t);e.tabs("option","active",n)},XPLAN.util.open_iassist=function(){jQuery('div[id^="tokenticket_"]').xplan_tokenticket("show_dialog")},XPLAN.util.open_video_meeting_dialog=function(e){jQuery('div[data-xplan-elem="xplan_videomeeting"]').xplan_videomeeting("show_dialog",e)},XPLAN.util.focusWhenVisible=function(e,t,n){var r=jQuery(e);r.length>0&&t>0&&(r.is(":hidden")?setTimeout(function(){XPLAN.util.focusWhenVisible(e,t-1,n)},n):r.focus().select())},XPLAN.util.detectCDNAvailability=function(e,t,n){try{new HttpRequest(e).doHEAD(function(){},function(e){const r=e.stack||"";setTimeout(function(){new HttpRequest(t).doHEAD(function(){},function(e){const t=e.stack||"";!function(e,t){var n=getBaseURL()+"/resourceful/logging/app",r={entries:[{level:40,name:"apex.cdn",payload:{metaData:{value:e,bundleValue:t},name:"client_error",value:1,type:"counter"},timestamp:(new Date).getTime()}]};jQuery.ajax({url:n,type:"POST",contentType:"application/json",data:JSON.stringify(r)})}(r,t)})},n)})}catch(e){}},XPLAN.util.getTabIndexById=function(e,t){for(var n=jQuery("#"+e).find("a"),r=0;r<n.length;r++)if("#"+t===jQuery(n[r]).attr("href"))return r;return 0};
;Dependency._js['main']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS&&(Dependency.addJS("main"),Dependency.addJS("lib/backbone/underscore"),Dependency.addJS("lib/backbone/backbone")),function(){var e=XPLAN.namespace("backbone_sync");e.replace_backbone_sync=function(){e.original_backbone_sync=Backbone.sync,Backbone.sync=function(a,t,o){if((o=underscore.clone(o||{})).converters={"text json":function(e){return XPLAN.json.decode(e)}},null!=o.data||!t||"create"!==a&&"update"!==a&&"patch"!==a){if(!(a in n)||"application/json"===o.contentType){var c=n[a]||a;o.type="POST",o.url=underscore.result(t,"url")+"/?_method=%a".replace("%a",encodeURIComponent(c)),o.contentType="application/json",a=null}}else o.contentType="application/json",o.data=o.attrs?o.attrs:underscore.isFunction(t.get_save_data)?t.get_save_data(o):t.toJSON(o),o.extra_json_data&&underscore.extend(o.data,o.extra_json_data);var r,d;"application/json"===o.contentType&&(o.data=XPLAN.json.encode(o.data)),"read"!==a||o.dont_flatten||o.data&&!underscore.isString(o.data)&&(o.data=(r=o.data,(d=function(e,n){var a={};return underscore.isString(n)||underscore.isNumber(n)||underscore.isBoolean(n)?a[e]=n:n instanceof Date?a[e]=n.toJSON()._val:n instanceof Decimal?a[e]=n.toString():underscore.each(n,function(n,t){underscore.extend(a,d(e?e+"."+t:""+t,n))}),a})("",r)));var s,i=e.original_backbone_sync(a,t,o);(void 0===o.show_egg_timer||o.show_egg_timer)&&(EggTimer.show(null,!0),i.always?s=underscore.bind(i.always,i):i.finally&&(s=underscore.bind(i.finally,i)),s&&s(function(){EggTimer.hide(null,!0)}));return i}},e.replace_backbone_sync();var n={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"}}();
;Dependency._js['backbone_sync']=true;

;
XPLAN.currentLanguage="en_AU",XPLAN.TRAN||(XPLAN.TRAN={}),XPLAN.PLURAL_EXPR="(n != 1)",window._=function(e){return e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," "),XPLAN.TRAN[e]||e},window.ngettext=function(singular,plural,replacement,count){singular=singular.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ");var textset=XPLAN.TRAN[singular],text=null;if(textset){var index=eval(XPLAN.PLURAL_EXPR.replace("n",count))+0;text=textset[index]}else text=1==count?singular:plural;return text.replace(replacement,count)};
;Dependency._js['lang/en_AU']=true;

;
XPLAN.Model={factory:{createClass:function(e){void 0===e&&(e={parentClass:XPLAN.Model.Model}),e.parentClass||(e.parentClass=XPLAN.Model.Model),e.registryName&&!e.factoryRootClass&&(e.factoryRootClass=e.parentClass);var t=e.parentClass.extend(e.properties,e.classProperties);return e.registryName&&(e.factoryRootClass.getClass||jQuery.extend(e.factoryRootClass,this._registerClass()),e.factoryRootClass.registerClass(e.registryName,t)),t},_registerClass:function(){return{_cache:{},getClass:function(e){var t=this._cache[e];return void 0===t&&(t=this),t},getInstance:function(e,t,s){var r=this.getClass(e);if(s){var a=new r;return jQuery.extend(a,t),a}return new r(t)},registerClass:function(e,t){this._cache[e]=t}}}},Model:Backbone.Model.extend({}),View:Backbone.View.extend({}),extend_model_instance:function(){var e="boolean"==XPLAN.util.getType(arguments[0]),t=Array.prototype.slice.call(arguments),s=e?1:0,r=t[s],a=t[s]={};for(var o in jQuery.extend.apply(jQuery,t),a)r[o]=a[o]}};
;Dependency._js['model']=true;

;
XPLAN.namespace("commonutil"),XPLAN.commonutil.breakColour=function(n){if((4===n.length||7===n.length)&&"#"===n.substring(0,1)){if(7===n.length)return t=[parseInt(n.substring(1,3),16),parseInt(n.substring(3,5),16),parseInt(n.substring(5),16)];for(var t=n.split(""),r=[],o=0;o<t.length;o++)r.push(parseInt(t[o]+t[o],16));return r}return"rgb("===n.substring(0,4)&&(t=n.match(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/))?[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]:null},XPLAN.commonutil.colourDarker=function(n,t){function r(n){return parseInt(n*t,10)}var o=XPLAN.commonutil.breakColour(n);return o?XPLAN.commonutil.RGBtoHex([r(o[0]),r(o[1]),r(o[2])]):null},XPLAN.commonutil.colourLighter=function(n,t){function r(n){return parseInt(255-Math.min(255,n),10)}function o(n){return 255-parseInt(n*t,10)}var u=XPLAN.commonutil.breakColour(n);return u?(u=[o((u=[r(u[0]),r(u[1]),r(u[2])])[0]),o(u[1]),o(u[2])],XPLAN.commonutil.RGBtoHex(u)):null},XPLAN.commonutil.RGBtoHex=function(n){var t=n[0].toString(16),r=n[1].toString(16),o=n[2].toString(16);return 1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),1==o.length&&(o="0"+o),"#"+t+r+o},XPLAN.commonutil.getFileExtension=function(n){return/(?:\.([^.]+))?$/.exec(n)[1]},XPLAN.commonutil.chunkArray=function(n,t){if(null==t||t<1)return[];for(var r=[],o=0,u=n.length;o<u;)r.push(Array.prototype.slice.call(n,o,o+=t));return r};
;Dependency._js['commonutils']=true;

;
function resetHeightIfNeeded(e,t){e||jQuery(t).height(30)}function adjustHeightForSelector(e,t,i,n,a){if(i){var o=jQuery(t).contents().find("#"+i).height();o&&o!==a&&(e=n?o+n:o+23,jQuery(t).contents().find("#pagecontent").height(e))}return e}XPLAN.namespace("ui"),XPLAN.ui.IFrameResize=function(e,t,i,n,a){var o=getFrameDoc(e);if(!o)return t?(jQuery(e).height(t),t):void 0;resetHeightIfNeeded(a,e);var r=o?Math.max(jQuery(o.body).prop("scrollHeight"),30):30,u=o?jQuery(o.body).prop("clientHeight"):30;return u>=r&&(r+=i||23),t&&r<t&&(r=t),adjustHeightForSelector(r,e,n,i,u),jQuery(e).height(r),r},XPLAN.ui.MultiIFrameResize=function(e,t){var i=30;for(var n in e){var a=e[n];i=Math.max(i,XPLAN.ui.IFrameResize(a))}jQuery(t).height(i)},XPLAN.ui.bindIFrameResize=function(e,t){jQuery(e).on("load",function(){XPLAN.ui.IFrameResize(this,t)}),jQuery(e).parents('div[class^="fieldhide"]').on("show",function(){var t=jQuery(e).contents().find("iframe").toArray();for(var i in t){var n=t[i],a=jQuery(n).contents().find("#pagecontent").first().height();XPLAN.ui.IFrameResize(jQuery(n),a)}var o=jQuery(e).contents().find("#pagecontent").first().height();XPLAN.ui.IFrameResize(jQuery(e),o)})},XPLAN.ui.fixTableKeys=function(){var e=0;jQuery('div.content table[data-dontfixkeycolumns!="true"] > tbody > tr > td.key').each(function(){var t=jQuery(this).width();t>e&&(e=t)}).width(e)},XPLAN.ui.fixTableKeysBySelector=function(e){var t=0;e.find("table td.key").each(function(){var e=jQuery(this).width();e>t&&(t=e)}).width(t)},XPLAN.ui.fixLabelsBySelector=function(e){e.find("fieldset").not(".full").each(function(t,i){var n=Math.max.apply(Math,e.find(i).find("label").map(function(){return jQuery(this).width()}).get());e.find(i).find("label").width(n)})},XPLAN.ui.addPanelboxButton=function(e,t,i){e.is("div")&&(e=e.find("h2:first"));var n=jQuery('<a class="panelbutton"></a>');n.addClass(t).bind(i);var a=e.find(".panelbutton:last");a.length>0?a.after('<a class="panelbutton add"></a>'):e.prepend(n)},XPLAN.ui.handlePanelboxButton=function(e,t,i){if((e=jQuery(e)).is(".panelbutton.minmax")){if(e.is(".panelbutton.minmax.expand")?XPLAN.ui.showPanelbox(e.closest("div.panelbox"),t,i):XPLAN.ui.hidePanelbox(e.closest("div.panelbox"),t,i),!e.hasClass("dont-save-state")){var n=e.parents("div.panelbox");if(n){var a;a=n.attr("id")?n.attr("id"):jQuery.trim(n.children("h2").text());var o=e.is(".panelbutton.minmax.expand")?"Y":"N";XMLRPC.call("panelbox.set_panelbox_state",[jQuery("#page_content_filename").val()||"",a,o],null,null)}}}else e.is(".panelbutton.close")&&(t?e.parent().parent().hide(i):e.parent().parent().fadeOut(i))},XPLAN.ui.handlePanelboxState=function(e,t){jQuery("div.panelbox",e).each(function(){var e=jQuery(this);e.attr("id")&&XMLRPC.call("panelbox.get_panelbox_state",[jQuery("#page_content_filename").val(),e.attr("id")],function(i){i&&XPLAN.ui.panelboxVisible(e)?XPLAN.ui.hidePanelbox(e,t):i||XPLAN.ui.panelboxVisible(e)||XPLAN.ui.showPanelbox(e,t)})})},XPLAN.ui.panelboxVisible=function(e){return e.find("div.content").is(":visible")},XPLAN.ui.showPanelbox=function(e,t,i){var n=e.find("div.content");e.find("h2 a.panelbutton.minmax").removeClass("expand"),t?n.show(i):n.slideDown("fast",i)},XPLAN.ui.hidePanelbox=function(e,t,i){var n=e.find("div.content");e.find("h2 a.panelbutton.minmax").addClass("expand"),t?n.hide(i):n.slideUp("fast",i)},XPLAN.ui.createSlideOutPanel=function(e,t,i){e.click(function(e){"ui-widget-overlay"===e.target.className||jQuery(e.target).parents().hasClass("ui-dialog")||XPLAN.ui.hideSlideOutPanel(t,i)}),jQuery("iframe",e).each(function(){jQuery(this).contents().find("body").click(function(){XPLAN.ui.hideSlideOutPanel(t)})}),t.click(function(e){return e.stopPropagation(),jQuery(e.target).is(":input")}),jQuery(window).resize(function(){0===parseInt(t.css("right"))&&XPLAN.ui.showSlideOutPanel(e,t)})},XPLAN.ui.showSlideOutPanel=function(e,t,i){void 0===i&&(i={}),jQuery("a.panelbutton.close",t).click(function(){XPLAN.ui.hideSlideOutPanel(t,i)}),e.css({position:"relative"}),"content"!==i.height_control&&t.css("min-height",e.height()+"px"),i.panel_height&&t.css("height",i.panel_height+"px"),t.addClass("slideout_panel"),t.css("right","0px"),jQuery(window).scrollTop()>e.offset().top?(t.removeClass("position_absolute"),t.addClass("position_fixed")):(t.removeClass("position_fixed"),t.addClass("position_absolute")),document.body.scrollHeight>document.body.clientHeight&&jQuery("body").css("overflow","hidden"),XPLAN.util.isBrowser("ie")?t.show():t.fadeIn("slow"),jQuery("body").css("overflow","auto"),t.focus()},XPLAN.ui.getSlideOutPanel=function(e,t){return{panelbox:e,panel:t,is_created:!1,show:function(e){this.is_created||(XPLAN.ui.createSlideOutPanel(this.panelbox,this.panel,e),this.is_created=!0),XPLAN.ui.showSlideOutPanel(this.panelbox,this.panel,e)},hide:function(e){XPLAN.ui.hideSlideOutPanel(this.panel,e)}}},XPLAN.ui.hideSlideOutPanel=function(e,t){void 0===t&&(t={}),"content"!==t.height_control&&e.height("0px"),e.css("right","-400px").hide()},XPLAN.ui.sortTableByURL=function(e,t,i){i||(i="sort");var n=jQuery(e).hasClass("sortable-asc");t.length>1&&(t+="&"),t+=i+"="+e.id.replace("th_",""),t+=n?"&reverse=1":"&reverse=0",document.location.href=t},XPLAN.ui.applySortClassFromQS=function(){var e=XPLAN.util.qs2object(XPLAN.util.decodeQS());e.sort&&jQuery("#th_"+e.sort).addClass("1"==e.reverse?"sortable-des":"sortable-asc")},XPLAN.ui.getLightboxholder=function(){var e=getMainFrame(),t=e.jQuery,i=t("#lbholder");return i.length||(i=t('<div id="lbholder" style="display:none"></div>').appendTo(e.document.body)),i},XPLAN.ui.setButtonState=function(e,t){t?jQuery(e).prop("disabled",!0).addClass("btn_loading"):jQuery(e).prop("disabled",!1).removeClass("btn_loading")},XPLAN.ui.trigger_iResize=function(e){for(var t=jQuery("iframe",e),i=0,n=t.length;i<n;i++)t[i].contentWindow.document.body&&(t[i].style.height=t[i].contentWindow.document.body.scrollHeight+20+"px")},XPLAN.ui.createHTMLEditor=function(e,t,i,n,a,o,r,u){var s=jQuery(e),l=s.attr("id")||s.attr("name"),d=CKEDITOR.instances[l];if(d)try{d.destroy(!0)}catch(e){window.console&&console.log("Did you forget to destroy CKEditor?",e),delete CKEDITOR.instances[l]}var c=getBaseURL();u=void 0!==u&&u,s.ckeditor({basePath:c+"/js/lib/ckeditor/",customConfig:c+"/js/ckeditor/config_"+t+".js",height:i,width:n,toolbarStartupExpanded:o,toolbar:a,readOnly:u,on:{key:XPLAN.framemain.onActivity}},r),window.setTimeout(function(){jQuery(".cke_hc").removeClass("cke_hc")},1e3)},XPLAN.ui.makeReadOnly=function(e){jQuery(document.body).css("background-color","white"),XPLAN.Portfolio.Subfunds.Dialog.resizeElements(),jQuery("input[type=hidden], input[type=submit], input[disabled=disabled]").remove(),jQuery("img.ui-datepicker-trigger").remove(),jQuery("span.icon").remove(),-1!=jQuery.inArray("input",e)&&jQuery("input:not(:checkbox)").each(function(e,t){var i=jQuery(t),n=i.attr("name");if("undefined"!=n){var a=i.val();jQuery("<span/>",{class:n}).prependTo(i.parent()).text(a),i.remove()}}),-1!=jQuery.inArray("checkbox",e)&&jQuery("input:checkbox").each(function(e,t){jQuery(t).prop("disabled",!0)}),-1!=jQuery.inArray("select",e)&&jQuery("option:selected").each(function(e,t){var i=jQuery(t),n=i.text(),a=i.parent(),o=a.attr("name");jQuery("<span/>",{class:o}).prependTo(a.parent()).text(n),a.remove()})},XPLAN.ui.addListenerForPanelBoxButtons=function(){document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".panelbutton.minmax").forEach(function(e){e.hasAttribute("panelbox-click-listener-added")||(e.addEventListener("click",function(){XPLAN.ui.handlePanelboxButton(this)}),e.setAttribute("panelbox-click-listener-added","true"))})})};
;Dependency._js['commonui']=true;

;
!function(e){"use strict";function n(e){for(var n,t,r=1,i=e.length,o=e[0]+"";r<i;r++){for(n=e[r]+"",t=y-n.length;t--;)n="0"+n;o+=n}for(i=o.length;"0"==o.charAt(--i););return o.slice(0,i+1||1)}function t(e,n,t,r){var i,o,s,c,u;for(o=1,s=e[0];s>=10;s/=10,o++);return(s=n-o)<0?(s+=y,i=0):(i=Math.ceil((s+1)/y),s%=y),o=E(10,y-s),u=e[i]%o|0,null==r?s<3?(0==s?u=u/100|0:1==s&&(u=u/10|0),c=t<4&&99999==u||t>3&&49999==u||5e4==u||0==u):c=(t<4&&u+1==o||t>3&&u+1==o/2)&&(e[i+1]/o/100|0)==E(10,s-2)-1||(u==o/2||0==u)&&0==(e[i+1]/o/100|0):s<4?(0==s?u=u/1e3|0:1==s?u=u/100|0:2==s&&(u=u/10|0),c=(r||t<4)&&9999==u||!r&&t>3&&4999==u):c=((r||t<4)&&u+1==o||!r&&t>3&&u+1==o/2)&&(e[i+1]/o/1e3|0)==E(10,s-3)-1,c}function r(e,n,t){var r=e.constructor;return null==n||((m=n<0||n>8)||0!==n&&(r.errors?parseInt:parseFloat)(n)!=n)&&!u(r,"rounding mode",n,t,0)?r.rounding:0|n}function i(e,n,t,r){var i=e.constructor;return!(m=n<(r||0)||n>=F+1)&&(0===n||(i.errors?parseInt:parseFloat)(n)==n)||u(i,"argument",n,t,0)}function o(e,r){var i,o,s,c,u,l,f,h=0,g=0,p=0,m=e.constructor,d=m.ONE,N=m.rounding,v=m.precision;if(!e.c||!e.c[0]||e.e>17)return new m(e.c?e.c[0]?e.s<0?0:1/0:d:e.s?e.s<0?0:e:NaN);for(null==r?(w=!1,u=v):u=r,f=new m(.03125);e.e>-2;)e=e.times(f),p+=5;for(u+=o=Math.log(E(2,p))/Math.LN10*2+5|0,i=c=l=new m(d),m.precision=u;;){if(c=a(c.times(e),u,1),i=i.times(++g),n((f=l.plus(R(c,i,u,1))).c).slice(0,u)===n(l.c).slice(0,u)){for(s=p;s--;)l=a(l.times(l),u,1);if(null!=r)return m.precision=v,l;if(!(h<3&&t(l.c,u-o,N,h)))return a(l,m.precision=v,N,w=!0);m.precision=u+=10,i=c=f=new m(d),g=0,h++}l=f}}function s(e,t,r,i){var o,s,c=e.constructor,u=(e=new c(e)).e;if(null==t?r=0:(a(e,++t,r),r=i?t:t+e.e-u),u=e.e,o=n(e.c),1==i||2==i&&(t<=u||u<=c.toExpNeg)){for(;o.length<r;o+="0");o.length>1&&(o=o.charAt(0)+"."+o.slice(1)),o+=(u<0?"e":"e+")+u}else{if(i=o.length,u<0){for(s=r-i;++u;o="0"+o);o="0."+o}else if(++u>i){for(s=r-u,u-=i;u--;o+="0");s>0&&(o+=".")}else s=r-i,u<i?o=o.slice(0,u)+"."+o.slice(u):s>0&&(o+=".");if(s>0)for(;s--;o+="0");}return e.s<0&&e.c[0]?"-"+o:o}function c(e){var n=e.length-1,t=n*y+1;if(n=e[n]){for(;n%10==0;n/=10,t--);for(n=e[0];n>=10;n/=10,t++);}return t}function u(e,n,t,r,i){if(e.errors){var o=new Error((r||["new Decimal","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFraction","pow","random","log","sqrt","toNearest","divToInt"][N?N<0?-N:N:1/N<0?1:0])+"() "+(["number type has more than 15 significant digits","LN10 out of digits"][n]||n+([m?" out of range":" not an integer"," not a boolean or binary digit"][i]||""))+": "+t);throw o.name="Decimal Error",m=N=0,o}}function l(e,n,t){var r=new e(e.ONE);for(w=!1;1&t&&(r=r.times(n)),t>>=1;)n=n.times(n);return w=!0,r}function f(e,r){var i,o,s,c,l,h,g,p,m,d,N,v=1,E=e,x=E.c,b=E.constructor,y=b.ONE,O=b.rounding,D=b.precision;if(E.s<0||!x||!x[0]||!E.e&&1==x[0]&&1==x.length)return new b(x&&!x[0]?-1/0:1!=E.s?NaN:x?0:E);if(null==r?(w=!1,g=D):g=r,b.precision=g+=10,o=(i=n(x)).charAt(0),!(Math.abs(c=E.e)<15e14))return E=new b(o+"."+i.slice(1)),g+2>A.length&&u(b,1,g+2,"ln"),E=f(E,g-10).plus(new b(A.slice(0,g+2)).times(c+"")),b.precision=D,null==r?a(E,D,O,w=!0):E;for(;o<7&&1!=o||1==o&&i.charAt(1)>3;)o=(i=n((E=E.times(e)).c)).charAt(0),v++;for(c=E.e,o>1?(E=new b("0."+i),c++):E=new b(o+"."+i.slice(1)),d=E,p=l=E=R(E.minus(y),E.plus(y),g,1),N=a(E.times(E),g,1),s=3;;){if(l=a(l.times(N),g,1),n((m=p.plus(R(l,new b(s),g,1))).c).slice(0,g)===n(p.c).slice(0,g)){if(p=p.times(2),0!==c&&(g+2>A.length&&u(b,1,g+2,"ln"),p=p.plus(new b(A.slice(0,g+2)).times(c+""))),p=R(p,new b(v),g,1),null!=r)return b.precision=D,p;if(!t(p.c,g-10,O,h))return a(p,b.precision=D,O,w=!0);b.precision=g+=10,m=l=E=R(d.minus(y),d.plus(y),g,1),N=a(E.times(E),g,1),s=h=1}p=m,s+=2}}function a(e,n,t,r){var i,o,s,c,u,l,f,a,h=e.constructor;e:if(null!=n){if(!(f=e.c))return e;for(i=1,c=f[0];c>=10;c/=10,i++);if((o=n-i)<0)o+=y,s=n,l=(u=f[a=0])/E(10,i-s-1)%10|0;else if((a=Math.ceil((o+1)/y))>=f.length){if(!r)break e;for(;f.length<=a;f.push(0));u=l=0,i=1,s=(o%=y)-y+1}else{for(u=c=f[a],i=1;c>=10;c/=10,i++);l=(s=(o%=y)-y+i)<0?0:v(u/E(10,i-s-1)%10)}if(r=r||n<0||null!=f[a+1]||(s<0?u:u%E(10,i-s-1)),r=t<4?(l||r)&&(0==t||t==(e.s<0?3:2)):l>5||5==l&&(4==t||r||6==t&&(o>0?s>0?u/E(10,i-s):0:f[a-1])%10&1||t==(e.s<0?8:7)),n<1||!f[0])return f.length=0,r?(n-=e.e+1,f[0]=E(10,n%y),e.e=-n||0):f[0]=e.e=0,e;if(0==o?(f.length=a,c=1,a--):(f.length=a+1,c=E(10,y-o),f[a]=s>0?(u/E(10,i-s)%E(10,s)|0)*c:0),r)for(;;){if(0==a){for(o=1,s=f[0];s>=10;s/=10,o++);for(s=f[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,f[0]==b&&(f[0]=1));break}if(f[a]+=c,f[a]!=b)break;f[a--]=0,c=1}for(o=f.length;0===f[--o];f.pop());}return w&&(e.e>h.maxE?e.c=e.e=null:e.e<h.minE&&(e.c=[e.e=0])),e}var h,g,p,m,d=e.crypto,w=!0,N=0,v=Math.floor,E=Math.pow,x=Object.prototype.toString,b=1e7,y=7,O="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",D={},S=9e15,F=1e9,A="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058";D.absoluteValue=D.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),a(e)},D.ceil=function(){return a(new this.constructor(this),this.e+1,2)},D.comparedTo=D.cmp=function(e,n){var t,r=this,i=r.c,o=(N=-N,(e=new r.constructor(e,n)).c),s=r.s,c=e.s,u=r.e,l=e.e;if(!s||!c)return null;if(t=i&&!i[0],n=o&&!o[0],t||n)return t?n?0:-c:s;if(s!=c)return s;if(t=s<0,!i||!o)return u==l?0:!i^t?1:-1;if(u!=l)return u>l^t?1:-1;for(s=-1,c=(u=i.length)<(l=o.length)?u:l;++s<c;)if(i[s]!=o[s])return i[s]>o[s]^t?1:-1;return u==l?0:u>l^t?1:-1},D.decimalPlaces=D.dp=function(){var e,n,t=null;if(e=this.c){if(t=((n=e.length-1)-v(this.e/y))*y,n=e[n])for(;n%10==0;n/=10,t--);t<0&&(t=0)}return t},D.dividedBy=D.div=function(e,n){return N=2,R(this,new this.constructor(e,n))},D.dividedToIntegerBy=D.divToInt=function(e,n){var t=this.constructor;return N=18,a(R(this,new t(e,n),0,1,1),t.precision,t.rounding)},D.equals=D.eq=function(e,n){return N=3,0===this.cmp(e,n)},D.exponential=D.exp=function(){return o(this)},D.floor=function(){return a(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(e,n){return N=4,this.cmp(e,n)>0},D.greaterThanOrEqualTo=D.gte=function(e,n){return N=5,1==(n=this.cmp(e,n))||0===n},D.isFinite=function(){return!!this.c},D.isInteger=D.isInt=function(){return!!this.c&&v(this.e/y)>this.c.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isZero=function(){return!!this.c&&0==this.c[0]},D.lessThan=D.lt=function(e,n){return N=6,this.cmp(e,n)<0},D.lessThanOrEqualTo=D.lte=function(e,n){return N=7,-1==(n=this.cmp(e,n))||0===n},D.logarithm=D.log=function(e,r){var i,o,s,c,l,h,g,p,m,d=this.constructor,v=d.precision,E=d.rounding;if(null==e)e=new d(10),i=!0;else{if(N=15,o=(e=new d(e,r)).c,e.s<0||!o||!o[0]||!e.e&&1==o[0]&&1==o.length)return new d(NaN);i=e.eq(10)}if(o=this.c,this.s<0||!o||!o[0]||!this.e&&1==o[0]&&1==o.length)return new d(o&&!o[0]?-1/0:1!=this.s?NaN:o?0:1/0);if(l=i&&(c=o[0],o.length>1||1!=c&&10!=c&&100!=c&&1e3!=c&&1e4!=c&&1e5!=c&&1e6!=c),w=!1,p=(g=v+5)+10,h=f(this,g),i?(p>A.length&&u(d,1,p,"log"),s=new d(A.slice(0,p))):s=f(e,g),t((m=R(h,s,g,1)).c,c=v,E))do{if(h=f(this,g+=10),i?((p=g+10)>A.length&&u(d,1,p,"log"),s=new d(A.slice(0,p))):s=f(e,g),m=R(h,s,g,1),!l){+n(m.c).slice(c+1,c+15)+1==1e14&&(m=a(m,v+1,0));break}}while(t(m.c,c+=10,E));return w=!0,a(m,v,E)},D.minus=function(e,n){var t,r,i,o,s=this,c=s.constructor,u=s.s;if(N=8,n=(e=new c(e,n)).s,!u||!n)return new c(NaN);if(u!=n)return e.s=-n,s.plus(e);var l=s.c,f=e.c,h=v(e.e/y),g=v(s.e/y),p=c.precision,m=c.rounding;if(!g||!h){if(!l||!f)return l?(e.s=-n,e):new c(f?s:NaN);if(!l[0]||!f[0])return s=f[0]?(e.s=-n,e):new c(l[0]?s:3==m?-0:0),w?a(s,p,m):s}if(r=(l=l.slice()).length,u=g-h){for((o=u<0)?(u=-u,t=l,r=f.length):(h=g,t=f),(g=Math.ceil(p/y))>r&&(r=g),u>(r+=2)&&(u=r,t.length=1),t.reverse(),n=u;n--;t.push(0));t.reverse()}else for((o=r<(i=f.length))&&(i=r),u=n=0;n<i;n++)if(l[n]!=f[n]){o=l[n]<f[n];break}if(o&&(t=l,l=f,f=t,e.s=-e.s),(n=-((i=l.length)-f.length))>0)for(;n--;l[i++]=0);for(g=b-1,n=f.length;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=g);--l[r],l[n]+=b}l[n]-=f[n]}for(;0==l[--i];l.pop());for(;0==l[0];l.shift(),--h);for(l[0]||(l=[h=0],e.s=3==m?-1:1),e.c=l,u=1,n=l[0];n>=10;n/=10,u++);return e.e=u+h*y-1,w?a(e,p,m):e},D.modulo=D.mod=function(e,n){var t,r,i=this,o=i.constructor,s=o.modulo;return N=9,n=(e=new o(e,n)).s,(t=!i.c||!n||e.c&&!e.c[0])||!e.c||i.c&&!i.c[0]?t?new o(NaN):a(new o(i),o.precision,o.rounding):(w=!1,9==s?(e.s=1,r=R(i,e,0,3,1),e.s=n,r.s*=n):r=R(i,e,0,s,1),r=r.times(e),w=!0,i.minus(r))},D.naturalLogarithm=D.ln=function(){return f(this)},D.negated=D.neg=function(){var e=new this.constructor(this);return e.s=-e.s||null,a(e)},D.plus=function(e,n){var t,r=this,i=r.constructor,o=r.s;if(N=10,n=(e=new i(e,n)).s,!o||!n)return new i(NaN);if(o!=n)return e.s=-n,r.minus(e);var s=r.c,c=e.c,u=v(e.e/y),l=v(r.e/y),f=i.precision,h=i.rounding;if(!l||!u){if(!s||!c)return new i(o/0);if(!s[0]||!c[0])return r=c[0]?e:new i(s[0]?r:0*o),w?a(r,f,h):r}if(s=s.slice(),o=l-u){for(o<0?(o=-o,t=s,n=c.length):(u=l,t=c,n=s.length),(l=Math.ceil(f/y))>n&&(n=l),o>++n&&(o=n,t.length=1),t.reverse();o--;t.push(0));t.reverse()}for(s.length-c.length<0&&(t=c,c=s,s=t),o=c.length,n=0,l=b;o;s[o]%=l)n=(s[--o]=s[o]+c[o]+n)/l|0;for(n&&(s.unshift(n),++u),o=s.length;0==s[--o];s.pop());for(e.c=s,o=1,n=s[0];n>=10;n/=10,o++);return e.e=o+u*y-1,w?a(e,f,h):e},D.precision=D.sd=function(e){var n=null,t=this;return e!=n&&e!==!!e&&1!==e&&0!==e&&u(t.constructor,"argument",e,"precision",1),t.c&&(n=c(t.c),e&&t.e+1>n&&(n=t.e+1)),n},D.round=function(){var e=this,n=e.constructor;return a(new n(e),e.e+1,n.rounding)},D.squareRoot=D.sqrt=function(){var e,t,r,i,o,s,c=this,u=c.c,l=c.s,f=c.e,h=c.constructor,g=new h(.5);if(1!==l||!u||!u[0])return new h(!l||l<0&&(!u||u[0])?NaN:u?c:1/0);for(w=!1,0==(l=Math.sqrt(+c))||l==1/0?(((t=n(u)).length+f)%2==0&&(t+="0"),l=Math.sqrt(t),f=v((f+1)/2)-(f<0||f%2),i=new h(t=l==1/0?"1e"+f:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+f)):i=new h(l.toString()),r=(f=h.precision)+3;;)if(s=i,i=g.times(s.plus(R(c,s,r+2,1))),n(s.c).slice(0,r)===(t=n(i.c)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(a(i,f+1,1),e=!i.times(i).eq(c));break}if(!o&&(a(s,f+1,0),s.times(s).eq(c))){i=s;break}r+=4,o=1}return w=!0,a(i,f,h.rounding,e)},D.times=function(e,n){var t,r,i=this,o=i.constructor,s=i.c,c=(N=11,(e=new o(e,n)).c),u=v(i.e/y),l=v(e.e/y),f=i.s;if(n=e.s,e.s=f==n?1:-1,!((u||s&&s[0])&&(l||c&&c[0])))return new o(!f||!n||s&&!s[0]&&!c||c&&!c[0]&&!s?NaN:s&&c?0*e.s:e.s/0);for(r=u+l,(f=s.length)<(n=c.length)&&(t=s,s=c,c=t,l=f,f=n,n=l),l=f+n,t=[];l--;t.push(0));for(u=n-1;u>-1;u--){for(n=0,l=f+u;l>u;n=n/b|0)n=t[l]+c[u]*s[l-u-1]+n,t[l--]=n%b|0;n&&(t[l]=(t[l]+n)%b)}for(n&&++r,t[0]||t.shift(),l=t.length;!t[--l];t.pop());for(e.c=t,f=1,n=t[0];n>=10;n/=10,f++);return e.e=f+r*y-1,w?a(e,o.precision,o.rounding):e},D.toDecimalPlaces=D.toDP=function(e,n){var t=this;return t=new t.constructor(t),null!=e&&i(t,e,"toDP")?a(t,(0|e)+t.e+1,r(t,n,"toDP")):t},D.toExponential=function(e,n){var t=this;return t.c?s(t,null!=e&&i(t,e,"toExponential")?0|e:null,null!=e&&r(t,n,"toExponential"),1):t.toString()},D.toFixed=function(e,n){var t,o=this,c=o.constructor,u=c.toExpNeg,l=c.toExpPos;return null!=e&&(e=i(o,e,t="toFixed")?o.e+(0|e):null,n=r(o,n,t)),c.toExpNeg=-(c.toExpPos=1/0),null!=e&&o.c?(t=s(o,e,n),o.s<0&&o.c&&(o.c[0]?t.indexOf("-")<0&&(t="-"+t):t=t.replace("-",""))):t=o.toString(),c.toExpNeg=u,c.toExpPos=l,t},D.toFormat=function(e,n){var t=this;if(!t.c)return t.toString();var r,i=t.s<0,o=t.constructor.format,s=o.groupSeparator,c=+o.groupSize,u=+o.secondaryGroupSize,l=t.toFixed(e,n).split("."),f=l[0],a=l[1],h=i?f.slice(1):f,g=h.length;if(u&&(g-=(r=c,c=u,u=r)),c>0&&g>0){for(r=g%c||c,f=h.substr(0,r);r<g;r+=c)f+=s+h.substr(r,c);u>0&&(f+=s+h.slice(r)),i&&(f="-"+f)}return a?f+o.decimalSeparator+((u=+o.fractionGroupSize)?a.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+o.fractionGroupSeparator):a):f},D.toFraction=function(e){var t,r,i,o,s,l,f,a,h=this,g=h.constructor,p=t=new g(g.ONE),d=l=new g(0),x=h.c,b=new g(d);if(!x)return h.toString();for(i=b.e=c(x)-h.e-1,b.c[0]=E(10,(f=i%y)<0?y+f:f),(null==e||(!(N=12,s=new g(e)).s||(m=s.cmp(p)<0||!s.c)||g.errors&&v(s.e/y)<s.c.length-1)&&!u(g,"max denominator",e,"toFraction",0)||(e=s).cmp(b)>0)&&(e=i>0?b:p),w=!1,s=new g(n(x)),f=g.precision,g.precision=i=x.length*y*2;a=R(s,b,0,1,1),1!=(r=t.plus(a.times(d))).cmp(e);)t=d,d=r,p=l.plus(a.times(r=p)),l=r,b=s.minus(a.times(r=b)),s=r;return r=R(e.minus(t),d,0,1,1),l=l.plus(r.times(p)),t=t.plus(r.times(d)),l.s=p.s=h.s,o=R(p,d,i,1).minus(h).abs().cmp(R(l,t,i,1).minus(h).abs())<1?[p+"",d+""]:[l+"",t+""],w=!0,g.precision=f,o},D.toNearest=function(e,n){var t=this,i=t.constructor;return t=new i(t),null==e?(e=new i(i.ONE),n=i.rounding):(N=17,e=new i(e),n=r(t,n,"toNearest")),e.c?t.c&&(e.c[0]?(w=!1,t=R(t,e,0,n<4?[4,5,7,8][n]:n,1).times(e),w=!0,a(t)):t.c=[t.e=0]):t.s&&(e.s&&(e.s=t.s),t=e),t},D.toNumber=function(){var e=this;return+e||(e.s?0*e.s:NaN)},D.toPower=D.pow=function(e,r){var i,s,c,u,h=this,g=h.constructor,p=h.s,m=(N=13,+(e=new g(e,r))),d=m<0?-m:m,x=g.precision,b=g.rounding;if(!h.c||!e.c||(c=!h.c[0])||!e.c[0])return new g(E(c?0*p:+h,m));if(i=(h=new g(h)).c.length,!h.e&&h.c[0]==h.s&&1==i)return h;if(r=e.c.length-1,e.e||e.c[0]!=e.s||r)if(!(c=(s=v(e.e/y))>=r)&&p<0)u=new g(NaN);else{if(c&&i*y*d<3e3){if(u=l(g,h,d),e.s<0)return g.ONE.div(u)}else{if(p=p<0&&1&e.c[Math.max(s,r)]?-1:1,(s=0!=(r=E(+h,m))&&isFinite(r)?new g(r+"").e:v(m*(Math.log("0."+n(h.c))/Math.LN10+h.e+1)))>g.maxE+1||s<g.minE-1)return new g(s>0?p/0:0);w=!1,g.rounding=h.s=1,d=Math.min(12,(s+"").length),t((u=a(u=o(e.times(f(h,x+d)),x),x+5,1)).c,x,b)&&(s=x+10,+n((u=a(o(e.times(f(h,s+d)),s),s+5,1)).c).slice(x+1,x+15)+1==1e14&&(u=a(u,x+1,0))),u.s=p,w=!0,g.rounding=b}u=a(u,x,b)}else u=a(h,x,b);return u},D.toPrecision=function(e,n){var t=this;return null!=e&&i(t,e,"toPrecision",1)&&t.c?s(t,0|--e,r(t,n,"toPrecision"),2):t.toString()},D.toSignificantDigits=D.toSD=function(e,n){var t=this,o=t.constructor;return t=new o(t),null!=e&&i(t,e,"toSD",1)?a(t,0|e,r(t,n,"toSD")):a(t,o.precision,o.rounding)},D.toString=function(e){var t,r,i,o=this,c=o.constructor,l=o.e;if(null===l)r=o.s?"Infinity":"NaN";else{if(e===t&&(l<=c.toExpNeg||l>=c.toExpPos))return s(o,null,c.rounding,1);if(r=n(o.c),l<0){for(;++l;r="0"+r);r="0."+r}else if(i=r.length,l>0)if(++l>i)for(l-=i;l--;r+="0");else l<i&&(r=r.slice(0,l)+"."+r.slice(l));else if(t=r.charAt(0),i>1)r=t+"."+r.slice(1);else if("0"==t)return t;if(null!=e)if((m=!(e>=2&&e<65))||e!=(0|e)&&c.errors)u(c,"base",e,"toString",0);else if("0"==(r=h(c,r,0|e,10,o.s)))return r}return o.s<0?"-"+r:r},D.truncated=D.trunc=function(){return a(new this.constructor(this),this.e+1,1)},D.valueOf=function(){return this.toString()},D.toJSON=function(){return{_type:"BigDecimal",_val:this.toString()}},h=function(){function e(e,n,t){for(var r,i,o=[0],s=0,c=e.length;s<c;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=O.indexOf(e.charAt(s++));r<o.length;r++)o[r]>t-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}return function(n,t,r,i,o){var s,c,u,f,a,h,g=t.indexOf("."),p=n.precision,m=n.rounding;for(i<37&&(t=t.toLowerCase()),g>=0&&(t=t.replace(".",""),f=l(n,h=new n(i),t.length-g),h.c=e(f.toFixed(),10,r),h.e=h.c.length),s=c=(a=e(t,i,r)).length;0==a[--c];a.pop());if(!a[0])return"0";if(g<0?s--:(f.c=a,f.e=s,f.s=o,a=(f=R(f,h,p,m,0,r)).c,u=f.r,s=f.e),g=a[p],c=r/2,u=u||null!=a[p+1],m<4?(null!=g||u)&&(0==m||m==(f.s<0?3:2)):g>c||g==c&&(4==m||u||6==m&&1&a[p-1]||m==(f.s<0?8:7)))for(a.length=p,--r;++a[--p]>r;)a[p]=0,p||(++s,a.unshift(1));else a.length=p;for(c=a.length;!a[--c];);for(g=0,t="";g<=c;t+=O.charAt(a[g++]));if(s<0){for(;++s;t="0"+t);t="0."+t}else if(++s>(g=t.length))for(s-=g;s--;t+="0");else s<g&&(t=t.slice(0,s)+"."+t.slice(s));return t}}();var R=function(){function e(e,n,t){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*n+i,e[o]=r%t|0,i=r/t|0;return i&&e.unshift(i),e}function n(e,n,t,r){var i,o;if(t!=r)o=t>r?1:-1;else for(i=o=0;i<t;i++)if(e[i]!=n[i]){o=e[i]>n[i]?1:-1;break}return o}function t(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]<n[t]?1:0,e[t]=i*r+e[t]-n[t];for(;!e[0]&&e.length>1;e.shift());}return function(r,i,o,s,c,u){var l,f,h,g,p,m,d,w,N,E,x,O,D,S,F,A,R,M,P,q=r.constructor,_=r.s==i.s?1:-1,L=r.c,U=i.c;if(!(L&&L[0]&&U&&U[0]))return new q(r.s&&i.s&&(L?!U||L[0]!=U[0]:U)?L&&0==L[0]||!U?0*_:_/0:NaN);for(u?(g=1,f=r.e-i.e):(u=b,g=y,f=v(r.e/g)-v(i.e/g)),M=U.length,A=L.length,E=(N=new q(_)).c=[],h=0;U[h]==(L[h]||0);h++);if(U[h]>(L[h]||0)&&f--,null==o?(_=o=q.precision,s=q.rounding):_=c?o+(r.e-i.e)+1:o,_<0)E.push(1),p=!0;else{if(_=_/g+2|0,h=0,1==M){for(m=0,U=U[0],_++;(h<A||m)&&_--;h++)S=m*u+(L[h]||0),E[h]=S/U|0,m=S%U|0;p=m||h<A}else{for((m=u/(U[0]+1)|0)>1&&(U=e(U,m,u),L=e(L,m,u),M=U.length,A=L.length),F=M,O=(x=L.slice(0,M)).length;O<M;x[O++]=0);(P=U.slice()).unshift(0),R=U[0],U[1]>=u/2&&R++;do{m=0,(l=n(U,x,M,O))<0?(D=x[0],M!=O&&(D=D*u+(x[1]||0)),(m=D/R|0)>1?(m>=u&&(m=u-1),1==(l=n(d=e(U,m,u),x,w=d.length,O=x.length))&&(m--,t(d,M<w?P:U,w,u))):(0==m&&(l=m=1),d=U.slice()),(w=d.length)<O&&d.unshift(0),t(x,d,O,u),-1==l&&(l=n(U,x,M,O=x.length))<1&&(m++,t(x,M<O?P:U,O,u)),O=x.length):0===l&&(m++,x=[0]),E[h++]=m,l&&x[0]?x[O++]=L[F]||0:(x=[L[F]],O=1)}while((F++<A||null!=x[0])&&_--);p=null!=x[0]}E[0]||E.shift()}if(1==g)N.e=f,N.r=+p;else{for(h=1,_=E[0];_>=10;_/=10,h++);N.e=h+f*g-1,a(N,c?o+N.e+1:o,s,p)}return N}}();if(g=function(){function e(e){var n,t,r,i="config",o=this.errors?parseInt:parseFloat;return e==t||"object"!=typeof e&&!u(this,"object expected",e,i)?this:((r=e[n="precision"])!=t&&((m=r<1||r>F)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(r=e[n="rounding"])!=t&&((m=r<0||r>8)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(r=e[n="toExpNeg"])!=t&&((m=r<-S||r>0)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="toExpPos"])!=t&&((m=r<0||r>S)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="minE"])!=t&&((m=r<-S||r>0)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="maxE"])!=t&&((m=r<0||r>S)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="errors"])!=t&&(r===!!r||1===r||0===r?(m=N=0,this[n]=!!r):u(this,n,r,i,1)),(r=e[n="crypto"])!=t&&(r===!!r||1===r||0===r?this[n]=!(!r||!d||"object"!=typeof d):u(this,n,r,i,1)),(r=e[n="modulo"])!=t&&((m=r<0||r>9)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(e=e[n="format"])!=t&&("object"==typeof e?this[n]=e:u(this,"format object expected",e,i)),this)}function n(e){return new this(e).exp()}function t(e){return new this(e).ln()}function r(e,n){return new this(e).log(n)}function o(e,n,t){var r,i,o=0;for("[object Array]"==x.call(n[0])&&(n=n[0]),r=new e(n[0]);++o<n.length;){if(!(i=new e(n[o])).s){r=i;break}r[t](i)&&(r=i)}return r}function s(){return o(this,arguments,"lt")}function c(){return o(this,arguments,"gt")}function l(e,n){return new this(e).pow(n)}function f(e){var n,t,r,o=0,s=[],c=new this(this.ONE);if(null!=e&&i(c,e,"random")?e|=0:e=this.precision,t=Math.ceil(e/y),this.crypto)if(d&&d.getRandomValues)for(n=d.getRandomValues(new Uint32Array(t));o<t;)(r=n[o])>=429e7?n[o]=d.getRandomValues(new Uint32Array(1))[0]:s[o++]=r%1e7;else if(d&&d.randomBytes){for(n=d.randomBytes(t*=4);o<t;)(r=n[o]+(n[o+1]<<8)+(n[o+2]<<16)+((127&n[o+3])<<24))>=214e7?d.randomBytes(4).copy(n,o):(s.push(r%1e7),o+=4);o=t/4}else u(this,"crypto unavailable",d,"random");if(!o)for(;o<t;)s[o++]=1e7*Math.random()|0;for(t=s[--o],e%=y,t&&e&&(r=E(10,y-e),s[o]=(t/r|0)*r);0===s[o];o--)s.pop();if(o<0)s=[t=0];else{for(t=-1;0===s[0];)s.shift(),t-=y;for(o=1,r=s[0];r>=10;)r/=10,o++;o<y&&(t-=y-o)}return c.e=t,c.c=s,c}function g(e){return new this(e).sqrt()}var p,b,A=(p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},function(e,n,t,r){var i,o,s,c,l,f;if("string"!=typeof t&&(t=(c="number"==typeof t||"[object Number]"==x.call(t))&&0===t&&1/t<0?"-0":t+""),l=t,null==r&&p.test(t))n.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==r)return a(new e(t),e.precision,e.rounding);if(t=b.call(t).replace(/^\+(?!-)/,""),n.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=r?r!=(0|r)&&e.errors||(m=!(r>=2&&r<65))?(u(e,"base",r,0,0),f=p.test(t)):(i="["+O.slice(0,r|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(f=new RegExp("^"+i+"(?:\\."+i+")?$",r<37?"i":"").test(t))?(c&&(t.replace(/^0\.0*|\./,"").length>15&&u(e,0,l),c=!c),t=h(e,t,10,r,n.s)):"Infinity"!=t&&"NaN"!=t&&(u(e,"not a base "+r+" number",l),t="NaN")):f=p.test(t),!f)return n.c=n.e=null,"Infinity"!=t&&("NaN"!=t&&u(e,"not a number",l),n.s=null),N=0,n}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(o<0&&(o=s),o+=+t.slice(s+1),t=t.substring(0,s)):o<0&&(o=t.length),s=0;"0"==t.charAt(s);s++);for(r=t.length;"0"==t.charAt(--r););if(t=t.slice(s,r+1)){if(r=t.length,c&&r>15&&u(e,0,l),n.e=o=o-s-1,n.c=[],s=(o+1)%y,o<0&&(s+=y),s<r){for(s&&n.c.push(+t.slice(0,s)),r-=y;s<r;)n.c.push(+t.slice(s,s+=y));t=t.slice(s),s=y-t.length}else s-=r;for(;s--;t+="0");n.c.push(+t),w&&(n.e>e.maxE?n.c=n.e=null:n.e<e.minE&&(n.c=[n.e=0]))}else n.c=[n.e=0];N=0});return function i(o){function h(e,n){var t=this;if(!(t instanceof h))return u(h,"Decimal called without new",e),new h(e,n);if(e instanceof h){if(null==n)return N=0,t.constructor=e.constructor,t.s=e.s,t.e=e.e,void(t.c=(e=e.c)?e.slice():e);if(10==n)return a(new h(e),h.precision,h.rounding);e+=""}return A(t.constructor=h,t,e,n)}return h.precision=20,h.rounding=4,h.modulo=1,h.toExpNeg=-7,h.toExpPos=21,h.minE=-S,h.maxE=S,h.errors=!0,h.crypto=!1,h.format={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},h.prototype=D,h.ZERO=new h(0),h.ONE=new h(1),h.HUNDRED=new h(100),h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=e,h.constructor=i,h.exp=n,h.ln=t,h.log=r,h.max=s,h.min=c,h.pow=l,h.sqrt=g,h.random=f,null!=o&&h.config(o),h}()}(),"function"==typeof define&&define.amd)define(function(){return g});else if("undefined"!=typeof module&&module.exports){if(module.exports=g,!d)try{d=require("crypto")}catch(e){}}else p=e.Decimal,g.noConflict=function(){return e.Decimal=e.BigDecimal=e.FastBigDecimal=p,g},e.Decimal=e.BigDecimal=e.FastBigDecimal=g}(this);
;Dependency._js['lib/decimaljs/decimal']=true;

;
!function(){var rsplit=function(e,t){for(var n,i=t.exec(e),r=new Array;null!=i;)n=i.index,t.lastIndex,0!=n&&(e.substring(0,n),r.push(e.substring(0,n)),e=e.slice(n)),r.push(i[0]),e=e.slice(i[0].length),i=t.exec(e);return""==!e&&r.push(e),r},chop=function(e){return e.substr(0,e.length-1)},extend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};EJS=function(e){if(e="string"==typeof e?{view:e}:e,this.set_options(e),e.precompiled)return this.template={},this.template.process=e.precompiled,void EJS.update(this.name,this);if(e.element){if("string"==typeof e.element){var t=e.element;if(e.element=document.getElementById(e.element),null==e.element)throw t+"does not exist!"}e.element.value?this.text=e.element.value:this.text=e.element.innerHTML,this.name=e.element.id,this.type="["}else if(e.url){e.url=EJS.endExt(e.url,this.extMatch),this.name=this.name?this.name:e.url;var n=e.url;if(i=EJS.get(this.name,this.cache))return i;if(i==EJS.INVALID_PATH)return null;try{this.text=EJS.request(n+(this.cache?"":"?"+Math.random()))}catch(e){}if(null==this.text)throw{type:"EJS",message:"There is no template at "+n}}var i;(i=new EJS.Compiler(this.text,this.type)).compile(e,this.name),EJS.update(this.name,this),this.template=i},EJS.prototype={render:function(e,t){e=e||{},this._extra_helpers=t;var n=new EJS.Helpers(e,t||{});return this.template.process.call(e,e,n)},update:function(element,options){if("string"==typeof element&&(element=document.getElementById(element)),null==options)return _template=this,function(e){EJS.prototype.update.call(_template,element,e)};"string"==typeof options?(params={},params.url=options,_template=this,params.onComplete=function(request){var object=eval(request.responseText);EJS.prototype.update.call(_template,element,object)},EJS.ajax_request(params)):element.innerHTML=this.render(options)},out:function(){return this.template.out},set_options:function(e){this.type=e.type||EJS.type,this.cache=null!=e.cache?e.cache:EJS.cache,this.text=e.text||null,this.name=e.name||null,this.ext=e.ext||EJS.ext,this.extMatch=new RegExp(this.ext.replace(/\./,"."))}},EJS.endExt=function(e,t){return e?(t.lastIndex=0,e+(t.test(e)?"":this.ext)):null},EJS.Scanner=function(e,t,n){extend(this,{left_delimiter:t+"%",right_delimiter:"%"+n,double_left:t+"%%",double_right:"%%"+n,left_equal:t+"%=",left_comment:t+"%#"}),this.SplitRegexp="["==t?/(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/:new RegExp("("+this.double_left+")|(%%"+this.double_right+")|("+this.left_equal+")|("+this.left_comment+")|("+this.left_delimiter+")|("+this.right_delimiter+"\n)|("+this.right_delimiter+")|(\n)"),this.source=e,this.stag=null,this.lines=0},EJS.Scanner.to_text=function(e){return null==e||void 0===e?"":e instanceof Date?e.toDateString():e.toString?e.toString():""},EJS.Scanner.prototype={scan:function(e){if(scanline=this.scanline,regex=this.SplitRegexp,""==!this.source)for(var t=rsplit(this.source,/\n/),n=0;n<t.length;n++){var i=t[n];this.scanline(i,regex,e)}},scanline:function(e,t,n){this.lines++;for(var i=rsplit(e,t),r=0;r<i.length;r++){var s=i[r];if(null!=s)try{n(s,this)}catch(e){throw{type:"EJS.Scanner",line:this.lines}}}}},EJS.Buffer=function(e,t){this.line=new Array,this.script="",this.pre_cmd=e,this.post_cmd=t;for(var n=0;n<this.pre_cmd.length;n++)this.push(e[n])},EJS.Buffer.prototype={push:function(e){this.line.push(e)},cr:function(){this.script=this.script+this.line.join("; "),this.line=new Array,this.script=this.script+"\n"},close:function(){if(this.line.length>0){for(var e=0;e<this.post_cmd.length;e++)this.push(pre_cmd[e]);this.script=this.script+this.line.join("; "),line=null}}},EJS.Compiler=function(e,t){this.pre_cmd=["var ___ViewO = [];"],this.post_cmd=new Array,this.source=" ",null!=e&&("string"==typeof e?(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"),this.source=e):e.innerHTML&&(this.source=e.innerHTML),"string"!=typeof this.source&&(this.source=""));var n=">";switch(t=t||"<"){case"[":n="]";break;case"<":break;default:throw t+" is not a supported deliminator"}this.scanner=new EJS.Scanner(this.source,t,n),this.out=""},EJS.Compiler.prototype={compile:function(options,name){options=options||{},this.out="";var put_cmd="___ViewO.push(",insert_cmd=put_cmd,buff=new EJS.Buffer(this.pre_cmd,this.post_cmd),content="",clean=function(e){return e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/"/g,'\\"')};this.scanner.scan(function(e,t){if(null==t.stag)switch(e){case"\n":content+="\n",buff.push(put_cmd+'"'+clean(content)+'");'),buff.cr(),content="";break;case t.left_delimiter:case t.left_equal:case t.left_comment:t.stag=e,content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),content="";break;case t.double_left:content+=t.left_delimiter;break;default:content+=e}else switch(e){case t.right_delimiter:switch(t.stag){case t.left_delimiter:"\n"==content[content.length-1]?(content=chop(content),buff.push(content),buff.cr()):buff.push(content);break;case t.left_equal:buff.push(insert_cmd+"(EJS.Scanner.to_text("+content+")))")}t.stag=null,content="";break;case t.double_right:content+=t.right_delimiter;break;default:content+=e}}),content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),buff.close(),this.out=buff.script+";";var to_be_evaled="/*"+name+"*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {"+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";try{eval(to_be_evaled)}catch(e){if("undefined"==typeof JSLINT)throw e;JSLINT(this.out);for(var i=0;i<JSLINT.errors.length;i++){var error=JSLINT.errors[i];if("Unnecessary semicolon."!=error.reason){error.line++;var err=new Error;throw err.lineNumber=error.line,err.message=error.reason,options.view&&(err.fileName=options.view),err}}}}},EJS.config=function(e){EJS.cache=null!=e.cache?e.cache:EJS.cache,EJS.type=null!=e.type?e.type:EJS.type,EJS.ext=null!=e.ext?e.ext:EJS.ext;var t=EJS.templates_directory||{};EJS.templates_directory=t,EJS.get=function(e,n){return 0==n?null:t[e]?t[e]:null},EJS.update=function(e,n){null!=e&&(t[e]=n)},EJS.INVALID_PATH=-1},EJS.config({cache:!0,type:"<",ext:".ejs"}),EJS.Helpers=function(e,t){this._data=e,this._extras=t,extend(this,t)},EJS.Helpers.prototype={view:function(e,t,n){return n||(n=this._extras),t||(t=this._data),new EJS(e).render(t,n)},to_text:function(e,t){return null==e||void 0===e?t||"":e instanceof Date?e.toDateString():e.toString?e.toString().replace(/\n/g,"<br />").replace(/''/g,"'"):""}},EJS.newRequest=function(){for(var e=[function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=0;t<e.length;t++)try{var n=e[t]();if(null!=n)return n}catch(e){continue}},EJS.request=function(e){var t=new EJS.newRequest;t.open("GET",e,!1);try{t.send(null)}catch(e){return null}return 404==t.status||2==t.status||0==t.status&&""==t.responseText?null:t.responseText},EJS.ajax_request=function(e){e.method=e.method?e.method:"GET";var t=new EJS.newRequest;t.onreadystatechange=function(){4==t.readyState&&(t.status,e.onComplete(t))},t.open(e.method,e.url),t.send(null)}}();
;Dependency._js['lib/ejs/ejs']=true;

;
function HttpRequest(e){return this.setURL(e),this.onerror=null,this}"undefined"!=typeof Dependency&&Dependency.addJS("main"),HttpRequest._log_alert=function(e){"undefined"!=typeof console&&(console.log(e),"function"==typeof console.trace&&console.trace())},HttpRequest.dummy=function(e){},HttpRequest.httppool=new Array,HttpRequest.onerror=function(e){var t="errormsg"in e?e.errormsg:e.message,r=_("Error:\n%a").replace("%a",t);HttpRequest._log_alert(r),alert(r)},HttpRequest.prototype.callMultiRPC=function(e,t,r,n){t||(t=this.onerror);return HttpRequest.invoke(this.url,HttpRequest.prepareMultiRPC(e,n),HttpRequest.processRPC,function(n){for(var o=0;o<n.length;o++){var a=n[o];if("struct"==XMLRPC.getDataType(a)&&a.faultCode){var u=t;e[o].length>=4&&(u=e[o][3]),u(new Error(new String(a.faultString)))}else if(e[o].length>=3){var s=e[o][2];s&&s(a)}}r&&r(n)},t||this.onerror)},HttpRequest.prototype.callJSONGET=function(e,t,r,n){var o=this.url,a=HttpRequest.prepareJSON(e,t);if(a.data.length<1500){t=HttpRequest.buildData({rpcreq:a.data});o.indexOf("?")>=0?o+="&"+t:o+="?"+t,o.length>1900?o=this.url:(a.cmd="GET",delete a.data,delete a.mimetype)}return HttpRequest.invoke(o,a,HttpRequest.processJSON,r,n||this.onerror)},HttpRequest.prototype.callJSON=function(e,t,r,n){return HttpRequest.invoke(this.url,HttpRequest.prepareJSON(e,t),HttpRequest.processJSON,r,n||this.onerror)},HttpRequest.prototype.callRPC=function(e,t,r,n){return HttpRequest.invoke(this.url,HttpRequest.prepareRPC(e,t),HttpRequest.processRPC,r,n||this.onerror)},HttpRequest.prototype.doHEAD=function(e,t){var r=this.url;return HttpRequest.invoke(r,{cmd:"HEAD"},function(){},e,t||this.onerror,!0)},HttpRequest.prototype.doGET=function(e,t,r){var n=this.url;"object"==typeof e?e=HttpRequest.buildData(e):"string"!=typeof e&&(e=""),""!=e&&(n.indexOf("?")>=0?n+="&"+e:n+="?"+e);return HttpRequest.invoke(n,{cmd:"GET"},HttpRequest.process,t,r||this.onerror)},HttpRequest.prototype.doPOST=function(e,t,r,n){"object"==typeof e?e=HttpRequest.buildData(e,n):"string"!=typeof e&&(e="");var o={cmd:"POST",data:e,mimetype:"<?xml"==e.substring(0,5)?"text/xml":"application/x-www-form-urlencoded"};return HttpRequest.invoke(this.url,o,HttpRequest.process,t,r||this.onerror)},HttpRequest.invoke=function(e,t,r,n,o,a){if(!r||"function"!=typeof r)throw new Error('invoke: argument "processor" not defined.');var u=!!n,s=HttpRequest.getHTTP();return s.onreadystatechange=u?function(){if(4==s.readyState){try{n(HttpRequest.receive(s,r))}catch(e){if(0!==e.http_status||a){if(!o)throw e;o(e,this)}else HttpRequest._log_alert("HTTP Error: 0 (User left the page before an ajax call returned.)")}s.abort()}}:document.all?function(){}:null,s.open(t.cmd,e,u),t.data&&s.setRequestHeader("Content-Type",t.mimetype),s.send(t.data?t.data:""),!!u||HttpRequest.receive(s,r)},HttpRequest.prototype.setURL=function(e){e=e?HttpRequest.normaliseURL(e):HttpRequest.getRPC2URL(),this.url=e},HttpRequest.buildData=function(e,t){var r=new Array;if(e instanceof Array)for(var n=0;n<e.length;n++){var o=e[n][0];if((u=e[n][1])instanceof Array)for(var a=0;a<u.length;a++)r.push(encodeURIComponent(o)+"="+encodeURIComponent(u[a]));else r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}else for(var o in e){var u;if((u=e[o])||t&&void 0!==u&&null!==u)if(u instanceof Array)for(a=0;a<u.length;a++)r.push(encodeURIComponent(o)+"="+encodeURIComponent(u[a]));else r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}return r.join("&")},HttpRequest.getHTTP=function(){for(var e,t=0;t<HttpRequest.httppool.length;t++)if(0==(e=HttpRequest.httppool[t]).readyState)return e;if(window.XMLHttpRequest)e=new XMLHttpRequest;else{if(!window.ActiveXObject)throw new Error("Cannot create HTTP Request object.");e=new ActiveXObject("Microsoft.XMLHTTP")}return HttpRequest.httppool.push(e),e},HttpRequest.getRPC2URL=function(){if(!HttpRequest.rpc2url){var e=getBaseURL()+"/RPC2/";HttpRequest.rpc2url=HttpRequest.normaliseURL(e)}return HttpRequest.rpc2url},HttpRequest.normaliseURL=function(e){if(!/^https?:\/\//.test(e)){var t=new String(document.location);e=/^\//.test(e)?t.replace(/^(https?:\/\/[^\/]+)?.*/,"$1"+e):t.replace(/\/[^\/]*$/,"/"+e)}return e},HttpRequest.openTracebackBox=function(){var e=getBaseURL()+"/home/error/tracebackbox";window.open(e,"tracebackbox","height=350,width=500,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no")},HttpRequest.prepareMultiRPC=function(e,t){void 0===t&&(t=!0);for(var r=new Array,n=0;n<e.length;n++){var o={};o.methodName=e[n][0],o.params=e[n][1],r.push(o)}return HttpRequest.prepareRPC("system.multicall",[r,t])},HttpRequest.prepareJSON=function(e,t){var r={method:e,params:t,id:1};return{cmd:"POST",data:XPLAN.json.encode(r),mimetype:"application/json"}},HttpRequest.prepareRPC=function(e,t){var r;r='<?xml version="1.0"?>\n',r+="<methodCall>\n",r+="<methodName>"+e+"</methodName>\n",r+="<params>\n";for(var n=0;n<t.length;n++)r+="<param>\n",r+="<value>"+XMLRPC.encodeXML(t[n])+"</value>\n",r+="</param>\n";return r+="</params>\n",{cmd:"POST",data:r+="</methodCall>",mimetype:"text/xml"}},HttpRequest.process=function(e){var t=e.getResponseHeader("Content-Type");return"text/xml"==t.substring(0,8)?e.responseXML:"application/json"==t.substring(0,18)?XPLAN.json.decode(e.responseText):e.responseText},HttpRequest.processJSON=function(e){var t=XPLAN.json.decode(e.responseText);if(t){if(t.error)throw-32501!=t.error.faultCode&&-32502!=t.error.faultCode||XPLAN.util.form_redirect(getBaseURL()+"/home/logoff"),-32505==t.error.faultCode&&HttpRequest.openTracebackBox(),new Error(new String(t.error.faultString));return t.result}throw new Error("XMLRPC: Invalid JSON")},HttpRequest.processRPC=function(e){var t=e.responseXML;if(t)return XMLRPC.decodeResponse(t);throw new Error("XMLRPC: Invalid RPC response - not DOM.")},HttpRequest.receive=function(e,t){if(200==e.status)return t(e);var r=new Error("HTTP: "+e.status+" "+e.statusText);throw console.log(e.responseText),r.http_status=e.status,r},XMLRPC={},XMLRPC.iso8601=new RegExp("^(\\d{4})(\\d{2})(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})"),XMLRPC.call=function(e,t,r,n){return(new HttpRequest).callJSON(e,t,r,n)},XMLRPC.callGET=function(e,t,r,n){return(new HttpRequest).callJSONGET(e,t,r,n)},XMLRPC.decodeDOM=function(e){switch(e.tagName){case"string":for(var t="",r=0;r<e.childNodes.length;r++){t+=(o=e.childNodes[r]).data}return t;case"int":case"i4":return e.firstChild?parseInt(e.firstChild.data):0;case"double":return e.firstChild?parseFloat(e.firstChild.data):0;case"dateTime.iso8601":return XMLRPC.iso8601.test(e.firstChild.nodeValue)?new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5,RegExp.$6):new Date;case"array":if((e=XMLRPC.getNode(e,0))&&"data"==e.tagName){var n=new Array;for(r=0;r<e.childNodes.length;r++){1==(o=e.childNodes[r]).nodeType&&n.push(XMLRPC.decodeDOM(o))}return n}throw new Error("XMLRPC: Invalid RPC Response on <array />.");case"struct":for(n={},r=0,r=0;r<e.childNodes.length;r++){var o;if(1==(o=e.childNodes[r]).nodeType&&"member"==o.tagName){var a=XMLRPC.getNode(o,0),u=XMLRPC.getNode(o,1);a.childNodes.length>0&&(n[a.firstChild.nodeValue]=XMLRPC.decodeDOM(u))}else if(1==o.nodeType)throw new Error("XMLRPC: Invalid RPC Response on <struct />.")}return n;case"boolean":return isNaN(parseInt(e.firstChild.data))?"true"==e.firstChild.data:parseInt(e.firstChild.data);case"base64":return XMLRPC.decodeBase64(e.firstChild.nodeValue);case"value":return(o=XMLRPC.getNode(e,0))?XMLRPC.decodeDOM(o):e.firstChild?e.firstChild.data:"";default:return!1}},XMLRPC.decodeResponse=function(e){var t=e.getElementsByTagName("fault");if(t.length>0)throw-32501!=(t=XMLRPC.decodeDOM(XMLRPC.firstElementChild(t[0]))).faultCode&&-32502!=t.faultCode||XPLAN.util.form_redirect(getBaseURL()+"/home/logoff"),-32505==t.faultCode&&HttpRequest.openTracebackBox(),new Error(new String(t.faultString));var r=e.getElementsByTagName("param");return 0==r.length?null:XMLRPC.decodeDOM(XMLRPC.getNode(r[0],0))},XMLRPC.encodeXML=function(e){var t=XMLRPC.getDataType(e);switch(t){case"array":for(var r="<array><data>\n",n=0;n<e.length;n++)r+="<value>"+XMLRPC.encodeXML(e[n])+"</value>\n";return r+="</data></array>\n";case"date":return"<dateTime.iso8601>"+XMLRPC.dateToISO8601(e)+"</dateTime.iso8601>";case"struct":r="<struct>\n";for(var n in e)r+="<member>\n",r+="<name>"+n+"</name>\n",r+="<value>"+XMLRPC.encodeXML(e[n])+"</value>\n",r+="</member>\n";return r+="</struct>\n";case"boolean":return"<boolean>"+(e?"1":"0")+"</boolean>";case"string":e=(e=(e=new String(e)).replace(/&/g,"&amp;")).replace(/</g,"&lt;");default:return"<"+t+">"+e+"</"+t+">"}},XMLRPC.isArray=function(e){return e instanceof Array||e.push&&e.pop&&void 0!=e.length},XMLRPC.isDate=function(e){return e instanceof Date||e.getFullYear&&e.getMonth&&e.getDate},XMLRPC.getDataType=function(e){var t=typeof e;switch(t=t.toLowerCase()){case"number":return Math.round(e)==e?"i4":"double";case"object":return XMLRPC.isArray(e)?"array":XMLRPC.isDate(e)?"date":"struct";default:return t}},XMLRPC.dateToISO8601=function(e){return new String(e.getFullYear())+XMLRPC.leadingZero(new String(e.getMonth()+1))+XMLRPC.leadingZero(new String(e.getDate()))+"T"+XMLRPC.leadingZero(new String(e.getHours()))+":"+XMLRPC.leadingZero(new String(e.getMinutes()))+":"+XMLRPC.leadingZero(new String(e.getSeconds()))},XMLRPC.leadingZero=function(e){return 1==e.length?"0"+e:e},XMLRPC.decodeBase64=function(e){if(e.length%4>0)return e;if("undefined"!=typeof atob)return atob(e);var t,r,n="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/\W|=/g,""),r=0;r<e.length;r+=4)t=(255&o.indexOf(e.charAt(r)))<<18|(255&o.indexOf(e.charAt(r+1)))<<12|(255&o.indexOf(e.charAt(r+2)))<<6|255&o.indexOf(e.charAt(r+3)),n+=String.fromCharCode(t>>16&255,t>>8&255,255&t);return n.substring(0,n.length-(61==e.charCodeAt(r-2)?2:61==e.charCodeAt(r-1)?1:0))},XMLRPC.getNode=function(e,t){var r=0;if(null==e)return!1;for(var n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];if(1==o.nodeType&&r++==t)return o}return!1},XMLRPC.firstElementChild=function(e){for(e=e.firstChild;e&&1!==e.nodeType;)e=e.nextSibling;return e},XMLRPC.deferred_call=function(e,t){var r=jQuery.Deferred();return XMLRPC.call(e,t,function(e){r.resolve(e)},function(e){HttpRequest.onerror(e),r.reject(e)}),r.promise()},XMLRPCMulti={queue:new Array,timer:null,delay:1e3,qsize:10,onerror:function(e){alert(_("Multi-call error: %a").replace("%a",e.message))},separate_context:!0},XMLRPCMulti.callMulti=function(e,t){for(var r in e)if(e.hasOwnProperty(r)){var n=e[r].when;(void 0===n||("function"==typeof n?n():n))&&XMLRPCMulti.queue.push([r,e[r].params,e[r].onresponse,e[r].onerror])}XMLRPCMulti.callAsync(void 0===t?XMLRPCMulti.separate_context:t)},XMLRPCMulti.call=function(e,t,r,n,o){XMLRPCMulti.queue.push([e,t,r,n]),XMLRPCMulti.queue.length<XMLRPCMulti.qsize&&(XMLRPCMulti.timer&&clearTimeout(XMLRPCMulti.timer),XMLRPCMulti.timer=setTimeout(function(){XMLRPCMulti.callAsync(void 0===o?XMLRPCMulti.separate_context:o)},XMLRPCMulti.delay))},XMLRPCMulti.callAsync=function(e){if(XMLRPCMulti.queue.length>0){var t=new HttpRequest;if(1==XMLRPCMulti.queue.length){var r=XMLRPCMulti.queue.pop();t.callRPC(r[0],r[1],r[2]||HttpRequest.dummy,r[3]||XMLRPCMulti.onerror)}else t.callMultiRPC(XMLRPCMulti.queue,XMLRPCMulti.onerror,null,e),XMLRPCMulti.queue=new Array}XMLRPCMulti.timer=null},function(e){e.XPLAN.namespace("net");var t=function(e,r,n,o){return t.fn.init(e,r,n,o)};t.fn=t.prototype={constructor:t,init:function(t,r,n,o){var a=this,u=null,s={method:t,params:r,id:Math.floor(2147483647*Math.random())+""};return u={type:"POST",url:getBaseURL()+"/RPC2/",data:JSON.stringify(s),dataType:"json",contentType:"application/json",context:e.document,converters:{"text json":XPLAN.json.decode}},"function"==typeof o&&(u.error=function(e,t,r){o.apply(a,r)}),"function"==typeof n&&(u.success=function(e,t,r){n(e.result)}),jQuery.ajax(u)}},e.XPLAN.net.makeRequest=t}(window),QueuedXMLRPC=function(){var e=null;this.call=function(t,r,n,o){var a=jQuery.Deferred();this.setup().done(function(){XMLRPC.call(t,r,function(e){a.resolve(),n(e)},function(e){a.resolve(),null==o&&(o=HttpRequest.onerror),o(e)})}),e=a.promise()},this.setup=function(){var t=jQuery.Deferred();return jQuery.when(e).always(function(){t.resolve()}),t.promise()}};var LimitQueuedXMLRPC=function(e,t){function r(){var e=n.shift();return void 0!==e&&e.on_discard&&e.on_discard({discarded_by_queue:!0}),e}e=e||1,t=t||1;var n=[],o=0;this.call=function(a,u,s,i,l){!function(t,o,a,u,s){for(;n.length>=e;)r();n.push({method:t,args:o,success:a,error:u,on_discard:s})}(a,u,s,i,l),function e(){if(!(o>=t)){var r=n.shift();if(void 0!==r){var a=jQuery.Deferred();o++,XMLRPC.call(r.method,r.args,function(e){a.resolve(),r.success(e)},function(e){a.resolve(),(r.error||HttpRequest.onerror)(e)}),a.always(function(){o--,e()})}}}()},this.clear_queued=function(){for(;n.length>0;)r()}};
;Dependency._js['httpreq']=true;

;
function PopupContent(t){return this.html=t,this}function PopupURL(t){return this.url=t,this.hide_on_blur=!1,this.inc_height=0,this.inc_width=0,this.height=null,this.width=null,this}function PopupURL2(t,e,o){return this.url=t,this.width=e,this.height=o,this.hide_on_blur=!1,this}function PopupHelpTip(t,e,o){return this.html=t,this.width=e,this.height=o,this}function PopupMsgBox(t,e){return this.html=t,this.caption=e,this.onclose=null,this.oncancel=null,this.button=0,this.prompt=null,this}function PopupForm(t,e,o,n){return this.html=t,this.caption=e,this.onclose=null,this.iterative=o,this.width=n,this}function PopupContent2(t){return this.html=t,this.div=null,this}function PopupForm2(t,e,o){return this.html=t,this.caption=e,this.onclose=null,this.iterative=o,this}function PopupFrame(t){var e=getMainFrame(),o=getFrameDoc(e),n=jQuery('<iframe id="popupframe" class="popupframe" src="'+getBaseURL()+'/static/dummy.html" frameborder="0" scrolling="no"/>',o).appendTo(o.body);this.doc=o,this.frame=n,this.framenew=null,this.shown=!1,this.firsttime=!0,this.level=t,this.x=null,this.y=null}function PopupDiv(t,e){var o=getMainFrame(),n=null;n=e?jQuery(e).get(0).ownerDocument:getFrameDoc(o);var i=jQuery('<div class="popupdiv" id="popupdiv-'+t+'"><div class="popupdivinner"></div></div>',n).hide();null==e?i.appendTo(n.body):i.insertAfter(e),this.div=i,this.divnext=null,this.doc=n,this.shown=!1,this.level=t,this.x=null,this.y=null,this.cssClass=null}function PopupURL3(t,e){return this.url=t,this.onclose=null,this.oncancel=null,this.button=0,this.prompt=null,this.handle_mouse=!0,this.updateAttrs(e,["caption","onclose","prompt","width","height","oncancel"]),this.button=e.button||[["ok",_("Ok")]],this.html='<iframe style="background-color:white" class="PopupURL2" src="'+getBaseURL()+this.url+'" width="'+(this.width-20)+'px" height="'+(this.height-80)+'px" frameborder="0" scrolling="auto"/>',this.enableEggTimer=e.enableEggTimer,this}function PopupYouTube(t,e){return this.videohash="0NogltmewmQ",this.caption=t,this.width=1e3,this.height=562,this.updateAttrs(e,["width","height"]),this}Date.now||(Date.now=function(){return(new Date).getTime()}),XPLAN.util.update(PopupContent,{css:getBaseURL()+"/css/",img:getBaseURL()+"/img/",dummy:function(){return!1},handleSelect:function(t){var e=t.target;return"INPUT"==e.tagName&&"text"==e.type||"TEXTAREA"==e.tagName}}),PopupContent.getHTMLSkel=function(t,e){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" class="'+t+'">\n<head><link rel="StyleSheet" type="text/css" href="'+PopupContent.css+'main.css" />\n<link rel="StyleSheet" type="text/css" href="'+PopupContent.css+'popup.css" />\n</head>\n<body class="'+t+'">\n<script type="text/javascript" src="'+getBaseURL()+'/js/lib/jquery/jquery.js"><\/script>\n<script type="text/javascript" defer="defer">var jQuery=window.parent.jQuery;jQuery.noConflict();<\/script>\n'+e+"\n</body>\n</html>"},PopupContent.prototype.getSizeAdjustment=function(t,e){return[t,e]},PopupContent.prototype.onBlur=function(){return!0},PopupContent.prototype.onPostShow=function(t){},PopupContent.prototype.updateAttrs=function(t,e){for(var o=0;o<e.length;o++){var n=e[o];t[n]&&(this[n]=t[n],delete t[n])}},PopupContent.prototype.updateContent=function(t){var e=t.getDocument();e.open("text/html","replace"),e.write(PopupContent.getHTMLSkel("Content",this.html)),e.close()},PopupURL.showCentre=function(t,e,o,n){var i=new PopupURL(t),p={height:o,modal:n,width:e},u=["width","height","hide_on_blur","onclose"];"object"==XPLAN.util.getType(e)&&(p=e);for(var r=0;r<u.length;r++){var s=u[r];p[s]&&(i[s]=p[s])}return p.modal&&ModalUtil.setModal(!0),popup=PopupFrame.getPopup(i),popup.showCentre(),popup},PopupURL.prototype=new PopupContent,PopupURL.prototype.getSizeAdjustment=function(t,e){return this.width&&this.height?[this.width,this.height]:[t+this.inc_width,e+this.inc_height]},PopupURL.prototype.onBlur=function(){return this.hide_on_blur},PopupURL.prototype.updateContent=function(t){t.frame.attr("src",getBaseURL()+this.url)},PopupURL2.show=function(t,e){var o=new PopupURL2(t,e.width,e.height);return o.updateAttrs(e,["hide_on_blur"]),e.x&&e.y||(e.centre=!0),PopupDiv.show(o,e)},PopupURL2.prototype=new PopupContent,PopupURL2.prototype.onBlur=function(){return this.hide_on_blur},PopupURL2.prototype.updateContent=function(t){jQuery('<iframe id="PopupURL2" class="PopupURL2" src="'+getBaseURL()+this.url+'" frameborder="0" scrolling="no"/>',t.doc).width(this.width).height(this.height).appendTo(t.div.children())},PopupHelpTip.bindHover=function(t,e){var o=null;"string"==XPLAN.util.getType(e)&&(e=jQuery(e)),e.hover(function(e){o=PopupHelpTip.show(t,{evt:e,nohide:!0})},function(){o&&(o.hide(),o=null)})},PopupHelpTip.show=function(t,e){return e||(e={}),PopupDiv.show(new PopupHelpTip(t,e.width,e.height),e)},PopupHelpTip.showByClick=function(t,e,o,n){return PopupDiv.show(new PopupHelpTip(t,o,n),{evt:e})},PopupHelpTip.hideLast=function(){return PopupDiv.hideLast()},PopupHelpTip.prototype=new PopupContent,PopupHelpTip.prototype.updateContent=function(t){var e=jQuery('<div class="HelpTip">'+this.html+"</div>",t.doc).appendTo(t.div.children()).bind("contextmenu",PopupContent.dummy).bind("selectstart",PopupContent.handleSelect);this.width&&e.width(this.width),this.height&&e.height(this.height).css("overflow","auto")},PopupMsgBox.show_confirm_html=function(t,e,o,n,i,p){var u=n||_("Confirm");return PopupMsgBox.show_generic_html(t,u,{button:p||[["yes",_("Yes")],["no",_("No")]],icon:"icon-warning.png",onclose:e,width:o,oncancel:i})},PopupMsgBox.show_confirm_text=function(t,e,o,n,i,p){return PopupMsgBox.show_confirm_html(XPLAN.util.escape(t),e,o,n,i,p)},PopupMsgBox.show_error_html=function(t,e){return PopupMsgBox.show_generic_html(t,_("Error"),{icon:"icon-error.png",onclose:e,cssClass:"iress-popup--state-error"})},PopupMsgBox.show_error_text=function(t,e){return PopupMsgBox.show_error_html(XPLAN.util.escape(t),e)},PopupMsgBox.show_generic_html=function(t,e,o){var n=new PopupMsgBox(t,e);return o=o||{},n.updateAttrs(o,["onclose","prompt","width","height","oncancel"]),n.button=o.button||[["ok",_("Ok")]],o.icon&&(n.icon=PopupContent.img+o.icon),o.x&&o.y||(o.centre=!0),PopupDiv.show(n,o)},PopupMsgBox.show_generic_text=function(t,e,o){return PopupMsgBox.show_generic_html(XPLAN.util.escape(t),e,o)},PopupMsgBox.show_info_html=function(t,e){return PopupMsgBox.show_generic_html(t,_("Information"),{icon:"icon-info.png",onclose:e,cssClass:"iress-popup--state-info"})},PopupMsgBox.show_info_text=function(t,e){return PopupMsgBox.show_info_html(XPLAN.util.escape(t),e)},PopupMsgBox.show_bgtask_notification=function(t,e){var o="<p>"+XPLAN.util.escape(t?t+" ":_("The report is now being generated asynchronously in the background. \n"));o+=XPLAN.util.escape(_("A message will be sent to you when it is completed and ready for download. \n")),o+=XPLAN.util.escape(_("You will be notified by the bell at the top right hand corner.\n"))+"</p>",PopupMsgBox.show_info_html(o,e)},PopupMsgBox.show_bgtask_already_running_notification=function(t,e,o){var n="<p>"+XPLAN.util.escape(e?e+" ":_("The report is already being generated asynchronously in the background (with job id %a).").replace("%a",t)+"\n");n+=XPLAN.util.escape(_("A message will be sent to you when it is completed and ready for download. \n")),n+=XPLAN.util.escape(_("You will be notified by the bell at the top right hand corner.\n"))+"</p>",PopupMsgBox.show_info_html(n,o)},PopupMsgBox.show_warning_html=function(t,e,o,n){var i=n||_("Warning");return PopupMsgBox.show_generic_html(t,i,{icon:"icon-warning.png",onclose:e,width:o,cssClass:"iress-popup--state-warning"})},PopupMsgBox.show_warning_text=function(t,e,o,n){return PopupMsgBox.show_warning_html(XPLAN.util.escape(t),e,o,n)},PopupMsgBox.getButtonFunc=function(t,e){return function(){return e.hide(),t.onclose&&t.onclose(jQuery(this).text(),jQuery(this).attr("id")),!1}},PopupMsgBox.getButtonPromptFunc=function(t,e){return function(){return e.hide(),t.onclose&&t.onclose(e.div.find("input:text").val()),!1}},PopupMsgBox.init=function(t,e){var o=e.xplanelem,n='<div class="MsgBox2"'+(o?' data-xplan-elem="'+o+'"':"")+">"+(e.title?'<h2 class="MsgBox-Title"></h2>':"")+(e.icon?'<div class="MsgBox-Icon"><img/></div>':"")+'<div class="MsgBox-Content'+(e.icon?" MsgBox-Content-Icon":"")+'"></div></div>',i=jQuery(n,t.doc).appendTo(t.div.children()).width(e.width);if(e.height&&i.height(e.height),e.title&&i.children("h2.MsgBox-Title").text(e.title).prepend('<a class="panelbutton close" data-xplan-elem="popup_btn_close"></a>').children("a").click(function(){t.hide(),t.content.oncancel&&t.content.oncancel()}),e.icon&&i.find("div.MsgBox-Icon > img").attr("src",e.icon),e.buttons){for(var p=jQuery('<div class="MsgBox-Button"/>',t.doc).appendTo(i),u=0;u<e.buttons.length;u++){var r=e.buttons[u],s="",h="";"string"==typeof r[0]?(s=r[0],h=r[0]):(s=r[0][0],h=r[0][1]),jQuery("<button/>",t.doc).attr("id","popup_btn_"+s).text(h).click(r[1]).appendTo(p)}jQuery("<br/>",t.doc).appendTo(i).css("clear","both")}return i.children("div.MsgBox-Content")},PopupMsgBox.prototype=new PopupContent,PopupMsgBox.prototype.onBlur=function(){return!1},PopupMsgBox.prototype.onPostShow=function(t){null!=this.prompt&&t.div.find("input").focus().select()},PopupMsgBox.prototype.updateContent=function(t){var e={icon:this.icon,title:this.caption?this.caption:"Message",height:this.height?this.height:0,width:this.width?this.width:this.icon?290:250};if(this.prompt)e.buttons=[[["ok",_("Ok")],PopupMsgBox.getButtonPromptFunc(this,t)],[["cancel",_("Cancel")],function(){t.hide()}]];else if(this.button){for(var o=[],n=0;n<this.button.length;n++)o.push([this.button[n],PopupMsgBox.getButtonFunc(this,t)]);e.buttons=o}var i=PopupMsgBox.init(t,e);i.html(this.html),this.prompt&&jQuery('<div class="MsgBox-Prompt"><input type="text"/></div>',t.doc).insertAfter(i).children("input").val(this.prompt)},PopupForm.getOkFunc=function(t,e,o){return function(){if(t.onbeforeclose||t.onclose)var n=getFormPostData(o,!0);return!(t.onbeforeclose&&!t.onbeforeclose(n,e.getDocument()))&&(e.hide(),t.onclose&&t.onclose(n),!1)}},PopupForm.getApplyFunc=function(t,e,o){return function(){return t.onapply&&t.onapply(getFormPostData(o,!0)),!1}},PopupForm.getDoneFunc=function(t,e,o){return function(){return t.ondone&&t.ondone(e.getDocument()),e.hide(),!1}},PopupForm.getCancelFunc=function(t,e,o){return function(){return t.oncancel&&t.oncancel(e.getDocument()),e.hide(),!1}},PopupForm.initBody=function(t,e,o){var n=t.getDocument();e=PopupContent.getHTMLSkel("MsgBox",e),n.open("text/html","replace"),n.write(e),n.close(),jQuery(n.body).bind("contextmenu",PopupContent.dummy).bind("selectstart",PopupContent.handleSelect);var i=jQuery("<div/>",n).appendTo(n.body);return o&&i.css("width",o),i},PopupForm.initButton=function(t,e,o){return"string"==typeof e?(id=e,text=e):(id=e[0],text=e[1]),t.append("<button/>").children("button:last").attr("id","btn_"+id).text(text).click(o)},PopupForm.initButtonBar=function(t){var e=t.children("#button-bar");return e.length||(e=t.append('<div id="button-bar" class="MsgBox-Button"/>').children("div:last")),e},PopupForm.initMainPane=function(t,e){var o;t.ownerDocument;if(e){var n=(o=t.append('<table cellpadding="0" cellspacing="0"/>').children("table:last").get(0)).insertRow(0);n.vAlign="top",jQuery(n.insertCell(0)).addClass("MsgBox-Icon").append("<img/>").children("img").attr("src",e),o=jQuery(n.insertCell(1))}else o=t.append("<div/>").children("div:last");return o.addClass("MsgBox-Content"),o},PopupForm.initTitle=function(t,e,o){return t.append('<div id="MsgBoxTitle" class="MsgBox-Title"/>').children("div:last").text(e||"Message")},PopupForm.prototype=new PopupContent,PopupForm.prototype.addCSS=function(t){this._css||(this._css=new Array),this._css.push(t)},PopupForm.prototype.addJS=function(t){this._js||(this._js=new Array),this._js.push(t)},PopupForm.prototype.getInitHTML=function(){var t="";if(this._css)for(var e=0;e<this._css.length;e++)t+='<link rel="StyleSheet" type="text/css" href="'+this._css[e]+'" />\n';if(this._js)for(e=0;e<this._js.length;e++)t+='<script type="text/javascript" src="'+this._js[e]+'"><\/script>\n';return t},PopupForm.prototype.onBlur=function(){return!1},PopupForm.prototype.onPostShow=function(t){var e=t.getDocument();jQuery("input:text,select,textarea",e).eq(0).focus()},PopupForm.prototype.updateContent=function(t){var e=this.getInitHTML();this.width||(this.width=this.icon?350:330);var o,n=PopupForm.initBody(t,e),i=n.get(0).ownerDocument;PopupForm.initTitle(n,this.caption,t,!0),o=PopupForm.initMainPane(n,this.icon);var p=i.createDocumentFragment(),u=[];jQuery(p).append(this.html);var r,s=i.getElementsByTagName("head")[0],h=jQuery('<form name="input"/>',i).append(p).css("margin","0").appendTo(o).bind("submit",function(){return!1}).get(0);u&&jQuery.each(u,function(t,e){var o=e.text||e.textContent||e.innerHTML||"",n=e.src,p=i.createElement("script");p.type="text/javascript",n&&(p.src=n),p.text=o,s.insertBefore(p,s.firstChild),s.removeChild(p)}),this.iterative?(r=PopupForm.getApplyFunc(this,t,h),f2=PopupForm.getDoneFunc(this,t,h)):(r=PopupForm.getOkFunc(this,t,h),f2=PopupForm.getCancelFunc(this,t,h)),o=PopupForm.initButtonBar(n),this.iterative?(PopupForm.initButton(o,["apply",_("Apply")],r),PopupForm.initButton(o,["done",_("Done")],f2)):(PopupForm.initButton(o,["ok",_("Ok")],r),PopupForm.initButton(o,["cancel",_("Cancel")],f2)),this.onaddeventhandler&&this.onaddeventhandler(i,t),this.data&&setFormPostData(i.forms[0],this.data)},PopupContent2.prototype=new PopupContent,PopupContent2.prototype.updateContent=function(t){t.div.html(this.html),this.div=t.div},PopupContent2.prototype.hide=function(){this.div.hide();var t=getMainFrame().PopupDiv;t&&t.hideAll()},PopupForm2.getApplyFunc=function(t,e){return function(){return t.onapply&&t.onapply(getFormPostData(PopupForm2.getForm(e),!0)),!1}},PopupForm2.getCancelFunc=function(t,e){return function(){return t.oncancel&&t.oncancel(e.div),e.hide(),!1}},PopupForm2.getDoneFunc=function(t,e){return function(){return t.ondone&&t.ondone(e.div),e.hide(),!1}},PopupForm2.getForm=function(t){return t.div.find("form").get(0)},PopupForm2.getOkFunc=function(t,e){return function(){if(t.onbeforeclose||t.onclose)var o=getFormPostData(PopupForm2.getForm(e),!0);return!(t.onbeforeclose&&!t.onbeforeclose(o,e.div,this))&&(e.hide(),t.onclose&&t.onclose(o),!1)}},PopupForm2.show=function(t,e,o){var n=new PopupForm2(t,e,!!o.interactive);return n.updateAttrs(o,["width","height","data","hide_on_blur","nocaption","onclose","ondone","onapply","oncancel","onbeforeclose","onupdatecontent","onaftershow","xplanelem","no_buttons","onblur"]),o.icon&&(n.icon=PopupContent.img+o.icon),o.x&&o.y||(o.centre=!0),PopupDiv.show(n,o),n},PopupForm2.prototype=new PopupContent,PopupForm2.prototype.onBlur=function(){return this.onblur&&this.onblur(),!!this.hide_on_blur},PopupForm2.prototype.onPostShow=function(t){var e=t.div.find("input:text,select,textarea");e.length&&e.eq(0).select(),this.onaftershow&&this.onaftershow(t)},PopupForm2.prototype.updateContent=function(t){var e={icon:this.icon,height:this.height?this.height:0,width:this.width?this.width:400,xplanelem:this.xplanelem};this.nocaption||(e.title=this.caption||"Input Form"),this.no_buttons||(this.iterative?e.buttons=[[["apply",_("Apply")],PopupForm2.getApplyFunc(this,t)],[["done",_("Done")],PopupForm2.getDoneFunc(this,t)]]:e.buttons=[[["ok",_("Ok")],PopupForm2.getOkFunc(this,t)],[["cancel",_("Cancel")],PopupForm2.getCancelFunc(this,t)]]);var o=PopupMsgBox.init(t,e),n=jQuery('<form name="input"><div id="popup_content"></div></form>',t.doc).bind("submit",function(){return!1}).appendTo(o);n.children("div#popup_content").html(this.html),this.onupdatecontent&&this.onupdatecontent(o),this.data&&setFormPostData(n.get(0),this.data)};var AbstractMenuElement=function(){};AbstractMenuElement.prototype=new PopupContent,AbstractMenuElement.prototype.appendRow=function(t,e){var o=jQuery('<li role="menuitem" />').appendTo(t);if(e)return o;o.addClass("Menu-Item");var n=this.is_menu?"menu":"item";if(this.href&&!this.disabled){var i={target:this.link_target,href:this.href};return this.options&&this.options.attributes&&underscore.extend(i,this.options.attributes),jQuery('<a class="button"/>').attr(i).text(this.text).attr("data-type",n).appendTo(o),o}var p=jQuery("<button/>");this.options&&this.options.attributes&&p.attr(this.options.attributes),p.attr("data-type",n),p.appendTo(o),jQuery("<span/>").text(this.text).appendTo(p),this.disabled&&(p.prop("disabled","disabled"),p.addClass("Menu-Item-Disabled"),this.disabled_reason&&p.prop("title",this.disabled_reason));var u=this;return this.action&&p.click(function(){u.disabled||(u._invoked=!0,u.dispatchAction())}).keydown(function(t){13==t.keyCode&&p.click()}),this._invoked=!1,o};var PopupMenu=function(t,e,o,n){return t||(t=new Array),this.title=t.title,this.items=t,this.text=e,this.disabled=o,this.level=-1,this.reverse=!1,this.is_menu=!0,this.popupDiv=null,this.options=n,this};PopupMenu.prototype=new AbstractMenuElement,PopupMenu.invoke_path=new Array,PopupMenu.showDropdown=function(t,e,o,n){var i=PopupMenu.generatePopupMenuFromMenuItems(t),p=jQuery(e),u=p.getXY();u.y+=p.outerHeight(),"right"==n&&(u.x+=p.outerWidth()),o=null==o?null:jQuery(o),PopupMenu.show(i,u.x,u.y,o,n)},PopupMenu.generatePopupMenuFromMenuItems=function(t){if(!t.length||t[0]instanceof PopupMenu||t[0]instanceof PopupMenuItem||t[0]instanceof PopupMenuOption||t[0]instanceof PopupMenuSeparator||t[0]instanceof PopupMenuSelect)return t;try{return function t(e,o){if(!o.length)return o;for(var n=0;n<o.length;n++){var i=o[n];if("menu"===i.type){var p=t([],i.items),u=!!i.disabled;e.push(new PopupMenu(p,i.title,u))}else if("menuitem"===i.type){var r=i.title,s=i.action||null,h=(u=!!i.disabled,i.link?getBaseURL()+i.link:null),a=i.target||null;e.push(new PopupMenuItem(r,s,u,h,a))}else"separator"===i.type&&e.push(new PopupMenuSeparator)}return e}(new Array,t)}catch(t){alert(t)}},PopupMenu.show=function(t,e,o,n,i){var p={x:e,y:o,insertAfterElem:n};return i&&(p[i]=!0),PopupDiv.show(new PopupMenu(t),p)},PopupMenu.showByClick=function(t,e,o,n){var i=PopupMenu.generatePopupMenuFromMenuItems(t);return!e&&window.event&&(e=jQuery.event.fix(window.event)),PopupDiv.show(new PopupMenu(i),{evt:e,x:o,y:n})},PopupMenu.prototype.itemEntered=function(t,e,o){this.clearTimers(t);this.isVerticalMove(o)?(this.hideSubMenu(),this.showSubMenu(t)):(this.delayCall(t,"_hovered_long",this.itemHoveredLongEnough,[t]),this.delayCall(t,"_hovered_maybe_stopped",this.itemHoveredMaybeStopped,[t]))},PopupMenu.prototype.itemLeft=function(t){this.clearTimers(t)},PopupMenu.prototype.isVerticalMove=function(t){if(!this.activeSubmenuDiv||null===this.menuTriggeredX||null===this.menuTriggeredY)return!0;var e=t.pageX-this.menuTriggeredX,o=-(t.pageY-this.menuTriggeredY),n=this.activeSubmenuDiv.div,i=n.offset(),p=n.height(),u=n.width(),r=this.menuTriggeredX>i.left,s=r?i.left+u:i.left,h=Math.max(25,p/8),a=s-this.menuTriggeredX,l=a*o-e*-(i.top-h-this.menuTriggeredY),c=a*o-e*-(i.top+p+h-this.menuTriggeredY);return!(r?l>=0&&c<=0:l<=0*c>=0)},PopupMenu.InitTimerDelays=function(t,e){for(var o=[],n=200;n<t;n+=150)o.push(n);PopupMenu._TimerDelays={_hovered_long:[t],_hovered_maybe_stopped:o},PopupMenu._hovered_stop_threshold=e},PopupMenu.InitTimerDelays(900,70),PopupMenu.prototype.clearTimers=function(t){for(key in PopupMenu._TimerDelays)this.clearTimer(t,key)},PopupMenu.prototype.clearTimer=function(t,e){var o=t[e];if(o)for(var n=0;n<o.length;n++)window.clearTimeout(o[n]);t[e]=null},PopupMenu.prototype.delayCall=function(t,e,o,n){var i=this;this.clearTimer(t,e);for(var p=[],u=PopupMenu._TimerDelays[e],r=0;r<u.length;r++)p.push(window.setTimeout(function(){o.apply(i,n)},u[r]));t[e]=p},PopupMenu.prototype.itemLeftLongAgo=function(t){if(this.clearTimers(t),this.activeSubmenuItem._hovered)return this.menuTriggeredX=null,void(this.menuTriggeredY=null);t===this.activeSubmenuItem&&this.hideSubMenu()},PopupMenu.prototype.itemHoveredLongEnough=function(t){this.hideSubMenu(),this.showSubMenu(t)},PopupMenu.prototype.itemHoveredMaybeStopped=function(t){Date.now()-this._mouse_time>PopupMenu._hovered_stop_threshold&&(this.hideSubMenu(),this.showSubMenu(t))},PopupMenu.prototype.showSubMenu=function(t){if(!t.disabled&&(this.clearTimers(t),this.menuTriggeredX=this._mouse_x,this.menuTriggeredY=this._mouse_y,t.is_menu)){var e=this.popupDiv.getX(),o=(this.popupDiv.getY(),t.el.offset().top),n=this.popupDiv.getWidth(),i=this.popupDiv.getNext(t);this.activeSubmenuDiv=i,this.activeSubmenuItem=t,i.show(e+n-3,o-1,!0);var p=this.popupDiv.doc.body.clientWidth,u=i.getWidth();(this.popupDiv.content.reverse||e+n+u-3>p)&&(i.fixPos(e-u+6,o-1),i.content.reverse=!0),t.el.addClass("Expanded"),this.menuEl.addClass("Expanded")}},PopupMenu.prototype.hideSubMenu=function(){this.menuEl.removeClass("Expanded"),this.activeSubmenuDiv&&(this.activeSubmenuDiv.hide(!1,!0),this.clearTimers(this.activeSubmenuItem),this.activeSubmenuItem.el.removeClass("Expanded"),this.activeSubmenuDiv=null,this.activeSubmenuItem=null,this.menuTriggeredX=null,this.menuTriggeredY=null)},PopupMenu.prototype.populateItem=function(t){return this.el=this.appendRow(t),this.icon&&(this.el.css("background-image","url("+this.icon+")"),table.addClass("Menu-Icon")),this.el.addClass("Expandable").attr("aria-haspopup",!0),this.el.attr("data-xplan-elem",this.text.replace(/ /g,"_").toLowerCase()),this.el},PopupMenu.prototype.rowCreated=function(t,e){var o=this;if(e.hover(function(n){o.itemEntered(t,e,n)},function(e){o.itemLeft(t)}),t.is_menu){o=this;e.keydown(function(e){13==e.keyCode&&(o.hideSubMenu(),o.showSubMenu(t))})}},PopupMenu.prototype.updateContent=function(t){this.popupDiv=t;var e=jQuery('<ul class="Menu" role="menu" />',t.doc).appendTo(t.div.children());this.menuEl=e;this.title&&jQuery('<h1 class="Menu-Title" />').text(this.title).insertBefore(e);var o=this;e.hover(function(){o._hovered=!0},function(){o._hovered=!1}),e.mousemove(function(t){o._mouse_x=t.pageX,o._mouse_y=t.pageY,o._mouse_time=Date.now()});var n=this.items;"function"==typeof n&&(n=n.apply(this),n=PopupMenu.generatePopupMenuFromMenuItems(n));var i=!1;if(n.length>0)for(var p=0;p<n.length;p++){var u=n[p].populateItem(e,t.level);this.rowCreated(n[p],u),!i&&u.find("button:enabled")&&(i=!0,u.find("button:enabled"),window.setTimeout(function(){},0))}else{var r=new PopupMenuItem(_("Empty"),null,!0);u=r.populateItem(e,t.level);this.rowCreated(r,u)}this.level=t.level,PopupMenu.invoke_path[this.level]=this;for(p=this.level+1;p<PopupMenu.invoke_path.length;p++)PopupMenu.invoke_path[p]=null;var s=t.div.outerHeight(),h=t.doc.body.clientHeight;if(h<s){var a=function(t){t=t||1;var o=e.scrollTop();o>0&&e.scrollTop(Math.max(o-10*t,0))},l=function(t){t=t||1,e.scrollTop(e.scrollTop()+10*t,0)};e.before('<div class="MenuScrollUp"/>').prev().hover(function(){jQuery(this).data("t",setInterval(a,100))},function(){clearTimeout(jQuery(this).data("t"))}).click(function(){a(10)}),e.after('<div class="MenuScrollDown"/>').next().hover(function(){jQuery(this).data("t",setInterval(l,100))},function(){clearTimeout(jQuery(this).data("t"))}).click(function(){l(10)}),n.show_scrollbar&&e.addClass("MenuScrollBar"),s=t.div.outerHeight();var c=t.div.is(":visible");t.div.show();var d=e.height();d-=s-(h-2),e.height(d),c||t.div.hide()}};var PopupMenuItem=function(t,e,o,n,i,p,u){return this.text=t,this.href=n,this.action=e,this.disabled=o||!1,this.level=-1,this.link_target=i||"_self",this.disabled_reason=p,this.options=u,this};PopupMenuItem.prototype=new AbstractMenuElement,PopupMenuItem.prototype.dispatchAction=function(){this.invoke()},PopupMenuItem.prototype.getInvokePath=function(){if(!this._invoked)return!1;for(var t=new Array,e=0;e<=this.level;e++)t.push(PopupMenu.invoke_path[e]);return t.push(this),t},PopupMenuItem.prototype.invoke=function(){if("string"==typeof this.action){var t=new String(this.action);t.match(/^javascript:/i)?this.action=new Function(t.substring(11)):this.action=function(){window.location.href=t}}for(var e=getMainFrame().PopupDiv;e;){if(e.content&&e.content.is_menu){e.hide();break}e=e.popup?e.popup:e.divnext}return this.action(this.getParams())},PopupMenuItem.prototype.populateItem=function(t,e){return this.el=this.appendRow(t),this.icon?this.iconType&&"SPAN"==this.iconType.toUpperCase()?(this.el.children().prepend('<span class="'+this.icon+'" />'),this.el.addClass("Menu-Icon-Span")):(this.el.css("background-image","url("+this.icon+")"),this.el.addClass("Menu-Icon-Img")):this.color&&this.el.prepend('<span style="font-size:80%;background-color:'+this.color+'" >&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;'),this.level=e,this.el.attr("data-xplan-elem",this.text.replace(/ /g,"_").toLowerCase()),this.el},PopupMenuItem.prototype.getParams=function(){return XPLAN.util.elem2object(this.el.parent())};var PopupMenuOption=function(t,e,o,n,i){return this.text=t,this.action=e,this.disabled=o||!1,this.checked=n,this.options=i,this};PopupMenuOption.prototype=new PopupMenuItem,PopupMenuOption.prototype.dispatchAction=function(){this.checked=!this.checked,0==this.invoke()&&(this.checked=!this.checked)},PopupMenuOption.prototype.populateItem=function(t){return this.el=this.appendRow(t),this.checked&&this.el.addClass("Tick"),this.el};var PopupMenuSeparator=function(){return this};PopupMenuSeparator.prototype=new AbstractMenuElement,PopupMenuSeparator.prototype.populateItem=function(t){return this.el=this.appendRow(t,!0),this.el.addClass("Menu-Separator").append("<hr/>"),this.el};var PopupMenuSelect=function(t,e,o){return this.name=t,this.options=o,this.label=e,this};PopupMenuSelect.prototype=new AbstractMenuElement,PopupMenuSelect.prototype.populateItem=function(t){var e=this;return e.el=e.appendRow(t,True),e.el.addClass("menu-select"),e.el.append(jQuery("<label>",{text:e.label})),e.el.append(jQuery("<select>",{name:e.name})),jQuery.each(e.options,function(t,o){jQuery('select[name="'+e.name+'"]').append(jQuery("<option>",{value:o[0],text:o[1]}))}),e.el},PopupFrame.popup=null,PopupFrame.modal=null,PopupFrame.getHideFunc=function(t){return function(){!t.frame.is(":hidden")&&t.content.onBlur()&&t.hide()}},PopupFrame.getOpener=function(){var t=getMainFrame();if(getFrameDoc(t)==document||!t.PopupFrame.popup)return t;for(var e=t.PopupFrame.popup,o=t;e.getDocument()!=document;)o=e.frame.get(0).contentWindow,e=e.getNext();return o},PopupFrame.getPopup=function(t,e){var o=PopupFrame.getPopupObj(e);return o.content=t,o},PopupFrame.getPopupObj=function(t){var e=getMainFrame();e.PopupFrame.popup||(e.PopupFrame.popup=new e.PopupFrame(0));var o=e.PopupFrame.popup;if(t)for(;t--;)o=o.getNext();else for(;o.getDocument()==document;)o=o.getNext();return o},PopupFrame.getSizeAdjusterFunc=function(t){return function(){t.fixPos(t.x,t.y)}},PopupFrame.hideAll=function(t){var e=getMainFrame().PopupFrame;e.popup&&e.popup.hide(),t&&(t.stopProgagation(),t.preventDefault())},PopupFrame.hideLast=function(){var t=getMainFrame().PopupFrame.popup;if(t){for(;t.framenew&&t.framenew.shown;)t=t.framenew;t.hide()}},PopupFrame.show=function(t,e,o){var n=PopupFrame.getPopup(t);e||(e=n.x),o||(o=n.y),n.show(e,o)},PopupFrame.show2=function(t,e,o){var n=PopupFrame.getPopup(t);e||(e=n.x),o||(o=n.y),n.show(e,o,function(){n.fixPos2(e,o)})},PopupFrame.showByClick=function(t,e,o){e&&ModalUtil.setModal(!0),PopupFrame.getPopup(t).showByClick(o,0,0)},PopupFrame.showCentre=function(t,e){e&&ModalUtil.setModal(!0),PopupFrame.getPopup(t).showCentre()},PopupFrame.prototype.fixPos=function(t,e){var o=this.doc.body.clientHeight,n=this.doc.body.clientWidth;o=this.frame.outerHeight()+e-o,n=this.frame.outerWidth()+t-n,this.frame.css({left:t-(n>0?n:0)+this.doc.body.scrollLeft+"px",top:e-(o>0?o:0)+this.doc.body.scrollTop+"px"})},PopupFrame.prototype.fixPos2=function(t,e){var o=this.doc.body.clientHeight,n=this.doc.body.clientWidth;o=this.frame.outerHeight()+e-o,n=this.frame.outerWidth()+t-n;var i=jQuery(this.doc).scrollTop(),p=o-i;this.frame.css({left:t-(n>0?n:0)+this.doc.body.scrollLeft+"px",top:e+(p>0?i-o:0)+"px"})},PopupFrame.prototype.setSize=function(t,e){return e&&(t=this.content.getSizeAdjustment(t[0],t[1])),this.frame.width(t[0]),this.frame.height(t[1]),t},PopupFrame.prototype.fixSize=function(){var t=this.getDocument(),e=this.content.width?this.content.width:t&&t.body?jQuery(t.body).outerWidth():10,o=this.content.height?this.content.height:t&&t.body?jQuery(t.body).outerHeight():10,n=this.content.getSizeAdjustment(e,o);return this.frame.width(n[0]).height(n[1]),n},PopupFrame.prototype.getDocument=function(){return this.frame.get(0).contentWindow.document},PopupFrame.prototype.getNext=function(t){var e=this.framenew;return e||(e=this.framenew=new PopupFrame(this.level+1)),t&&(e.content=t),e},PopupFrame.prototype.getPosition=function(){var t=this.frame.offset();return[t.left,t.top]},PopupFrame.prototype.getPrev=function(){return this.level>0?PopupFrame.getPopupObj(this.level-1):null},PopupFrame.prototype.getWindow=function(){return this.frame.get(0).contentWindow},PopupFrame.prototype.getX=function(){return this.frame.offset().left},PopupFrame.prototype.getY=function(){return this.frame.offset().top},PopupFrame.prototype.hide=function(){this.shown=!1,this.framenew&&this.framenew.shown&&this.framenew.hide(),this.frame&&(!this.frame.is(":hidden")&&this.onhide&&this.onhide(),this.frame.hide()),0==this.level&&ModalUtil.setModal(!1)},PopupFrame.prototype.unhide=function(){this.frame.show(),this.shown=!0},PopupFrame.prototype.move=function(t,e){this.frame.css({left:t+"px",top:e+"px"})},PopupFrame.prototype.setupHideHandler=function(){if(this.level>0)var t=PopupFrame.getPopupObj(this.level-1).getDocument();else t=document;if(!t._popup_frame_hide_handler){var e=PopupFrame.getHideFunc(this);jQuery(t.body).mousedown(e),t._popup_frame_hide_handler=!0,this._hide_handler||(this.frame.blur(e),this._hide_handler=!0)}},PopupFrame.prototype.show=function(t,e,o){this.content.updateContent(this),this.frame.show().css("z-index",XPLAN.util.getMaxZIndex()+1),this.content.width&&this.frame.width(this.content.width),this.content.height&&this.frame.height(this.content.height),this.shown=!0,this.x=t,this.y=e,o||(o=PopupFrame.getSizeAdjusterFunc(this));var n=this;jQuery(this.getDocument().body).ready(function(){o(n.fixSize()),n.content.onPostShow(n),setTimeout(function(){o(n.fixSize())},this.firstime?500:250),this.firsttime=!1}),this.setupHideHandler()},PopupFrame.prototype.showByClick=function(t,e,o){var n=0,i=0;!t&&window.event&&(t=jQuery.event.fix(window.event)),t&&(n=t.pageX,i=t.pageY),e&&(n+=e),o&&(i+=o),this.show(n,i),t&&(t.preventDefault(),t.stopPropagation())},PopupFrame.prototype.showCentre=function(){var t=this.frame;this.show(void 0,0,function(e){!function(t){var e=jQuery(t),o=jQuery;e.css("position","absolute"),e.css("top",Math.max(0,(o(window).height()-e.outerHeight())/2+o(window).scrollTop())+"px"),e.css("left",Math.max(0,(o(window).width()-e.outerWidth())/2+o(window).scrollLeft())+"px")}(t)})},PopupDiv.popup=null,PopupDiv.modal=null,PopupDiv.getPopup=function(t,e,o){var n=PopupDiv.getPopupObj(e,o);return n.content=t,n},PopupDiv.getPopupObj=function(t,e){var o=getMainFrame();o.PopupDiv.popup||(o.PopupDiv.popup=new o.PopupDiv(0,e));var n=o.PopupDiv.popup;if(t)for(;t--;)n=n.getNext();else for(;n.shown&&n.content&&!n.content.onBlur();)n=n.getNext();return n},PopupDiv.getSizeAdjusterFunc=function(t){return function(){t.fixPos(t.x,t.y),t.div.css("visibility",""),t.content.onPostShow(t)}},PopupDiv.hideAll=function(t){var e=getMainFrame().PopupDiv;e&&e.popup&&e.popup.hide()},PopupDiv.hideAllChecked=function(t){var e=getMainFrame().PopupDiv;e&&e.popup&&(hide=e.popup.hide(!0))},PopupDiv.hideLast=function(){var t=getMainFrame().PopupDiv.popup;if(t){for(;t.divnext&&t.divnext.shown;)t=t.divnext;t.hide()}},PopupDiv.show=function(t,e){var o,n,i=PopupDiv.getPopup(t,null,e.insertAfterElem),p=e.evt;if(p){var u=XPLAN.util.getXY(p);o=u.x+(e.x||0),n=u.y+(e.y||0);try{p.preventDefault(),p.stopPropagation()}catch(t){}}else o=e.x||i.x||0,n=e.y||i.y||0;try{e.cssClass&&(i.cssClass=e.cssClass,i.div.addClass(e.cssClass))}catch(t){console.error("handle error gracefully",t)}return i.show(o,n,e.nohide),e.centre&&(o=(i.doc.body.clientWidth-i.div.width())/2+jQuery(i.doc).scrollLeft(),n=(i.doc.body.clientHeight-i.div.height())/2+jQuery(i.doc).scrollTop(),i.fixPos(o,n,e)),e.right&&(i.x=o-i.div.width(),i.div.css({left:o+"px"})),e.enableEggTimer&&(i.egg_timer=EggTimer.getNewTimer("popup_eggtimer"),i.egg_timer.show({doc:window.document,positionElement:i.div})),i},PopupDiv.hideEggTimer=function(t){t.egg_timer.hide(window.document)},PopupDiv.prototype.setupHideHandler=function(){var t=getMainFrame(),e=getFrameDoc(t),o=t.PopupDiv;null==o.modaldiv&&(o.modaldiv=jQuery("<div class=popupdivmodal />",e).appendTo(e.body).mousedown(PopupDiv.hideAllChecked)),body=jQuery(e.body);var n=body.width()+jQuery(e).scrollLeft(),i=body.height()+jQuery(e).scrollTop();o.modaldiv.show().width(n).height(i).css("z-index",this.zindex-1)},PopupDiv.prototype.fixPos=function(t,e,o){var n=jQuery(this.doc),i=this.doc.body.clientHeight+n.scrollTop(),p=this.doc.body.clientWidth+n.scrollLeft();"undefined"==typeof o?(this.div.outerHeight()+e>i&&(e=i-this.div.outerHeight()),this.div.outerWidth()+t>p&&(t=p-this.div.outerWidth())):(e=(this.doc.body.clientHeight-this.div.outerHeight())/2+n.scrollTop(),t=(this.doc.body.clientWidth-this.div.outerWidth())/2+n.scrollLeft()),e=e<n.scrollTop()?n.scrollTop():e,t=t<n.scrollLeft()?n.scrollLeft():t;var u=jQuery("#xplan-globalnav-root .header"),r=u.length>0&&"fixed"===u.css("position")?u.height():0,s=e-n.scrollTop();s<r&&(e=e+r-s),this.div.css({left:t+"px",top:e+"px"}),this.x=t,this.y=e},PopupDiv.prototype.getNext=function(t){var e=this.divnext;return e||(e=this.divnext=new PopupDiv(this.level+1,this.div)),t&&(e.content=t),e},PopupDiv.prototype.getPosition=function(){var t=this.div.offset();return[t.left,t.top]},PopupDiv.prototype.getPrev=function(){return this.level>0?PopupDiv.getPopupObj(this.level-1):null},PopupDiv.prototype.getWidth=function(){return this.div.outerWidth()},PopupDiv.prototype.getX=function(){return this.div.offset().left},PopupDiv.prototype.getY=function(){return this.div.offset().top},PopupDiv.prototype.hide=function(t,e){var o=!0;if(this.divnext&&this.divnext.shown&&(o=this.divnext.hide(t,e)),(o||!t)&&(!this.content||this.content.onBlur()||!t)){this.div.hide();try{null!==this.cssClass&&this.div.removeClass(this.cssClass)}catch(t){console.error("handle error gracefully",t)}if(this.shown=!1,PopupDiv.modaldiv)if(0==this.level)PopupDiv.modaldiv.hide();else{var n=null;n=1==this.level?PopupDiv.popup:PopupDiv.getPopupObj(this.level-1),e||PopupDiv.modaldiv.css("z-index",n.zindex-1)}return jQuery(document).trigger("PopupDivHidden"),!0}return!1},PopupDiv.prototype.unhide=function(){this.div.css("visibility",""),this.div.show(),this.shown=!0},PopupDiv.prototype.move=function(t,e){this.div.css({left:t+"px",top:e+"px"})},PopupDiv.prototype.show=function(t,e,o){this.div.children().get(0).innerHTML="",this.content.updateContent(this),this.zindex=XPLAN.util.getMaxZIndex()+2,o||this.setupHideHandler(),this.div.show().css("z-index",this.zindex),this.fixPos(t+1,e+1),this.shown=!0,setTimeout(PopupDiv.getSizeAdjusterFunc(this),1)},PopupDragUtil={},PopupDragUtil.onmousedown=function(t){return function(e){var o=e.pageX,n=e.pageY,i=t.getPosition();t._drag=!0,t._drag_x=i[0]-o,t._drag_y=i[1]-n,e.stopPropagation(),e.preventDefault()}},PopupDragUtil.onmousemove=function(t){return function(e){t._drag&&(1==e.button?t.move(e.pageX+t._drag_x,e.pageY+t._drag_y):t._drag=!1)}},PopupDragUtil.onmouseup=function(t){return function(){t._drag=!1}};var ModalUtil={setModal:function(t){var e=getMainFrame(),o=getFrameDoc(e),n=jQuery(o).find("body > div.modalmask:first");if(0==n.length&&(n=jQuery('<div class="modalmask"></div>',o).appendTo(o.body)),t){var i=(o=jQuery(o)).width(),p=o.height();XPLAN.util.isBrowser("ie")&&(i-=21),n.show().width(i).height(p)}else n.hide()}};(function(t,e){t.XPLAN.namespace("ui.Popup");var o=function(t,e,n){return o.fn.init(t,e,n)};o.fn=o.prototype={constructor:o,init:function(t,e,o){return e.indexOf(getBaseURL())>-1?this.uri=e:this.uri=getBaseURL()+e,this.selector=t,"undefined"==typeof o?(this.options={},this.title=_("Popup Dialog"),this.width="auto",this.height="auto"):(this.options=o,this.title=o.title,this.width=o.width,this.height=o.height),this.mfjQuery=jQuery,this},show:function(){this.mfjQuery(this.selector).html("");var t=this._getOptions(),e=this.mfjQuery(this.selector).dialog(t),o=this,n=null;t.buttons||e.dialog("option","buttons",this._getButtons()),EggTimer.show(),(n=this.mfjQuery.get(this.uri)).success(function(t,n,i){o.mfjQuery(t).appendTo(e)}),n.error(function(t,n,i){alert(i),o.mfjQuery(n+": "+i).appendTo(e)}),n.complete(function(t,e){"function"==typeof o.options.onComplete&&o.options.onComplete(),EggTimer.hide(),o.mfjQuery(o.selector).dialog("option","zIndex",4e3),o.mfjQuery(o.selector).dialog("open")})},_getOptions:function(){var t=this,e={title:this.title,autoOpen:!1,modal:!0,height:t.height,width:t.width,resizable:!1,overlay:{"background-color":"#454545",opacity:.9},close:function(){t.mfjQuery(t.selector).empty()}};return this.width&&(e.width=this.width),this.height&&(e.height=this.height),e},_getButtons:function(){var t=[],e=this;return t.push({text:_("Cancel"),click:function(){"function"==typeof e.options.onCancel&&e.options.onCancel();var t=e.mfjQuery(e.selector);t.dialog("isOpen")&&t.dialog("close")}}),t.push({text:_("Ok"),click:function(){var t=!0;"function"==typeof e.options.onOk&&!1===e.options.onOk()&&(t=!1);var o=e.mfjQuery(e.selector);o.dialog("isOpen")&&!0===t&&o.dialog("close")}}),t}},t.XPLAN.ui.Popup.URL=o})(window),function(){var t={};XPLAN.ui.Popup.get_dialog=function(e){var o=t[e];void 0===o?0===jQuery("#"+e).length&&((o=jQuery('<div id="'+window.XPLAN.util.escape(e,"xmlq")+'" />').appendTo(jQuery("body"))).data("new",!0),t[e]=o):o.data("new",!1);return o}}(),PopupURL3.show=function(t,e){var o=new PopupURL3(t,e),n=jQuery.extend(!0,{},e);return n.icon&&(o.icon=PopupContent.img+n.icon),n.x&&n.y||(n.centre=!0),PopupDiv.show(o,n)},PopupURL3._onclose=function(t,e,o){t.enableEggTimer&&PopupDiv.hideEggTimer(e),t.onclose&&t.onclose(e,o)},PopupURL3.getButtonFunc=function(t,e){return function(){return PopupURL3._onclose(t,e,jQuery(this).text()),!1}},PopupURL3.getButtonPromptFunc=function(t,e){return function(){return PopupURL3._onclose(t,e,e.div.find("input:text").val()),!1}},PopupURL3.prototype=new PopupMsgBox,PopupURL3.prototype.updateContent=function(t){var e={icon:this.icon,title:this.caption?this.caption:"Message",height:this.height?this.height:0,width:this.width?this.width:this.icon?340:300,enableEggTimer:this.enableEggTimer};if(this.prompt)e.buttons=[[["ok",_("Ok")],PopupURL3.getButtonPromptFunc(this,t)],[["cancel",_("Cancel")],function(){t.hide()}]];else if(this.button){for(var o=[],n=0;n<this.button.length;n++)o.push([this.button[n],PopupURL3.getButtonFunc(this,t)]);e.buttons=o}var i=PopupMsgBox.init(t,e);i.html(this.html),this.enableEggTimer&&jQuery(t.div.find("iframe")).on("load",function(){PopupDiv.hideEggTimer(t)}),this.prompt&&jQuery('<div class="MsgBox-Prompt"><input type="text"/></div>',t.doc).insertAfter(i).children("input").val(this.prompt)},PopupYouTube.prototype=new PopupContent,PopupYouTube.show=function(t,e){var o=new PopupYouTube(t,e);(new HttpRequest).callRPC("factfind.lookupYouTube",[t],function(t){if(t.result){var e='<iframe name="youtubepopup" src="//www.youtube.com/embed/'+t.videohash+'?rel=0&autoplay=1&controls=0&showinfo=0" width="'+o.width+'" height="'+o.height+'" scrolling="no" frameborder="0" allowfullscreen=""></iframe>';PopupForm2.show(e,o.caption,{width:o.width+20,height:o.height+50,hide_on_blur:!0,no_buttons:!0,onblur:function(){jQuery('iframe[name="youtubepopup"').prop("src","")}})}},function(t){})};
;Dependency._js['popup']=true;

;
XPLAN.namespace("usermsg"),XPLAN.util.update(XPLAN.usermsg,{check_interval:15e3,poll_interval_id:null,msg_count:0}),XPLAN.usermsg.deleteAllMessage=function(){XMLRPC.call("today.deleteMessages",[XPLAN.login_role,!1],XPLAN.usermsg.onMessageDeleted)},XPLAN.usermsg.deleteAllRead=function(){XMLRPC.call("today.deleteMessages",[XPLAN.login_role,!0],XPLAN.usermsg.onMessageDeleted)},XPLAN.usermsg.fixCount=function(){var e=jQuery("#mfts-msg > a").text(XPLAN.usermsg.msg_count);XPLAN.usermsg.msg_count>0?e.addClass("hasusermsg"):e.removeClass("hasusermsg")},XPLAN.usermsg.checkUnreadMessage=function(){XMLRPC.callGET("today.checkUnreadMessage",[XPLAN.login_role],XPLAN.usermsg.onCheckResult,XPLAN.usermsg.onCheckError)},XPLAN.usermsg.startPoll=function(e){return XPLAN.usermsg.poll_interval_id||(XPLAN.usermsg.poll_interval_id=setInterval(XPLAN.usermsg.checkUnreadMessage,XPLAN.usermsg.check_interval),e&&XPLAN.usermsg.checkUnreadMessage()),!1},XPLAN.usermsg.stopPoll=function(){XPLAN.usermsg.poll_interval_id&&(clearInterval(XPLAN.usermsg.poll_interval_id),XPLAN.usermsg.poll_interval_id=null)},XPLAN.usermsg.init=function(e){var s=jQuery("#mfts-msg > a");(0!=s.length||e)&&(XPLAN.usermsg.fixCount(),s.click(XPLAN.usermsg.onImgClick),jQuery(document).on("visibilitychange",function(){"hidden"===document.visibilityState?XPLAN.usermsg.stopPoll():XPLAN.usermsg.startPoll(!0)}),"hidden"!==document.visibilityState&&XPLAN.usermsg.startPoll(!1))},XPLAN.usermsg.onCheckResult=function(e){XPLAN.usermsg.msg_count!=e&&(e>XPLAN.usermsg.msg_count&&XPLAN.usermsg.onNewMessage(),XPLAN.usermsg.msg_count=e,XPLAN.usermsg.fixCount())},XPLAN.usermsg.onCheckError=function(e){console.log(e)},XPLAN.usermsg.lastClicked=0,XPLAN.usermsg.windowOpened=!1,XPLAN.usermsg.onImgClick=function(e){var s=(new Date).valueOf();return XPLAN.usermsg.windowOpened||(XPLAN.usermsg.windowOpened=!0,s-XPLAN.usermsg.lastClicked>1e3&&XPLAN.usermsg.openWindow(),XPLAN.usermsg.lastClicked=s,XPLAN.usermsg.windowOpened=!1),!1},XPLAN.usermsg.onImgContext=function(e){var s=[new PopupMenuItem(_("Message Index"),XPLAN.usermsg.openMessageIndex),new PopupMenuItem(_("Send Message"),XPLAN.usermsg.sendMessage),new PopupMenuItem(_("Delete All Read Messages"),XPLAN.usermsg.deleteAllRead),new PopupMenuItem(_("Delete All Messages"),XPLAN.usermsg.deleteAllMessage)];PopupMenu.showByClick(s,e)},XPLAN.usermsg.onMessageDeleted=function(e){alert(ngettext("%a message deleted.","%a messages deleted.","%a",e))},XPLAN.usermsg.onNewMessage=function(){XPLAN.usermsg.msg_win&&!XPLAN.usermsg.msg_win.closed&&XPLAN.usermsg.msg_win.focus()},XPLAN.usermsg.openMessageIndex=function(){XPLAN.usermsg.openWindow("open=index")},XPLAN.usermsg.openWindow=function(e){if(XPLAN.usermsg.msg_win)try{XPLAN.usermsg.msg_win.window.XPLAN.usermsg}catch(e){XPLAN.usermsg.msg_win=void 0}if(!XPLAN.usermsg.msg_win||XPLAN.usermsg.msg_win.closed){var s=screen.width?(screen.width-400)/2:50,n="height=300,width=400,top="+(screen.height?(screen.height-300)/2:50)+",left="+s+",heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no",g=getBaseURL()+"/home/usermsg";g+="?login_role="+XPLAN.login_role,e&&(g+="&"+e),XPLAN.usermsg.msg_win=window.open(g,"usermsg",n)}else jQuery(function(){XPLAN.usermsg.msg_win.window.XPLAN.usermsg.nextMessage()});XPLAN.usermsg.msg_win&&XPLAN.usermsg.msg_win.window.focus&&XPLAN.usermsg.msg_win.window.focus()},XPLAN.usermsg.sendMessage=function(){XPLAN.usermsg.openWindow("open=send")},XPLAN.usermsg.openURL=function(e){window.location.href=getBaseURL()+e};
;Dependency._js['usermsg']=true;

;
function expandPageContentPane(e){return XPLAN.framemain.expand_page(e)}TopFrame={action:null},TopFrame.addActionButton=function(e,t,n,a,i,r,o,u,c){null==r&&(r=True),(s=jQuery("div.buttonbar:eq(0)")).length&&!s.parents(".panelbox:eq(0)").length||(s=XPLAN.framemain.createButtonBar("mf-topaction"));var l="button";r&&(l+=" primary"),o&&(l+=" dropdown");var s=jQuery("div.buttonbar:eq(0)"),m=jQuery("div.buttonbar[id='bottombuttonbar']"),p=jQuery('<a href="#" class="'+l+'"/>'),d=jQuery('<a href="#" class="'+l+'"/>');c?(p.prependTo(s),d.prependTo(m)):(p.appendTo(s),d.appendTo(m));var f=/(.*)_([A-Za-z0-9])_(.*)/.exec(e);return null!=f?(p.append(f[1]),p.append("<u>"+f[2]+"</u>"),p.append(f[3]),p.attr("accessKey",f[2].toLowerCase()),d.append(f[1]),d.append("<u>"+f[2]+"</u>"),d.append(f[3]),d.attr("accessKey",f[2].toLowerCase())):p.text(e),d.text(e),u&&u.is_prevent_multiple_click&&(p.on("click",function(){p.attr("disabled","disabled").css("pointer-events","none")}),u.message_event&&XPLAN.event.listen("enable_top_frame_button_"+u.message_event,function(){p.removeAttr("disabled").css("pointer-events","")})),"string"==typeof t?(p.attr("href",t),d.attr("href",t),n&&"xplanmain"!=n&&(p.attr("target",n),d.attr("target",n))):(p.attr("href","#"),d.attr("href","#"),"function"==typeof t?(p.click(t),d.click(t)):t||(p.attr("disabled","disabled"),d.attr("disabled","disabled"))),i&&(p.attr("id",i),d.attr("id",i)),u&&u.attributes&&p.attr(u.attributes),a instanceof Function&&(p.length>0&&a(p.get(0)),d.length>0&&a(d.get(0))),p},TopFrame.addActionImage=function(e,t,n){var a=jQuery('<img class="action"/>').attr("src",e).click(function(){XPLAN.util.process_action(t)}).appendTo(TopFrame.getNewActionCell());return n instanceof Function&&n(a.get(0)),a},TopFrame.clear=function(){TopFrame.clearAction(),TopFrame.clearTitle()},TopFrame.clearAction=function(){jQuery("#mf-topaction").empty(),TopFrame.action=null,TopFrame.setCode("")},TopFrame.clearTitle=function(){jQuery("#mf-toptitle").text("")},TopFrame.getActionCellCount=function(){return null!=TopFrame.action?TopFrame.action.children("li").length:0},TopFrame.getActionCellElement=function(e){return null!=TopFrame.action?TopFrame.action.children("li").eq(e):null},TopFrame.getActionElement=function(){},TopFrame.getCode=function(){var e=getMainFrame();return e?e._top_frame_code:""},TopFrame.getNewActionCell=function(){var e;return null==TopFrame.action&&((e=jQuery("#mf-titlecontentwrap > ul")).length||(e=jQuery("<ul/>").appendTo("#mf-titlecontentwrap")),TopFrame.action=e),jQuery("<li/>").appendTo(TopFrame.action)},TopFrame.setCode=function(e){var t=getMainFrame();t&&(t._top_frame_code=e)},TopFrame.setTitleText=function(e,t){XPLAN.framemain.setTitle(e),t&&jQuery("#mf-titlecontent").html(t)},TopFrame.appendTitle=function(e,t){return jQuery("#mf-titlecontent").append(t?e:XPLAN.util.escape(e))},TopFrame.addText=function(e){return jQuery('<span class="page_title">'+e+"</span>").appendTo(TopFrame.getNewActionCell())},XPLAN.namespace("framemain"),XPLAN.framemain.printpdf=!1,XPLAN.framemain.resizers=[],XPLAN.framemain.alert=function(e,t,n,a){a||(a=jQuery("#mf-contentinner"));var i=jQuery("#mf-alert",a);0==i.length&&(i=jQuery('<div id="mf-alert"><div class="mfa-icon"></div><span></span><div class="mfa-content"></div></div>').prependTo(a).children("span").click(function(){jQuery(this).parent().fadeOut()}).end()),t?(i.attr("data-variant","warning"),i.children("div.mfa-icon").addClass("warning")):(i.attr("data-variant",""),i.children("div.mfa-icon").removeClass("warning"));var r=i.show("fast").children("div.mfa-content").html(e);return n&&setTimeout(function(){i.fadeOut()},n),r},XPLAN.framemain.alert_text=function(e,t,n,a){return XPLAN.framemain.alert(XPLAN.util.escape(e),t,n,a)},XPLAN.framemain.close=function(){var e=jQuery("#mf-alert");e.length>0&&e.fadeOut()},XPLAN.framemain.applyURL=function(url,target){if(url.search(/^https?:\/\//)<0){var jsregex=/^javascript:/;if(url.search(jsregex)<0)"_blank"==target?window.open(getBaseURL()+url):window.location.href=getBaseURL()+url;else{var evalstr=url.replace(jsregex,"");eval(evalstr)}}else window.open(url)},XPLAN.framemain.getURL=function(e,t){return function(){XPLAN.framemain.applyURL(e,t)}},XPLAN.framemain.doAddMenu=function(e){var t=jQuery(this);e.preventDefault(),XPLAN.framemain.add_menu?XPLAN.framemain.doAddContextMenu(XPLAN.framemain.add_menu,t):XMLRPC.callGET("today.get_add_links",[],function(e){XPLAN.framemain.add_menu=e,XPLAN.framemain.doAddContextMenu(e,t)})},XPLAN.framemain.doClientContextMenu=function(){var e=new Array;return FactFind.getClientContextMenu(this.entityid,e,this.email,this.visible),FactFind.entityid=this.entityid,FactFind.entityrole="client",e},XPLAN.framemain.doClientListMenu=function(e){var t=jQuery(this);e.preventDefault(),XMLRPC.callGET("factfind.getRecentEntities",["client"],function(e){for(var n=[new PopupMenuItem(_("Recent Clients"),null,!0),new PopupMenuSeparator],a=0;a<e.length;a++){var i=e[a],r=new PopupMenu(XPLAN.framemain.doClientContextMenu,i.name);r.entityid=i.entityid,r.email=i.email,r.visible=i.visible,n.push(r)}PopupMenu.showDropdown(n,t)})},XPLAN.framemain.doClientSearchContextMenu=function(e){var t=jQuery(this);e.preventDefault(),XMLRPC.callGET("factfind.getSavedSearch",[],function(e){for(var n=document.forms.quicksearch.elements.role.value,a=[new PopupMenuItem(_("Advanced Search"),XPLAN.framemain.getURL("/factfind/search?role="+n)),new PopupMenuSeparator],i=0;i<e.length;i++){var r=e[i],o=XPLAN.util.getURL("/factfind/search/load",{entityid:r.entityid,name:r.name,search:"1",role:n}),u=new PopupMenuItem(r.name,XPLAN.framemain.getURL(o));a.push(u)}a.show_scrollbar=!0,PopupMenu.showDropdown(a,t)})},XPLAN.framemain.doAddContextMenu=function(e,t){for(var n=[],a=0;a<e.length;a++)if(e[a].submenuitems){for(var i=[],r=0;r<e[a].submenuitems.length;r++){var o=e[a].submenuitems[r];i.push(new PopupMenuItem(o.title,XPLAN.framemain.getURL(o.url)))}n.push(new PopupMenu(i,e[a].title))}else if("-"==e[a])n.push(new PopupMenuSeparator);else{var u;u=e[a].script?new Function(e[a].script):XPLAN.framemain.getURL(e[a].url);var c=new PopupMenuItem(e[a].title,u);e[a].icon&&(c.icon=getBaseURL()+e[a].icon),n.push(c)}PopupMenu.showDropdown(n,t,jQuery("#mf-topapps"))},XPLAN.framemain.doHomeMenu=function(e){var t=jQuery(this);e.preventDefault(),XPLAN.framemain.getTodayMenu(function(e){var n=[new PopupMenuItem(_("Dashboard"),getBaseURL()+"/dashboard/mainhtml")];XPLAN.util.hasFeature("portfolio_dashboard")&&n.push(new PopupMenuItem(_("Portfolio Dashboard"),getBaseURL()+"/portfolio/app")),(XPLAN.util.isCapable("client_focus")||XPLAN.util.isCapable("edit_entity_note"))&&n.push(new PopupMenuItem(_("Document Library"),getBaseURL()+"/docnote/library")),XPLAN.util.isCapable("digital_signature")&&n.push(new PopupMenuItem(_("Digital Signature"),getBaseURL()+"/digital_signature/list")),n.push(new PopupMenuSeparator);for(var a=0;a<e.length;a++){for(var i=e[a],r=new Array,o=0;o<i.functions.length;o++){var u=i.functions[o],c={attributes:{"data-xplan-elem":XPLAN.util.escape(u.xplan_dataname,"xmlq")}},l=new PopupMenuItem(u.title,XPLAN.framemain.getURL(u.url,u.target),!1,void 0,void 0,void 0,c);u.icon&&(l.icon=getBaseURL()+u.icon),r.push(l)}if(r.length>0){c={attributes:{"data-xplan-elem":XPLAN.util.escape(i.id,"xmlq")}};r=new PopupMenu(r,i.title,!1,c),i.icon&&(r.icon=getBaseURL()+i.icon),n.push(r)}}PopupMenu.showDropdown(n,t,jQuery("#mf-topapps"))})},XPLAN.framemain.doLanguageMenu=function(e){e.preventDefault();var t=function(e){return function(){XMLRPC.call("sysadmin.saveLanguageSetting",[e,2],function(e){var t=top.location.toString();t.lastIndexOf("#")==t.length-1&&(t=t.substring(0,t.length-1)),top.location.href=t},HttpRequest.onerror)}},n=function(e){return function(){var t=top.location.toString();t.lastIndexOf("#")==t.length-1&&(t=t.substring(0,t.length-1)),t.indexOf("lang=")>0?url=t.replace(/lang=[a-z]{2}_[A-Z]{2}/,"lang="+e):url=t+"?lang="+e,window.location=url}};XMLRPC.callGET("today.get_language_menu",[],function(e){var a=[],i=n,r=e[1];if(r&&(a.push(new PopupMenuItem(_("Language Setting"),XPLAN.framemain.getURL("/sysadmin/user/language"))),i=t),(e=e[0]).length>0){a.length>0&&a.push(new PopupMenuSeparator);for(var o=0;o<e.length;o++){var u=new PopupMenuOption(e[o].text,i(e[o].value),!1,!!r&&e[o].selected);a.push(u)}PopupMenu.showDropdown(a,"#mfts-lang")}})},XPLAN.framemain.doQuicklinksMenu=function(e){e.preventDefault(),XMLRPC.callGET("today.get_quicklinks",[],function(t){var n=[new PopupMenuItem(_("Edit Quicklinks"),XPLAN.framemain.editQuicklinks),new PopupMenuItem(_("Load System Default Quicklinks"),XPLAN.framemain.loadSystemQuickLinks)];if(t.length>0){n.push(new PopupMenuSeparator);for(var a=0;a<t.length;a++){var i=t[a];n.push(new PopupMenuItem(i.title,XPLAN.framemain.getURL(i.url)))}}PopupMenu.showDropdown(n,e.target,jQuery("#mf-topapps"))})},XPLAN.framemain.doTradeMenu=function(e){e.preventDefault(),XMLRPC.callGET("today.get_trademenu",[],function(t){if(0==t.length)return!1;var n=t.can_plus_orderentry,a=t.can_plus_orderpad,i=t.can_classic_orderentry,r=t.can_classic_orderpad,o=[],u=[];n&&o.push(new PopupMenuItem(_("Buy"),function(){openIOSPlusOrderEntry(!0,!1,1)}),new PopupMenuItem(_("Sell"),function(){openIOSPlusOrderEntry(!0,!1,2)}),new PopupMenuItem(_("Short Sell"),function(){openIOSPlusOrderEntry(!0,!1,5)})),a&&o.push(new PopupMenuItem(_("Order Pad"),function(){openIOSPlusOrders(!1)})),i&&u.push(new PopupMenuItem(_("Buy"),function(){openIOSOrderEntry("B")}),new PopupMenuItem(_("Sell"),function(){openIOSOrderEntry("A")})),r&&u.push(new PopupMenuItem(_("Order Pad"),function(){openIOSOrders()}));var c=[];if(o.length>0&&u.length>0)c.push(new PopupMenu(o,_("IOS+"))),c.push(new PopupMenu(u,_("IOS")));else{for(var l=0;l<o.length;l++)c.push(o[l]);for(var s=0;s<u.length;s++)c.push(u[s])}0===c.length&&c.push(new PopupMenuItem(_("(No IOS Connections)"),null,!0)),PopupMenu.showDropdown(c,e.target,jQuery("#mf-topapps"))})},XPLAN.framemain.doSearchContextMenu=function(e){e.preventDefault(),XPLAN.util.onCapabilitiesLoaded(function(){PopupMenu.showDropdown(XPLAN.framemain.search_menu,e.target)})},XPLAN.framemain.doUpdateSearch=function(e,t){var n=document.forms.quicksearch,a=XPLAN.test_language_util.prepare_escape(this.text),i=jQuery("#mf-topsearchbox input");i.length&&i.hasClass("empty")&&i.val(a),jQuery("#mfts-select").attr("title",a).children("span").removeClass().addClass("entity_icon "+this.icon),jQuery(n).attr("action",getBaseURL()+this.posturl).find('input[name="role"]').val(this.role),t||XMLRPC.call("today.setSearchInputDefault",[this.role],HttpRequest.dummy),this.hasListing?jQuery("#mfts-list").show():jQuery("#mfts-list").hide(),this.hasListing?jQuery("#mfts-advanced").show():jQuery("#mfts-advanced").hide(),i.data("autocomplete")&&i.autocomplete("disable");var r=jQuery.inArray(this.role,["client","user","group","referral","supplier","profadviser","insurancepolicy"])>-1;r&&(i.data("autocomplete_role",this.role),XPLAN.framemain.activateQuickEntitySearch(i)),jQuery("#mfts-quick_client_search").toggle(r)},XPLAN.framemain.activateQuickEntitySearch=function(e){e.data("autocomplete")?e.autocomplete("enable"):e.autocomplete({source:function(t,n){role=e.data("autocomplete_role"),-1===t.term.indexOf(":")?XMLRPC.call("factfind.quick_search",[role,t.term],function(e){n(jQuery.map(e,function(e){return{value:e[1],label:e[1],id:e[0]}}))}):n([])},minLength:1,select:function(t,n){if(role=e.data("autocomplete_role"),jQuery.inArray(role,["client","user","group","referral","supplier","profadviser"])>-1)XPLAN.framemain.registerQuickSearch(),showEntity(n.item.id,role);else if("docnote"==role)FactFind.editNote(n.item.id);else if("insurancepolicy"==role){var a=n.item.id.split("-"),i=getBaseURL()+"/factfind/view_list/insurance_group?entityid="+a[1]+"&index="+a[0]+"&page_name=insurance_group";XPLAN.util.form_redirect(i)}}})},XPLAN.framemain.doListContextMenu=function(e){e.preventDefault();var t=[],n=document.forms.quicksearch.elements.role.value,a="/factfind/search/result?is_listing=1&refresh=1&role="+n,i="/factfind/search/result?role="+n;t.push(new PopupMenuItem(_("Entire List"),XPLAN.framemain.getURL(a))),t.push(new PopupMenuItem(_("Last Search"),XPLAN.framemain.getURL(i))),PopupMenu.showDropdown(t,jQuery(this))},XPLAN.framemain.editQuicklinks=function(){XPLAN.util.loadScript("/js/quicklinks.js",function(){XPLAN.framemain.editQuickLinks()})},XPLAN.framemain.loadSystemQuickLinks=function(){XPLAN.util.loadScript("/js/quicklinks.js",function(){XPLAN.framemain.loadSystemQuickLinks()})},XPLAN.framemain.expand_page=function(e){var t=getMainFrame(),n=getFrameDoc(t);n&&(e?jQuery("html",n).removeClass("expanded"):(jQuery("html",n).addClass("expanded"),XPLAN.framemain.registerResizer(null),jQuery(function(){var e=jQuery("#mf-contentinner",n),t=(e.height(),!1);e.children().each(function(){var e=jQuery(this);e.is("iframe")&&"100%"==e.attr("height")?t=!0:e.hasClass("maxpagepane")&&(t=!0)}),t&&e.css("overflow","hidden")})))},XPLAN.framemain.getTodayMenu=function(e){XPLAN.framemain.today_menu?e(XPLAN.framemain.today_menu):XMLRPC.callGET("today.getBlocks",[],function(t){XPLAN.framemain.today_menu=t,e(t)})},XPLAN.framemain.init=function(e){jQuery("#ta-home a").click(XPLAN.framemain.doHomeMenu),jQuery("#ta-add a").click(XPLAN.framemain.doAddMenu),jQuery("#ta-links a").click(XPLAN.framemain.doQuicklinksMenu),jQuery("#ta-trade a").click(XPLAN.framemain.doTradeMenu),jQuery("#mfts-recent a").click(XPLAN.framemain.doClientListMenu),jQuery("#mfts-lang a").click(XPLAN.framemain.doLanguageMenu),XPLAN.framemain.initSearchMenu(e);var t=jQuery("#mf-topsearchbox input");if(t.length){jQuery("#mfts-btn").click(function(){t.hasClass("empty")&&t.removeClass("empty").val(""),document.forms.quicksearch.submit()}),jQuery("#mfts-select").click(XPLAN.framemain.doSearchContextMenu),t.focus(function(){t.hasClass("empty")&&t.removeClass("empty").val("")}).blur(function(){XPLAN.framemain.registerQuickSearch(),""==t.val()&&t.addClass("empty").val(jQuery("#mfts-select").attr("title"))}).keypress(function(e){e&&13==e.keyCode&&XPLAN.framemain.registerQuickSearch()}).val(XPLAN.cache.get("qs","")).blur();for(var n=jQuery('form[name="quicksearch"] input[name="role"]').val(),a=0;a<XPLAN.framemain.search_menu.length;a++){var i=XPLAN.framemain.search_menu[a];if(i.role==n){i.action(this.event,!0);break}}}jQuery("#mfts-list a").click(XPLAN.framemain.doListContextMenu),jQuery("#mfts-advanced a").click(XPLAN.framemain.doClientSearchContextMenu),null!=XPLAN.no_usermsg&&XPLAN.no_usermsg&&XPLAN.debugmode||XPLAN.usermsg.init(),XPLAN.timeticker.init();var r=jQuery("#page_content_filename").val();"login/login.html"!=r&&"login/password_expired.html"!=r&&"login/login_duplicate.html"!=r&&XPLAN.util.isLogin()&&XMLRPC.callGET("panelbox.get_panelbox_collapsed_by_page",[jQuery("#page_content_filename").val()],XPLAN.framemain.setPanelboxState,HttpRequest.onerror)},XPLAN.framemain.createButtonBar=function(e){var t=jQuery("<div "+(e?' id="'+e+'" ':"")+'class="buttonbar"></div>').prependTo("#mf-contentinner");return XPLAN.event.send("button bar created",{bar:t}),t},XPLAN.framemain.logout=function(){XMLRPC.call("timetaken.has_unsaved_tickers",[],function(e){e?XPLAN.timeticker.alert(_("There are unsaved tickers. Please save or discard the tickers before logout.")):XPLAN.util.form_redirect(XPLAN.util.getURL("/home/logoff",{},!0))},function(){XPLAN.util.form_redirect(XPLAN.util.getURL("/home/logoff",{},!0))})},XPLAN.framemain.initFinal=function(e){if(e&&XPLAN.timeticker.alert_running_ticker(),jQuery("#mfts-logout").find("a").on("click",XPLAN.framemain.logout),XPLAN.framemain.initActivity(),"undefined"!=typeof doPrint&&XPLAN.framemain.printpdf){var t=jQuery("div.buttonbar:eq(0)");t.length||(t=XPLAN.framemain.createButtonBar());var n=!1;void 0==XPLAN.framemain.printpdfLabel&&(XPLAN.framemain.printpdfLabel=_("PDF")),void 0==XPLAN.framemain.printcsvLabel&&(XPLAN.framemain.printcsvLabel=_("CSV"));const e=jQuery('<button type="button"></button>').text(XPLAN.framemain.printpdfLabel).click(function(){doPrint("pdf")}),a=jQuery('<button type="button"></button>').text(XPLAN.framemain.printcsvLabel).click(function(){doPrint("csv")});t.children("a.button,button").each(function(){var t=jQuery(this);if(t.hasClass("next")||t.hasClass("last"))return e.insertBefore(t),window.location.href.includes("/factfind/search/")&&a.insertBefore(t),n=!0,!1}),n||(e.appendTo(t),window.location.href.includes("/factfind/search/")&&a.appendTo(t))}},XPLAN.framemain.setPanelboxState=function(e){for(var t=0;t<e.length;t++){var n="#"+XPLAN.util.escape(e[t],"css");jQuery(n).length>0?jQuery(n).hasClass("dont-save-state")||(jQuery(n).children("div.content").hide(),jQuery(n+" > h2 > a.panelbutton.minmax").addClass("expand")):jQuery("div.panelbox > h2").each(function(n,a){jQuery.trim(jQuery(a).text()).substring(0,50)!=e[t]||jQuery(a).hasClass("dont-save-state")||(jQuery(a).parent().children("div.content").hide(),jQuery(a).children("a.panelbutton.minmax").addClass("expand"))})}},XPLAN.framemain.registerQuickSearch=function(){var e=jQuery("#mf-topsearchbox input"),t=e.val();e.hasClass("empty")||""===t?XPLAN.cache.del("qs"):XPLAN.cache.set("qs",t)},XPLAN.framemain.registerResizer=function(e){0==XPLAN.framemain.resizers.length&&(jQuery(window).resize(XPLAN.framemain.resize_page),jQuery(function(){jQuery(window).resize()})),XPLAN.framemain.resizers.push(e)},XPLAN.framemain.resize_page=function(){var e,t=getFrameDoc(getMainFrame()),n=jQuery("#mf-contentinner",t),a=n.offset(),i=Math.max(t.body.clientHeight-a.top-1,0),r=Math.max(t.body.clientWidth-a.left-26,0);for(n.height(i),e=0;e<XPLAN.framemain.resizers.length;e++){var o=XPLAN.framemain.resizers[e];"function"==typeof o&&o(r,i)}},XPLAN.framemain.height=function(){return jQuery("#mf-contentinner").height()},XPLAN.framemain.resize_element=function(e,t,n){if(e){var a=jQuery("#"+e);a.length&&((t=t||{height:0,width:0}).height||(t.height=0),t.width||(t.width=0),XPLAN.framemain.registerResizer(function(e,i){var r=jQuery("#mf-contentinner"),o=a.offset(),u=r.offset(),c=t.height+(a.outerHeight(!0)-a.innerHeight())/2,l=r.children().first();l.is("div.buttonbar")&&(c+=l.outerHeight());var s=t.width+(a.outerWidth(!0)-a.innerWidth())/2;a.width(e+u.left-o.left-s).height(i+u.top-o.top-c),void 0!=n&&n()}))}},XPLAN.framemain.resize_iframe=function(e,t){var n=(n=document.documentElement.clientHeight-jQuery("#mf-toppane").height()-t).toString()+"px";jQuery(e).css({height:n})},XPLAN.framemain.set_scroll=function(e){jQuery("#mf-contentinner",getFrameDoc(getMainFrame())).css("overflow",e?"auto":"hidden")},XPLAN.framemain.setTitle=function(e,t,n,a){var i,r,o=jQuery("#mf-titlecontent");(o.length||(jQuery('<div id="mf-titlebar"><div><div id="mf-titlecontentwrap"><div id="mf-titlecontent"></div></div></div></div>').prependTo("#pagecontent"),o=jQuery("#mf-titlecontent")),t)?e?(r=o.html('<strong></strong>:&nbsp;<span data-heap-redact-text="true" class="titlecontent__subtitle-display"></span>').children("strong").text(e).end().children("span").text(t),n&&r.addClass("selector").click(n),i=e+": "+t):(r=o.html('<span data-heap-redact-text="true"></span>').children("span").text(t),n&&r.addClass("selector").click(n),i=t,a&&a(jQuery('<span class="titlecontent__extra-title"></span>').appendTo(o))):(o.text(e).attr("title",e),i=e);XPLAN.apptitle&&(i=i+" | "+XPLAN.apptitle),document.title=i},XPLAN.framemain.initActivity=function(){XPLAN.framemain.activity_notified_at=Date.now();["keydown","mousedown","wheel","touchstart","scroll"].forEach(function(e){document.addEventListener(e,XPLAN.framemain.onActivity,{capture:!0,passive:!0})})},XPLAN.framemain.onActivity=function(e){var t=Date.now();t-XPLAN.framemain.activity_notified_at>6e4&&(XPLAN.framemain.activity_notified_at=t,XMLRPC.call("today.notify_activity",[!0],function(e){}))},XPLAN.namespace("timeticker"),XPLAN.util.update(XPLAN.timeticker,{entityid:null,wnd:null,size_w:350,size_h:400,init:function(){jQuery("#mfts-ttaken").click(XPLAN.timeticker.onImgClick)},onImgClick:function(e){XPLAN.timeticker.start(XPLAN.timeticker.entityid)},_get_wnd_settings:function(e,t){return"height="+XPLAN.timeticker.size_h+",width="+XPLAN.timeticker.size_w+",top="+e+",left="+t+",heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no"},start:function(e){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var t=screen.width?screen.width-XPLAN.timeticker.size_w-5:0,n=XPLAN.timeticker._get_wnd_settings(0,t),a=getBaseURL()+"/timetaken/tickerpopup";e&&(a+="?entityid="+escape(e)),XPLAN.timeticker.wnd=window.open(a,"timeticker",n)}else e&&XPLAN.timeticker.wnd.TimeTicker.select_entity(e);XPLAN.timeticker._set_no_warning_entity(-1),XPLAN.timeticker.wnd.focus()},alert:function(e){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var t=screen.width?(screen.width-XPLAN.timeticker.size_w-5)/2:0,n=XPLAN.timeticker._get_wnd_settings(0,t),a=getBaseURL()+"/timetaken/tickerpopup";XPLAN.timeticker.wnd=window.open(a,"timeticker",n)}XPLAN.timeticker.wnd.focus(),XPLAN.timeticker.wnd.alert(e)},_set_no_warning_entity:function(e){XMLRPC.call("timetaken.set_no_running_ticker_warning_entity",[e])},alert_running_ticker:function(){var e=XPLAN.ui.Popup.get_dialog("time_taken_running_alert");e.html("<p>"+XPLAN.util.escape(_("Time taken running. Do you wish to start a new time taken for this client?"))+"</p>"),e.dialog({title:_("Time Taken Running"),width:400,modal:!0,buttons:[{text:_("Pause"),click:function(){XMLRPC.call("timetaken.ticker_pause",[],function(){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var e=screen.width?screen.width-XPLAN.timeticker.size_w-5:0,t=XPLAN.timeticker._get_wnd_settings(0,e),n=getBaseURL()+"/timetaken/tickerpopup";XPLAN.timeticker.wnd=window.open(n,"timeticker",t)}XPLAN.timeticker.wnd.focus()}),e.dialog("close"),e.dialog("destroy")}},{text:_("No"),click:function(){XPLAN.timeticker._set_no_warning_entity(XPLAN.timeticker.entityid),e.dialog("close"),e.dialog("destroy")}},{text:_("Yes"),click:function(){XPLAN.timeticker.start(XPLAN.timeticker.entityid),e.dialog("close"),e.dialog("destroy")}}]})}}),XPLAN.framemain.search_menu=[],XPLAN.framemain.initSearchMenu=function(e){if(e)for(var t=0;t<e.length;t++){var n=new PopupMenuItem(e[t].title,XPLAN.framemain.doUpdateSearch);n.iconType="SPAN",n.icon=e[t].icon;var a=n.role=e[t].role;n.posturl=e[t].action,n.hasListing=e[t].has_listing,n.options={attributes:{"data-xplan-elem":a}},XPLAN.framemain.search_menu.push(n)}},XPLAN.namespace("layout"),XPLAN.layout.resizeVbox=function(e,t){var n,a,i,r,o,u=t,c=[],l=0;if(e.is("table")){r=!0,o=jQuery(e.get(0).rows);var s=parseInt(e.attr("cellspacing"),10)||0,m=parseInt(e.attr("cellpadding"),10)||0;u-=s*(o.length+1)}else r=!1,o=e.children();u-=e.outerHeight(!0)-e.height(),o.each(function(e){"none"!=(a=jQuery(this)).css("display")&&"inline"!=a.css("display")&&(i=parseInt(a.attr("flex-height"),10),isNaN(i)?u-=a.outerHeight(!0):(c.push([a,i]),l+=i))});var p=u/(l||1);for(n=0;n<c.length;n++)a=c[n][0],i=p*c[n][1],r?a.children().each(function(e){var t=jQuery(this),n=t.outerHeight(!0)-t.height()+2*m;t.height(Math.floor(i-n))}):(diff=a.outerHeight(!0)-a.height(),a.height(Math.floor(i-diff)))},XPLAN.layout.vbox=function(e){var t=jQuery(e);XPLAN.framemain.registerResizer(function(e,n){XPLAN.layout.resizeVbox(t,n)})};
;Dependency._js['framemain']=true;

;
SlideMenu={build:function(e,n,i){jQuery(e).empty().append(SlideMenu.buildMenu(n,0))},buildMenu:function(e,n){for(var i=jQuery('<ul class="slide-container slide-lvl'+n+'"/>'),t=0;t<e.length;t++){var l=e[t],a=jQuery("<li/>").appendTo(i).append("<a/>").children("a:first").attr("href",l.href||"#").attr("title",l.title||"").text(l.text||"").end();if(l.menu)a.addClass("slide-menu").append(SlideMenu.buildMenu(l.menu,n+1)).children("a:first").click(SlideMenu.click);else{a.addClass("slide-item");var r,u=a.children("a:first");if(l.target&&u.attr("target",l.target),l.onclick)r="string"==XPLAN.util.getType(l.onclick)?new Function(l.onclick):l.onclick,u.click(r)}}return i},click:function(e){var n;if("string"==typeof e){if(null==(n=document.getElementById(e)))return}else n=e.currentTarget;(n=jQuery(n)).hasClass("slide-title")?n.parent().toggleClass("slide-open"):n.next("ul").parent().parent().toggleClass("slide-open"),e.preventDefault(),e.stopPropagation()},init:function(){jQuery("#mf-navigator").length&&(jQuery("#mf-navigatorbox").on("click","div.slidemenu li.slide-menu > div > a",SlideMenu.click),jQuery("#mf-navigatorbox").on("click","div.slidemenu > div.slide-title",SlideMenu.click),jQuery("#mf-navgrip").click(function(){jQuery(document.body).toggleClass("hasnav"),XMLRPC.call("today.autohide",[!jQuery(document.body).hasClass("hasnav")],function(e){setTimeout(function(){jQuery("#mf-contentinner").trigger("resize")},200)},HttpRequest.onerror)}))},loadMenu:function(e){var n=jQuery(".slidemenu").eq(0),i=n.attr("class");n.replaceWith(e.menuhtml),jQuery(".slidemenu").eq(0).attr("class",i),window.XPLAN&&XPLAN.instasearch&&XPLAN.instasearch.addSideMenu&&XPLAN.instasearch.addSideMenu(e.cfg,e.menudata)}},jQuery(SlideMenu.init);
;Dependency._js['slidemenu']=true;

;
XPLAN.namespace("DateLocales"),XPLAN.DateLocales=[],XPLAN.DateLocales.en_AU={closeText:_("Close"),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","June","July","Aug","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su.","M.","Tu.","W.","Th.","F.","Sa."],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y - d MMM y",dateFormat:"d/MM/yy",dateFormatFull:"EEEE, d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.af_ZA={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember"],monthNamesShort:["Jan.","Feb.","Mrt.","Apr.","Mei","Jun.","Jul.","Aug.","Sep.","Okt.","Nov.","Des."],monthYearFull:"MMMM y",dayNames:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],dayNamesShort:["So.","Ma.","Di.","Wo.","Do.","Vr.","Sa."],dayNamesMin:["S","M","D","W","D","V","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM, y – d MMM, y",dateFormat:"yyyy-MM-dd",dateFormatFull:"EEEE dd MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_ZA={closeText:_("Close"),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","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"dd MMM y - dd MMM y",dateFormat:"dd/MM/yyyy",dateFormatFull:"EEEE dd MMMM y",yearMonthMediumDay:"dd MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_NZ={closeText:_("Close"),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","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y - d MMM y",dateFormat:"d/MM/yy",dateFormatFull:"EEEE, d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_GB={closeText:_("Close"),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","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y - d MMM y",dateFormat:"dd/MM/yyyy",dateFormatFull:"EEEE, d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"HH:mm",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.zh_CN={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthYearFull:"y年M月",dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"y年M月d日至y年M月d日",dateFormat:"yy-M-d",dateFormatFull:"y年M月d日EEEE",yearMonthMediumDay:"y年M月d日",timeShort:"ah:mm",timeIntervalFormat:"ah:mm至ah:mm",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.zh_HK={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthYearFull:"y年M月",dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["週日","週一","週二","週三","週四","週五","週六"],dayNamesMin:["日","一","二","三","四","五","六"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"y年M月d日至y年M月d日",dateFormat:"yy-M-d",dateFormatFull:"y年M月d日EEEE",yearMonthMediumDay:"y年M月d日",timeShort:"ah:mm",timeIntervalFormat:"ah:mm至ah:mm",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_HK={closeText:_("Close"),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","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM, y – d MMM, y",dateFormat:"d/M/yy",dateFormatFull:"EEEE, d MMMM, y",yearMonthMediumDay:"d MMM, y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.zh_SG={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthYearFull:"y年M月",dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"y年M月d日至y年M月d日",dateFormat:"yy-M-d",dateFormatFull:"y年M月d日EEEE",yearMonthMediumDay:"y年M月d日",timeShort:"ah:mm",timeIntervalFormat:"ah:mm至ah:mm",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_SG={closeText:_("Close"),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","Sept","Oct","Nov","Dec"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM, y – d MMM, y",dateFormat:"d/M/yy",dateFormatFull:"EEEE, d MMMM, y",yearMonthMediumDay:"MMM d, y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.th_TH={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthNamesShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],monthYearFull:"MMMM y",dayNames:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],dayNamesShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayNamesMin:["อา","จ","อ","พ","พฤ","ศ","ส"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y – d MMM y",dateFormat:"d/M/yyyy",dateFormatFull:"EEEEที่ d MMMM G y",yearMonthMediumDay:"d MMM y",timeShort:"H:mm",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.ms_MY={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthNamesShort:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],monthYearFull:"MMMM y",dayNames:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],dayNamesShort:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],dayNamesMin:["A","I","S","R","K","J","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y – d MMM y",dateFormat:"d/MM/yy",dateFormatFull:"EEEE, d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.el_GR={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],monthNamesShort:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],monthYearFull:"LLLL y",dayNames:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],dayNamesShort:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"],dayNamesMin:["Κ","Δ","Τ","Τ","Π","Π","Σ"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"dd MMM y - dd MMM y",dateFormat:"d/M/yy",dateFormatFull:"EEEE, d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.zh_TW={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthYearFull:"y年M月",dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["週日","週一","週二","週三","週四","週五","週六"],dayNamesMin:["日","一","二","三","四","五","六"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"y年M月d日至y年M月d日",dateFormat:"yy-M-d",dateFormatFull:"y年M月d日EEEE",yearMonthMediumDay:"y年M月d日",timeShort:"ah:mm",timeIntervalFormat:"ah:mm至ah:mm",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.id_ID={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],monthYearFull:"MMMM y",dayNames:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],dayNamesShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayNamesMin:["M","S","S","R","K","J","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d MMM y – d MMM y",dateFormat:"dd/MM/yy",dateFormatFull:"EEEE, dd MMMM yyyy",yearMonthMediumDay:"d MMM y",timeShort:"HH:mm",timeIntervalFormat:"h.mm a – h.mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.en_CA={closeText:_("Close"),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"],monthYearFull:"MMMM y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"d MMM, y – d MMM, y",dateFormat:"MM/dd/yy",dateFormatFull:"EEEE, MMMM d, y",yearMonthMediumDay:"d MMM, y",timeShort:"h:mm a",timeIntervalFormat:"h:mm a - h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.fr_CA={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juill.","août","sept.","oct.","nov.","déc."],monthYearFull:"MMMM y",dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],dayMonthShort:"MM-dd",weekHeader:"Wk",weekIntervalFormat:"'du' d MMM y 'au' d MMM y",dateFormat:"yy-MM-dd",dateFormatFull:"EEEE d MMMM y",yearMonthMediumDay:"d MMM y",timeShort:"HH:mm",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.es_AR={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene","feb","mar","abr","may","jun","jul","ago","sept","oct","nov","dic"],monthYearFull:"MMMM y",dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","jue","vie","sáb"],dayNamesMin:["D","L","M","M","J","V","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d 'de' MMM 'de' y 'al' d 'de' MMM 'de' y",dateFormat:"dd/MM/yy",dateFormatFull:"EEEE d 'de' MMMM 'de' y",yearMonthMediumDay:"d MMM y",timeShort:"HH:mm",timeIntervalFormat:"h:mm a – h:mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.pt_BR={closeText:_("Close"),prevText:_("Prev"),nextText:_("Next"),currentText:_("Today"),monthNames:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthNamesShort:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],monthYearFull:"MMMM y",dayNames:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],dayNamesShort:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."],dayNamesMin:["D","S","T","Q","Q","S","S"],dayMonthShort:"dd/MM",weekHeader:"Wk",weekIntervalFormat:"d 'de' MMM 'de' y - d 'de' MMM 'de' y",dateFormat:"dd/MM/yy",dateFormatFull:"EEEE, d 'de' MMMM 'de' y",yearMonthMediumDay:"d 'de' MMM 'de' y",timeShort:"HH:mm",timeIntervalFormat:"h'h'mm a - h'h'mm a",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},XPLAN.DateLocales.ByOutputType=function(e,a){function t(e,a){switch(e){case"datepicker":a=(a=(a=(a=(a=(a=(a=a.replace(new RegExp("/M/","g"),"/m/")).replace(new RegExp("(^|[^M])M{2}($|[^M])","g"),"$1mm$2")).replace(new RegExp("M{4}","g"),"MM")).replace(new RegExp("(^|[^M])M{3}($|[^M])","g"),"$1M$2")).replace(new RegExp("E{4}","g"),"DD")).replace(new RegExp("y{4}","g"),"yy")).replace(new RegExp("([^y])y($|[^y])","g"),"$1yy$2");break;case"fullcalendar":a=(a=(a=(a=a.replace(new RegExp("E{4}","g"),"dddd")).replace(new RegExp("(^|[^y])y($|[^y])","g"),"$1yyyy$2")).replace(/(\s)a(\s|$)/g,"$1tt$2")).replace(new RegExp("( - | – |至)(.*)","g"),"{$1$2}")}return a}a=null==a?XPLAN.currentLanguage:a;var r=jQuery.extend({},XPLAN.DateLocales[a]);return r.monthYearFull=t(e,r.monthYearFull),r.weekIntervalFormat=t(e,r.weekIntervalFormat),r.dateFormat=t(e,r.dateFormat),r.dateFormatFull=t(e,r.dateFormatFull),r.yearMonthMediumDay=t(e,r.yearMonthMediumDay),r.dayMonthShort=t(e,r.dayMonthShort),r.timeIntervalFormat=t(e,r.timeIntervalFormat),r},jQuery(function(){jQuery.datepicker&&jQuery.datepicker.setDefaults(XPLAN.DateLocales.ByOutputType("datepicker"))});
;Dependency._js['datelocales']=true;

;
XPLAN.namespace("commondates"),XPLAN.commondates.dateToRaw=function(t,e){var a=XPLAN.commondates.dateToDateSet(t);return null==a?e:XPLAN.commondates.dateSetToRaw(a)},XPLAN.commondates.dateSetToRaw=function(t){var e="";for(var a in t){""!=e&&(e+="-"),e+=XPLAN.commondates.dateObjToYYYYMMDD(t[a])}return e},XPLAN.commondates.dateObjToYYYYMMDD=function(t){return t.getFullYear()<1901?"0":XPLAN.DateTimeUtil.strftime("%Y%m%d",t)},XPLAN.commondates.dateToDateSet=function(t){return"Today"==t?[XPLAN.commondates.getToday()]:"Yesterday"==t?[XPLAN.commondates.getYesterday()]:"End of Previous Week"==t?[XPLAN.commondates.getEndOfLastWeek()]:"End of Previous Month"==t?[XPLAN.commondates.getEndOfLastMonth()]:"End of Previous Quarter"==t?[XPLAN.commondates.getEndOfLastQuarter()]:"End of Previous Year"==t?[XPLAN.commondates.getEndOfLastYear()]:"End of Previous Financial Year"==t?[XPLAN.commondates.getEndOfLastFinancialYear()]:"Today Only"==t?[XPLAN.commondates.getToday(),XPLAN.commondates.getToday()]:"Current Month"==t?[XPLAN.commondates.getFirstOfMonth(),XPLAN.commondates.getToday()]:"Previous Month"==t?[XPLAN.commondates.getFirstOfLastMonth(),XPLAN.commondates.getEndOfLastMonth()]:"Current Quarter"==t?[XPLAN.commondates.getFirstOfQuarter(),XPLAN.commondates.getToday()]:"Previous Quarter"==t?[XPLAN.commondates.getFirstOfLastQuarter(),XPLAN.commondates.getEndOfLastQuarter()]:"Current Year"==t?[XPLAN.commondates.getFirstOfYear(),XPLAN.commondates.getToday()]:"Previous Year"==t?[XPLAN.commondates.getFirstOfLastYear(),XPLAN.commondates.getEndOfLastYear()]:"Current Financial Year"==t?[XPLAN.commondates.getFirstOfFinancialYear(),XPLAN.commondates.getToday()]:"Previous Financial Year"==t?[XPLAN.commondates.getFirstOfLastFinancialYear(),XPLAN.commondates.getEndOfLastFinancialYear()]:"Last 3 Months"==t||"Last 3 Months (Day)"==t?[XPLAN.commondates.getThreeMonthsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 3 Months (Mth)"==t?[XPLAN.commondates.getFirstOfThreeMonthsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 6 Months"==t||"Last 6 Months (Day)"==t?[XPLAN.commondates.getSixMonthsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 6 Months (Mth)"==t?[XPLAN.commondates.getFirstOfSixMonthsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 12 Months"==t||"Last 12 Months (Day)"==t?[XPLAN.commondates.getOneYearAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 12 Months (Mth)"==t?[XPLAN.commondates.getFirstOfTwelveMonthsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 2 Years"==t||"Last 2 Years (Day)"==t?[XPLAN.commondates.getTwoYearsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 2 Years (Mth)"==t?[XPLAN.commondates.getFirstOfTwoYearsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 3 Years"==t||"Last 3 Years (Day)"==t?[XPLAN.commondates.getThreeYearsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 3 Years (Mth)"==t?[XPLAN.commondates.getFirstOfThreeYearsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 5 Years"==t||"Last 5 Years (Day)"==t?[XPLAN.commondates.getFiveYearsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 5 Years (Mth)"==t?[XPLAN.commondates.getFirstOfFiveYearsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 7 Years"==t||"Last 7 Years (Day)"==t?[XPLAN.commondates.getSevenYearsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 7 Years (Mth)"==t?[XPLAN.commondates.getFirstOfSevenYearsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Last 10 Years"==t||"Last 10 Years (Day)"==t?[XPLAN.commondates.getTenYearsAgoPlusDay(),XPLAN.commondates.getToday()]:"Last 10 Years (Mth)"==t?[XPLAN.commondates.getFirstOfTenYearsAgo(),XPLAN.commondates.getEndOfLastMonth()]:"Since Inception"==t?[XPLAN.commondates.getInception(),XPLAN.commondates.getToday()]:"Next Month"==t?[XPLAN.commondates.getFirstOfNextMonth(),XPLAN.commondates.getEndOfNextMonth()]:"Next 6 Months (Mth)"==t?[XPLAN.commondates.getFirstOfNextMonth(),XPLAN.commondates.getEndOfNextSixMonthsByMonth()]:"Next Year"==t?[XPLAN.commondates.getFirstOfNextYear(),XPLAN.commondates.getEndOfNextOneYear()]:"Next 3 Years (Mth)"==t?[XPLAN.commondates.getFirstOfNextMonth(),XPLAN.commondates.getEndOfNextThreeYearsByMonth()]:"Next 5 Years (Mth)"==t?[XPLAN.commondates.getFirstOfNextMonth(),XPLAN.commondates.getEndOfNextFiveYearsByMonth()]:"No Date Set"==t?[XPLAN.commondates.getInception(),XPLAN.commondates.getInception()]:null},XPLAN.commondates.getDates=function(t){return"single"==t?XPLAN.commondates.getSingleDates():XPLAN.commondates.getRangeDates()},XPLAN.commondates.getSingleDates=function(){return[{value:"Today",text:_("Today")},{value:"Yesterday",text:_("Yesterday")},{value:"End of Previous Week",text:_("End of Previous Week")},{value:"End of Previous Month",text:_("End of Previous Month")},{value:"End of Previous Quarter",text:_("End of Previous Quarter")},{value:"End of Previous Year",text:_("End of Previous Year")},{value:"End of Previous Financial Year",text:_("End of Previous Financial Year")}]};var GB_CD_date_range_limits=[{value:"Today Only",text:_("Today Only"),limit:0},{value:"Current Month",text:_("Current Month"),limit:1},{value:"Previous Month",text:_("Previous Month"),limit:1},{value:"Current Quarter",text:_("Current Quarter"),limit:3},{value:"Previous Quarter",text:_("Previous Quarter"),limit:3},{value:"Current Year",text:_("Current Year"),limit:12},{value:"Previous Year",text:_("Previous Year"),limit:12},{value:"Current Financial Year",text:_("Current Financial Year"),limit:12},{value:"Previous Financial Year",text:_("Previous Financial Year"),limit:12},{value:"Last 6 Months (Day)",text:_("Last 6 Months (Day)"),limit:6},{value:"Last 6 Months (Mth)",text:_("Last 6 Months (Mth)"),limit:6},{value:"Last 12 Months (Day)",text:_("Last 12 Months (Day)"),limit:12},{value:"Last 12 Months (Mth)",text:_("Last 12 Months (Mth)"),limit:12},{value:"Last 2 Years (Day)",text:_("Last 2 Years (Day)"),limit:24},{value:"Last 2 Years (Mth)",text:_("Last 2 Years (Mth)"),limit:24},{value:"Last 3 Years (Day)",text:_("Last 3 Years (Day)"),limit:36},{value:"Last 3 Years (Mth)",text:_("Last 3 Years (Mth)"),limit:36},{value:"Last 5 Years (Day)",text:_("Last 5 Years (Day)"),limit:60},{value:"Last 5 Years (Mth)",text:_("Last 5 Years (Mth)"),limit:60},{value:"Since Inception",text:_("Since Inception"),limit:123456789}],GB_CD_future_date_range_limits=[{value:"Next Month",text:_("Next Month"),limit:1},{value:"Next 6 Months (Mth)",text:_("Next 6 Months (Mth)"),limit:6},{value:"Next Year",text:_("Next Year"),limit:12},{value:"Next 3 Years (Mth)",text:_("Next 3 Years (Mth)"),limit:36},{value:"Next 5 Years (Mth)",text:_("Next 5 Years (Mth)"),limit:60}],GB_CD_no_date_range_limits=[{value:"No Date Set",text:_("No Date Set"),limit:0}];XPLAN.commondates.getRangeDates=function(t,e){var a,o=new Array;if(null==t||null==e)for(var n in GB_CD_date_range_limits)o.push(GB_CD_date_range_limits[n]);else for(var n in"year"==t&&(e*=12),GB_CD_date_range_limits)e>=(a=GB_CD_date_range_limits[n]).limit&&o.push(a);return o},XPLAN.commondates.getFutureDates=function(){var t=new Array;for(var e in GB_CD_future_date_range_limits)t.push(GB_CD_future_date_range_limits[e]);return t},XPLAN.commondates.getNoDateSet=function(){var t=new Array;for(var e in GB_CD_no_date_range_limits)t.push(GB_CD_no_date_range_limits[e]);return t},XPLAN.commondates.endOfWeekCheck=function(t){return 6==t.getDay()},XPLAN.commondates.locateDate=function(t,e){for(;!e(t);)t=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);return t},XPLAN.commondates.getInception=function(){return new Date(0,0,0)},XPLAN.commondates.getToday=function(t){return t||(t=new Date),t},XPLAN.commondates.getYesterday=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)},XPLAN.commondates.getEndOfLastWeek=function(t){return t=XPLAN.commondates.getToday(t),t=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7),XPLAN.commondates.locateDate(t,XPLAN.commondates.endOfWeekCheck)},XPLAN.commondates.getFirstOfMonth=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),t.getMonth(),1)},XPLAN.commondates.getEndOfMonth=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),t.getMonth()+1,0)},XPLAN.commondates.getFirstOfLastMonth=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),t.getMonth()-1,1)},XPLAN.commondates.getEndOfLastMonth=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),t.getMonth(),0)},XPLAN.commondates.getFirstOfQuarter=function(t){var e=(t=XPLAN.commondates.getToday(t)).getMonth();return new Date(t.getFullYear(),e-e%3,1)},XPLAN.commondates.getFirstOfLastQuarter=function(t){var e=(t=XPLAN.commondates.getToday(t)).getMonth();return new Date(t.getFullYear(),e-e%3-3,1)},XPLAN.commondates.getEndOfLastQuarter=function(t){var e=(t=XPLAN.commondates.getToday(t)).getMonth();return new Date(t.getFullYear(),e-e%3,0)},XPLAN.commondates.getFirstOfYear=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear(),0,1)},XPLAN.commondates.getFirstOfLastYear=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear()-1,0,1)},XPLAN.commondates.getOneYearAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,1,0)},XPLAN.commondates.getOneYearAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,1,1)},XPLAN.commondates.getTwoYearsAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,2,0)},XPLAN.commondates.getTwoYearsAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,2,1)},XPLAN.commondates.getThreeYearsAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,3,0)},XPLAN.commondates.getThreeYearsAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,3,1)},XPLAN.commondates.getFiveYearsAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,5,0)},XPLAN.commondates.getFiveYearsAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,5,1)},XPLAN.commondates.getSevenYearsAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,7,0)},XPLAN.commondates.getSevenYearsAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,7,1)},XPLAN.commondates.getTenYearsAgo=function(t){return XPLAN.commondates.getXYearsAgo(t,10,0)},XPLAN.commondates.getTenYearsAgoPlusDay=function(t){return XPLAN.commondates.getXYearsAgo(t,10,1)},XPLAN.commondates.getXYearsAgo=function(t,e,a){var o=(t=XPLAN.commondates.getToday(t)).getMonth();return(t=new Date(t.getFullYear()-e,t.getMonth(),t.getDate())).getMonth()!=o&&(t=XPLAN.commondates.getEndOfLastMonth(t)),a>0&&(t=new Date(t.getFullYear(),t.getMonth(),t.getDate()+a)),t},XPLAN.commondates.getEndOfLastYear=function(t){return t=XPLAN.commondates.getToday(t),new Date(t.getFullYear()-1,11,31)},XPLAN.commondates.getEndOfLastFinancialYear=function(t){var e=(t=XPLAN.commondates.getToday(t)).getFullYear();return t.getMonth()<=5&&(e-=1),new Date(e,XPLAN.DateTimeUtil.getFYDate("endMonth")-1,XPLAN.DateTimeUtil.getFYDate("endDay"))},XPLAN.commondates.getFirstOfLastFinancialYear=function(t){return t=XPLAN.commondates.getEndOfLastFinancialYear(t),new Date(t.getFullYear()-1,XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay"))},XPLAN.commondates.getFirstOfFinancialYear=function(t){return t=XPLAN.commondates.getEndOfLastFinancialYear(t),new Date(t.getFullYear(),XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay"))},XPLAN.commondates.getXMonthsAgo=function(t,e,a){var o=(t=XPLAN.commondates.getToday(t)).getFullYear(),n=t.getMonth();return n<=e-1&&o--,n=(n+12-e)%12,(t=new Date(o,n,t.getDate())).getMonth()!=n&&(t=XPLAN.commondates.getEndOfLastMonth(t)),a>0&&(t=new Date(t.getFullYear(),t.getMonth(),t.getDate()+a)),t},XPLAN.commondates.getEndOfXMonthsAgo=function(t,e){var a=(t=XPLAN.commondates.getToday(t)).getMonth()-e+1;return t=new Date(t.getFullYear(),a,0)},XPLAN.commondates.getThreeMonthsAgo=function(t){return XPLAN.commondates.getXMonthsAgo(t,3,0)},XPLAN.commondates.getThreeMonthsAgoPlusDay=function(t){return XPLAN.commondates.getXMonthsAgo(t,3,1)},XPLAN.commondates.getSixMonthsAgo=function(t){return XPLAN.commondates.getXMonthsAgo(t,6,0)},XPLAN.commondates.getSixMonthsAgoPlusDay=function(t){return XPLAN.commondates.getXMonthsAgo(t,6,1)},XPLAN.commondates.getFirstOfThreeMonthsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getThreeMonthsAgo(t))},XPLAN.commondates.getFirstOfSixMonthsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getSixMonthsAgo(t))},XPLAN.commondates.getFirstOfTwelveMonthsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getOneYearAgo(t))},XPLAN.commondates.getFirstOfTwoYearsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getTwoYearsAgo(t))},XPLAN.commondates.getFirstOfThreeYearsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getThreeYearsAgo(t))},XPLAN.commondates.getFirstOfFiveYearsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getFiveYearsAgo(t))},XPLAN.commondates.getFirstOfSevenYearsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getSevenYearsAgo(t))},XPLAN.commondates.getFirstOfTenYearsAgo=function(t){return XPLAN.commondates.getFirstOfMonth(XPLAN.commondates.getTenYearsAgo(t))},XPLAN.commondates.getFirstOfNextMonth=function(t){return date1=XPLAN.commondates.getFirstOfMonth(t),new Date(date1.getFullYear(),date1.getMonth()+1,date1.getDate())},XPLAN.commondates.getEndOfNextMonth=function(t){return date1=XPLAN.commondates.getFirstOfNextMonth(t),date2=new Date(date1.getFullYear(),date1.getMonth()+1,date1.getDate()),new Date(date2.getFullYear(),date2.getMonth(),date2.getDate()-1)},XPLAN.commondates.getEndOfNextSixMonthsByMonth=function(t){return date1=XPLAN.commondates.getFirstOfNextMonth(t),date2=new Date(date1.getFullYear(),date1.getMonth()+6,date1.getDate()),new Date(date2.getFullYear(),date2.getMonth(),date2.getDate()-1)},XPLAN.commondates.getFirstOfNextYear=function(t){date1=XPLAN.commondates.getFirstOfMonth(t);var e=12-date1.getMonth();return new Date(date1.getFullYear(),date1.getMonth()+e,date1.getDate())},XPLAN.commondates.getEndOfNextOneYear=function(t){return date1=XPLAN.commondates.getFirstOfNextYear(t),date2=new Date(date1.getFullYear(),date1.getMonth()+12,date1.getDate()),new Date(date2.getFullYear(),date2.getMonth(),date2.getDate()-1)},XPLAN.commondates.getEndOfNextThreeYearsByMonth=function(t){return date1=XPLAN.commondates.getFirstOfNextMonth(t),date2=new Date(date1.getFullYear(),date1.getMonth()+36,date1.getDate()),new Date(date2.getFullYear(),date2.getMonth(),date2.getDate()-1)},XPLAN.commondates.getEndOfNextFiveYearsByMonth=function(t){return date1=XPLAN.commondates.getFirstOfNextMonth(t),date2=new Date(date1.getFullYear(),date1.getMonth()+60,date1.getDate()),new Date(date2.getFullYear(),date2.getMonth(),date2.getDate()-1)};
;Dependency._js['commondates']=true;

;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return st.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function r(e){return void 0===e}function a(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function o(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var n,s=[],i=e.length;for(n=0;n<i;++n)s.push(t(e[n],n));return s}function l(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function d(e,t,n,s){return ye(e,t,n,s,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function c(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());return s&&(t=h(e),n=it.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function f(e){var t=d(NaN);return null!=e?l(h(t),e):h(t).userInvalidated=!0,t}function m(e,t){var n,s,i,a=at.length;if(r(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),r(t._i)||(e._i=t._i),r(t._f)||(e._f=t._f),r(t._l)||(e._l=t._l),r(t._strict)||(e._strict=t._strict),r(t._tzm)||(e._tzm=t._tzm),r(t._isUTC)||(e._isUTC=t._isUTC),r(t._offset)||(e._offset=t._offset),r(t._pf)||(e._pf=h(t)),r(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r(i=t[s=at[n]])||(e[s]=i);return e}function _(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===ot&&(ot=!0,e.updateOffset(this),ot=!1)}function y(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function g(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,n){var i=!0;return l(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),i){var r,a,o,u=[],l=arguments.length;for(a=0;a<l;a++){if(r="","object"==typeof arguments[a]){for(o in r+="\n["+a+"] ",arguments[0])s(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[a];u.push(r)}g(t+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+(new Error).stack),i=!1}return n.apply(this,arguments)},n)}function p(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),ut[t]||(g(n),ut[t]=!0)}function v(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function k(e,t){var i,r=l({},e);for(i in t)s(t,i)&&(n(e[i])&&n(t[i])?(r[i]={},l(r[i],e[i]),l(r[i],t[i])):null!=t[i]?r[i]=t[i]:delete r[i]);for(i in e)s(e,i)&&!s(t,i)&&n(e[i])&&(r[i]=l({},r[i]));return r}function M(e){null!=e&&this.set(e)}function D(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}function Y(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(ft[e]=i),t&&(ft[t[0]]=function(){return D(i.apply(this,arguments),t[1],t[2])}),n&&(ft[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function S(e,t){return e.isValid()?(t=O(t,e.localeData()),ct[t]=ct[t]||function(e){var t,n,s,i=e.match(dt);for(t=0,n=i.length;t<n;t++)ft[i[t]]?i[t]=ft[i[t]]:i[t]=(s=i[t]).match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"");return function(t){var s,r="";for(s=0;s<n;s++)r+=v(i[s])?i[s].call(t,e):i[s];return r}}(t),ct[t](e)):e.localeData().invalidDate()}function O(e,t){function n(e){return t.longDateFormat(e)||e}var s=5;for(ht.lastIndex=0;s>=0&&ht.test(e);)e=e.replace(ht,n),ht.lastIndex=0,s-=1;return e}function b(e){return"string"==typeof e?mt[e]||mt[e.toLowerCase()]:void 0}function T(e){var t,n,i={};for(n in e)s(e,n)&&(t=b(n))&&(i[t]=e[n]);return i}function x(e,t,n){lt[e]=v(t)?t:function(e,s){return e&&n?n:t}}function N(e,t){return s(lt,e)?lt[e](t._strict,t._locale):new RegExp(W(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function W(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function P(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function R(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=P(t)),n}function C(e,t){var n,s,i=t;for("string"==typeof e&&(e=[e]),a(t)&&(i=function(e,n){n[t]=R(e)}),s=e.length,n=0;n<s;n++)Ct[e[n]]=i}function U(e,t){C(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function H(e,t,n){null!=t&&s(Ct,e)&&Ct[e](t,n._a,n,e)}function F(e){return e%4==0&&e%100!=0||e%400==0}function L(e){return F(e)?366:365}function V(t,n){return function(s){return null!=s?(E(this,t,s),e.updateOffset(this,n),this):G(this,t)}}function G(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function E(e,t,n){var s,i,r,a,o;if(e.isValid()&&!isNaN(n)){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(i?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(i?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(i?s.setUTCHours(n):s.setHours(n));case"Date":return void(i?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}r=n,a=e.month(),o=29!==(o=e.date())||1!==a||F(r)?o:28,i?s.setUTCFullYear(r,a,o):s.setFullYear(r,a,o)}}function A(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?F(e)?29:28:31-s%7%2}function j(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=R(t);else if(!a(t=e.localeData().monthsParse(t)))return e;var n=t,s=e.date();return s=s<29?s:Math.min(s,A(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function I(t){return null!=t?(j(this,t),e.updateOffset(this,!0),this):G(this,"Month")}function Z(){function e(e,t){return t.length-e.length}var t,n,s,i,r=[],a=[],o=[];for(t=0;t<12;t++)n=d([2e3,t]),s=W(this.monthsShort(n,"")),i=W(this.months(n,"")),r.push(s),a.push(i),o.push(i),o.push(s);r.sort(e),a.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function z(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function q(e,t,n){var s=7+t-n;return-((7+z(e,0,s).getUTCDay()-t)%7)+s-1}function $(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+q(e,s,i);return o<=0?a=L(r=e-1)+o:o>L(e)?(r=e+1,a=o-L(e)):(r=e,a=o),{year:r,dayOfYear:a}}function B(e,t,n){var s,i,r=q(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+J(i=e.year()-1,t,n):a>J(e.year(),t,n)?(s=a-J(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function J(e,t,n){var s=q(e,t,n),i=q(e+1,t,n);return(L(e)-s+i)/7}function Q(e,t){return e.slice(t,7).concat(e.slice(0,t))}function X(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=d([2e3,1]).day(t),s=W(this.weekdaysMin(n,"")),i=W(this.weekdaysShort(n,"")),r=W(this.weekdays(n,"")),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);a.sort(e),o.sort(e),u.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function K(){return this.hours()%12||12}function ee(e,t){Y(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function te(e,t){return t._meridiemParse}function ne(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function se(e){return e?e.toLowerCase().replace("_","-"):e}function ie(e){var t=null;if(void 0===on[e]&&"undefined"!=typeof module&&module&&module.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(e))try{t=sn._abbr,require("./locale/"+e),re(t)}catch(t){on[e]=null}return on[e]}function re(e,t){var n;return e&&((n=r(t)?oe(e):ae(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function ae(e,t){if(null!==t){var n,s=an;if(t.abbr=e,null!=on[e])p("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."),s=on[e]._config;else if(null!=t.parentLocale)if(null!=on[t.parentLocale])s=on[t.parentLocale]._config;else{if(null==(n=ie(t.parentLocale)))return un[t.parentLocale]||(un[t.parentLocale]=[]),un[t.parentLocale].push({name:e,config:t}),null;s=n._config}return on[e]=new M(k(s,t)),un[e]&&un[e].forEach(function(e){ae(e.name,e.config)}),re(e),on[e]}return delete on[e],null}function oe(e){var n;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!t(e)){if(n=ie(e))return n;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=se(e[r]).split("-")).length,n=(n=se(e[r+1]))?n.split("-"):null;t>0;){if(s=ie(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&ne(i,n)>=t-1)break;t--}r++}return sn}(e)}function ue(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[Ht]<0||n[Ht]>11?Ht:n[Ft]<1||n[Ft]>A(n[Ut],n[Ht])?Ft:n[Lt]<0||n[Lt]>24||24===n[Lt]&&(0!==n[Vt]||0!==n[Gt]||0!==n[Et])?Lt:n[Vt]<0||n[Vt]>59?Vt:n[Gt]<0||n[Gt]>59?Gt:n[Et]<0||n[Et]>999?Et:-1,h(e)._overflowDayOfYear&&(t<Ut||t>Ft)&&(t=Ft),h(e)._overflowWeeks&&-1===t&&(t=At),h(e)._overflowWeekday&&-1===t&&(t=jt),h(e).overflow=t),e}function le(e){var t,n,s,i,r,a,o=e._i,u=ln.exec(o)||dn.exec(o),l=cn.length,d=fn.length;if(u){for(h(e).iso=!0,t=0,n=l;t<n;t++)if(cn[t][1].exec(u[1])){i=cn[t][0],s=!1!==cn[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=d;t<n;t++)if(fn[t][1].exec(u[3])){r=(u[2]||" ")+fn[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!hn.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),me(e)}else e._isValid=!1}function de(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);if(t<=49)return 2e3+t;if(t<=999)return 1900+t;return t}(e),qt.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}function he(e){var t,n=_n.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(n){if(t=de(n[4],n[3],n[2],n[5],n[6],n[7]),!function(e,t,n){return!e||Xt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(h(n).weekdayMismatch=!0,n._isValid=!1,!1)}(n[1],t,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return yn[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(n[8],n[9],n[10]),e._d=z.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function ce(e,t,n){return null!=e?e:null!=t?t:n}function fe(t){var n,s,i,r,a,o=[];if(!t._d){for(i=function(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}(t),t._w&&null==t._a[Ft]&&null==t._a[Ht]&&function(e){var t,n,s,i,r,a,o,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=ce(t.GG,e._a[Ut],B(ge(),1,4).year),s=ce(t.W,1),((i=ce(t.E,1))<1||i>7)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,l=B(ge(),r,a),n=ce(t.gg,e._a[Ut],l.year),s=ce(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r);s<1||s>J(n,r,a)?h(e)._overflowWeeks=!0:null!=u?h(e)._overflowWeekday=!0:(o=$(n,s,i,r,a),e._a[Ut]=o.year,e._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(a=ce(t._a[Ut],i[Ut]),(t._dayOfYear>L(a)||0===t._dayOfYear)&&(h(t)._overflowDayOfYear=!0),s=z(a,0,t._dayOfYear),t._a[Ht]=s.getUTCMonth(),t._a[Ft]=s.getUTCDate()),n=0;n<3&&null==t._a[n];++n)t._a[n]=o[n]=i[n];for(;n<7;n++)t._a[n]=o[n]=null==t._a[n]?2===n?1:0:t._a[n];24===t._a[Lt]&&0===t._a[Vt]&&0===t._a[Gt]&&0===t._a[Et]&&(t._nextDay=!0,t._a[Lt]=0),t._d=(t._useUTC?z:function(e,t,n,s,i,r,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Lt]=24),t._w&&"undefined"!=typeof t._w.d&&t._w.d!==r&&(h(t).weekdayMismatch=!0)}}function me(t){if(t._f!==e.ISO_8601)if(t._f!==e.RFC_2822){t._a=[],h(t).empty=!0;var n,s,i,r,a,o,u,l=""+t._i,d=l.length,c=0;for(u=(i=O(t._f,t._locale).match(dt)||[]).length,n=0;n<u;n++)r=i[n],(s=(l.match(N(r,t))||[])[0])&&((a=l.substr(0,l.indexOf(s))).length>0&&h(t).unusedInput.push(a),l=l.slice(l.indexOf(s)+s.length),c+=s.length),ft[r]?(s?h(t).empty=!1:h(t).unusedTokens.push(r),H(r,s,t)):t._strict&&!s&&h(t).unusedTokens.push(r);h(t).charsLeftOver=d-c,l.length>0&&h(t).unusedInput.push(l),t._a[Lt]<=12&&!0===h(t).bigHour&&t._a[Lt]>0&&(h(t).bigHour=void 0),h(t).parsedDateParts=t._a.slice(0),h(t).meridiem=t._meridiem,t._a[Lt]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}(t._locale,t._a[Lt],t._meridiem),null!==(o=h(t).era)&&(t._a[Ut]=t._locale.erasConvertYear(o,t._a[Ut])),fe(t),ue(t)}else he(t);else le(t)}function _e(s){var i=s._i,d=s._f;return s._locale=s._locale||oe(s._l),null===i||void 0===d&&""===i?f({nullInput:!0}):("string"==typeof i&&(s._i=i=s._locale.preparse(i)),y(i)?new _(ue(i)):(o(i)?s._d=i:t(d)?function(e){var t,n,s,i,r,a,o=!1,u=e._f.length;if(0===u)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<u;i++)r=0,a=!1,t=m({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],me(t),c(t)&&(a=!0),r+=h(t).charsLeftOver,r+=10*h(t).unusedTokens.length,h(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));l(e,n||t)}(s):d?me(s):function(s){var i=s._i;r(i)?s._d=new Date(e.now()):o(i)?s._d=new Date(i.valueOf()):"string"==typeof i?function(t){var n=mn.exec(t._i);null===n?(le(t),!1===t._isValid&&(delete t._isValid,he(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:e.createFromInputFallback(t)))):t._d=new Date(+n[1])}(s):t(i)?(s._a=u(i.slice(0),function(e){return parseInt(e,10)}),fe(s)):n(i)?function(e){if(!e._d){var t=T(e._i),n=void 0===t.day?t.date:t.day;e._a=u([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),fe(e)}}(s):a(i)?s._d=new Date(i):e.createFromInputFallback(s)}(s),c(s)||(s._d=null),s))}function ye(e,s,r,a,o){var u,l={};return!0!==s&&!1!==s||(a=s,s=void 0),!0!==r&&!1!==r||(a=r,r=void 0),(n(e)&&i(e)||t(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=o,l._l=r,l._i=e,l._f=s,l._strict=a,(u=new _(ue(_e(l))))._nextDay&&(u.add(1,"d"),u._nextDay=void 0),u}function ge(e,t,n,s){return ye(e,t,n,s,!1)}function we(e,n){var s,i;if(1===n.length&&t(n[0])&&(n=n[0]),!n.length)return ge();for(s=n[0],i=1;i<n.length;++i)n[i].isValid()&&!n[i][e](s)||(s=n[i]);return s}function pe(e){var t=T(e),n=t.year||0,i=t.quarter||0,r=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,u=t.hour||0,l=t.minute||0,d=t.second||0,h=t.millisecond||0;this._isValid=function(e){var t,n,i=!1,r=pn.length;for(t in e)if(s(e,t)&&(-1===It.call(pn,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<r;++n)if(e[pn[n]]){if(i)return!1;parseFloat(e[pn[n]])!==R(e[pn[n]])&&(i=!0)}return!0}(t),this._milliseconds=+h+1e3*d+6e4*l+1e3*u*60*60,this._days=+o+7*a,this._months=+r+3*i+12*n,this._data={},this._locale=oe(),this._bubble()}function ve(e){return e instanceof pe}function ke(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Me(e,t){Y(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+D(~~(e/60),2)+t+D(~~e%60,2)})}function De(e,t){var n,s,i=(t||"").match(e);return null===i?null:0===(s=60*(n=((i[i.length-1]||[])+"").match(vn)||["-",0,0])[1]+R(n[2]))?0:"+"===n[0]?s:-s}function Ye(t,n){var s,i;return n._isUTC?(s=n.clone(),i=(y(t)||o(t)?t.valueOf():ge(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+i),e.updateOffset(s,!1),s):ge(t).local()}function Se(e){return-Math.round(e._d.getTimezoneOffset())}function Oe(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function be(e,t){var n,i,r,o=e,u=null;return ve(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:a(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(u=kn.exec(e))?(n="-"===u[1]?-1:1,o={y:0,d:R(u[Ft])*n,h:R(u[Lt])*n,m:R(u[Vt])*n,s:R(u[Gt])*n,ms:R(ke(1e3*u[Et]))*n}):(u=Mn.exec(e))?(n="-"===u[1]?-1:1,o={y:Te(u[2],n),M:Te(u[3],n),w:Te(u[4],n),d:Te(u[5],n),h:Te(u[6],n),m:Te(u[7],n),s:Te(u[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(r=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Ye(t,e),e.isBefore(t)?n=xe(e,t):((n=xe(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(ge(o.from),ge(o.to)),(o={}).ms=r.milliseconds,o.M=r.months),i=new pe(o),ve(e)&&s(e,"_locale")&&(i._locale=e._locale),ve(e)&&s(e,"_isValid")&&(i._isValid=e._isValid),i}function Te(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function xe(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Ne(e,t){return function(n,s){var i;return null===s||isNaN(+s)||(p(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=s,s=i),We(this,be(n,s),e),this}}function We(t,n,s,i){var r=n._milliseconds,a=ke(n._days),o=ke(n._months);t.isValid()&&(i=null==i||i,o&&j(t,G(t,"Month")+o*s),a&&E(t,"Date",G(t,"Date")+a*s),r&&t._d.setTime(t._d.valueOf()+r*s),i&&e.updateOffset(t,a||o))}function Pe(e){return"string"==typeof e||e instanceof String}function Re(e){return y(e)||o(e)||Pe(e)||a(e)||function(e){var n=t(e),s=!1;n&&(s=0===e.filter(function(t){return!a(t)&&Pe(e)}).length);return n&&s}(e)||function(e){var t,r=n(e)&&!i(e),a=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=o.length;for(t=0;t<u;t+=1)a=a||s(e,o[t]);return r&&a}(e)||null===e||void 0===e}function Ce(e,t){if(e.date()<t.date())return-Ce(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Ue(e){var t;return void 0===e?this._locale._abbr:(null!=(t=oe(e))&&(this._locale=t),this)}function He(){return this._locale}function Fe(e,t){return(e%t+t)%t}function Le(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-xn:new Date(e,t,n).valueOf()}function Ve(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-xn:Date.UTC(e,t,n)}function Ge(e,t){return t.erasAbbrRegex(e)}function Ee(){var e,t,n,s,i,r=[],a=[],o=[],u=[],l=this.eras();for(e=0,t=l.length;e<t;++e)n=W(l[e].name),s=W(l[e].abbr),i=W(l[e].narrow),a.push(n),r.push(s),o.push(i),u.push(n),u.push(s),u.push(i);this._erasRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function Ae(e,t){Y(0,[e,e.length],0,t)}function je(e,t,n,s,i){var r;return null==e?B(this,s,i).year:(t>(r=J(e,s,i))&&(t=r),function(e,t,n,s,i){var r=$(e,t,n,s,i),a=z(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}function Ie(e,t){t[Et]=R(1e3*("0."+e))}function Ze(e){return e}function ze(e,t,n,s){var i=oe(),r=d().set(s,t);return i[n](r,e)}function qe(e,t,n){if(a(e)&&(t=e,e=void 0),e=e||"",null!=t)return ze(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=ze(e,s,n,"month");return i}function $e(e,t,n,s){"boolean"==typeof e?(a(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,a(t)&&(n=t,t=void 0),t=t||"");var i,r=oe(),o=e?r._week.dow:0,u=[];if(null!=n)return ze(t,(n+o)%7,s,"day");for(i=0;i<7;i++)u[i]=ze(t,(i+o)%7,s,"day");return u}function Be(e,t,n,s){var i=be(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function Je(e){return e<0?Math.floor(e):Math.ceil(e)}function Qe(e){return 4800*e/146097}function Xe(e){return 146097*e/4800}function Ke(e){return function(){return this.as(e)}}function et(e){return function(){return this.isValid()?this._data[e]:NaN}}function tt(e){return(e>0)-(e<0)||+e}function nt(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o,u=ss(this._milliseconds)/1e3,l=ss(this._days),d=ss(this._months),h=this.asSeconds();return h?(t=P((e=P(u/60))/60),u%=60,e%=60,n=P(d/12),d%=12,s=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=h<0?"-":"",r=tt(this._months)!==tt(h)?"-":"",a=tt(this._days)!==tt(h)?"-":"",o=tt(this._milliseconds)!==tt(h)?"-":"",i+"P"+(n?r+n+"Y":"")+(d?r+d+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+s+"S":"")):"P0D"}var st,it;it=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),s=n.length>>>0;for(t=0;t<s;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var rt,at=e.momentProperties=[],ot=!1,ut={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null,rt=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var lt,dt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ht=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ct={},ft={},mt={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"},_t={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},yt=/\d/,gt=/\d\d/,wt=/\d{3}/,pt=/\d{4}/,vt=/[+-]?\d{6}/,kt=/\d\d?/,Mt=/\d\d\d\d?/,Dt=/\d\d\d\d\d\d?/,Yt=/\d{1,3}/,St=/\d{1,4}/,Ot=/[+-]?\d{1,6}/,bt=/\d+/,Tt=/[+-]?\d+/,xt=/Z|[+-]\d\d:?\d\d/gi,Nt=/Z|[+-]\d\d(?::?\d\d)?/gi,Wt=/[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,Pt=/^[1-9]\d?/,Rt=/^([1-9]\d|\d)/;lt={};var Ct={},Ut=0,Ht=1,Ft=2,Lt=3,Vt=4,Gt=5,Et=6,At=7,jt=8;Y("Y",0,0,function(){var e=this.year();return e<=9999?D(e,4):"+"+e}),Y(0,["YY",2],0,function(){return this.year()%100}),Y(0,["YYYY",4],0,"year"),Y(0,["YYYYY",5],0,"year"),Y(0,["YYYYYY",6,!0],0,"year"),x("Y",Tt),x("YY",kt,gt),x("YYYY",St,pt),x("YYYYY",Ot,vt),x("YYYYYY",Ot,vt),C(["YYYYY","YYYYYY"],Ut),C("YYYY",function(t,n){n[Ut]=2===t.length?e.parseTwoDigitYear(t):R(t)}),C("YY",function(t,n){n[Ut]=e.parseTwoDigitYear(t)}),C("Y",function(e,t){t[Ut]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return R(e)+(R(e)>68?1900:2e3)};var It,Zt=V("FullYear",!0);It=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},Y("M",["MM",2],"Mo",function(){return this.month()+1}),Y("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),Y("MMMM",0,0,function(e){return this.localeData().months(this,e)}),x("M",kt,Pt),x("MM",kt,gt),x("MMM",function(e,t){return t.monthsShortRegex(e)}),x("MMMM",function(e,t){return t.monthsRegex(e)}),C(["M","MM"],function(e,t){t[Ht]=R(e)-1}),C(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[Ht]=i:h(n).invalidMonth=e});var zt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),qt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),$t=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Bt=Wt,Jt=Wt;Y("w",["ww",2],"wo","week"),Y("W",["WW",2],"Wo","isoWeek"),x("w",kt,Pt),x("ww",kt,gt),x("W",kt,Pt),x("WW",kt,gt),U(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=R(e)});Y("d",0,"do","day"),Y("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),Y("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),Y("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),Y("e",0,0,"weekday"),Y("E",0,0,"isoWeekday"),x("d",kt),x("e",kt),x("E",kt),x("dd",function(e,t){return t.weekdaysMinRegex(e)}),x("ddd",function(e,t){return t.weekdaysShortRegex(e)}),x("dddd",function(e,t){return t.weekdaysRegex(e)}),U(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:h(n).invalidWeekday=e}),U(["d","e","E"],function(e,t,n,s){t[s]=R(e)});var Qt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),en=Wt,tn=Wt,nn=Wt;Y("H",["HH",2],0,"hour"),Y("h",["hh",2],0,K),Y("k",["kk",2],0,function(){return this.hours()||24}),Y("hmm",0,0,function(){return""+K.apply(this)+D(this.minutes(),2)}),Y("hmmss",0,0,function(){return""+K.apply(this)+D(this.minutes(),2)+D(this.seconds(),2)}),Y("Hmm",0,0,function(){return""+this.hours()+D(this.minutes(),2)}),Y("Hmmss",0,0,function(){return""+this.hours()+D(this.minutes(),2)+D(this.seconds(),2)}),ee("a",!0),ee("A",!1),x("a",te),x("A",te),x("H",kt,Rt),x("h",kt,Pt),x("k",kt,Pt),x("HH",kt,gt),x("hh",kt,gt),x("kk",kt,gt),x("hmm",Mt),x("hmmss",Dt),x("Hmm",Mt),x("Hmmss",Dt),C(["H","HH"],Lt),C(["k","kk"],function(e,t,n){var s=R(e);t[Lt]=24===s?0:s}),C(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),C(["h","hh"],function(e,t,n){t[Lt]=R(e),h(n).bigHour=!0}),C("hmm",function(e,t,n){var s=e.length-2;t[Lt]=R(e.substr(0,s)),t[Vt]=R(e.substr(s)),h(n).bigHour=!0}),C("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Lt]=R(e.substr(0,s)),t[Vt]=R(e.substr(s,2)),t[Gt]=R(e.substr(i)),h(n).bigHour=!0}),C("Hmm",function(e,t,n){var s=e.length-2;t[Lt]=R(e.substr(0,s)),t[Vt]=R(e.substr(s))}),C("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Lt]=R(e.substr(0,s)),t[Vt]=R(e.substr(s,2)),t[Gt]=R(e.substr(i))});var sn,rn=V("Hours",!0),an={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:zt,monthsShort:qt,week:{dow:0,doy:6},weekdays:Qt,weekdaysMin:Kt,weekdaysShort:Xt,meridiemParse:/[ap]\.?m?\.?/i},on={},un={},ln=/^\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)?)?$/,dn=/^\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)?)?$/,hn=/Z|[+-]\d\d(?::?\d\d)?/,cn=[["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/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],fn=[["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/]],mn=/^\/?Date\((-?\d+)/i,_n=/^(?:(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}))$/,yn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};e.createFromInputFallback=w("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. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){},e.RFC_2822=function(){};var gn=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:f()}),wn=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}),pn=["year","quarter","month","week","day","hour","minute","second","millisecond"];Me("Z",":"),Me("ZZ",""),x("Z",Nt),x("ZZ",Nt),C(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=De(Nt,e)});var vn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var kn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Mn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;be.fn=pe.prototype,be.invalid=function(){return be(NaN)};var Dn=Ne(1,"add"),Yn=Ne(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Sn=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)}),On=1e3,bn=60*On,Tn=60*bn,xn=3506328*Tn;Y("N",0,0,"eraAbbr"),Y("NN",0,0,"eraAbbr"),Y("NNN",0,0,"eraAbbr"),Y("NNNN",0,0,"eraName"),Y("NNNNN",0,0,"eraNarrow"),Y("y",["y",1],"yo","eraYear"),Y("y",["yy",2],0,"eraYear"),Y("y",["yyy",3],0,"eraYear"),Y("y",["yyyy",4],0,"eraYear"),x("N",Ge),x("NN",Ge),x("NNN",Ge),x("NNNN",function(e,t){return t.erasNameRegex(e)}),x("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),C(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var i=n._locale.erasParse(e,s,n._strict);i?h(n).era=i:h(n).invalidEra=e}),x("y",bt),x("yy",bt),x("yyy",bt),x("yyyy",bt),x("yo",function(e,t){return t._eraYearOrdinalRegex||bt}),C(["y","yy","yyy","yyyy"],Ut),C(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ut]=n._locale.eraYearOrdinalParse(e,i):t[Ut]=parseInt(e,10)}),Y(0,["gg",2],0,function(){return this.weekYear()%100}),Y(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ae("gggg","weekYear"),Ae("ggggg","weekYear"),Ae("GGGG","isoWeekYear"),Ae("GGGGG","isoWeekYear"),x("G",Tt),x("g",Tt),x("GG",kt,gt),x("gg",kt,gt),x("GGGG",St,pt),x("gggg",St,pt),x("GGGGG",Ot,vt),x("ggggg",Ot,vt),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=R(e)}),U(["gg","GG"],function(t,n,s,i){n[i]=e.parseTwoDigitYear(t)}),Y("Q",0,"Qo","quarter"),x("Q",yt),C("Q",function(e,t){t[Ht]=3*(R(e)-1)}),Y("D",["DD",2],"Do","date"),x("D",kt,Pt),x("DD",kt,gt),x("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),C(["D","DD"],Ft),C("Do",function(e,t){t[Ft]=R(e.match(kt)[0])});var Nn=V("Date",!0);Y("DDD",["DDDD",3],"DDDo","dayOfYear"),x("DDD",Yt),x("DDDD",wt),C(["DDD","DDDD"],function(e,t,n){n._dayOfYear=R(e)}),Y("m",["mm",2],0,"minute"),x("m",kt,Rt),x("mm",kt,gt),C(["m","mm"],Vt);var Wn=V("Minutes",!1);Y("s",["ss",2],0,"second"),x("s",kt,Rt),x("ss",kt,gt),C(["s","ss"],Gt);var Pn,Rn,Cn=V("Seconds",!1);for(Y("S",0,0,function(){return~~(this.millisecond()/100)}),Y(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Y(0,["SSS",3],0,"millisecond"),Y(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Y(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Y(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Y(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Y(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Y(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),x("S",Yt,yt),x("SS",Yt,gt),x("SSS",Yt,wt),Pn="SSSS";Pn.length<=9;Pn+="S")x(Pn,bt);for(Pn="S";Pn.length<=9;Pn+="S")C(Pn,Ie);Rn=V("Milliseconds",!1),Y("z",0,0,"zoneAbbr"),Y("zz",0,0,"zoneName");var Un=_.prototype;Un.add=Dn,Un.calendar=function(t,r){1===arguments.length&&(arguments[0]?Re(arguments[0])?(t=arguments[0],r=void 0):function(e){var t,r=n(e)&&!i(e),a=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<o.length;t+=1)a=a||s(e,o[t]);return r&&a}(arguments[0])&&(r=arguments[0],t=void 0):(t=void 0,r=void 0));var a=t||ge(),o=Ye(a,this).startOf("day"),u=e.calendarFormat(this,o)||"sameElse",l=r&&(v(r[u])?r[u].call(this,a):r[u]);return this.format(l||this.localeData().calendar(u,this,ge(a)))},Un.clone=function(){return new _(this)},Un.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Ye(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=b(t)){case"year":r=Ce(this,s)/12;break;case"month":r=Ce(this,s);break;case"quarter":r=Ce(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:P(r)},Un.endOf=function(t){var n,s;if(void 0===(t=b(t))||"millisecond"===t||!this.isValid())return this;switch(s=this._isUTC?Ve:Le,t){case"year":n=s(this.year()+1,0,1)-1;break;case"quarter":n=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=s(this.year(),this.month()+1,1)-1;break;case"week":n=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=Tn-Fe(n+(this._isUTC?0:this.utcOffset()*bn),Tn)-1;break;case"minute":n=this._d.valueOf(),n+=bn-Fe(n,bn)-1;break;case"second":n=this._d.valueOf(),n+=On-Fe(n,On)-1}return this._d.setTime(n),e.updateOffset(this,!0),this},Un.format=function(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=S(this,t);return this.localeData().postformat(n)},Un.from=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||ge(e).isValid())?be({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Un.fromNow=function(e){return this.from(ge(),e)},Un.to=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||ge(e).isValid())?be({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Un.toNow=function(e){return this.to(ge(),e)},Un.get=function(e){return v(this[e=b(e)])?this[e]():this},Un.invalidAt=function(){return h(this).overflow},Un.isAfter=function(e,t){var n=y(e)?e:ge(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=b(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Un.isBefore=function(e,t){var n=y(e)?e:ge(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=b(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Un.isBetween=function(e,t,n,s){var i=y(e)?e:ge(e),r=y(t)?t:ge(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},Un.isSame=function(e,t){var n,s=y(e)?e:ge(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=b(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Un.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Un.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Un.isValid=function(){return c(this)},Un.lang=Sn,Un.locale=Ue,Un.localeData=He,Un.max=wn,Un.min=gn,Un.parsingFlags=function(){return l({},h(this))},Un.set=function(e,t){if("object"==typeof e){var n,i=function(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:_t[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=T(e)),r=i.length;for(n=0;n<r;n++)this[i[n].unit](e[i[n].unit])}else if(v(this[e=b(e)]))return this[e](t);return this},Un.startOf=function(t){var n,s;if(void 0===(t=b(t))||"millisecond"===t||!this.isValid())return this;switch(s=this._isUTC?Ve:Le,t){case"year":n=s(this.year(),0,1);break;case"quarter":n=s(this.year(),this.month()-this.month()%3,1);break;case"month":n=s(this.year(),this.month(),1);break;case"week":n=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=s(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=Fe(n+(this._isUTC?0:this.utcOffset()*bn),Tn);break;case"minute":n=this._d.valueOf(),n-=Fe(n,bn);break;case"second":n=this._d.valueOf(),n-=Fe(n,On)}return this._d.setTime(n),e.updateOffset(this,!0),this},Un.subtract=Yn,Un.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Un.toObject=function(){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()}},Un.toDate=function(){return new Date(this.valueOf())},Un.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?S(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):v(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",S(n,"Z")):S(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Un.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,s="moment",i="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Un[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Un.toJSON=function(){return this.isValid()?this.toISOString():null},Un.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Un.unix=function(){return Math.floor(this.valueOf()/1e3)},Un.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Un.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Un.eraName=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].name;if(s[e].until<=n&&n<=s[e].since)return s[e].name}return""},Un.eraNarrow=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].narrow;if(s[e].until<=n&&n<=s[e].since)return s[e].narrow}return""},Un.eraAbbr=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].abbr;if(s[e].until<=n&&n<=s[e].since)return s[e].abbr}return""},Un.eraYear=function(){var t,n,s,i,r=this.localeData().eras();for(t=0,n=r.length;t<n;++t)if(s=r[t].since<=r[t].until?1:-1,i=this.clone().startOf("day").valueOf(),r[t].since<=i&&i<=r[t].until||r[t].until<=i&&i<=r[t].since)return(this.year()-e(r[t].since).year())*s+r[t].offset;return this.year()},Un.year=Zt,Un.isLeapYear=function(){return F(this.year())},Un.weekYear=function(e){return je.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Un.isoWeekYear=function(e){return je.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Un.quarter=Un.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Un.month=I,Un.daysInMonth=function(){return A(this.year(),this.month())},Un.week=Un.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Un.isoWeek=Un.isoWeeks=function(e){var t=B(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Un.weeksInYear=function(){var e=this.localeData()._week;return J(this.year(),e.dow,e.doy)},Un.weeksInWeekYear=function(){var e=this.localeData()._week;return J(this.weekYear(),e.dow,e.doy)},Un.isoWeeksInYear=function(){return J(this.year(),1,4)},Un.isoWeeksInISOWeekYear=function(){return J(this.isoWeekYear(),1,4)},Un.date=Nn,Un.day=Un.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=G(this,"Day");return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Un.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Un.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Un.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Un.hour=Un.hours=rn,Un.minute=Un.minutes=Wn,Un.second=Un.seconds=Cn,Un.millisecond=Un.milliseconds=Rn,Un.utcOffset=function(t,n,s){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=De(Nt,t)))return this}else Math.abs(t)<16&&!s&&(t*=60);return!this._isUTC&&n&&(i=Se(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!n||this._changeInProgress?We(this,be(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Se(this)},Un.utc=function(e){return this.utcOffset(0,e)},Un.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Se(this),"m")),this},Un.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=De(xt,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Un.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?ge(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Un.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Un.isLocal=function(){return!!this.isValid()&&!this._isUTC},Un.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Un.isUtc=Oe,Un.isUTC=Oe,Un.zoneAbbr=function(){return this._isUTC?"UTC":""},Un.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Un.dates=w("dates accessor is deprecated. Use date instead.",Nn),Un.months=w("months accessor is deprecated. Use month instead",I),Un.years=w("years accessor is deprecated. Use year instead",Zt),Un.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Un.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return m(t,this),(t=_e(t))._a?(e=t._isUTC?d(t._a):ge(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&R(e[s])!==R(t[s]))&&a++;return a+r}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Hn=M.prototype;Hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return v(s)?s.call(t,n):s},Hn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(dt).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Hn.invalidDate=function(){return this._invalidDate},Hn.ordinal=function(e){return this._ordinal.replace("%d",e)},Hn.preparse=Ze,Hn.postformat=Ze,Hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return v(i)?i(e,t,n,s):i.replace(/%d/i,e)},Hn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return v(n)?n(t):n.replace(/%s/i,t)},Hn.set=function(e){var t,n;for(n in e)s(e,n)&&(v(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Hn.eras=function(t,n){var s,i,r,a=this._eras||oe("en")._eras;for(s=0,i=a.length;s<i;++s){switch(typeof a[s].since){case"string":r=e(a[s].since).startOf("day"),a[s].since=r.valueOf()}switch(typeof a[s].until){case"undefined":a[s].until=1/0;break;case"string":r=e(a[s].until).startOf("day").valueOf(),a[s].until=r.valueOf()}}return a},Hn.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s]}else if([r,a,o].indexOf(e)>=0)return u[s]},Hn.erasConvertYear=function(t,n){var s=t.since<=t.until?1:-1;return void 0===n?e(t.since).year():e(t.since).year()+(n-t.offset)*s},Hn.erasAbbrRegex=function(e){return s(this,"_erasAbbrRegex")||Ee.call(this),e?this._erasAbbrRegex:this._erasRegex},Hn.erasNameRegex=function(e){return s(this,"_erasNameRegex")||Ee.call(this),e?this._erasNameRegex:this._erasRegex},Hn.erasNarrowRegex=function(e){return s(this,"_erasNarrowRegex")||Ee.call(this),e?this._erasNarrowRegex:this._erasRegex},Hn.months=function(e,n){return e?t(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||$t).test(n)?"format":"standalone"][e.month()]:t(this._months)?this._months:this._months.standalone},Hn.monthsShort=function(e,n){return e?t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[$t.test(n)?"format":"standalone"][e.month()]:t(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=d([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=It.call(this._shortMonthsParse,a))?i:null:-1!==(i=It.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=It.call(this._shortMonthsParse,a))?i:-1!==(i=It.call(this._longMonthsParse,a))?i:null:-1!==(i=It.call(this._longMonthsParse,a))?i:-1!==(i=It.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=d([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Hn.monthsRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Z.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Jt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Hn.monthsShortRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Z.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Bt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Hn.week=function(e){return B(e,this._week.dow,this._week.doy).week},Hn.firstDayOfYear=function(){return this._week.doy},Hn.firstDayOfWeek=function(){return this._week.dow},Hn.weekdays=function(e,n){var s=t(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(n)?"format":"standalone"];return!0===e?Q(s,this._week.dow):e?s[e.day()]:s},Hn.weekdaysMin=function(e){return!0===e?Q(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Hn.weekdaysShort=function(e){return!0===e?Q(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=d([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=It.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=It.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=It.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=It.call(this._weekdaysParse,a))?i:-1!==(i=It.call(this._shortWeekdaysParse,a))?i:-1!==(i=It.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=It.call(this._shortWeekdaysParse,a))?i:-1!==(i=It.call(this._weekdaysParse,a))?i:-1!==(i=It.call(this._minWeekdaysParse,a))?i:null:-1!==(i=It.call(this._minWeekdaysParse,a))?i:-1!==(i=It.call(this._weekdaysParse,a))?i:-1!==(i=It.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=d([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||X.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=en),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||X.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tn),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||X.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nn),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Hn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},re("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===R(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",re),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",oe);var Fn=Math.abs,Ln=Ke("ms"),Vn=Ke("s"),Gn=Ke("m"),En=Ke("h"),An=Ke("d"),jn=Ke("w"),In=Ke("M"),Zn=Ke("Q"),zn=Ke("y"),qn=Ln,$n=et("milliseconds"),Bn=et("seconds"),Jn=et("minutes"),Qn=et("hours"),Xn=et("days"),Kn=et("months"),es=et("years"),ts=Math.round,ns={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},ss=Math.abs,is=pe.prototype;return is.isValid=function(){return this._isValid},is.abs=function(){var e=this._data;return this._milliseconds=Fn(this._milliseconds),this._days=Fn(this._days),this._months=Fn(this._months),e.milliseconds=Fn(e.milliseconds),e.seconds=Fn(e.seconds),e.minutes=Fn(e.minutes),e.hours=Fn(e.hours),e.months=Fn(e.months),e.years=Fn(e.years),this},is.add=function(e,t){return Be(this,e,t,1)},is.subtract=function(e,t){return Be(this,e,t,-1)},is.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=b(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Qe(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Xe(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},is.asMilliseconds=Ln,is.asSeconds=Vn,is.asMinutes=Gn,is.asHours=En,is.asDays=An,is.asWeeks=jn,is.asMonths=In,is.asQuarters=Zn,is.asYears=zn,is.valueOf=qn,is._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*Je(Xe(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=P(r/1e3),u.seconds=e%60,t=P(e/60),u.minutes=t%60,n=P(t/60),u.hours=n%24,o+=i=P(Qe(a+=P(n/24))),a-=Je(Xe(i)),s=P(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},is.clone=function(){return be(this)},is.get=function(e){return e=b(e),this.isValid()?this[e+"s"]():NaN},is.milliseconds=$n,is.seconds=Bn,is.minutes=Jn,is.hours=Qn,is.days=Xn,is.weeks=function(){return P(this.days()/7)},is.months=Kn,is.years=es,is.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,s,i=!1,r=ns;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},ns,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),s=function(e,t,n,s){var i=be(e).abs(),r=ts(i.as("s")),a=ts(i.as("m")),o=ts(i.as("h")),u=ts(i.as("d")),l=ts(i.as("M")),d=ts(i.as("w")),h=ts(i.as("y")),c=r<=n.ss&&["s",r]||r<n.s&&["ss",r]||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return null!=n.w&&(c=c||d<=1&&["w"]||d<n.w&&["ww",d]),(c=c||l<=1&&["M"]||l<n.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=t,c[3]=+e>0,c[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,c)}(this,!i,r,n=this.localeData()),i&&(s=n.pastFuture(+this,s)),n.postformat(s)},is.toISOString=nt,is.toString=nt,is.toJSON=nt,is.locale=Ue,is.localeData=He,is.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nt),is.lang=Sn,Y("X",0,0,"unix"),Y("x",0,0,"valueOf"),x("x",Tt),x("X",/[+-]?\d+(\.\d{1,3})?/),C("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),C("x",function(e,t,n){n._d=new Date(R(e))}),e.version="2.30.1",st=ge,e.fn=Un,e.min=function(){return we("isBefore",[].slice.call(arguments,0))},e.max=function(){return we("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=d,e.unix=function(e){return ge(1e3*e)},e.months=function(e,t){return qe(e,t,"months")},e.isDate=o,e.locale=re,e.invalid=f,e.duration=be,e.isMoment=y,e.weekdays=function(e,t,n){return $e(e,t,n,"weekdays")},e.parseZone=function(){return ge.apply(null,arguments).parseZone()},e.localeData=oe,e.isDuration=ve,e.monthsShort=function(e,t){return qe(e,t,"monthsShort")},e.weekdaysMin=function(e,t,n){return $e(e,t,n,"weekdaysMin")},e.defineLocale=ae,e.updateLocale=function(e,t){if(null!=t){var n,s,i=an;null!=on[e]&&null!=on[e].parentLocale?on[e].set(k(on[e]._config,t)):(null!=(s=ie(e))&&(i=s._config),t=k(i,t),null==s&&(t.abbr=e),(n=new M(t)).parentLocale=on[e],on[e]=n),re(e)}else null!=on[e]&&(null!=on[e].parentLocale?(on[e]=on[e].parentLocale,e===re()&&re(e)):null!=on[e]&&delete on[e]);return on[e]},e.locales=function(){return rt(on)},e.weekdaysShort=function(e,t,n){return $e(e,t,n,"weekdaysShort")},e.normalizeUnits=b,e.relativeTimeRounding=function(e){return void 0===e?ts:"function"==typeof e&&(ts=e,!0)},e.relativeTimeThreshold=function(e,t){return void 0!==ns[e]&&(void 0===t?ns[e]:(ns[e]=t,"s"===e&&(ns.ss=t-1),!0))},e.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},e.prototype=Un,e.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"},e});
;Dependency._js['lib/moment/moment']=true;

;
try{Dependency.addJS("datelocales"),Dependency.addJS("commondates"),Dependency.addJS("lib/moment/moment")}catch(e){}XPLAN.namespace("DateField"),XPLAN.DateField.buildDate=function(e,t,a,r,n,i){if(!((e=jQuery(e)).find("#"+XPLAN.util.escape(t,"css")).length>0)){i=null==i?t:i,html='<input type="text" id="%id" name="%name" size="10" %element_attributes>',html=html.replace(/%id/g,t).replace(/%name/g,i),r&&r.data_xplan_elem&&(html=html.replace(/%element_attributes/g,"data-xplan-elem='"+XPLAN.util.escape(r.data_xplan_elem,"xmlq")+"'"));var o=jQuery(html).appendTo(e);r&&r.disabled&&o.attr("disabled","disabled");var l=(new Date).getFullYear();if(dpOptions={showOn:"button",buttonImageOnly:!0,buttonImage:getBaseURL()+"/img/diary.png",showButtonPanel:!0,changeMonth:!0,changeYear:!0,yearRange:"c-99:c+10",minDate:new Date(1900,0,1)},a){var s=l-a.getFullYear();if(s>10){var d=s+10;dpOptions.yearRange="c-99:c+"+d}}if(r){if(1==r.no_day&&(dpOptions.dateFormat="M yy"),1==r.no_year){dpOptions.dateFormat="dd M",dpOptions.changeYear=!1;var D=(new Date).getFullYear();dpOptions.minDate=new Date(D,0,1),dpOptions.maxDate=new Date(D,11,31)}void 0!==r.yearRange&&(dpOptions.yearRange=r.yearRange),void 0!=r.minDate&&(dpOptions.minDate=r.minDate),void 0!=r.maxDate&&(dpOptions.maxDate=r.maxDate)}jQuery(o).datepicker(dpOptions).datepicker("widget").hide(),null!=n&&(o.bind(n),null!=n.blur&&o.bind({keypress:function(e){"13"==e.which&&(e.preventDefault(),jQuery(this).blur())}})),XPLAN.DateField.setDate(o,a,dpOptions.dateFormat)}},XPLAN.DateField.buildDateRange=function(e,t,a,r,n,i,o){o="undefined"!=typeof o?o:[null,null],e=jQuery(e),t=-1==t.indexOf("%s")?"%s"+t:t;var l=jQuery('<span id="'+t.replace("%s","")+'" />').appendTo(e),s=t.replace("%s","start_"),d=t.replace("%s","stop_"),D=t.replace("%s","customrange_");if(e.data({fromId:s,toId:d,customRangeButtonId:D}),XPLAN.DateField.buildDate(l,s,a,o[0],i),jQuery("<span>&nbsp;&nbsp;</span>").appendTo(l),XPLAN.DateField.buildDate(l,d,r,o[1],i),n){var u=[];jQuery.each(n,function(e,t){var a;"function"==typeof t[2]?(a=new PopupMenuItem(t[1],t[2])).id=t[0]:((a=new PopupMenuItem(t[1],function(){var e=XPLAN.DateTimeUtil.getDateRange(this.id);XPLAN.DateField.setDate(jQuery("#"+s),e[0]),XPLAN.DateField.setDate(jQuery("#"+d),e[1]),null!=i&&null!=i.change&&i.change()})).id=t[0],a.options={attributes:{name:t[0]}}),u.push(a)});jQuery('<span style="margin-left:5px;" class="icon icon-action" id="'+D+'"></span>').click(function(){jQuery(this).hasClass("disabled")||PopupMenu.showDropdown(u,this)}).appendTo(l)}},XPLAN.DateField.buildSingleRollingDatePicker=function(e,t,a,r,n,i,o){e=jQuery(e);var l=jQuery('<select id="'+t+'" name="'+t+'" ></select>').appendTo(e),s=0,d=XPLAN.commondates.getSingleDates();for(var D in d){var u=d[D].value;l.get(0).options[s++]="value"==a?new Option(d[D].text,XPLAN.commondates.dateToRaw(u)):new Option(d[D].text,u)}if(n!==False){l.get(0).options[s++]=new Option(_("Other"),"Other");var c=jQuery('<span id="'+t+'_customdate" style="display:none;padding-left:5px;"></span>').appendTo(e);XPLAN.DateField.buildDate("#"+t+"_customdate",t+"_other",XPLAN.DateTimeUtil.stringToDate(i))}void 0!=o?null!=o.change&&jQuery(l).change(o.change):jQuery(l).change(function(){n&&("Other"==jQuery(this).val()?c.show():c.hide())}),l.val(r).change()},XPLAN.DateField.buildRangeRollingDatePicker=function(e,t,a,r,n){e=jQuery(e);var i=jQuery('<select id="'+t+'" name="'+t+'" ></select>').appendTo(e),o=0,l=XPLAN.commondates.getRangeDates();for(var s in l){var d=l[s].value;i.get(0).options[o++]="value"==a?new Option(l[s].text,XPLAN.commondates.dateToRaw(d)):new Option(l[s].text,d)}void 0!=n&&null!=n.change&&jQuery(i).change(n.change),i.val(r).change()},XPLAN.DateField.parseDateRange=function(e,t){t=-1==t.indexOf("%s")?"%s"+t:t;var a=jQuery("#"+t.replace("%s","start_"),e),r=jQuery("#"+t.replace("%s","stop_"),e);return{start:XPLAN.DateField.getDate(a),stop:XPLAN.DateField.getDate(r)}},XPLAN.DateField.getDate=function(e){if(0!==jQuery(e).length){var t=jQuery(e).val(),a=jQuery.data(jQuery(e)[0],"datepicker")?jQuery.data(jQuery(e)[0],"datepicker").settings.dateFormat:null;return XPLAN.DateTimeUtil.stringToDate(t,a)}},XPLAN.DateField.setDate=function(e,t){if("int"==XPLAN.util.getType(t)&&(t=XPLAN.DateTimeUtil.intToDate(t)),0!==jQuery(e).length){var a=jQuery.data(jQuery(e)[0],"datepicker")?jQuery.data(jQuery(e)[0],"datepicker").settings.dateFormat:null,r=a||XPLAN.DateField.getCurrentDateFormat();jQuery(e).val(jQuery.datepicker.formatDate(r,t))}},XPLAN.DateField.ErrorCode={},XPLAN.DateField.ErrorCode.EmptyElement=0,XPLAN.DateField.ErrorCode.EmptyDate=1,XPLAN.DateField.ErrorCode.InvalidFormat=2,XPLAN.DateField.ErrorCode.EarlierThanMinDate=3,XPLAN.DateField.ErrorCode.LaterThanMaxDate=4,XPLAN.DateField.ErrorCode.InvalidRangeDate=5,XPLAN.DateField.isValid=function(e,t,a){t="undefined"!=typeof t?t:{},a="undefined"!=typeof a?a:{};var r=XPLAN.DateField.getCurrentDateFormat(),n=r.replace("yyyy","%Y").replace("yy","%Y").replace("mm","%m").replace("dd","%s").replace("d","%s").replace("s","d"),i=n.replace("%Y","yyyy").replace("%m","mm").replace("%d","dd");if(error_map={},error_map[XPLAN.DateField.ErrorCode.EmptyElement]=_("The element doesn't exist."),error_map[XPLAN.DateField.ErrorCode.EmptyDate]=_("The date can not be empty."),error_map[XPLAN.DateField.ErrorCode.InvalidFormat]=_("The date format is invalid(%a).").replace("%a",i),error_map[XPLAN.DateField.ErrorCode.EarlierThanMinDate]=_("The date can not be earlier than %s."),error_map[XPLAN.DateField.ErrorCode.LaterThanMaxDate]=_("The date can not be later than %s."),error_map[XPLAN.DateField.ErrorCode.InvalidRangeDate]=_("The Start date should be earlier than the End date."),0===jQuery(e).length)return a.error_code=XPLAN.DateField.ErrorCode.EmptyElement,a.error_msg=error_map[XPLAN.DateField.ErrorCode.EmptyElement],!1;var o=function(e,t){var i=jQuery(e).val(),o=!0;if("chkEmptyDate"in t&&t.chkEmptyDate&&0===i.length)return a.error_code=XPLAN.DateField.ErrorCode.EmptyDate,a.error_msg=error_map[XPLAN.DateField.ErrorCode.EmptyDate],!1;if("allowEmpty"in t&&t.allowEmpty&&0===i.length)return o;var l=function(){return a.error_code=XPLAN.DateField.ErrorCode.InvalidFormat,a.error_msg=error_map[XPLAN.DateField.ErrorCode.InvalidFormat],!1},s=XPLAN.currentLanguage,d=XPLAN.DateLocales[s];if(regstring="^"+r.replace("dd","\\s{2}").replace("d","\\s{1,2}").replace("s","d").replace("mm","\\d{2}").replace("m","\\d{1,2}").replace("yy","\\d{4}").replace("y","\\d{2}").replace("MM","%~~%").replace("M","%~%").replace("DD","%==%").replace("D","%=%")+"$",regstring=regstring.replace("%~~%","("+d.monthNames.join("|")+")").replace("%~%","("+d.monthNamesShort.join("|")+")").replace("%==%","("+d.dayNames.join("|")+")").replace("%=%","("+d.dayNamesShort.join("|")+")"),re=new RegExp(regstring),!i.match(re))return l();try{i.length>0&&(o=jQuery.datepicker.parseDate(r,i))}catch(e){return l()}if("chkMinDate"in t&&t.chkMinDate){var D=$(e).datepicker("option","minDate");if(D&&o<D)return a.error_code=XPLAN.DateField.ErrorCode.EarlierThanMinDate,a.error_msg=error_map[XPLAN.DateField.ErrorCode.EarlierThanMinDate].replace("%s",XPLAN.DateTimeUtil.strftime(n,D)),!1}if("chkMaxDate"in t&&t.chkMaxDate){var u=$(e).datepicker("option","maxDate");if(u&&o>u)return a.error_code=XPLAN.DateField.ErrorCode.LaterThanMaxDate,a.error_msg=error_map[XPLAN.DateField.ErrorCode.LaterThanMaxDate].replace("%s",XPLAN.DateTimeUtil.strftime(n,u)),!1}return o};if(jQuery(e).hasClass("hasDatepicker")){if(!o(e,t))return!1}else{var l=jQuery(e).find(".hasDatepicker:eq(0)"),s=jQuery(e).find(".hasDatepicker:eq(1)"),d=o(l,t);if(!d)return!1;var D=o(s,t);if(!D)return!1;if("enforceNotEqual"in t&&t.enforceNotEqual&&d.valueOf()==D.valueOf()||d>D)return a.error_code=XPLAN.DateField.ErrorCode.InvalidRangeDate,a.error_msg=error_map[XPLAN.DateField.ErrorCode.InvalidRangeDate],!1}return!0},XPLAN.DateField.getCurrentDateFormat=function(){return XPLAN.DateLocales.ByOutputType("datepicker").dateFormat},XPLAN.DateField.setState=function(e,t){if(0!==jQuery(e).length){var a=jQuery(e);-1!=jQuery.inArray(t,["readonly","disabled"])?(a.datepicker("disable").removeAttr("disabled"),a.attr(t,t),a.next("span.icon-calendar").hide()):"enabled"===t&&(a.removeAttr("readonly").removeAttr("disabled"),a.next("span.icon-calendar").show(),a.datepicker("enable"))}},XPLAN.DateField.setRangeState=function(e,t){if(0!==jQuery(e).length){var a=jQuery(e);XPLAN.DateField.setState("#"+a.data("fromId"),t),XPLAN.DateField.setState("#"+a.data("toId"),t),jQuery("#"+a.data("customRangeButtonId")).toggleClass("disabled",-1!=jQuery.inArray(t,["readonly","disabled"]))}},XPLAN.namespace("DateTimeUtil"),XPLAN.DateTimeUtil.getFYDate=function(e){var t={AU:{endMonth:6,endDay:30,startMonth:7,startDay:1},GB:{endMonth:4,endDay:5,startMonth:4,startDay:6},NZ:{endMonth:3,endDay:31,startMonth:4,startDay:1},HK:{endMonth:3,endDay:31,startMonth:4,startDay:1},TW:{endMonth:3,endDay:31,startMonth:4,startDay:1},ID:{endMonth:3,endDay:31,startMonth:4,startDay:1},SG:{endMonth:12,endDay:31,startMonth:1,startDay:1},ZA:{endMonth:2,endDay:28,startMonth:3,startDay:1},NA:{endMonth:2,endDay:28,startMonth:3,startDay:1},AA:{endMonth:2,endDay:28,startMonth:3,startDay:1},TH:{endMonth:8,endDay:31,startMonth:9,startDay:1},MY:{endMonth:11,endDay:30,startMonth:12,startDay:1},CA:{endMonth:12,endDay:31,startMonth:1,startDay:1},default:{endMonth:6,endDay:30,startMonth:7,startDay:1}};return XPLAN.login_locale in t?t[XPLAN.login_locale][e]:t.default[e]},XPLAN.DateTimeUtil.getDateRange=function(e){var t=new Date,a=t.getFullYear(),r=t.getMonth(),n=t.getDate(),i=null,o=null;if("string"==typeof e)switch(e.toLowerCase()){case"current":case"today":i=t,o=t;break;case"yesterday":(i=new Date).setDate(i.getDate()-1),o=i;break;case"tomorrow":(i=new Date).setDate(i.getDate()+1),o=i;break;case"sevendays":(i=new Date).setDate(i.getDate()-7),o=t;break;case"next_sevendays":i=t,(o=new Date).setDate(o.getDate()+7);break;case"thisweek":var l=t.getDay();i=new Date(a,r,n-l),o=new Date(a,r,n+(6-l));break;case"cur_month":i=new Date(a,r,1),o=new Date(a,r+1,0);break;case"thismonth":case"this_month":i=t,o=new Date(a,r+1,0);break;case"lastmonth":case"last_month":i=new Date(a,r-1,1),o=new Date(a,r,0);break;case"next_month":i=new Date(a,r+1,1),o=new Date(a,r+2,0);break;case"cur_qtr":i=new Date(a,r-r%3,1),o=new Date(a,r-r%3+3,0);break;case"thisquarter":case"this_qtr":i=t,o=new Date(a,r-r%3+3,0);break;case"lastquarter":case"last_qtr":i=new Date(a,r-r%3-3,1),o=new Date(a,r-r%3,0);break;case"next_qtr":i=new Date(a,r-r%3+3,1),o=new Date(a,r-r%3+6,0);break;case"last_12_mon":(i=new Date(a-1,r,n)).setDate(i.getDate()+1),o=t;break;case"last_24_mon":(i=new Date(a-2,r,n)).setDate(i.getDate()+1),o=t;break;case"last_36_mon":(i=new Date(a-3,r,n)).setDate(i.getDate()+1),o=t;break;case"last_60_mon":(i=new Date(a-5,r,n)).setDate(i.getDate()+1),o=t;break;case"next_12_mon":i=t,(o=new Date(a+1,r,n)).setDate(o.getDate()-1);break;case"next_24_mon":i=t,(o=new Date(a+2,r,n)).setDate(o.getDate()-1);break;case"next_36_mon":i=t,(o=new Date(a+3,r,n)).setDate(o.getDate()-1);break;case"next_60_mon":i=t,(o=new Date(a+5,r,n)).setDate(o.getDate()-1);break;case"year_to_date":i=new Date(a,0,1),o=t;break;case"this_year":i=t,o=new Date(a+1,0,0);break;case"since_incept":i=new Date(0,0,1),o=t;break;case"thiscyear":i=new Date(a,0,1),o=new Date(a,11,31);break;case"this_fin_year":r<6&&a--,i=t,o=new Date(a+1,XPLAN.DateTimeUtil.getFYDate("endMonth")-1,XPLAN.DateTimeUtil.getFYDate("endDay"));break;case"thisfyear":r<6&&a--,i=new Date(a,XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay")),o=new Date(a+1,XPLAN.DateTimeUtil.getFYDate("endMonth")-1,XPLAN.DateTimeUtil.getFYDate("endDay"));break;case"fy_to_date":r<XPLAN.DateTimeUtil.getFYDate("endMonth")&&a--,i=new Date(a,XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay")),o=t;break;case"lastweek":l=t.getDay();i=new Date(a,r,n-l-7),o=new Date(a,r,n-l-1);break;case"lastcyear":i=new Date(a-1,0,1),o=new Date(a-1,11,31);break;case"last_fin_year":case"lastfyear":r<XPLAN.DateTimeUtil.getFYDate("endMonth")&&a--,i=new Date(a-1,XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay")),o=new Date(a,XPLAN.DateTimeUtil.getFYDate("endMonth")-1,XPLAN.DateTimeUtil.getFYDate("endDay"));break;case"nextfyear":case"next_fin_year":r<6&&a--,i=new Date(a+1,XPLAN.DateTimeUtil.getFYDate("startMonth")-1,XPLAN.DateTimeUtil.getFYDate("startDay")),o=new Date(a+2,XPLAN.DateTimeUtil.getFYDate("endMonth")-1,XPLAN.DateTimeUtil.getFYDate("endDay"));break;case"all_future":i=t,o=new Date(3500,11,31)}return[i,o]},XPLAN.DateTimeUtil.dateToString=function(e,t){var a=t||XPLAN.DateField.getCurrentDateFormat();return jQuery.datepicker.formatDate(a,e)},XPLAN.DateTimeUtil.stringToDate=function(e,t){var a=t||XPLAN.DateField.getCurrentDateFormat();try{return jQuery.datepicker.parseDate(a,e)}catch(e){return null}},XPLAN.DateTimeUtil.intToDate=function(e,t){if(e){t||(t=0);var a=Math.floor(e/1e4),r=Math.floor(e/100)%100-1,n=e%100,i=Math.floor(t/1e4),o=Math.floor(t/100)%100,l=new Date(a,r,n,i,o,t%100);return l.setFullYear(a),l}},XPLAN.DateTimeUtil.dateToInt=function(e){return e?1e4*e.getFullYear()+100*(e.getMonth()+1)+e.getDate():0},XPLAN.DateTimeUtil.timeToInt=function(e){return e?1e4*e.getHours()+100*e.getMinutes()+e.getSeconds():null},XPLAN.DateTimeUtil.getMonths=function(e){for(var t=[],a=1;a<=12;a++)t.push([a,XPLAN.DateTimeUtil.getMonthStr(a,e)]);return t},XPLAN.DateTimeUtil.getMonthStr=function(e,t){var a=XPLAN.DateLocales.ByOutputType("datepicker");return(t?a.monthNames:a.monthNamesShort)[e-1]},XPLAN.DateTimeUtil.getWeekStr=function(e,t){var a=XPLAN.DateLocales.ByOutputType("datepicker");return(t?a.dayNames:a.dayNamesShort)[e]},XPLAN.DateTimeUtil.strftime=function(e,t){for(var a,r=[],n=0,i=0;i<e.length;i++){var o=e.charAt(i);if(n){switch(o){case"a":case"A":a=XPLAN.DateTimeUtil.getWeekStr(t.getDay(),"A"==o);break;case"b":case"B":a=XPLAN.DateTimeUtil.getMonthStr(t.getMonth()+1,"B"==o);break;case"d":a=t.getDate();break;case"H":case"I":a=t.getHours(),"I"==o&&(0==a?a=12:a>12&&(a-=12));break;case"j":a=new Date(t.getFullYear(),0,1).getTime(),a=t.getTime()-a,(a=Math.floor(a/864e5))<10?a="00"+a:a<100&&(a="0"+a);break;case"m":a=t.getMonth()+1;break;case"M":a=t.getMinutes();break;case"p":a=t.getHours()>11?"PM":"AM";break;case"S":a=t.getSeconds();break;case"w":a=t.getDay();break;case"y":a=t.getYear();break;case"Y":a=t.getFullYear();break;case"%":a="%";break;default:throw new Error('strftime: Invalid format character "'+o+'".')}"int"==typeof a||"i4"==typeof a||"number"==typeof a?r.push(a<10?"0":"",a):r.push(a),n=0}else"%"==o?n=1:r.push(o)}return r.join("")},XPLAN.DateTimeUtil.parseTime=function(e){if(!e)return null;var t=e.match(/(\d+)(:\d+)?(:\d+)?\s*(am|pm)?/i);if(!t)return null;var a=parseInt(t[1],10),r=0;t[2]&&(r=parseInt(t[2].substring(1),10));var n=0;return t[3]&&(n=parseInt(t[3].substring(1),10)),t[4]&&("pm"==t[4].toLowerCase()?a<12&&(a+=12):a>=12&&(a-=12)),a>=0&&a<=23&&r>=0&&r<=59&&n>=0&&n<=59?1e4*a+100*r+n:null},XPLAN.DateTimeUtil.yearsDiff=function(e,t,a){var r=1;if(e<t){var n=e;e=t,t=n,r=-1}var i=0;return a?e.getMonth()>t.getMonth()?i=1:e.getMonth()==t.getMonth()&&e.getDate()>t.getDate()&&(i=1):e.getMonth()<t.getMonth()?i=-1:e.getMonth()==t.getMonth()&&e.getDate()<t.getDate()&&(i=-1),(e.getFullYear()-t.getFullYear()+i)*r},XPLAN.DateTimeUtil.monthsDiff=function(e,t,a){var r=1;if(e<t){var n=e;e=t,t=n,r=-1}var i=0;return i=a?e.getDate()>t.getDate()?1:0:e.getDate()<t.getDate()?-1:0,(12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())+i)*r},XPLAN.DateTimeUtil.daysDiff=function(e,t){var a=e.getTime(),r=t.getTime(),n=Math.abs(a-r);return Math.round(n/864e5)},XPLAN.DateTimeUtil.addIntTime=function(e,t){var a,r,n,i=Math.floor(e/1e4),o=Math.floor(e/100)%100,l=e%100,s=Math.floor(t/1e4),d=Math.floor(t/100)%100,D=t%100;return a=(l+D)%60,r=(o+d+(n=Math.floor((l+D)/60)))%60,1e4*((i+s+Math.floor((o+d+n)/60))%24)+100*r+a},XPLAN.DateTimeUtil.describeRelativeTime=function(e,t){var a;a=t?Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()):Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());var r,n=(new Date).getTime()-a;return(n<6e4?1==(r=Math.round(n/1e3))?_("%a second ago"):_("%a seconds ago"):n<36e5?1==(r=Math.round(n/6e4))?_("%a minute ago"):_("%a minutes ago"):n<864e5?1==(r=Math.round(n/36e5))?_("%a hour ago"):_("%a hours ago"):n<2592e6?1==(r=Math.round(n/864e5))?_("%a day ago"):_("%a days ago"):n<31536e6?1==(r=Math.round(n/2592e6))?_("%a month ago"):_("%a months ago"):1==(r=Math.round(n/31536e6))?_("%a year ago"):_("%a years ago")).replace("%a",r)},XPLAN.DateTimeUtil.addBusinessDays=function(e,t){if(e=moment(e),t>0)for(;t>0;)(e=e.add(1,"days")).isoWeekday()<6&&t--;else for(;t<0;)(e=e.subtract(1,"days")).isoWeekday()<6&&t++;return e.toDate()},DateField={},DateField.onSetTime=null,DateField.displayFormat="%a %d/%m/%Y",DateField.initSetTime=function(e){var t=getMainFrame();t&&(t.DateField||(t.DateField=new Object),t.DateField.onSetTime=e)},DateField.showTime=function(e,t,a){var r="/static/timepopup.html",n={};a&&(n.time=a),(n=XPLAN.util.encodeQS(XPLAN.util.object2qs(n)))&&(r+="?"+n),PopupURL2.show(r,{width:152,height:172,x:e,y:t,hide_on_blur:!0})},DateField.showTimePopup=function(e,t){var a=t.currentTarget,r=XPLAN.util.getXY(a);DateField.initSetTime(function(t){DateField.setTime2(e,t)}),DateField.showTime(r.x,r.y+a.clientHeight,DateField.getTime2(e))},DateField.buildTime=function(e,t,a){var r=e.ownerDocument,n=jQuery('<input type="text" name="'+t+'" class="timefield" size="8"/>',r),i=n.get(0);DateField.setTime2(i,a),n.blur(function(e){var t=this.getAttribute("value");if(t){var a=DateField.getTime2(this);if(null==a)return alert(_("Invalid time: %a").replace("%a",t)),this.focus(),this.select(),!1;DateField.setTime2(this,a)}return!0}).appendTo(e);jQuery('<span class="icon icon-clock" />',r).click(function(e){DateField.showTimePopup(i,e)}).appendTo(e)},DateField.getTime2=function(e){return XPLAN.DateTimeUtil.parseTime(e.value)},DateField.setTime2=function(e,t){if(e)if(null==t)e.value="";else{"date"==XPLAN.util.getType(t)&&(t=XPLAN.DateTimeUtil.timeToInt(t));var a=Math.floor(t/1e4),r="AM";a>11&&(a-=12,r="PM"),0==a&&(a=12);var n=Math.floor(t/100%100);n<10&&(n="0"+n),e.value=a+":"+n+" "+r}};
;Dependency._js['datefield']=true;

;
function ListTable(t,e){this.id=ListTable.collection.length,ListTable.collection.push(this),this.rowclass="listtable",this.shading=False,this.filter=null,this.sorter=null,this.reverse=null,this.table=t,jQuery(this.table).data("listtableid",this.id),this.onclick=null,this.oncontextmenu=null,this.keys=[],this.data=[],this.trans=[],this.colWidths=[],this.multi=!!e,this.multi?(this.index=[],this.value=[],this.lastindex=-1):(this.index=-1,this.value=null);var i=this._getTableHead();if(i){if(this.headrows=i.rows.length,jQuery(i).data("listtableid",this.id),this.headrows>0){for(var l=0;l<i.rows[0].cells.length;l++){var s=i.rows[0].cells[l].getAttribute("width");s&&(this.colWidths[l]=s)}this._addSortColumns(i)}}else this.headrows=0;return this.display_hint=!1,this.hint=[],this.hint_column_index=-1,this}window.Dependency&&Dependency.addJS("datefield"),TableUtil={},TableUtil.buildTableInFrame=function(t){return _d=t.document,_d.open("text/html","replace"),_d.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\n"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<link rel="StyleSheet" type="text/css" href="'+getBaseURL()+'/css/main.css"></link><body class="framelist"><div id="pagecontent"><table id="report_table" class="list" border="0" cellpadding="2" cellspacing="0" width="100%"></table></div></body></html>\n'),_d.close(),t.document.getElementById("report_table")},TableUtil.clearTHead=function(t){var e=t.createTHead();if(e.rows.length>0)for(var i=e.rows.length-1;i>=0;i--)e.deleteRow(i);return e},TableUtil.buildReportHeader=function(t,e,i){var l=jQuery(TableUtil.clearTHead(e));l.append("<tr />");var s=l.children("tr");for(var a in i){var n=i[a];s.append("<th />"),s.children("th:last").html(n)}return s.get(0)},TableUtil.clearTable=function(t){for(;t.rows.length>0;)t.deleteRow(0)},TableUtil.fixRowClass=function(t){for(var e=0;e<t.rows.length;e++)t.rows[e].className="item_"+(e%2==1?"odd":"even")},TableUtil.makeRow=function(t,e){for(var i=t.cells.length,l=0;l<e.length;l++){(l<i?t.cells[l]:t.insertCell(l)).innerHTML=e[l]}for(;t.cells.length>e.length;)t.deleteCell(e.length)},TableUtil.makeTable=function(t,e,i){var l=t;t.tBodies&&t.tBodies.length>0&&(l=t.tBodies[0]);for(var s=l.rows.length,a=0;a<e.length;a++){var n,r=e[a];n=a<s?l.rows[a]:l.insertRow(a),TableUtil.makeRow(n,r),i&&(n.className="item_"+(a%2==0?"even":"odd"))}for(;l.rows.length>e.length;)l.deleteRow(e.length)},TableUtil.showColumn=function(t,e,i){for(var l=0;l<t.rows.length;l++){var s=t.rows[l].cells(e);s&&(s.style.display=i?"":"none")}},TableUtil.startEggTimer=function(t){var e=0,i=t.rows[0];if(null!=i){var l=i.cells;if(null!=l)for(var s=0;s<l.length;s++)e+=l[s].colSpan}e||(e=1);var a=t.tBodies;if(a.length>0){for(a=a[0];a.rows.length>0;)a.deleteRow(0);var n=getBaseURL();n=n||"";var r=a.insertRow(0).insertCell(0);r.colSpan=e,r.className="eggtimer",r.innerHTML='<img src="'+n+'/img/eggtimer_tiny.gif" /> <em>Loading...</em>'}},SelectUtil={},SelectUtil.addSorted=function(t,e,i){for(var l=t.options,s=0;s<l.length;s++){if(l[s].text==i&&l[s].value==e)return void(t.selectedIndex=s);if(l[s].text>i){for(var a=l.length-1;a>s;a--)l[a]=new Option(l[a-1].text,l[a-1].value);break}}l[s]=new Option(i,e),t.selectedIndex=s},SelectUtil.clearSelect=function(t,e){e||(e=0),t.options&&(t.options.length=e)},SelectUtil.removeOption=function(t,e){t.find('option[value="'+XPLAN.util.escape(e,"jsq")+'"]').remove()},SelectUtil.makeOptionsHTML=function(t,e){for(var i=[],l=0;l<t.length;l++)i.push('<option value="',XPLAN.util.escape(t[l][0]),'"'),(Array.isArray(e)&&e.indexOf(t[l][0])>=0||t[l][0]==e)&&i.push(' selected="selected"'),i.push(">",XPLAN.util.escape(t[l][1]),"</option>");return i.join("")},SelectUtil._correctItems=function(t){var e,i=[];if(!t)return[];for(var l=0;l<t.length;l++)e=t[l],XPLAN.util.isArray(e)||(e=[e,e]),i.push(e);return i},SelectUtil.modifySelect=function(t,e){var i=t.selectedIndex,l=null;-1!=i&&(l=t.options[i].value),e();var s=-1;if(-1!=i)for(var a=0;a<t.options.length;++a)if(t.options[a].value==l){s=a;break}t.selectedIndex=s},SelectUtil.makeSelect=function(t,e,i){var l=t.value;(!i||i<0)&&(i=0),SelectUtil.clearSelect(t,i);var s=SelectUtil._correctItems(e);0===i?jQuery(t).html(SelectUtil.makeOptionsHTML(s,l)):(jQuery(t).append(SelectUtil.makeOptionsHTML(s)),SelectUtil.setValue(t,l))},SelectUtil.makeSelectHTML=function(t,e,i,l){return l?'<select name="'+t+'" onchange="'+l+'">'+SelectUtil.makeOptionsHTML(e,i)+"</select>":'<select name="'+t+'">'+SelectUtil.makeOptionsHTML(e,i)+"</select>"},SelectUtil.capPermissionOption={set_email_tpl_share_all:"Public",set_thread_tpl_share_all:"2",set_task_tpl_share_all:"300",set_diary_tpl_public:["400","300"],set_criteria_save_all:"2",set_doc_category_save_all:"2",set_report_tpl_cate_share_all:"1",set_report_share_all:"1",set_campaign_share_all:"2",docnote_shareall:"2"},SelectUtil.handlePermissionSelect=function(t,e,i){var l=SelectUtil.capPermissionOption[e];void 0===l&&alert(_("Share all permission does not exist in mapping"));var s=jQuery('select[name="'+t+'"]');0!=s.length&&(void 0!==i&&null!==i&&""!==i||(i=XMLRPC.call("factfind.is_capable",[e])),i||s.each(function(){if("string"==typeof l)jQuery(this).val()!=l&&jQuery(this).find('option[value="'+l+'"]').remove();else for(var t in l)jQuery(this).val()!=l[t]&&jQuery(this).find('option[value="'+l[t]+'"]').remove()}))},SelectUtil.setValue=function(t,e){var i=[];null!==e&&(XPLAN.util.isArray(e)?i=e:i.push(e),jQuery.each(i,function(e,i){jQuery(t).find('option[value="'+i+'"]').prop("selected",!0)}))},SelectUtil.getText=function(t){return jQuery(t).find("option:selected").text()},SelectUtil.getValue=function(t){var e=jQuery(t).find("option:selected");if(e)return e.val()},SelectUtil.getArray=function(t){for(var e=[],i=0;i<t.options.length;i++)e.push([t.options[i].value,jQuery(t.options[i]).text()]);return e},SelectUtil.copy=function(t,e){SelectUtil.clearSelect(e);var i=SelectUtil.getArray(t);SelectUtil.makeSelect(e,i)},SelectUtil.selectAll=function(t){if(t.multiple)for(var e=0;e<t.length;e++)t.options[e].selected=!0},SelectUtil.getTextInArray=function(t,e){for(var i=0;i<e.length;i++)if(t==e[i][0])return e[i][1];return""},ListTable.prototype.clear=function(){TableUtil.clearTable(this.table)},ListTable.prototype.clearSelection=function(){if(this.multi){for(var t=0;t<this.index.length;t++)this.table.rows[this.index[t]].className=this.getClassName(this.rowclass,this.index[t]);this.index=[],this.value=[]}else this.index>=0&&(this.table.rows[this.index].className=this.getClassName(this.rowclass,this.index),this.index=-1,this.value=null)},ListTable.prototype.dispose=function(){this.data=null,this.keys=null,this.table=null,this.value=null,this.onclick=null,this.oncontextmenu=null},ListTable.prototype.doFilter=function(t){var e=function(){};t?(this.filter=t,this.keys_old?this.loadData(this.keys_old,this.data_old,e):this.loadData(this.keys,this.data,e)):this.filter&&(this.filter=null,this.loadData(this.keys_old,this.data_old,e))},ListTable.prototype.doSort=function(t,e){var i=function(){};t?(this.sorter=t,this.reverse=e,this.keys_old?this.loadData(this.keys_old,this.data_old,i):this.loadData(this.keys,this.data,i)):this.sorter&&(this.sorter=null,this.reverse=null,this.loadData(this.keys_old,this.data_old,i))},ListTable.prototype.doSortColumn=function(t,e){this.doSort(function(e,i){var l=e[1][t],s=i[1][t];return l<s?-1:l>s?1:0},e),this.onsort&&this.onsort(t,e)},ListTable.prototype.getIndexByKey=function(t){for(var e=0;e<this.keys.length;e++)if(this.keys[e]==t)return e;return-1},ListTable.prototype.installKeyEventHandler=function(t){var e=this;jQuery(t).keydown(function(t){var i=e.multi?e.lastindex:e.index;38==t.keyCode?(e.selectRow(i-1,!0),t.stopPropagation()):40==t.keyCode?(e.selectRow(i+1,!0),t.stopPropagation()):65==t.keyCode&&t.ctrlKey&&(e.selectAll(),t.stopPropagation())})},ListTable.prototype.loadData=function(t,e,i){this.keys_old=null,this.data_old=null,this.filter&&(this.keys_old=t,this.data_old=e,e=(t=ListTable._doFilter(t,e,this.filter))[1],t=t[0]),this.sorter&&(this.keys_old||(this.keys_old=t,this.data_old=e),e=(t=ListTable._doSort(t,e,this.sorter,this.reverse))[1],t=t[0]),this._loadData(t,e,0,i)},ListTable.prototype.loadXML=function(t,e){var i=new Array,l=new Array,s=null;if(!XPLAN.util.isBrowser("ie"))for(var a=(s=t.evaluate("//record",t,null,XPathResult.ANY_TYPE,null)).iterateNext();a;){var n=new Array;i.push(a.getAttribute("id"));for(var r=0;r<a.childNodes.length;r++)1==a.childNodes[r].nodeType&&n.push(a.childNodes[r].textContent);l.push(n),a=s.iterateNext()}else{s=t.documentElement.selectNodes("record");for(var o=0;o<s.length;o++){a=s[o],n=new Array;i.push(a.getAttribute("id"));for(r=0;r<a.childNodes.length;r++)1==a.childNodes[r].nodeType&&n.push(a.childNodes[r].text);l.push(n)}}this.loadData(i,l,e)},ListTable.prototype._setCellData=function(t,e,i){if(this.trans.length>e&&null!=this.trans[e])try{i=this.trans[e](i)}catch(t){i=i.toString()}"string"==typeof i?"<html>"==i.substr(0,6)&&"</html>"==i.substr(i.length-7)||"<span"===i.substr(0,5)?t.html(i):t.text(i):t.empty().append(i)},ListTable.prototype._loadData=function(t,e,i,l){var s=this.table.rows.length;0==i&&s>0&&this.table.rows[0].cells[0].colSpan>1&&(this.clear(),s=0),this.index=this.multi?[]:-1;for(var a=i;a<e.length;a++){var n,r=e[a],o=!1;n=a<s?this.table.rows[a]:this.table.insertRow(this.table.rows.length);var h=jQuery(n);if(h.data("event_added")||h.click(ListTable._onClick).dblclick(ListTable._onDblClick).bind("contextmenu",ListTable._onContextMenu).bind("selectstart",ListTable._onSelectStart).data("event_added",!0),this.multi){for(var c=0;c<this.value.length;c++)if(this.value[c]==t[a]){this.index.push(a),o=!0;break}}else this.value==t[a]&&(o=!0,this.index=a);n.className=o?"listtable-selected":this.getClassName(this.rowclass,a);var d=n.cells.length;for(c=0;c<r.length;c++){var u;c<d?u=jQuery(n.cells[c]):((u=jQuery(n.insertCell(c))).css("white-space","nowrap"),this.colWidths[c]&&u.attr("width",this.colWidths[c])),this._setCellData(u,c,r[c]),this.display_hint&&c==this.hint_column_index&&a<=this.hint.length&&this.hint[a].length>=0&&(hint_cell=n.cells[c],hint_cell.title=this._getRealHint(a,t))}for(;n.cells.length>r.length;)n.deleteCell(r.length);if(a%25==24&&"function"==typeof l){var f=this;return void window.setTimeout(function(){f._loadData(t,e,a+1,l)},50)}}for(;this.table.rows.length>e.length;)this.table.deleteRow(e.length);if(this.keys=t,this.data=e,this.multi){this.value=[];for(a=0;a<this.index.length;a++)this.value.push(this.keys[this.index[a]])}else this.value=this.index>=0?this.keys[this.index]:null;"function"==typeof l&&l.apply()},ListTable.prototype.getKeys=function(){return this.keys},ListTable.prototype.getCellData=function(t,e){var i=this.getIndexByKey(t);return this.data[i][e]},ListTable.prototype.setCellData=function(t,e,i){var l=this.getIndexByKey(t);if(!(l<0)){this.data[l][e]=i,this.data_old&&(this.data_old[l][e]=i);var s=jQuery(this.table.rows[l].cells[e]);this._setCellData(s,e,i)}},ListTable.prototype._getRealHint=function(t,e){if(null==this.keys_old||"undefined"==typeof this.keys_old)return this.hint[t];for(var i=e[t],l=0;l<this.keys_old.length;l++)if(this.keys_old[l]==i)return this.hint[l];return this.hint[t]},ListTable.prototype.sanifyIndex=function(t){return t<0?0:t>=this.keys.length?this.keys.length-1:t},ListTable.prototype.getClassName=function(t,e){return this.shading?(e%2==0?"item_even":"item_odd")+" "+t:t},ListTable.prototype.selectAll=function(){if(this.multi){this.index=[],this.value=[];for(var t=0;t<this.keys.length;t++)this.index.push(t),this.value.push(this.keys[t]),this.table.rows[t].className="listtable-selected"}},ListTable.prototype.selectRange=function(t,e){if(this.multi){if(this.clearSelection(),t>e){var i=e;e=t,t=i}t=this.sanifyIndex(t),e=this.sanifyIndex(e);for(var l=t;l<=e;l++)this.table.rows[l].className="listtable-selected",this.index.push(l),this.value.push(this.keys[l])}},ListTable.prototype._selectRow=function(t,e){0!=this.keys.length&&(this.clearSelection(),t=this.sanifyIndex(t),this.table.rows[t].className="listtable-selected",this.multi?(this.index.push(t),this.value.push(this.keys[t]),this.lastindex=t):(this.index=t,this.value=this.keys[t]),e&&this.onclick&&this.onclick())},ListTable.prototype.selectRow=function(t,e){return this._selectRow(t,e)},ListTable.prototype.selectRowByKey=function(t,e){var i=this.getIndexByKey(t);i>=0&&this.selectRow(i,e)},ListTable.prototype.setOneRowContent=function(t){this.clear();var e=this.table.insertRow(0).insertCell(0),i=this._getTableHead();if(i){var l=i.getElementsByTagName("TH");l.length>1&&(e.colSpan=l.length)}e.innerHTML=t},ListTable.prototype.toggleRow=function(t){if(this.multi){var e;for(e=0;e<this.index.length&&t<=this.index[e];e++)if(t==this.index[e])return this.table.rows[t].className=this.getClassName(this.rowclass,t),this.index.splice(e,1),void this.value.splice(e,1);t=this.sanifyIndex(t),this.table.rows[t].className="listtable-selected",this.index.splice(e,0,t),this.value.splice(e,0,this.keys[t]),this.lastindex=t}},ListTable.prototype.startEggTimer=function(){var t='<img src="'+(this.eggtimer_image?this.eggtimer_image:getBaseURL()+"/img/eggtimer_tiny.gif")+'" align="absmiddle" /> '+(this.eggtimer_text?this.eggtimer_text:_("Loading..."));this.setOneRowContent(t)},ListTable.collection=new Array,ListTable._doFilter=function(t,e,i){for(var l=[],s=[],a=0;a<t.length;a++)i(t[a],e[a])&&(l.push(t[a]),s.push(e[a]));return[l,s]},ListTable._doSort=function(t,e,i,l){for(var s=new Array,a=0;a<t.length;a++)s.push([t[a],e[a]]);s.sort(i),l&&s.reverse();var n=new Array,r=new Array;for(a=0;a<s.length;a++)n.push(s[a][0]),r.push(s[a][1]);return[n,r]},ListTable._getTableObjFromRow=function(t){var e=t.parentNode,i=parseInt(jQuery(e).data("listtableid"));return ListTable.collection[i]},ListTable._onClick=function(t){var e=ListTable._getTableObjFromRow(this);if("undefined"==typeof e)return!1;var i=this.rowIndex-e.headrows;return e.multi&&t.ctrlKey?e.toggleRow(i):e.multi&&t.shiftKey?e.selectRange(i,e.lastindex):e.selectRow(i,!0),!1},ListTable._onContextMenu=function(t){var e=ListTable._getTableObjFromRow(this);return e.oncontextmenu&&(e.multi&&0!=e.index.length||e.selectRow(this.rowIndex-e.headrows,!1),e.oncontextmenu(t)),!1},ListTable._onDblClick=function(t){var e=ListTable._getTableObjFromRow(this);return e.selectRow(this.rowIndex-e.headrows,!0),e.ondblclick&&e.ondblclick(t),!1},ListTable._onSelectStart=function(){return!1},ListTable._onSortClick=function(){var t=jQuery(this),e=this.parentNode,i=ListTable._getTableObjFromRow(e),l=this.cellIndex,s=t.hasClass("sortable-asc");jQuery(e).children(".sortable").removeClass("sortable-asc").removeClass("sortable-des"),t.addClass(s?"sortable-des":"sortable-asc"),i.doSortColumn(l,s)},ListTable.prototype._addSortColumns=function(t){for(var e=0;e<t.rows[0].cells.length;e++){var i=jQuery(t.rows[0].cells[e]);i.attr("sort")&&i.removeAttr("sort").addClass("sortable"),i.hasClass("sortable")&&i.click(ListTable._onSortClick)}},ListTable.prototype._getTableHead=function(){for(var t=this.table.previousSibling;t;){if(1==t.nodeType&&"THEAD"==t.tagName)return t;t=t.previousSibling}return null},CellTransform={},CellTransform.date=function(t){return t?XPLAN.DateTimeUtil.strftime("%d %b %Y",t):""},CellTransform.datetime=function(t){return t?XPLAN.DateTimeUtil.strftime("%d %b %Y %H:%M",t):""},CellTransform.email=function(t){if(!t)return"";var e="",i="",l="";if("object"==typeof t&&t.constructor==Array){var s=t[1];if(!(e=t[0]))return"";XPLAN.util.isCapable("allow_email")&&(i=getBaseURL()+"/email/edit?add_to_note=1&client="+s+"&new=client",l="Xplan")}else e=t;return i||(i="mailto:"+e,i="Email client"),jQuery("<span/>").css("text-decoration","underline").attr("title","Email via "+l).text(e).click(function(){getMainFrame().location.href(i)}).get(0)};
;Dependency._js['table']=true;

;
!function(e){function t(e){this.ajax_instance=e,this.auto_eggtimer=!1,this.global_eggtimer=!1,this.egg=EggTimer.getNewTimer(),this.egg_options={modal:!0}}var n,i=XPLAN.namespace("XplanAjax");e.extend(i,(n={},{getClass:function(e){return n[e]},setClass:function(e,t){return n[e]=t,t}})),t.prototype._get_eggtimer_options=function(t){var n={auto_eggtimer:this.auto_eggtimer,global_eggtimer:this.global_eggtimer};return e.extend(n,t||{}),n},t.prototype._show_eggtimer=function(e){var t=this._get_eggtimer_options(e);t.auto_eggtimer&&(t.global_eggtimer?EggTimer.show(this.egg_options,!0):this.egg.show(this.egg_options))},t.prototype._hide_eggtimer=function(e){var t=this._get_eggtimer_options(e);t.auto_eggtimer&&(t.global_eggtimer?EggTimer.hide(null,!0):this.egg.hide())},t.prototype.call_wait=function(e,t,n){return this.call(e,t,!0,n)},t.prototype.call_sync=function(e,t,n){var i,r=this.ajax_instance.options.ajax_rpcs[e];this._show_eggtimer(n);try{i=XMLRPC.call(r,t)}catch(e){throw this._hide_eggtimer(n),e}return this._hide_eggtimer(n),i},t.prototype.call=function(t,n,i,r){var a=e.Deferred(),s=this,o=this.ajax_instance.options.ajax_rpcs[t];return o?(s._show_eggtimer(r),i?XMLRPCMulti.call(o,n,function(e){s._hide_eggtimer(r),a.resolveWith(s.ajax_instance,[e])},function(e){s._hide_eggtimer(r),a.rejectWith(s.ajax_instance,[e])},!1):XMLRPC.call(o,n,function(e){s._hide_eggtimer(r),a.resolveWith(s.ajax_instance,[e])},function(e){s._hide_eggtimer(r),a.rejectWith(s.ajax_instance,[e])})):(s._show_eggtimer(r),e.post(this.ajax_instance.options.ajax_urls[t],n,function(e){s._hide_eggtimer(r),a.resolveWith(s.ajax_instance,[e])},arguments[2]).error(function(){s._hide_eggtimer(r),a.rejectWith(s.ajax_instance)})),a.promise()},i.Connection=t}(jQuery),function(e){var t=XPLAN.namespace("XplanAjax");t.hasPluginApplied=function(e,t){return!!e.data(t)};var n=function(t,n){t&&n&&(this._elem=t,this.plugin_name=n,this.args=e.makeArray(arguments),this.args.splice(0,2),this.args.length>0&&(this.options=this.args[0]))};n.prototype.set_elem=function(e){this._elem=e},n.prototype.get_elem=function(){return this._elem&&0===this._elem.length&&this.set_elem(e(this._elem.selector,this._elem.context)),this._elem};var i=function(t,i,r){return n.apply(this,e.makeArray(arguments))};(i.prototype=new n).create=function(){var n=new(t.getClass(this.plugin_name))({el:this.get_elem()}),i={};return e.extend(!0,i,this.options),this.get_elem().data(this.plugin_name,n),n.options=i,n.connection=new t.Connection(n),n.create(this.get_elem()),this.options&&this.get_elem().attr("data-xplan-elem",this.options.ajax_data_xplan_elem),n},i.prototype.call=function(t){var n=t.splice(0,1),i=this.get_elem();if(0===i.length)return window.console&&console.log("ajax element not found:"+this._elem.selector),null;var r=i.data(this.plugin_name);return r&&r[n]?(r.public_method_requires_elem&&t.splice(0,0,this.get_elem()),r[n].apply(r,t)):(e.error("Method "+n+" does not exist on jQuery."+this.plugin_name),null)};var r=function(t,i){return n.apply(this,e.makeArray(arguments))};(r.prototype=new n).create=function(){var e=this.get_elem();return e[this.plugin_name].apply(e,this.args)},r.prototype.call=function(){var t=this.get_elem();return t[this.plugin_name].apply(t,e.makeArray(arguments))},t.Plugin=r;var a=function(n){var i,r=t.getClass(n.parent_plugin_name);return r?(i=function(){r.apply(this,e.makeArray(arguments))}).prototype=new r:((i=function(t){t&&(e.extend(this,t),this.el&&(this.setElement(this.el),this.events&&this.delegateEvents(this.events)))}).prototype._parseEvent=function(t,n){var i=t.indexOf(" "),r=e.trim(t.substring(0,i+1)),a=e.trim(t.substring(i+1))||void 0;this.$el.off(r,a),this.$el.on(r,a,e.proxy(this[n],this))},i.prototype.setElement=function(t){this.el=t,this.$el=e(t)},i.prototype.$=function(t){return e(t,this.$el)},i.prototype.delegateEvents=function(t){var n=this;e.each(e.isFunction(t)?t():t,function(e,t){t&&n._parseEvent(e,t)})}),e.extend(i.prototype,n),t.setClass(n.plugin_name,i),i};t.createClass=function(t){var n=a(t),r=t.plugin_name;return e.fn[r]=function(t){return"object"!=typeof t&&t?new i(this,r).call(e.makeArray(arguments)):(this.each(function(){var n=t;new i(e(this),r,n).create()}),this)},n};var s={parent_plugin_name:null,public_method_requires_elem:!0,plugin_name:"xplan_ajax",create:function(e){},parent_prototype:function(){if(this.parent_plugin_name)return t.getClass(this.parent_plugin_name).prototype},get_plugin:function(){return new t.Plugin(this.$el,this.plugin_name)}};t.createClass(s)}(jQuery),function(e){var t=XPLAN.namespace("XplanAjax"),n=function(e,i,r){var a=this;this._plugins=underscore.map(e.names,function(r){var s=e.ajaxes[r];if(s){var o=new t.Plugin(n._selector_jquery(s,i),s.ajax_plugin_name,s);return a[r]=o,o}return null}),this._plugins=underscore.filter(this._plugins,function(e){return null!==e}),r||this.render()};n._selector_jquery=function(t,n){var i=t.ajax_selector;return i||t.ajax_id&&(i="#"+t.ajax_id),e(i,n)},n.prototype.call=function(){return underscore.map(this._plugins,function(t){t.call.apply(t,e.makeArray(arguments))})},n.prototype.render=function(){return underscore.each(this._plugins,function(e){return e.create()})},t.Plugins=n;var i={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_ajaxes",public_method_requires_elem:!1,create:function(){this.plugins=new t.Plugins(this.options.ajaxes,this.$el,!0),this._before_created(),this._render(this.options.config.delay_create),this._after_created()},_render:function(e){this.$el.html(this.options.template),e||this.plugins.render()},render:function(){this._render(),this.options.after_render&&this.options.after_render()},_before_created:function(){},_after_created:function(){},_call_ajax_method:function(e){var t=this.plugins[e],n=Array.prototype.slice.call(arguments,1);t.call.apply(t,n)}};t.createClass(i)}(jQuery);
;Dependency._js['ajax/ajax']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/ajax"),function(e){function t(e){this.$selector=e}t._cache={},t.getModel=function(n,a){var i=e(a),o=i.data("model_event_id");o||(o=XPLAN.util.get_html_random_id(),i.data("model_event_id",o),(t._cache[o]=new t(i)).add(i,function(e){i.val(e.value)}));return t._cache[o]},t.prototype._getEventName=function(){return"xplan.event.handler."+this.$selector.data("model_event_id")},t.prototype.notify=function(e,t){XPLAN.event.send(this._getEventName(),e,t)},t.prototype.add=function(t,n){var a=this,i=(a.$selector.data("model_event_id"),XPLAN.event.listen(a._getEventName(),function(e){n(e)}));t.on("change",function(t){var n=e(t.target);a.notify({value:n.val(),disabled:n.prop("disabled"),visible:n.is(":visible")},i)})};var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_event_handler",_getModel:function(){var n=e(this.options.selector);return t.getModel(this.options.domain||"xplan",n)},create:function(e){this._getModel().add(this.$el,this.options.callback)},notify:function(e,t){this._getModel().notify(t)}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['ajax/event_handler']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/event_handler"),function(e){var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_currency_code_controller",create:function(e){XPLAN.util.hasFeature("multi_currency")&&this._populateCurrencyCodeHtml(e)},_populateCurrencyCodeHtml:function(n){var a="view"===this.options.fieldStatus?e('<span data-xplan-elem="currency"></span>'):XPLAN.MultiCurrency.getCurrencyCodeOptionsHtml({},!0),t=this.options.position;t||(t="after");var l=e(n);switch(t){case"after":l.after(a);break;case"before":l.before(a);break;case"append":l.append(a);break;case"prepend":l.prepend(a)}this.bindCurrencyCodeEventHandling(a)},_defaultCallback:function(e,n){var a=!!n.disabled,t=void 0===n.visible||n.visible;"view"===this.options.fieldStatus?e.text("("+n.value+")"):e.val(n.value),e.prop("disabled",a).toggle(t)},getFieldCallbackFunction:function(e){var n=this;return function(a){n._defaultCallback(e,a),underscore.isFunction(n.options.callback)&&n.options.callback(a)}},bindCurrencyCodeEventHandling:function(n){var a={selector:this.options.selector,callback:this.getFieldCallbackFunction(n)};e(this.options.selector).xplan_event_handler(a);var t={value:e(this.options.selector).val()};underscore.extend(t,this.options),this.options.skipExternalCallbackWhenBind?this._defaultCallback(n,t):a.callback(t),n.xplan_event_handler(a)}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['xpt/multicurrency/currency_code_controller']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("xpt/multicurrency/currency_code_controller"),function(e){var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_invoicing_multicurrency",create:function(e){if(XPLAN.util.hasFeature("multi_currency"))for(var n in this.options)if(this.options.hasOwnProperty(n))for(var r=this.options[n],t=0;t<r.length;t++)this._addCurrencyCode(n,r[t])},_addCurrencyCode:function(n,r){if(this.$(n).length>0){var t=r.selector;e.extend(r,{selector:n}),this.$(t).xplan_currency_code_controller(r)}}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['xpt/invoicing/multicurrency']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("xpt/invoicing/multicurrency"),XPLAN.namespace("MultiCurrency"),function(e,t){function n(e,n,i,r){return this.parent=e,this.name=n,this.items=r==t?[]:r,this.doc=this.parent.ownerDocument,this.value=i==t?null:i,this.init(),this}var i=e.document,r={},u=1,c=function(e){return this.init(u,e||{}),c.addHandler(this),u++,this};c.prototype={constructor:c,init:function(e,t){this.id=e,this.options=t,this.selector=this._getSelector(),this.field_name=t.field_name,this.depend_type=t.depend_type||"code",this._init()},_getSelector:function(){var e=null;return this.options.name&&(e=this._isSource()||this._manualChangeAllowed()?jQuery('select[name="'+this.options.name+'"]',i):jQuery('input[type="hidden"][name="'+this.options.name+'"]',i)),e},_getValue:function(){if(this.selector)return this.selector.val()},_setValue:function(e){this.selector&&this.selector.val(e)},_setText:function(e){var t=this.field_name+"_"+this.depend_type+"_span";jQuery("#"+t).text(" ("+e+")")},_manualChangeAllowed:function(){return this.options.manual_change==t||this.options.manual_change},_isSource:function(){return this.options.is_source},_init:function(){if(this._isSource()){var e=c.getCodeChangeHandler(this.id);this.selector.bind("change",e),setTimeout("XPLAN.MultiCurrency.DependencyHandler.getHandler("+this.id+").initPage();",100)}else if(this.options.source){e=c.getCodeChangeListener(this.id);XPLAN.event.listen("currency "+this.depend_type+" changed",e)}},initPage:function(){XPLAN.event.send("currency "+this.depend_type+" changed",{field_name:this.field_name,value:this._getValue(),init:!0})}},c.getCodeChangeHandler=function(e){return function(t){var n=c.getHandler(e);XPLAN.event.send("currency "+n.depend_type+" changed",{field_name:n.field_name,value:n._getValue(),init:!1})}},c.getCodeChangeListener=function(e){return function(t){var n=c.getHandler(e);t.field_name==n.options.source&&(t.init&&n._manualChangeAllowed()||(n._setValue(t.value),n._setText(t.value)))}},c.getHandler=function(e){return r[e]},c.addHandler=function(e){r[e.id]=e};var a=function(e,t){return t instanceof a?t:(this.code=e,this.value=t,this)};a.prototype={constructor:a,toObjString:function(){return"new XPLAN.MultiCurrency.Currency('"+this.code+"',"+this.value+")"},toString:function(){return this.value+"("+this.code+")"},toJSON:function(e){return{_type:"Currency",_val:{code:this.code,value:{_val:""+this.value,_type:"BigDecimal"}}}},toArray:function(){return[this.value,this.code]},toElemObject:function(e){var t={};return t[e]=this.toArray(),t},convert:function(e){var t=o(),n=t[this.code]||1,i=t[e]||1;return this.code=e,this.value=this.value*n/i,this}},n.prototype={constructor:n,init:function(){this.input_span=jQuery('<span id="'+this.name+'_span"></span>');var e=XMLRPC.call("currency.format",["edithtml",this.value,{name:this.name}]);this.input_span.appendTo(this.parent).html(e),this.select=jQuery("<select></select>").appendTo(this.parent),jQuery("<option></option>").appendTo(this.select).val(-1).text("");for(var t=0;t<this.items.length;t++)jQuery("<option></option>").appendTo(this.select).val(t).text(this.items[t][1]);this.value_input=this.input_span.children("input:text"),this.code_input=this.input_span.children("select"),this.code_input.length||(this.code_input=this.input_span.children("input:hidden")),this.registerEvent()},registerEvent:function(){var e=this;this.select.change(function(){var t=parseInt(e.select.val());t>=0&&(e.value_input.val(e.items[t][0].value),e.code_input.val(e.items[t][0].code))}),this.value_input.bind("change",function(){e.inputChangeHanlder()}).change(),this.code_input.bind("change",function(){e.inputChangeHanlder()}).change()},setInputReadOnly:function(e){this.value_input.attr("disabled",e),this.code_input.attr("disabled",e)},inputChangeHanlder:function(){for(var e=0;e<this.items.length;e++)if(this.items[e][0].value==this.value_input.val()&&this.items[e][0].code==this.code_input.val())return void this.select.val(e);this.select.val(-1)}};var o=function(){return e.XPLAN.MultiCurrency._simpleFxRates||(e.XPLAN.MultiCurrency._simpleFxRates=XMLRPC.call("currency.get_simple_fx_rates",[])),e.XPLAN.MultiCurrency._simpleFxRates};e.XPLAN.MultiCurrency.DependencyHandler=c,e.XPLAN.MultiCurrency.htmlMoney=function(e,t){return"undefined"==typeof t&&(t=!0),XPLAN.format2.write_float("money",e.value,t,{pospre:"",negpre:"",pospost:"",negpost:""})+"("+e.code+")"},e.XPLAN.MultiCurrency.textMoney=function(e){return XPLAN.format2.write_float("money",e.value,!1,{pospre:"",negpre:"-",pospost:"",negpost:""})+"("+e.code+")"},e.XPLAN.MultiCurrency.Currency=a,e.XPLAN.MultiCurrency.EditCombo=n,e.XPLAN.MultiCurrency.getCurrencyCodeOptions=function(){var e=XPLAN.cache,t="multicurrency.codeOptions";if(!e.get(t)){var n=XMLRPC.callGET("currency.get_currency_codes",[]);e.set(t,n)}return e.get(t)},e.XPLAN.MultiCurrency.getCurrencyCodeOptionsHtml=function(e,t,n,i){var r=function(){var e=XPLAN.cache,t="multicurrency.defaultSiteCurrencyCode";if(!e.get(t)){var n=XMLRPC.callGET("currency.get_site_currency_code",[]);e.set(t,n)}return e.get(t)}();"user"===n&&(r=XPLAN.login_user_currency_code),i&&(r=i);var u=XPLAN.MultiCurrency.getCurrencyCodeOptions();e["data-xplan-elem"]="currency";for(var c=jQuery("<select></select>",e),a=0;a<u.length;a++){var o=u[a];c.append('<option value="'+XPLAN.util.escape(o[0])+'"'+(r===o[0]?' selected="selected"':"")+">"+XPLAN.util.escape(o[1])+"</option>")}return t?c:c[0].outerHTML},e.XPLAN.MultiCurrency.getEntityReportCurrency=function(e,t){EggTimer.show(),XMLRPC.call("currency.get_entity_report_currency",[e],function(e){t(e),EggTimer.hide()},function(e){EggTimer.hide(),HttpRequest.onerror(e)})},e.XPLAN.MultiCurrency._simpleFxRates=t,e.XPLAN.MultiCurrency.getSimpleFxRates=o,e.XPLAN.MultiCurrency.changeCurrency=function(t,n,i){var r=jQuery(t);if(2===r.length){var u=r.eq(0).val(),c=r.eq(1).val(),a=new e.XPLAN.MultiCurrency.Currency(c,u);a.convert(n),r.eq(0).val(a.value),r.eq(1).val(a.code),i&&r.eq(1).change()}},XPLAN.namespace("AutoMultiCurrency"),e.XPLAN.AutoMultiCurrency.getCurrencyCodeOptionsHtml=function(e,t,n,i){return XPLAN.util.hasFeature("multi_currency")||(n="system"),XPLAN.MultiCurrency.getCurrencyCodeOptionsHtml(e,t,n,i)}}(window),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_multicurrency_field",create:function(e){XPLAN.util.hasFeature("multi_currency")&&this.bindEvents()},bindEvents:function(){var e=this,t=this.$el.parent(),n=this.$el.attr("name");XPLAN.util.elemChange(t,function(i){var r=i.data[n][0],u=i.data[n][1],c=i.old_data[n][1],a=new window.XPLAN.MultiCurrency.Currency(c,r);a.convert(u),XPLAN.util.object2elem(t,a.toElemObject(n)),e.options.on_complete_conversion&&(e.options.on_complete_conversion,1)&&e.options.on_complete_conversion(a)})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['xpt/multicurrency']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/ajax"),function(t,a){function n(t){return a.util.endswith(t,"#")&&(t=t.substring(0,t.length-1)),t}var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_jumpback",create:function(e){if(this.options.jump.active){var r=this;t('<button type="button" data-xplan-elem="btn_back">'+a.util.escape(this.options.jump.backward_text)+"</button>").appendTo(e).click(function(){r.options.onclick&&r.options.onclick()||t.get(r.options.ajax_urls.stop_jumpback,r.options.jump,function(t){r.options.jump.backward_url.indexOf("#")>=0?window.location=n(r.options.jump.backward_url):a.util.form_redirect(n(r.options.jump.backward_url))})})}}};a.namespace("XplanAjax").createClass(e);var r=a.namespace("jumpback");r._get_options=function(t){var n=a.util.isString(t)?{forward_url:t}:t;return void 0===n.active&&(n.active=!0,void 0===n.backward_url&&(n.backward_url=getMainFrame().location.href),void 0===n.backward_text&&(n.backward_text=_("Back")),void 0===n.target&&(n.target="_self")),n},r.jumpto=function(e){var r=this._get_options(e);XMLRPC.call("today.start_jumpback",[r],function(e){if(e.active&&e.forward_url)if(a.util.startswith(e.forward_url,"javascript:"))t.globalEval(e.forward_url.substring(11),{nonce:a.nonce});else{var o=n(e.forward_url);"_self"===r.target?a.util.form_redirect(o):getMainFrame().XPLAN.util.form_redirect(o)}})},r.get_jumpto_href=function(t,n){var e=this._get_options(t),r=a.json.encode(e),o="XPLAN.jumpback.jumpto("+(r=a.util.escape(r))+");";return n&&(o="javascript:"+o),o},r.get_jumpto_link=function(t,n){return'<a href="#" onclick="'+this.get_jumpto_href(n,!0)+';return false;">'+a.util.escape(t)+"</a>"},r.get_server_options=function(t){return XMLRPC.call("today.get_jumpback_options",[t])}}(jQuery,XPLAN);
;Dependency._js['ajax/jumpback']=true;

;
function XCampaignEmail(e){this.data=e}function XCampaignEmailList(e){this.list=[];for(var a=0;a<e.length;a++)this.list.push(new XCampaignEmail(e[a]))}"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("xpt/multicurrency"),Dependency.addJS("ajax/jumpback")),XCampaign={data:{},origin_outcome:[],share_all:2,share_not:0,share_specified_groups:1,cthreadid:-1,mapping:{},email_analysis:{}},XCampaign.modes=[[0,_("By Relative Days")],[1,_("Immediately")]],XCampaign.conditions=[[0,_("Not Invited")],[1e3,_("Invited")],[2e3,_("Invited & Attended")],[3e3,_("Invited & Not Attended")],[4e3,_("Invited & Accepted")],[5e3,_("Invited & Not Accepted")],[6e3,_("Invited & Attended & Accepted")],[7e3,_("Invited & Attended & Not Accepted")],[8e3,_("Invited & Not Attended & Accepted")],[9e3,_("Invited & Not Attended & Not Accepted")]],XCampaign.template_types={0:_("Thread"),100:_("Case"),200:_("Lead")},XCampaign.show_msgbox=function(e,a){var t="";a||(a=_("Information")),a==_("Information")&&(t="icon-info.png"),a==_("Error")&&(t="icon-error.png"),a==_("Warning")&&(t="icon-warning.png"),PopupForm2.show(e,a,{icon:t})};var XCampaign_OK_button_name=_("OK"),XCampaign_Cancel_button_name=_("Cancel");XCampaign.show_msgbox_jq=function(e,a){jQuery("#msgbox_hidden")&&jQuery("#msgbox_hidden").remove(),a||(a=_("Information")),jQuery("body").append('<div id="msgbox_hidden">'+e+"</div>"),jQuery("#msgbox_hidden").dialog({title:a});var t={};return t[XCampaign_OK_button_name]=function(){jQuery(this).dialog("close")},jQuery("#msgbox_hidden").dialog("option","buttons",t),jQuery("#msgbox_hidden")},XCampaign.show_dialogbox=function(e,a,t){jQuery("#dialogbox_hidden")&&jQuery("#dialogbox_hidden").remove(),a||(a=_("Information"));var n={};if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=XCampaign_OK_button_name==i?function(){t[XCampaign_OK_button_name](),jQuery(this).dialog("close")}:i==XCampaign_Cancel_button_name?function(){t[XCampaign_Cancel_button_name](),jQuery(this).dialog("close")}:t[i]);else n[XCampaign_Cancel_button_name]=function(){jQuery(this).dialog("close")},n[XCampaign_OK_button_name]=function(){jQuery(this).dialog("close")};return jQuery("body").append('<div id="dialogbox_hidden">'+e+"</div>"),jQuery("#dialogbox_hidden").dialog({title:a}),jQuery("#dialogbox_hidden").dialog("option","buttons",n),jQuery("#dialogbox_hidden")},XCampaign.show_dialogbox_OKCancel=function(e,a,t,n){var i={};return i[XCampaign_Cancel_button_name]=n||function(){},i[XCampaign_OK_button_name]=t||function(){},XCampaign.show_dialogbox(e,a,i)},XCampaign.isImmediate=function(e){return 1==e},XCampaign.validate=function(){if(""===document.getElementsByName("title")[0].value)return XCampaign.show_msgbox(_("Please enter title")),!1;if(""===document.getElementsByName("place")[0].value)return XCampaign.show_msgbox(_("Please choose a place")),!1;if(""===document.getElementsByName("campaigntype")[0].value)return XCampaign.show_msgbox(_("Please choose a campaign type")),!1;var e=document.getElementsByName("direct_cost")[0].value,a=document.getElementsByName("indirect_cost")[0].value;if(""!==e&&isNaN(parseFloat(e)))return XCampaign.show_msgbox(_("Invalid direct cost")),!1;if(""!==a&&isNaN(parseFloat(a)))return XCampaign.show_msgbox(_("Invalid indirect cost")),!1;var t=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#startdate")),n=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#enddate")),i=XCampaign._getTime("starttime"),r=XCampaign._getTime("endtime");return t>n?(XCampaign.show_msgbox(_("Start Date must be before or same as End Date.")),!1):!(t==n&&i>=r)||(XCampaign.show_msgbox(_("Start time must be before End Time.")),!1)},XCampaign.get_notify=function(){for(var e=document.getElementsByName("notify"),a=[],t=0;t<e.length;t++)if(e[t].checked){var n=parseInt(e[t].value,10);isNaN(n)||a.push(n)}return a},XCampaign.setValues=function(){var e=XCampaign.data,a=document.getElementsByName("title")[0];e.title=a.value;var t=document.getElementsByName("campaigntype")[0];e.campaigntype=parseInt(t.value,10);var n=document.getElementsByName("markettype")[0];e.markettype=parseInt(n.value,10);var i=document.getElementsByName("description")[0];e.description=i.value;var r=document.getElementsByName("status")[0];e.status=parseInt(r.value,10);var o=document.getElementsByName("place")[0];e.place=o.value;var m=document.getElementsByName("location")[0];e.location=m.value;var s=XCampaign.responsible_search.getEntity();e.responsible=s;var p=XCampaign.key_relationship_search.getEntity();e.key_relationship=p;var d=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#startdate"));e.startdate=d,d=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#enddate")),e.enddate=d;var c=XCampaign._getTime("starttime");e.starttime=c,c=XCampaign._getTime("endtime"),e.endtime=c;var l=parseFloat(document.getElementsByName("direct_cost")[0].value),g=document.getElementsByName("direct_cost")[1].value;isNaN(l)?e.direct_cost=new XPLAN.MultiCurrency.Currency(g,0):e.direct_cost=new XPLAN.MultiCurrency.Currency(g,l);var u=parseFloat(document.getElementsByName("indirect_cost")[0].value),C=document.getElementsByName("indirect_cost")[1].value;isNaN(u)?e.indirect_cost=new XPLAN.MultiCurrency.Currency(C,0):e.indirect_cost=new XPLAN.MultiCurrency.Currency(C,u);var X=document.getElementsByName("permission")[0];e.permission=parseInt(X.value,10),e.notify=XCampaign.get_notify();var _=document.getElementsByName("not_confirm")[0];e.not_confirm=parseInt(_.value,10);var h=document.getElementsByName("autoinvoice")[0];e.autoinvoice=parseInt(h.value,10);var v=document.getElementsByName("max_attendees")[0];if(v=parseInt(v.value,10),isNaN(v)||(e.max_attendees=v),e.sharegroup=parseInt(jQuery('select[name="sharegroup"]').val(),10),e.sharegroup==XCampaign.share_not||e.sharegroup==XCampaign.share_all)e.groups=[];else{for(var y=document.getElementsByName("groups"),f=[],b=0;b<y.length;b++)y[b].checked&&f.push(parseInt(y[b].value,10));0===f.length?e.sharegroup=0:e.groups=f}e.email=jQuery('input[name="email"]').val(),1==jQuery('select[name="diary_auto_add"]').length&&(e.diary_auto_add=parseInt(jQuery('select[name="diary_auto_add"]').val(),10),e.diary_template=parseInt(jQuery('select[name="diary_template"]').val(),10),isNaN(e.diary_template)&&(e.diary_template=-1));var w=jQuery('input[name="no_gateway"]').is(":checked");e.no_gateway=w,e.is_newsletter=jQuery('input:checkbox[name="is_newsletter"]').is(":checked")},XCampaign.save=function(e,a){if(XCampaign.validate()){if(XCampaign.setValues(),"campaign"==e&&!XCampaign._saveAllEmailAnalysis())return!1;XCampaign._save(e,a)}},XCampaign._save=function(e,a){var t="save_"+e,n=XMLRPC.call("xcampaigns."+t,[XCampaign.data]);n?XCampaign.show_msgbox(n,_("Error")):a&&(window.location.href=a)},XCampaign._saveAllEmailAnalysis=function(){for(var e in XCampaign.email_analysis){if(!XCampaign.email_analysis[e].save())return!1}return!0},XCampaign.loadXML=function(e){XCampaign.data=XMLiser.loadXML(e)},XCampaign.setShareGroupOnChange=function(){jQuery('select[name="sharegroup"]').change(function(){"1"==jQuery(this).val()?jQuery("#div_groups").show():jQuery("#div_groups").hide()}).change()},XCampaign.setMaxAttendeesOnChange=function(){jQuery('input[name="max_attendees"]').change(function(){var e=parseInt(jQuery(this).val(),10);if(!isNaN(e)){var a=isNaN(XCampaign.data.num_attendees)?0:XCampaign.data.num_attendees;jQuery("#td_remain").text(""+(e-a))}})},XCampaign.init=function(e){if(XCampaign.editable=e,XCampaign.data.outcome&&XCampaign.data.outcome.length){var a=XCampaign.data.outcome;XCampaign.origin_outcome=[];for(var t=0;t<a.length;t++)XCampaign.origin_outcome.push({id:a[t].id,name:a[t].name})}else XCampaign.origin_outcome=[];XCampaign.data.costs||(XCampaign.data.costs=[]),XCampaign.setShareGroupOnChange(),XCampaign.setMaxAttendeesOnChange(),XCampaign.editable&&(XCampaign.init_diary_tab(),XCampaign.responsible_search.setEntity("user",XCampaign.data.responsible,XCampaign.data.responsible_name),XCampaign.key_relationship_search.setEntity(XCampaign.data.key_relationship_role,XCampaign.data.key_relationship,XCampaign.data.key_relationship_name)),XCampaign._displayOutcome(),XCampaign._displayCosts(),XCampaign._displayThread(),XCampaignEmailList.loadFromInput().makeTable("EmailTable",e)},XCampaign.init_diary_tab=function(){jQuery('select[name="diary_auto_add"]').change(function(){1==this.value?jQuery("#diary_template_row").show():jQuery("#diary_template_row").hide()})},XCampaign._clearOutcome=function(){for(var e=document.getElementById("table_outcome");e.rows.length>0;)e.deleteRow(0)},XCampaign._addOutcome=function(){XCampaign._outcomeDialog()},XCampaign._editOutcome=function(e){outcome=XCampaign._findOutcome(e),outcome&&XCampaign._outcomeDialog(outcome)},XCampaign._removeOutcome=function(e){var a=XCampaign._findOutcomeIndex(e);if(a>=0){for(var t=XCampaign.data.outcome,n=[],i=0;i<t.length;i++)i!=a&&n.push(t[i]);XCampaign.data.outcome=n,XCampaign._displayOutcome()}},XCampaign._addCost=function(){XCampaign._costDialog()},XCampaign._findCost=function(e){for(var a=0;a<XCampaign.data.costs.length;a++){var t=XCampaign.data.costs[a];if(t.value==e.value&&t.code==e.code)return a}return-1},XCampaign._editCost=function(e){XCampaign._costDialog(e)},XCampaign._removeCost=function(e){var a=XCampaign._findCost(e);if(a>=0){for(var t=[],n=0;n<this.data.costs.length;n++)n!=a&&t.push(this.data.costs[n]);this.data.costs=t,XCampaign._displayCosts()}},XCampaign._costDialog=function(e){var a;void 0==e?e=null:a=e;var t=XMLRPC.call("currency.format",["edithtml",e,{name:"cost"}]),n="<table ><tr><td>"+_("Cost:")+"</td><td>"+t+"</td></tr></table>";PopupForm2.show(n,_("Cost"),{width:"auto",onclose:function(e){if(void 0!=e.cost&&2==e.cost.length){var t=parseFloat(e.cost[0]);if(isNaN(t))return;var n=new XPLAN.MultiCurrency.Currency(e.cost[1],t);if(XCampaign._findCost(n)>=0)return;if(void 0==XCampaign.data.costs&&(XCampaign.data.costs=[]),void 0==a)XCampaign.data.costs.push(n);else{var i=XCampaign._findCost(a);i>=0?XCampaign.data.costs[i]=n:XCampaign.data.costs.push(n)}}XCampaign._displayCosts()}})},XCampaign._clearCosts=function(){for(var e=document.getElementById("table_cost");e.rows.length>0;)e.deleteRow(0)},XCampaign._displayCosts=function(){if(XCampaign._clearCosts(),XCampaign.data&&XCampaign.data.costs){for(var e=0,a=document.getElementById("table_cost"),t=XCampaign.data.costs,n=0;n<t.length;n++){var i=document.createElement("TR");a.appendChild(i);var r=document.createElement("TD");if(i.appendChild(r),XCampaign.editable){var o='<span class="icon icon-edit" onclick="javascript:XCampaign._editCost('+t[n].toObjString()+');" ></span>&nbsp;';o+='<span class="icon icon-remove" onclick="javascript:XCampaign._removeCost('+t[n].toObjString()+');" ></span>',r.innerHTML=o,r=document.createElement("TD"),i.appendChild(r)}e+=t[n].value;var m=XMLRPC.call("currency.format",["html",t[n],{}]);jQuery(r).css("white-space","nowrap").html(m)}0==e?jQuery('input[name="no_gateway"]').prop("disabled","disabled").prop("checked","checked"):jQuery('input[name="no_gateway"]').removeAttr("disabled")}},XCampaign._newCThreadId=function(){return XCampaign.cthreadid--},XCampaign._newOutcomeId=function(){var e=XCampaign.data.outcome;if(void 0!=e&&e.length>0){for(var a=0,t=0;t<e.length;t++){var n=parseInt(e[t].id,10);n>a&&(a=n)}return a+1e3}return 1e3},XCampaign._findOutcomeIndex=function(e){var a=XCampaign.data.outcome;if(void 0!=a&&a.length>0)for(var t=0;t<a.length;t++)if(a[t].id==e)return t;return-1},XCampaign._findOutcome=function(e){var a=XCampaign._findOutcomeIndex(e);if(a>=0)return XCampaign.data.outcome[a]},XCampaign._isOutcomeRemovable=function(e){var a=XCampaign.origin_outcome;if(a&&a.length>0)for(var t=0;t<a.length;t++)if(a[t].id==e)return!1;return!0},XCampaign._getThreadTemplates=function(e,a){return XMLRPC.call("xtask.getThreadTemplateList",[e,a])},XCampaign._getThreadName=function(e,a){for(var t="",n=0;n<a.length;n++)if(e==a[n][0]){t=a[n][1];break}return t},XCampaign._getThreadTemplateSelect=function(e,a){var t=XCampaign._getThreadTemplates(e,a),n='<select id="threadid" name="threadid" >';return n+=XCampaign._getTemplateOptions(e,t),n+="</select>"},XCampaign._templateChange=function(e){var a=jQuery.find("#threadid")[0],t=parseInt(e.value,10),n=parseInt(e.getAttribute("data-threadid"),10),i=XCampaign._getThreadTemplates(n,t);jQuery(a).html(XCampaign._getTemplateOptions(n,i))},XCampaign._getTemplateOptions=function(e,a){for(var t='<option value="-1" >'+_("Please choose a template")+"</option>",n=0;n<a.length;n++){var i=a[n],r=i[0]===e?"selected":"";t+=['<option value="',XPLAN.util.escape(i[0],"xmlq"),'" ',r," >",XPLAN.util.escape(i[1]),"</option>"].join("")}return t},XCampaign._addThread=function(){XCampaign._threadDialog()},XCampaign._removeThread=function(e){var a=XCampaign._findThreadIndex(e);if(a>=0){for(var t=XCampaign.data.thread,n=[],i=0;i<t.length;i++)i!=a&&n.push(t[i]);XCampaign.data.thread=n,XCampaign._displayThread()}},XCampaign._findThreadIndex=function(e){var a=XCampaign.data.thread;if(void 0!=a&&a.length>0)for(var t=0;t<a.length;t++)if(a[t].id==e)return t;return-1},XCampaign._findThread=function(e){var a=XCampaign._findThreadIndex(e);if(a>=0)return XCampaign.data.thread[a]},XCampaign._clearThread=function(){for(var e=document.getElementById("table_thread");e.rows.length>0;)e.deleteRow(0)},XCampaign._editThread=function(e){var a=XCampaign._findThread(e);a&&XCampaign._threadDialog(a)},XCampaign._displayThread=function(){if(XCampaign._clearThread(),XCampaign.data&&XCampaign.data.thread)for(var e=document.getElementById("table_thread"),a=XCampaign.data.thread,t=0;t<a.length;t++){var n=document.createElement("TR");e.appendChild(n);var i=document.createElement("TD");if(n.appendChild(i),XCampaign.editable){var r='<span class="icon icon-edit" onclick="javascript:XCampaign._editThread('+a[t].id+');" ></span>&nbsp;';XCampaign._isOutcomeRemovable(a[t].id)?r+='<span class="icon icon-remove" onclick="javascript:XCampaign._removeThread('+a[t].id+');" ></span>':r+="&nbsp;",i.innerHTML=r,i=document.createElement("TD"),n.appendChild(i)}jQuery(i).text(""+a[t].id),i=document.createElement("TD"),n.appendChild(i),XCampaign.isImmediate(a[t].mode)?jQuery(i).text(_("Immediate")):jQuery(i).text(a[t].relative),i=document.createElement("TD"),n.appendChild(i),jQuery(i).text(XCampaign._getConditionName(a[t].condition)),i=document.createElement("TD"),n.appendChild(i),jQuery(i).text(a[t].name),i=document.createElement("TD"),n.appendChild(i),jQuery(i).text(XCampaign.template_types[a[t].advice_container])}},XCampaign.selectTemplate=function(e,a){var t=parseInt(e,10);t>0&&getMainFrame(a+"&load_template="+t)},XCampaign._getConditionName=function(e){for(var a=XCampaign.conditions,t=0;t<a.length;t++){var n=a[t];if(n[0]==e)return n[1]}return""},XCampaign._changeModeSelect=function(){"1"===jQuery("#mode").val()?jQuery("#relative").hide():(jQuery("#relative").show(),-1==jQuery('[name="relative"]').val()&&jQuery('[name="relative"]').val("1"))},XCampaign._getModeSelect=function(e){for(var a=XCampaign.modes,t='<select id="mode" name="mode" onchange="XCampaign._changeModeSelect()" >',n=0;n<a.length;n++){var i=a[n],r=e==i[0]?"selected":"";t+='<option value="'+i[0]+'" '+r+" >"+i[1]+"</option>"}return t+="</select>"},XCampaign._getConditonSelect=function(e){for(var a=XCampaign.conditions,t='<select id="condition" name="condition" >',n=0;n<a.length;n++){var i=a[n],r=e==i[0]?"selected":"";t+='<option value="'+i[0]+'" '+r+" >"+i[1]+"</option>"}return t+="</select>"},XCampaign._getTemplateTypeSelect=function(e,a){var t='<select id="advice_container" name="advice_container" data-threadid="'+e+'" onchange="XCampaign._templateChange(this)">';for(var n in XCampaign.template_types){var i=XCampaign.template_types[n],r=a==n?"selected":"";t+=['<option value="',XPLAN.util.escape(n,"xmlq"),'" ',r," >",XPLAN.util.escape(i),"</option>"].join("")}return t+="</select>"},XCampaign._threadDialog=function(e){void 0==e&&(e={id:XCampaign._newCThreadId(),mode:0,relative:1,condition:1e3,threadid:-1,name:"",advice_container:0});var a="<table ><tr><td>"+_("Id")+"</td>",t=e.mode?"none":"";a+='<td><input name="id" type="hidden" value="">'+e.id,a+="</td></tr>",a+="<tr><td>"+_("Mode")+"</td><td>"+XCampaign._getModeSelect(e.mode)+"</td></tr>",a+='<tr id="relative" style="display:'+t+'"><td nowrap>'+_("Days relative <br> to end date")+'</td><td><input name="relative" tabindex="0" value="'+e.relative,a+='" ></td></tr>',a+="<tr><td>"+_("Condition")+"</td><td>"+XCampaign._getConditonSelect(e.condition)+"</td></tr>",a+="<tr><td>"+_("Type")+"</td><td>"+XCampaign._getTemplateTypeSelect(e.threadid,e.advice_container)+"</td></tr>",a+="<tr><td>"+_("Templates")+"</td><td>"+XCampaign._getThreadTemplateSelect(e.threadid,e.advice_container)+"</td></tr>",a+="</table>",PopupForm2.show(a,_("Thread/Case/Lead"),{width:"auto",data:e,onclose:function(e){var a=parseInt(e.relative,10);if(XCampaign.isImmediate(e.mode))a=-1;else if(isNaN(a))return void XCampaign.show_msgbox(_("Days relative to end date must be an integer!"));if(e.threadid>0){var t=XCampaign._findThread(e.id),n=XCampaign._getThreadTemplates(parseInt(e.threadid,10),parseInt(e.advice_container,10));void 0!=t?(t.id=parseInt(e.id,10),t.mode=parseInt(e.mode,10),t.relative=parseInt(a,10),t.condition=parseInt(e.condition,10),t.threadid=parseInt(e.threadid,10),t.name=XCampaign._getThreadName(e.threadid,n),t.advice_container=parseInt(e.advice_container,10)):(void 0==XCampaign.data.thread&&(XCampaign.data.thread=[]),XCampaign.data.thread.push({id:parseInt(e.id,10),mode:parseInt(e.mode,10),relative:parseInt(a,10),condition:parseInt(e.condition,10),threadid:parseInt(e.threadid,10),name:XCampaign._getThreadName(e.threadid,n),advice_container:parseInt(e.advice_container,10)}))}else XCampaign.show_msgbox(_("No thread template specified."),_("Error"));XCampaign._displayThread()}})},XCampaign._outcomeDialog=function(e){void 0==e&&(e={id:XCampaign._newOutcomeId(),name:""});var a="<table ><tr><td>"+_("Id")+'</td><td data-xplan-elem="outcome_id_value"><input name="id" type="hidden" value="'+e.id+'">'+e.id;a+="</td></tr><tr><td>"+_("Name")+'</td><td data-xplan-elem="outcome_name_value"><input name="name" tabindex="0" value="'+e.name+'" ></td></tr></table>',PopupForm2.show(a,_("Outcome"),{width:300,onclose:function(e){if(e.id&&e.name){var a=XCampaign._findOutcome(e.id);void 0!=a?(a.id=parseInt(e.id,10),a.name=e.name):(void 0==XCampaign.data.outcome&&(XCampaign.data.outcome=[]),XCampaign.data.outcome.push({id:parseInt(e.id,10),name:e.name}))}XCampaign._displayOutcome()}})},XCampaign._displayOutcome=function(){if(XCampaign._clearOutcome(),XCampaign.data&&XCampaign.data.outcome)for(var e=document.getElementById("table_outcome"),a=XCampaign.data.outcome,t=0;t<a.length;t++){var n=document.createElement("TR");e.appendChild(n);var i=document.createElement("TD");if(n.appendChild(i),XCampaign.editable){var r='<span class="icon icon-edit" data-xplan-elem="outcome_edit_'+a[t].id+'" onclick="javascript:XCampaign._editOutcome('+a[t].id+');" ></span>&nbsp;';XCampaign._isOutcomeRemovable(a[t].id)?r+='<span class="icon icon-remove" data-xplan-elem="outcome_remove_'+a[t].id+'" onclick="javascript:XCampaign._removeOutcome('+a[t].id+');" ></span>':r+="&nbsp;",i.innerHTML=r,i=document.createElement("TD"),n.appendChild(i)}jQuery(i).text(""+a[t].id),i=document.createElement("TD"),n.appendChild(i),jQuery(i).text(a[t].name)}},XCampaign._getTime=function(e){var a=document.getElementsByName(e);return parseInt(a[0].value,10)+parseInt(a[1].value,10)+parseInt(a[2].value,10)},XCampaignList={},XCampaignList.gotoGroup=function(e,a,t){var n="campaign"==t?"list":"tpllist";window.frames.campaignlist.location.href=getBaseURL()+"/xcampaigns/"+n+"?"+e+"="+a},XCampaignList.deleteCampaign=function(e,a){var t="campaign"==a?_("Are you sure want to remove this campaign?\nAll campaigns per client linked to this campaign will be lost!\n"):_("Are you sure you want to remove this template?");confirm(t)&&XCampaignList.gotoGroup("remove",e,a)},XCampaignList.generateFeedbackCSV=function(){if(XMLRPC.call("xcampaigns.generatefeedbackcsv",[!0])){var e=_("The csv file will be generated asynchronously in the background.\n");e+=_("A message will be sent to you when it has been completed\n and ready for download."),e+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(e)}},XCampaigner={source:1,data:{},role:"",complianceid:null,occurrenceid:null,email_analysis:{}},XCampaigner.entitytypemap={100:"client",200:"user",300:"profadviser",400:"referral",500:"supplier"},XCampaigner.SOURCE_FACTFIND=1,XCampaigner.SOURCE_CAMPAIGN=0,XCampaigner.SOURCE_CLIENTLIST=2,XCampaigner.SOURCE_COMPLIANCE=3,XCampaigner.SOURCE_USERLIST=4,XCampaigner.SOURCE_PROFADVISERLIST=5,XCampaigner.SOURCE_CLIENTLIST_PORTFOLIO=6,XCampaigner.avaiableHandler=function(e,a){if(e.length>=1){var t="<table ><tr><td>"+XPLAN.util.escape(_("Please choose a campaign"))+"</td></tr>";t+='<tr><td><select name="cid" style="width:300px" >';for(var n=0;n<e.length;n++)t+=['<option value="',XPLAN.util.escape(e[n].campaignid,"xmlq"),'" >',XPLAN.util.escape(e[n].title),"</option>"].join("");t+="</select></td></tr></table>",PopupForm2.show(t,_("Add a New Campaign"),{data:{cid:e[0].campaignid},onclose:function(e){if(e.cid){var t={id:-1,campaignid:e.cid};XCampaigner.role&&(t.role=XCampaigner.role),a&&XPLAN.util.update(t,a);var n=XPLAN.util.getURL("/xcampaigns/edit_campaigner/edit",t,!0);getMainFrame(n)}}})}else XCampaign.show_msgbox(_("There is no active campaign to choose"))},XCampaigner.getAvailableCampaigns=function(e){var a=void 0==e?[{}]:[e];XMLRPC.call("xcampaigns.get_available_campaigns",a,function(e){var t={};return void 0!==a[0].entityid&&(t.from_entityid=a[0].entityid),XCampaigner.avaiableHandler(e,t)})},XCampaigner.calculateGST=function(){var e=document.getElementsByName("cost")[0];if(e){var a=document.getElementById("span_gst"),t=parseFloat(e.value);jQuery(a).text(isNaN(t)?": ":": "+XCampaigner.floatToStr(t/1.1))}},XCampaigner.initCost=function(){for(var e=[],a=0;a<XCampaigner.data.costs.length;a++){var t=XCampaigner.data.costs[a];e.push([t[0],t[1]])}var n=!(XCampaigner.allow_edit_cost||0===XCampaigner.data.costs.length),i=document.getElementById("td_cost");i&&(XCampaigner.edit_combo=new XPLAN.MultiCurrency.EditCombo(jQuery(i),"cost",XCampaigner.data.cost,e),XCampaigner.edit_combo.setInputReadOnly(n))},XCampaigner.loadXML=function(e){XCampaigner.data=XMLiser.loadXML(e)},XCampaigner.init=function(e){XCampaigner.source=e,XCampaigner.initEntity(),XCampaigner.initCost(),XCampaigner.initDisabledAttendeesTips(),XCampaigner.initAcceptance(),XCampaigner.onclickAttendees(),XCampaigner.setEntityTypeOnChange()},XCampaigner.validate_attendees=function(){var e=XCampaigner._getAttendees(),a=XCampaigner._getAttendances(),t=XCampaigner._getAcceptances();if(XCampaigner._hasAttendeeOptions()&&0==e.length)return XCampaign.show_msgbox(_("You have not selected an invitee. Please select at least one invitee.")),!1;for(var n=0;n<a.length;n++)if(a[n][2]<-1)return XCampaign.show_msgbox(_("Number of additional attendances must be greater than -1.")),!1;for(n=0;n<t.length;n++)if(1==parseInt(t[n][1],10)&&t[n][2]<-1)return XCampaign.show_msgbox(_("Number of additional acceptances must be greater than -1.")),!1;return!0},XCampaigner.validate=function(){var e=document.getElementsByName("costcode")[0].value;if(isNaN(parseFloat(e)))return XCampaign.show_msgbox(_("Please enter Charge Basis")),!1;var a=document.getElementsByName("salesperson")[0];if(a=parseInt(a.value,10),isNaN(a)||a<0)return XCampaign.show_msgbox(_("Please choose a salesperson.")),!1;var t=document.getElementsByName("cost")[0];if(t=parseFloat(t.value.replace("$","")),isNaN(t))return XCampaign.show_msgbox(_("Please enter cost.")),!1;if(XCampaigner.includeEntityId()&&XCampaigner.entityAlredayAdded)return XCampaign.show_msgbox(_("This entity has already been added to the campaign.")),!1;if(XCampaigner.includeEntityId()&&XCampaigner.getEntityId()<0)return XCampaign.show_msgbox(_("Please select an entity first!")),!1;var n=XCampaigner.data.invoiceid;return XCampaigner.data.campaign_createinvoice=100==XCampaigner.getEntityType()&&XCampaigner.data.id<0&&XCampaigner.autoinvoice&&(n<0||void 0==n),!(XCampaigner.data.campaign_createinvoice&&t<=0)||(XCampaigner.confirmCreateInvoice(),!1)},XCampaigner.confirmCreateInvoice=function(){PopupMsgBox.show_confirm_text(_("Cost is zero. Do you still want to create invoice?"),function(e){XCampaigner.data.campaign_createinvoice=e==_("Yes"),XCampaigner.doSave()})},XCampaigner.setValues=function(){XCampaigner.data=XCampaigner.getValues()},XCampaigner.getValues=function(){var e=jQuery.extend({},XCampaigner.data);e.entitytype=XCampaigner.getEntityType(),e.regodate=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#regodate")),e.attendees=XCampaigner.getAttendees();var a=document.getElementsByName("salesperson")[0];e.salesperson=parseInt(a.value,10);var t=document.getElementsByName("costcode")[0];e.costcode=parseInt(t.value,10);var n=jQuery('input:text[name="cost"]',document).val();e.cost=parseFloat(n.replace("$","")),jQuery('select[name="cost"]').length?e.cost_type=jQuery('select[name="cost"]',document).val():e.cost_type=jQuery('input:hidden[name="cost"]',document).val();var i=document.getElementsByName("outcome")[0];i=parseInt(i.value,10),e.outcome=!isNaN(i)&&i;var r=XCampaigner.getEntityId();r>0&&(e.entityid=r);var o=document.getElementsByName("comment")[0];e.comment=o.value;var m=document.getElementsByName("marketsource")[0];return e.marketsource=parseInt(m.value,10),e.email_subscription_data=XCampaigner.getEmailSubscriptionData(),e},XCampaigner.handleEmailSubscription=function(e){var a=XMLRPC.call("xcampaigns.allow_ea_subscription",[e,XCampaigner.data.campaignid]);jQuery.each(XCampaigner.email_analysis,function(e,t){t.setAllowSubscription(a)})},XCampaigner.getEmailSubscriptionData=function(){var e=[];for(var a in XCampaigner.email_analysis){var t=jQuery('[name="'+("ea_"+a+"_subscribed")+'"]').is(":checked");e.push({provider_name:a,is_subscribed:t,groupings:XCampaigner.email_analysis[a]._getGroupingsData()})}return e},XCampaigner.getAttendees=function(){for(var e=[],a=XCampaigner._getAttendees(),t=XCampaigner._getAttendances(),n=XCampaigner._getAcceptances(),i=0;i<a.length;i++){for(var r=!1,o=0,m=0,s=0,p=0;p<t.length;p++)if(a[i]==t[p][0]){r=t[p][1],o=t[p][2];break}for(p=0;p<n.length;p++){var d=n[p][0],c=n[p][1];if(a[i]==d){m=c,s=1==parseInt(m,10)?n[p][2]:0;break}}e.push({entityid:a[i],attendance:r,acceptance:m,extra_acceptance:s,extra_attendance:o})}return e},XCampaigner._hasAttendeeOptions=function(){return document.getElementsByName("attendees").length>0},XCampaigner._getAttendees=function(){for(var e=[],a=document.getElementsByName("attendees"),t=0;t<a.length;t++)a[t].checked&&e.push(parseInt(a[t].value,10));return e},XCampaigner._getAcceptances=function(){for(var e=[],a=document.getElementsByName("acceptances"),t=0;t<a.length;t++){var n=document.getElementById("extra_"+a[t].id);n=n?parseInt(n.value,10):0,isNaN(n)&&(n=0),e.push([parseInt(a[t].id.replace(a[t].name+"_",""),10),parseInt(a[t].value,10),n])}return e},XCampaigner._getAttendances=function(){for(var e=[],a=document.getElementsByName("attendances"),t=0;t<a.length;t++){var n=parseInt(a[t].value,10),i=document.getElementById("extra_attendances_"+n);i=i?parseInt(i.value,10):0,isNaN(i)&&(i=0),e.push([n,a[t].checked,i])}return e},XCampaigner.doSave=function(){XCampaigner.setValues(),XCampaigner._save(jQuery.isPlainObject(XCampaigner.email_analysis)?void 0:XCampaigner._saveAllEmailAnalysis)},XCampaigner._saveAllEmailAnalysis=function(e,a){for(var t in XCampaigner.email_analysis){if(!XCampaigner.email_analysis[t].save(e))return!1}return a&&a(),!0},XCampaigner.save=function(){EggTimer.show({html:"Saving"});var e=XCampaigner.validate_attendees();e&&(e=XCampaigner.validate())&&(e=XCampaigner.doSave())||EggTimer.hide()},XCampaigner._get_attendee_option=function(){if(XCampaigner.source===XCampaigner.SOURCE_CLIENTLIST||XCampaigner.source===XCampaigner.SOURCE_COMPLIANCE){var e=document.getElementsByName("attendee_option");if(1==e.length){var a=parseInt(e[0].value,10);if(!isNaN(a))return a}}return 0},XCampaigner._save=function(e){var a=!e,t=XMLRPC.call("xcampaigns.save_campaigner",[XCampaigner.data,XCampaigner._get_attendee_option(),a]);if(t.msg)XCampaign.show_msgbox(msg);else{function n(){var e;e=XCampaigner.source==XCampaigner.SOURCE_FACTFIND?XPLAN.util.getURL("/factfind/view/"+XCampaigner.data.entityid,{is_resuming:1},!0):XCampaigner.source==XCampaigner.SOURCE_CAMPAIGN?XPLAN.util.getURL("/xcampaigns/clients",void 0,!0):XCampaigner.source==XCampaigner.SOURCE_COMPLIANCE?XPLAN.util.getURL("/compliance/occurrences/"+XCampaigner.complianceid,{oid:XCampaigner.occurrenceid},!0):XCampaigner.source==XCampaigner.SOURCE_CLIENTLIST_PORTFOLIO?XPLAN.util.getURL(XPLAN.jumpback.get_server_options("clientlist_portfolio").options.backward_url,void 0,!0):XPLAN.util.getURL("/factfind/search/result",a&&t.background?{display_code:"create_clientlist_campaigns"}:void 0,!0),XPLAN.util.form_redirect(e)}t.warning&&alert(t.warning),e?e(t.ids,n):n()}},XCampaigner.changeCampaignId=function(e){var a=parseInt(e,10);isNaN(a)||(XCampaignerList.changeCampaignId(a),window.frames.campaigners.location.href=getBaseURL()+"/xcampaigns/campaigners?campaignid="+e)},XCampaigner.changeCAttendance=function(e){var a=parseInt(e,10);isNaN(a)||(window.frames.campaigners.location.href=getBaseURL()+"/xcampaigns/campaigners?cattendance="+e)},XCampaigner.changeAdviser=function(e){var a=parseInt(e,10);isNaN(a)||(window.frames.campaigners.location.href=getBaseURL()+"/xcampaigns/campaigners?cadviser="+e)},XCampaigner.changeCategory=function(e){var a=parseInt(e,10);isNaN(a)||(window.frames.campaigners.location.href=getBaseURL()+"/xcampaigns/campaigners?ccategory="+e)},XCampaigner.changeAccepted=function(e){var a=parseInt(e,10);isNaN(a)||(window.frames.campaigners.location.href=getBaseURL()+"/xcampaigns/campaigners?caccepted="+e)},XCampaigner.includeEntityId=function(){return XCampaigner.source==XCampaigner.SOURCE_CAMPAIGN&&XCampaigner.data.id<0},XCampaigner.initEntity=function(){if(XCampaigner.includeEntityId()){var e=document.getElementById("div_entity"),a=XCampaigner.getEntityType();a=XCampaigner.entitytypemap[a],XCampaigner.selector=new EntitySelector(e,"entityid","entitytype"),XCampaigner.selector.setFilterShowInvisible(!0),XCampaigner.selector.onchange=function(){var e=XCampaigner.getEntityId();XCampaigner.handleEmailSubscription(e),XCampaigner.retrieveAttendees(e)}}},XCampaigner.getEntityType=function(){var e=document.getElementsByName("entitytype");return parseInt(e[0].value,10)},XCampaigner.setEntityTypeOnChange=function(){XCampaigner.includeEntityId()?jQuery('select[name="entitytype"]').change(function(){var e=XCampaigner.entitytypemap[this.value];XCampaigner.selector.setEntityType(e),XCampaigner.cleanAttendees(),jQuery("#email_subscription").toggle("client"===e)}).change():jQuery('select[name="entitytype"]').prop("disabled","disabled")},XCampaigner.cleanAttendees=function(){var e=document.getElementById("div_attendees");e.innerHTML="",(e=document.getElementById("div_attendances")).innerHTML="",(e=document.getElementById("div_acceptances")).innerHTML=""},XCampaigner.retrieveAttendees_handler=function(e){e.error?(XCampaigner.entityAlredayAdded=!0,XCampaign.show_msgbox(e.error,_("Error"))):e.attendees&&(XCampaigner.entityAlredayAdded=!1,jQuery("#div_attendees").html(e.attendees),jQuery("#div_attendances").html(e.attendances),jQuery("#div_acceptances").html(e.acceptances),XCampaigner.initDisabledAttendeesTips(),XCampaigner.initAcceptance(),XCampaigner.onclickAttendees())},XCampaigner.onclickAttendees=function(){var e=document.getElementsByName("attendances");XCampaigner._onclickAttendees(e);var a=document.getElementsByName("acceptances");XCampaigner._onclickAttendees2(a)},XCampaigner.initAcceptance=function(){jQuery('select[name="acceptances"]').change(function(){XCampaigner._onchangeAcceptance(this)})},XCampaigner.initDisabledAttendeesTips=function(){var e=_("This client has un-subscribed from this type of campaign");jQuery('span[data-xplan-elem="multiple_choice_span_attendees"]').find('input[name="attendees"][disabled="disabled"][type="checkbox"]').prop("title",e).siblings('label[for^="attendees_"]').prop("title",e)},XCampaigner._onchangeAcceptance=function(e){var a=document.getElementById("td_extra_"+e.id);1==parseInt(e.value,10)?jQuery(a).show():jQuery(a).hide()},XCampaigner._onclickAttendees=function(e){for(var a=XCampaigner._getAttendees(),t=0;t<e.length;t++){for(var n=!1,i=0;i<a.length;i++)if(a[i]==e[t].value){n=!0;break}var r=document.getElementById("extra_attendances_"+e[t].value);n?(e[t].disabled=!1,r.disabled=!1):(e[t].disabled=!0,e[t].checked=!1,r.disabled=!0)}},XCampaigner._onclickAttendees2=function(e){for(var a=XCampaigner._getAttendees(),t=0;t<e.length;t++){for(var n=!1,i=0;i<a.length;i++)if(e[t].name+"_"+a[i]==e[t].id){n=!0;break}var r=document.getElementById("extra_"+e[t].id);n?(e[t].disabled=!1,jQuery(e[t]).change()):(e[t].disabled=!0,e[t].selectedIndex=0,jQuery(e[t]).change(),r.value="")}},XCampaigner.retrieveAttendees=function(e){if(e>0)XMLRPC.call("xcampaigns.retrieve_attendees",[XCampaigner.data.campaignid,e],XCampaigner.retrieveAttendees_handler)},XCampaigner.getEntityId=function(){return XCampaigner.selector?XCampaigner.selector.getEntity():-1},XCampaigner.changeCostCode=function(e,a){var t=XMLRPC.call("xcampaigns.set_campaigner",[e,"costcode",parseInt(a,10)]);t&&XCampaign.show_msgbox(t,_("Error"))},XCampaigner.changeMarketSource=function(e,a){var t=XMLRPC.call("xcampaigns.set_campaigner",[e,"marketsource",parseInt(a,10)]);t&&XCampaign.show_msgbox(t,_("Error"))},XCampaigner.changeOutcome=function(e,a){var t=XMLRPC.call("xcampaigns.set_campaigner",[e,"outcome",parseInt(a,10)]);t&&XCampaign.show_msgbox(t,_("Error"))},XCampaigner.changeAttendance=function(e,a){if(XCampaigner.source==XCampaigner.SOURCE_CAMPAIGN)parent.window.location.href=getBaseURL()+"/xcampaigns/clients?change_attendance="+e+"&value="+a;else{var t=XMLRPC.call("xcampaigns.set_campaigner",[e,"attendance",parseInt(a,10)]);t&&XCampaign.show_msgbox(t,_("Error"))}},XCampaigner.expandAttendees=function(e,a){function t(){e.toggleClass("icon16-collapse icon16-expand"),i.toggle(n);try{e.hasClass("icon16-expand")&&parent.XPLAN.ui.IFrameResize("#campaigners",void 0,0)}catch(e){}}var n=!!e.hasClass("icon16-collapse"),i=jQuery('div[data-xplan-elem="entity_expander_'+a+'"]');n?e.data("fetched")?t():XMLRPC.call("xcampaigns.expand_attendees",[a],function(a){e.data("fetched",!0);for(var n,r=["<hr/><ul>"],o=0;o<a.length;o++)n=a[o],r.push(["<li>",XPLAN.util.escape(n.name)," (",XPLAN.util.escape(n.desc),")</li>"].join(""));r.push("</ul>"),i.append(r.join("")),t()}):t()},XCampaignerList={mapping:{},email_analysis:{},selected:{},entityTypes:{}},XCampaignerList.loadCampaignsDict=function(e){XCampaignerList.mapping=XMLiser.loadXML(e)},XCampaignerList.changeCampaignId=function(e){var a=XCampaignerList.mapping[e];jQuery("#span_num_attendees").text(a.remain_attendees+"/"+a.max_attendees)},XCampaignerList.init=function(){var e=document.getElementsByName("c_campaign");1==e.length&&e[0]&&XCampaignerList.changeCampaignId(parseInt(e[0].value,10))},XCampaignerList.printpdf=function(){XMLRPC.call("xcampaigns.printpdf",[],function(e){e&&(msg=_("The report will be generated asynchronously in the background.\n"),msg+=_("A message will be sent to you when it has been completed\n and ready for download."),msg+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(msg))})},XCampaignerList.emailmenu=function(e,a){var t=function(e){return function(){a<0?XCampaign.show_msgbox(_("No campaign has been selected!")):window.parent.location.href=getBaseURL()+"/xcampaigns/emailall?type="+e}},n=[new PopupMenuItem(_("Email Entity"),t("entity"),!1),new PopupMenuItem(_("Email All"),t("all"),!1),new PopupMenuItem(_("Email Invitees"),t("invitee"),!1),new PopupMenuItem(_("Email Non-Invitees"),t("ninvitee"),!1),new PopupMenuItem(_("Email Acceptance"),t("accept"),!1),new PopupMenuItem(_("Email Non-Acceptance"),t("naccept"),!1),new PopupMenuItem(_("Email Attended"),t("attend"),!1),new PopupMenuItem(_("Email Non-Attended"),t("nattend"),!1)];PopupMenu.showByClick(n,e)},XCampaignerList.gotoPage=function(e,a){jQuery("#campaigners",window.parent.document).attr("src",getBaseURL()+"/xcampaigns/campaigners?"+e+"="+a)},XCampaignerList.invoicemenu=function(e,a){var t=[new PopupMenuItem(_("Create Invoice"),function(){XCampaignerList.gotoPage("createinvoice",e)},!1)];PopupMenu.showByClick(t,a)},XCampaignerList.generateCSV=function(){if(XMLRPC.call("xcampaigns.generatecampaignercsv",[])){var e=_("The csv file will be generated asynchronously in the background.\n");e+=_("A message will be sent to you when it has been completed\n and ready for download."),e+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(e)}},XCampaignerList.generateFeedbackCSV=function(){if(XMLRPC.call("xcampaigns.generatefeedbackcsv",[!1])){var e=_("The csv file will be generated asynchronously in the background.\n");e+=_("A message will be sent to you when it has been completed\n and ready for download."),e+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(e)}},XCampaignerList.check_update_dialog_result=function(e){var a={},t=!1,n=jQuery('select[name="attended"]').val(),i=jQuery('select[name="accepted"]').val();if(-1!=n&&(a.attended=parseInt(n,10),t=!0),-2!=i&&(a.accepted=parseInt(i,10),t=!0),t){XMLRPC.call("xcampaigns.updatecampaigners",[a,e],function(e){var a=_("The update will be executed asynchronously in the background.\n");a+=_("A message will be sent to you when it has been completed\n and ready for download."),a+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(a)})}},XCampaignerList.getEntityTypes=function(){return campaigners.getEntityTypes()},XCampaignerList.showUpdateDialog=function(){var e=campaigners.getSelected();if(0!==e.length){var a=getMainFrame();a.XPLAN.XCampaigns||(a.XPLAN.namespace("XCampaigns"),a.XPLAN.namespace("XCampaigns.XCampaignerList")),this.selected=e,a.XPLAN.XCampaigns.XCampaignerList=this;var t=document.getElementsByName("c_campaign");1==t.length&&t[0]&&PopupURL2.show("/xcampaigns/campaigners_power_functions?campaignid="+t[0].value,{width:400,height:520})}else XCampaign.show_msgbox(_("No items are selected!"),_("Warning"))},XCampaignerList.showUpdateDialog1=function(){var e=campaigners.getSelected();if(0!==e.length){var a='<table ><tr><td class="key" >'+_("Attended")+"</td><td>";a+='<select name="attended" ><option value="-1" >'+_("Do not modify")+"</option>",a+='<option value="0" >'+_("Not Attended")+"</option>",a+='<option value="1" >'+_("Attended")+"</option></select></td></tr>",a+='<tr><td class="key" >'+_("Reply")+"</td><td>",a+='<select name="accepted" ><option value="-2" >'+_("Do not modify")+"</option>",a+='<option value="0" >'+_("No Reply")+"</option>",a+='<option value="1" >'+_("Accepted")+"</option>",a+='<option value="-1" >'+_("Not Accepted")+"</option></select></td></tr>",a+="</table>",PopupForm2.show(a,_("Modify entities listed"),{onclose:function(a){var t={},n=!1;if(-1!=a.attended&&(t.attended=parseInt(a.attended,10),n=!0),-2!=a.accepted&&(t.accepted=parseInt(a.accepted,10),n=!0),n){XMLRPC.call("xcampaigns.updatecampaigners",[t,e],function(e){var a=_("The update will be executed asynchronously in the background.\n");a+=_("A message will be sent to you when it has been completed\n and ready for download."),a+=_("You will be notified by the \n bell at the top right hand corner."),XCampaign.show_msgbox(a)})}}})}else XCampaign.show_msgbox(_("No items are selected!"),_("Warning"))},XCampaignEmail.newEmail=function(){PopupURL.showCentre("/xcampaigns/emailnew",400,200,!1)},XCampaignEmail.prototype.makeHTML=function(e){var a=e?'<td><a class="lstbtn" href="javascript:XCampaignEmailList.edit('+this.data.emailid+');" >'+_("Edit")+'</a>&nbsp;<a href="javascript:XCampaignEmailList.remove('+this.data.emailid+');" class="lstbtn" >'+_("Remove")+"</a></td>":"",t=this.data.template,n=XCampaign.mapping.emailmap,i=n.meta[t]&&n.meta[t].is_unviewable?'<td class="campaign_email_tpl_warning_msg"></td>':"<td></td>",r=jQuery("<tr></tr>").append(a);jQuery("<td></td>").append(XPLAN.util.escape(this.data.emailid)).appendTo(r),jQuery("<td></td>").append(XPLAN.util.escape(n.when[this.data.when])).appendTo(r),jQuery(i).append(XPLAN.util.escape(n.template[t])).appendTo(r);return r},XCampaignEmail.prototype.show=function(){var e="/xcampaigns/emailedit?"+XPLAN.util.encodeObject(this.data);PopupURL.showCentre(e,400,200,!1)},XCampaignEmail.createHeaderHTML=function(e){return"<thead><tr>"+(e?'<th width="18%" >'+_("Action")+"</th>":"")+"<th>Id</th><th>"+_("When")+'</th><th width="70%" >'+_("Template")+"</th></tr><thead>"},XCampaignEmailList.prototype.getEmail=function(e){for(var a=0;a<this.list.length;a++)if(e==this.list[a].data.emailid)return this.list[a];return null},XCampaignEmailList.prototype.getRaw=function(){for(var e=[],a=0;a<this.list.length;a++)e.push(this.list[a].data);return e},XCampaignEmailList.prototype.setEmail=function(e){for(var a=0;a<this.list.length;a++)if(e.emailid==this.list[a].data.emailid)return void(this.list[a]=new XCampaignEmail(e));this.list.push(new XCampaignEmail(e))},XCampaignEmailList.prototype.makeTable=function(e,a){var t=XPLAN.util.isString(e)?jQuery("#"+e):e;t.html("");for(var n=jQuery('<table class="list" cellspacing="0" style="width:95%" bgcolor="white" />',document).appendTo(t).append(XCampaignEmail.createHeaderHTML(a)),i=jQuery("<tbody />",document).appendTo(n),r=0;r<this.list.length;r++)i.append(this.list[r].makeHTML(a))},XCampaignEmailList.prototype.remove=function(e){for(var a=[],t=0;t<this.list.length;t++)e!=this.list[t].data.emailid&&a.push(this.list[t]);this.list=a},XCampaignEmailList.loadFromInput=function(){var e=jQuery('input[name="email"]').val();return new XCampaignEmailList(XMLiser.loadXML(e))},XCampaignEmailList.add=function(){XCampaignEmail.newEmail()},XCampaignEmailList.edit=function(e){var a=XCampaignEmailList.loadFromInput().getEmail(e);a&&a.show()},XCampaignEmailList.remove=function(e){var a=XCampaignEmailList.loadFromInput();a.remove(e),jQuery('input[name="email"]').val(XMLiser.dumpXML(a.getRaw())),a.makeTable("EmailTable",!0)},XCampaignEmailList.storeEmail=function(e){var a=XCampaignEmailList.loadFromInput();a.setEmail(e),jQuery('input[name="email"]').val(XMLiser.dumpXML(a.getRaw())),a.makeTable("EmailTable",!0)},XPLAN.namespace("XCampaigns"),XPLAN.namespace("XCampaigns.XCampaignerPowerFunctions"),XPLAN.XCampaigns.XCampaignerPowerFunctions={email_analysis:{}},XPLAN.XCampaigns.XCampaignerPowerFunctions.registerCampaign=function(e){this.campaign_id=e,XPLAN.XCampaigns.XCampaignerPowerFunctions.self=this},XPLAN.XCampaigns.XCampaignerPowerFunctions.init=function(){jQuery("select[name=update_email_analysis]").change(XPLAN.XCampaigns.XCampaignerPowerFunctions.onchangeUpdateEAGrouping).change(),this.initPopupHandler()},XPLAN.XCampaigns.XCampaignerPowerFunctions.initPopupHandler=function(){jQuery("#btn_ok").attr("data-xplan-elem","btn_bulk_update_ajax"),PopupHandler.handleButtonCustom=function(e){return"cancel"==e&&PopupHandler.hide(),!0}},XPLAN.XCampaigns.XCampaignerPowerFunctions.registerEAProvider=function(e,a,t,n){this.campaign_id=t,this.email_analysis[a]={subscription:new XPLAN.EmailAnalysis.Subscription(e,a,"campaign",t,-1,n),subscription_cell:e},this.email_analysis[a].subscription.load(!0)},XPLAN.XCampaigns.XCampaignerPowerFunctions.onchangeUpdateEAGrouping=function(e){var a=1==jQuery(e.currentTarget).val(),t=XPLAN.XCampaigns.XCampaignerPowerFunctions.self;for(var n in t.email_analysis)a?t.email_analysis[n].subscription_cell.show():t.email_analysis[n].subscription_cell.hide()},XPLAN.XCampaigns.XCampaignerPowerFunctions.handleMsg=function(e){"run"==e?PopupMsgBox.show_bgtask_notification(_("The changes against the selected clients will be executed asynchronously in the background.")):PopupMsgBox.show_warning_html("<p>"+XPLAN.util.escape(_("Failed to run the specified changes:"))+"</p>"+e,PopupHandler.hide)},XPLAN.XCampaigns.XCampaignerPowerFunctions.getPowerFunctionsData=function(){var e=getFormPostData(jQuery("#popupform").get(0),!0);for(var a in e.email_analysis_data={},e.entity_types=getMainFrame().XPLAN.XCampaigns.XCampaignerList.getEntityTypes(),e.campaign_id=this.campaign_id,this.email_analysis)e.email_analysis_data[a]=this.email_analysis[a].subscription._getGroupingsData();return e},XPLAN.XCampaigns.XCampaignerPowerFunctions.execPowerFunctions=function(e){XMLRPC.call("xcampaigns.modify_all_campaigners",[e.campaign_id,e,getMainFrame().XPLAN.XCampaigns.XCampaignerList.selected],this.handleMsg,this.handleMsg)};
;Dependency._js['xcampaign']=true;

;
function EntitySearch(t,e,i,n,a,l){a&&(this.EntityEvent=new a(this)),this.parent=t;var r=t.ownerDocument,s=this;this.etypes=i,this.etypeFilterMap={},this.filterElms=new Array,this.selected_group=null,this.valueFilter=l,"undefined"==typeof i&&(i=new Array("client"),n=new Array("user_group"));var h=r.createElement("SELECT");h.name="ff_entity_type";for(var c=0;c<i.length;c++){var o=r.createElement("OPTION");o.value=i[c],o.text=XPLAN.util.capitalize(EntitySearch._etypeMap(i[c])),h.options.add(o);var p=n[c];if(null!=p)for(var y=0;y<p.length;y++)EntitySearch._getFilterData(p[y]);this.etypeFilterMap[i[c]]=p}h.style.margin="0",h.style.padding="0",h.style.width="80px",h.onchange=function(){s._onEntityTypeChange()},t.appendChild(h),1==i.length&&(h.style.display="none"),this.etypeElm=h,this.inputElm=jQuery('<input type="text" id="entity_search_box"/>',r).css({margin:"0",padding:"0",width:"250px"}).focus(function(){s._onSearchFocus()}).keypress(function(t){s._onSearchKeyPress(t)}).appendTo(t);var u=t.appendChild(r.createElement("SELECT"));e&&(u.name=e,u.id=e),this.EntityEvent&&this.EntityEvent.registerSelectChange(u),u.style.display="none",u.style.margin="0",u.style.padding="0",u.style.width="250px",u.onchange=function(){if(""==this.value)return s.value=null,void(s.text=null);s.text=this.options[this.selectedIndex].text,s.value=parseInt(this.value),s.onchange&&s.onchange()},this.selectElm=u;var f=t.appendChild(r.createElement("span"));return f.classList.add("client-search__button"),f.style.cursor="pointer",this.imgElm=f,this.setEntityType(i[0]),this.onchange=null,this}"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("popup"),Dependency.addJS("table"));var EntitySearchData={_filterData:{}},EntitySearchHolder={};EntitySearch._update_filters=function(t,e,i){if(null!==e&&void 0!==e&&i in e)for(var n=0;n<e[i].length;n++){var a=e[i][n];if("op"in a){"_criteria"in t||(t._criteria=[]);var l={field:a.field,op:a.op};"value"in a&&(l.value=a.value),t._criteria.push(l)}else t[a].field=a.value}},EntitySearch._search=function(t,e,i,n,a,l){if(t.match("^\\"+_("[Search "))==_("[Search ")&&(t=""),"client"==e&&!XPLAN.util.trim(t))return i([]);"commpay_adviser"==e?XMLRPC.call("commpay.search_advisers",[t,n],i,HttpRequest.onerror):(a="undefined"==typeof a||a,EntitySearch._update_filters(n,l,e),XMLRPC.call("factfind.searchEntities",[e,t,n,a],i,HttpRequest.onerror))},EntitySearch._getFilterData=function(t){if("undefined"==typeof EntitySearchData._filterData[t]||null==EntitySearchData._filterData[t]){var e=new HttpRequest;try{if(data=e.callRPC("factfind.getChoiceOptions",[t]),data.length>=2)return EntitySearchData._filterData[t]=data,data}catch(t){}return EntitySearchData._filterData[t]=null,null}return EntitySearchData._filterData[t]},EntitySearch._createFilter=function(t,e){var i=EntitySearch._getFilterData(e),n=null;if(null!=i){(n=t.createElement("SELECT")).name="factfindFilter"+i[0],n.style.marginLeft="0",n.style.padding="0",n.style.width="120px",n.className="margin-right--sm",(l=t.createElement("OPTION")).value="",l.text=_("All ")+i[1],n.options.add(l);for(var a=2;a<i.length;a+=2){var l=document.createElement("OPTION"),r=typeof i[a];"number"==(r=r.toLowerCase())&&n.setAttribute("ff_type","intoption"),l.value=i[a],l.text=i[a+1],n.options.add(l),n.value=l.value}}return n},EntitySearch._handleSearch=function(t,e,i,n){var a=[];n.length>1?a.push([-1,"- Select a %s -".replace("%s",EntitySearch._etypeMap(i))]):a.push([-1,"- No %s matches -".replace("%s",EntitySearch._etypeMap(i))]);for(var l=0;l<n.length;l+=2){var r=parseInt(n[l]),s=n[l+1];r>0&&a.push([r,s])}SelectUtil.makeSelect(e,a)},EntitySearch.prototype._handleSearch=function(t){if(EntitySearch._handleSearch(this,this.selectElm,this.etype,t),this._showSelect(),this.showAllOption)for(var e=this.getFilters(),i=0;i<e.length;i++)if(""!=e[i])return this.selectElm.options[0].text="All %ss".replace("%s",XPLAN.util.capitalize(EntitySearch._etypeMap(this.etype))),this.imgElm.style.display="none",void(null!=this.onchange&&this.onchange())},EntitySearch.prototype.setReadonly=function(t){this.etypeElm.disabled=t,this.selectElm.disabled=t;for(var e=0;e<this.filterElms.length;e++)this.filterElms[e].disabled=t;this.imgElm.style.display=t?"none":""},EntitySearch.prototype.setEntity=function(t,e,i){this.setEntityType(t),e>0&&(this._handleSearch([e,i]),this.selectElm.value=e,XPLAN.event.dispatch(this.selectElm,"change"))},EntitySearch.prototype.setFilterPartner=function(t){this.filterPartner=t},EntitySearch.prototype.setShowAllOption=function(t){this.showAllOption=t},EntitySearch.prototype.getEntity=function(){var t=this.selectElm,e=parseInt(t.value);return isNaN(e)||e<0?-1:e},EntitySearch.prototype.getEntityName=function(){var t=this.selectElm;return jQuery(t).find("option:selected").text()},EntitySearch.prototype.getFilters=function(){for(var t=new Array,e=0;e<this.filterElms.length;e++)t.push(this.filterElms[e].value);return t},EntitySearch.prototype.addEntityTypes=function(t,e){for(var i=this.etypeElm,n=0;n<t.length;n++){this.etypes.push(t[n]);var a=this.parent.ownerDocument.createElement("OPTION");a.value=t[n],a.text=XPLAN.util.capitalize(t[n]),i.options.add(a);var l=e[n];if(null!=l)for(var r=0;r<l.length;r++)EntitySearch._getFilterData(l[r]);this.etypeFilterMap[t[n]]=l}i.style.display=""},EntitySearch.prototype.setEntityType=function(t){this.etype=t,found=!1;for(var e=0;e<this.etypes.length;e++)if(t==this.etypes[e]){found=!0,this.etypeElm.value=t;break}found||(t=this.etypes[0],this.etypeElm.value=t),this.etypeElm.onchange()},EntitySearch.prototype._onEntityTypeChange=function(){var t=this;etype=this.etypeElm.value,this.etype=etype;for(var e=0;e<this.filterElms.length;e++)this.parent.removeChild(this.filterElms[e]);if(this.filter=this.etypeFilterMap[this.etype],this.filterElms=new Array,null!=this.filter)for(e=0;e<this.filter.length;e++){var i=EntitySearch._createFilter(this.parent.ownerDocument,this.filter[e]);null!=i&&(i.value="",i.onchange=function(){t._onFilterChange(this)},i.onfocus=function(){t._onSearchFocus()},this.filterElms.push(i))}for(e=0;e<this.filterElms.length;e++)this.parent.insertBefore(this.filterElms[e],this.inputElm.get(0));this.inputElm.val(_("[Search ")+EntitySearch._etypeMap(etype)+_(" name]")).attr("init","").show(),elm=this.selectElm,elm.style.display="none",SelectUtil.clearSelect(elm),elm.onchange(),elm=this.imgElm,elm.className="client-search__search_btn",elm.title="Search",elm.onclick=function(){t._onImgSearch()},elm.ondblclick=function(){t._showSelect()}},EntitySearch.prototype._resetFilters=function(){for(var t=0;t<this.filterElms.length;t++)this.filterElms[t].value=""},EntitySearch.prototype._showSelect=function(){var t=this;this.selectElm.style.display="",this.selectElm.focus(),this.inputElm.removeAttr("disabled").val("").hide(),this.imgElm.className="client-search__edit_btn",this.imgElm.onclick=function(){t._onImgSelect()},this.imgElm.ondblclick=function(){t._onImgSelect()},this.imgElm.title=_("Edit Search Criteria")},EntitySearch.prototype._onImgSelect=function(){var t=this;this.selectElm.value=-1,this.selectElm.onchange(),this.selectElm.style.display="none",this.inputElm.show().focus(),this.imgElm.style.display="",this.imgElm.className="client-search__search_btn",this.imgElm.onclick=function(){t._onImgSearch()},this.imgElm.ondblclick=function(){t._showSelect()},this.imgElm.title=_("Click to Search, Double click to show drop-down")},EntitySearch.prototype._onImgSearch=function(){this.search()},EntitySearch.prototype._onSearchFocus=function(){this.inputElm.attr("init")||this.inputElm.attr("init","1").val("")},EntitySearch.prototype._onSearchKeyPress=function(t){13==t.keyCode&&(t.stopPropagation(),t.preventDefault(),this.search())},EntitySearch.prototype._onFilterChange=function(t){this.filterValue=t.value;var e=this.filterValue,i=this.inputElm.value;"client"==this.etypeElm.value&&(e=i&&XPLAN.util.trim(i)),e?this.search():this._onImgSelect()},EntitySearch.prototype._onSearch=function(){this.imgElm.className="client-search__egg_timer_btn",this.imgElm.onclick=null,this.inputElm.val("Searching...").prop("disabled","disabled")},EntitySearch.prototype.search=function(){for(var t=this.inputElm.val(),e=this,i={},n=0;n<this.filterElms.length;n++){var a=this.filterElms[n];a.value&&("intoption"==a.getAttribute("ff_type")?i[a.name.substring(14)]=parseInt(a.value):i[a.name.substring(14)]=a.value)}null!=this.selected_group&&(i.entity_id=this.selected_group),this._onSearch(),EntitySearch._search(t,this.etype,function(t){e._handleSearch(t)},i,this.filterPartner,this.valueFilter)},EntitySearch.prototype._onHierarchyControlChange=function(t){this.selected_group=t;var e=this.inputElm.val(),i=this,n={};null!=this.selected_group&&(n.entity_id=t),this._onSearch(),EntitySearch._search(e,this.etype,function(t){i._handleSearch(t)},n,this.filterPartner,this.valueFilter)},EntitySearch._etypeMap=function(t){var e={client:_("client"),user:_("user"),group:_("group"),referral:_("referral"),profadviser:_("profadviser"),supplier:_("supplier"),individual:_("individual"),company:_("company"),commpay_adviser:_("CommPay adviser")};return"undefined"===e[t]?t:e[t]};
;Dependency._js['factfind_entity_search']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("model"),jQuery,XPLAN.namespace("XPLAN.docnote").SearchParams=XPLAN.Model.factory.createClass({properties:{list_filters:{},init:function(t){for(var e in this.options=t,this.options){var i=this.options[e];"date_from"!==e&&"date_to"!==e||this.options.date_type||(i=null),this.set_search(e,i)}},set_search:function(t,e){e?this.set_value(t,e):this.unset_value(t)},set_value:function(t,e){this.list_filters[t]=e},get_value:function(t){return this.list_filters[t]},unset_value:function(t){delete this.list_filters[t]},get_filters:function(){return this.list_filters}}}),function(t){XPLAN.namespace("XPLAN.docnote").ViewParams=XPLAN.Model.factory.createClass({properties:{data:{entityid:null,categoryid:null,extra_entityids:[],item_owners:[],from_container_new_item:null,from_container_new_benchmarkable:null,from_container_new_item_benchmark:null,from_container_attachment_note:null,from_container_attachment_note_link_id:-1,tasklinkid:null,in_tpl:!1,noentities:!1,docid:null,returnlocation:null,autotemplate:!1,entitylist:[],subfund:null,superplan_members:null,list_name:null,list_index:null},allow_zero_value:["from_container_new_benchmarkable"],init:function(t){for(var e in t)e in this.data&&("entityid"!=e||this.data[e]>0)&&(this.data[e]=t[e])},get_value:function(t){return this.data[t]},get_data:function(){var e={};for(var i in this.data)(this.data[i]||null!=this.data[i]&&t.inArray(i,this.allow_zero_value)>-1)&&(e[i]=this.data[i]);return e}}})}(jQuery),function(t){var e=XPLAN.namespace("XPLAN.docnote");e.GlobalParams=XPLAN.Model.factory.createClass({properties:{category_rootid:"0000000000000000",category_tempid:"0000000000000001",category_xmergeid:"0000000000000002",options:{view_type:"",categoryid:"",entityid:-1,noentities:!1,has_category_panel:!1,has_entity_panel:!1,has_search:!0,has_list:!0},searchable_fields:["category","entities","unallocated"],init:function(t){XPLAN.util.update(this.options,t),this.search_filters=new e.SearchParams,this.search_filters.init(this.options.search_params?this.options.search_params:{}),this.view_params=new e.ViewParams,this.view_params.init(this.options.view_params?this.options.view_params:{}),this.bookmark_history=[],this.selected_notes=[],this.select_all=!1},reset_selected_notes:function(){this.selected_notes=[],this.select_all=!1},get_value:function(t){return this.options[t]},set_value:function(t,e){this.options[t]=e},unset_value:function(t){delete this.options[t]},set_search_filter:function(t,e){this.search_filters.set_search(t,e)},get_search_filters:function(){var e={};this.has_list&&this.search_filters&&(e=this.search_filters.get_filters()),this.options.entityid>0&&(!e.entities||e.entities.length<1)&&(e.entities=[this.options.entityid],this.options.view_params&&this.options.view_params.item_owners&&this.options.view_params.item_owners.length>0&&(e.entities=this.options.view_params.item_owners));var i=this.options.view_type;return t.inArray(i,["category","client","user","unallocated"])>=0&&("category"===i?!e[i]&&this.options.categoryid&&(e[i]=[this.options.categoryid]):"unallocated"===i?e[i]||(e[i]=this.options.viewtype):e.entities||(e.entities=this.options.viewtype)),e},get_pin_search_filters:function(){var t={};return this.has_list&&this.search_filters&&(t.entities=this.search_filters.get_filters().entities),t},get_pagination_bookmark:function(t){return"prev"===t?this.bookmark_history[this.bookmark_history.length-3]:this.bookmark_history[this.bookmark_history.length-1]},reset_pagination_bookmark:function(){this.bookmark_history=[]},get_categoryid:function(){return this.options.has_category_panel?this.options.categoryid:null},has_list:function(){return this.options.has_list},get_category_popup:function(t,e){return this.get_category_popup_by_catid(this.category_rootid,t,e)},get_view_params:function(){var t=this.view_params.get_data();return this.options.categoryid&&(t.categoryid=this.options.categoryid),this.options.entityid&&this.options.entityid>0&&(t.entityid=this.options.entityid),t},get_category_popup_by_catid:function(t,e,i){var s=this,n=function(){for(var t=new Array([s.category_rootid,"Root"]),e=this.getInvokePath(),n=0;n<e.length-1;n++)e[n]&&e[n]._catid&&t.push([e[n]._catid,e[n]._catname]);i.apply(this,[t])};return function(){for(var a=XMLRPC.call("docnote.listCategories",[t],null,HttpRequest.onerror),o=[new PopupMenuItem(e,n),new PopupMenuSeparator],r=0;r<a.length;r++){var l=a[r],h=s.get_category_popup_by_catid(l.catid,e,i),c=new PopupMenu(h,l.catname);c._catid=l.catid,c._catname=l.catname,o.push(c)}return 0===a.length&&o.push(new PopupMenuItem(_("No sub-category"),null,!0)),o}},has_custom_filter_definition:function(){return this.search_filters.get_value("use_custom_filter_definition")},get_custom_title:function(){return this.has_custom_filter_definition()?this.search_filters.get_value("panel_title"):_("Document List")},get_list_name:function(){return this.view_params.get_value("list_name")},get_list_index:function(){return this.view_params.get_value("list_index")},has_search:function(){return this.options.has_search},unset:function(){this.view_params.unset(),this.options.categoryid="",this.options.entityid=-1}}})}(jQuery);
;Dependency._js['docnote/params']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("popup"),Dependency.addJS("ajax/ajax")),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_item_dialog",create:function(e){this.panel=e,this._load(e)},_load:function(e){var t=this;EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.html,[this.options.data],function(i){EggTimer.hide(),t.panel.html(i.html),t._initEvents(e),t.options.afterload&&t.options.afterload(e)},function(e){EggTimer.hide(),PopupMsgBox.show_error_text(e.message)})},_get_object_data:function(){return XPLAN.util.elem2object(this.panel)},save:function(e,t){var i=this,n=i._get_object_data();this._validate_before_save(e,n)&&(EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.save,[this.options.data,n],function(n){EggTimer.hide(),i._save(e,n,t)},function(e){EggTimer.hide(),PopupMsgBox.show_error_text(e.message)}))},_validate_before_save:function(e,t){return!0},_save:function(e,t,i){t.ok||PopupMsgBox.show_error_text(t.error),i&&i(t)},resize4Dialog:function(e,t,i){var n=this.panel.width(),a=0;this.panel.children().each(function(){a+=jQuery(this).height(),jQuery(this).width()>n&&(n=jQuery(this).width())}),a=this._check_minimum_height(a),this.panel.dialog({width:n+(void 0===t?50:t),height:a+(void 0===i?120:i),position:"center"})},_check_minimum_height:function(e){return e},_initEvents:function(e){}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery),function(e){var t={parent_plugin_name:"xplan_item_dialog",plugin_name:"xplan_item_view",create:function(e){this.panel=e,this._load(e)},_load:function(e){var t=this;EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.html,[this.options.data,!0],function(i){EggTimer.hide(),t.panel.html(i.html),t._initEvents(e),t.options.afterload&&t.options.afterload(e)},function(e){EggTimer.hide(),PopupMsgBox.show_error_text(e.message)})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['ajax/item_dialog']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/ajax"),function(t){var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_column_config",create:function(t){var e=this;this.connection.auto_eggtimer=!0,this.dialog_id=XPLAN.util.get_html_random_id(),e.options.params.popup?t.click(function(n){e._render_html(t)}):e._render_html(t)},_render_html:function(e){var n=this;this.connection.call("get_html_data",[this.options.params]).done(function(i){if(n.options.params.popup){var a=XPLAN.ui.Popup.get_dialog(n.dialog_id);a.html(n.options.template),n._render_rows(e,a,i),n._init_events(e,a),n._show_popup(e)}else e.html(n.options.template),n._render_rows(e,e,i),n.options.params.save_button&&t("button.save_button").click(function(t){n._save(e,e)}),n._init_events(e,e)})},_init_events:function(t,e){},_render_row:function(e,n,i,a){var o=t("<tr/>").appendTo(n).addClass("panel_row");o.css("cursor","pointer"),a.visible&&t("<td/>").addClass("text--align-default").appendTo(o).append(i.visible);var s=t("<td/>").appendTo(o);for(var p in s.append(i.title).append(i.name).append(i.width_type).append(i.align),a)"order"!==p&&"visible"!==p&&"editable"!==p&&t("<td/>").appendTo(o).append(i[p])},_render_rows:function(e,n,i){var a=this,o=i.rows,s=i.config.supported_config_fields,p=t("tbody.panel",n);o.length<15&&t("div:first",n).height("auto"),t(o).each(function(){a._render_row(e,p,this,s)}),"percent"==t('input[name="width_type"]:first',n).val()?t("span.width_type",n).html("%"):t("span.width_type",n).html(""),s.order&&t("tbody.panel",n).sortable({update:function(t,n){a._highlight_rows(e,p)}}).disableSelection(),a._highlight_rows(e,p)},_highlight_rows:function(e,n){t("tr",n).each(function(e,n){e%2==0?t(n).removeClass("item_odd").addClass("item_even"):t(n).removeClass("item_even").addClass("item_odd")})},_save:function(t,e){var n=this,i=n.getData(e);this.connection.call("save",[this.options.params,i]).done(function(t){n.options.after_save&&n.options.after_save()})},getData:function(e){return t("tbody.panel tr.panel_row",e).map(function(){return XPLAN.util.elem2object(this)}).get()},_show_popup:function(t){var e=this,n=XPLAN.ui.Popup.get_dialog(this.dialog_id);n.dialog({title:XPLAN.util.escape(this.options.translated_title),buttons:[{text:"^"+_("Ok"),click:function(){n.dialog("close"),n.dialog("destroy"),e._save(t,n)}},{text:_("Cancel"),click:function(){n.dialog("close"),n.dialog("destroy")}}]})}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery);
;Dependency._js['ajax/column_config']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addJS("ajax/item_dialog"),Dependency.addJS("ajax/column_config")),function(t){var i={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_item_list",item_plugin_name:"xplan_item_dialog",view_plugin_name:"xplan_item_view",add_button_has_dropdown:!1,default_dialog_config:{width:500,height:400},create:function(t){this.options.extra_data={},XPLAN.util.setdefault(this.options.extra_data,{}),this.panel=t,this.options.data.delay_loaded_when_created||this._load(t)},get_add_button:function(i){return t("a.button.add-item",this.panel)},toggle_add_button:function(t,i){this.get_add_button().toggle(i)},reload:function(t){return this._load(t)},get_data:function(){return this.options.data},set_data:function(i,e){t.extend(this.options.data,e)},_update_options_after_load:function(t){this.options.extra_data.item_dialog_options=t.item_dialog_options,this.options.extra_data.config_column_options=t.config_column_options},_load:function(i){var e=this;EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.html,[this.options.data],function(a){if(EggTimer.hide(),e.panel.html(a.html),e._build_menus_for_icons(),e.options.extra_data.orig_item_dialog_options_data={},e._update_options_after_load(a),t.extend(e.options.extra_data.orig_item_dialog_options_data,a.item_dialog_options.data),a.item_dialog_ajax?e.item_plugin_name=a.item_dialog_ajax:e.item_plugin_name="xplan_item_dialog",a.config_column_ajax?e.config_column_plugin_name=a.config_column_ajax:e.config_column_plugin_name="xplan_column_config",e.editItemDialog=t("<div></div>").appendTo(e.panel),e._init_extra_ui(i),e._init_tooltip_div(i),e._initEvents(i),e.options.afterload&&e.options.afterload(),a.error){var n=_("Error: %a").replace("%a",a.error);alert(n)}},function(t){EggTimer.hide();var i=_("Error: %a").replace("%a",t.message);alert(i)})},_generate_pdf:function(t){var i=XPLAN.json.encode(this.options.data),e=this.options.ajax_urls.generate_pdf;XPLAN.util.form_redirect(e+"?option="+XPLAN.util.escape(i,"query"))},_generate_csv:function(){if(XMLRPC.call(this.options.ajax_rpcs.generate_csv,[this.options.data])){var t=_("The csv file will be generated asynchronously in the background. ");t+=_("A message will be sent to you when it has been completed and ready for download. "),t+=_("You will be notified by the bell at the top right hand corner."),PopupMsgBox.show_info_text(t)}},_get_params_from_elem:function(i,e){var a={};return e.closest("tr").find('input[type="hidden"]').each(function(){var i,n=t(this),o=n.attr("name");if(i=o.match(/^ixnp:o=/)?o.replace(/^ixnp:o=.+:f=/,""):o,void 0===a[i]){var _=e.closest("tr").find('input[type="hidden"][name="'+o+'"]');_.length>1?a[i]=t.map(_,function(i,e){return t(i).val()}):a[i]=n.val()}}),a},_get_params_from_evt:function(i,e){return this._get_params_from_elem(i,t(e.target))},_build_menus_for_icons:function(){var i=this;this.options.data.icons_in_menus&&this.options.data.icons_in_menus.length>0&&i.$("table tr").each(function(){var e=t("td:first",this),a=0;t.each(i.options.data.icons_in_menus,function(i,n){var o=t("span.icon-"+n,e);o.length>0&&(o.hide(),a++)}),a>0&&e.prepend('<span class="icon icon-action" data-itemmenu="1" />')}),this.$el.on("click",'span[data-itemmenu="1"]',{},function(e){var a=t(this),n=t.map(i.options.data.icons_in_menus,function(t){var i=a.siblings("span.icon-"+t);return new PopupMenuItem(i.attr("title"),function(){i.click()})});PopupMenu.showByClick(n,e)})},_initEvents:function(i){var e=this;if(e._beforeInitEvents(i),t("span.icon-remove",e.panel).bind("click",function(t){t.stopPropagation();var a=e._get_params_from_evt(i,t);e._removeItem(i,a)}),t("span.icon-edit",e.panel).bind("click",function(t){t.stopPropagation();var a=e._get_params_from_evt(i,t);e._editItem(i,a)}),t("span.icon-view",e.panel).bind("click",function(t){t.stopPropagation();var a=e._get_params_from_evt(i,t);e._viewItem(i,a)}),e.get_add_button().bind("click",function(t){e._addItem(i,this)}).addClass(e.add_button_has_dropdown?"dropdown":void 0),t("a.button.previous",e.panel).bind("click",function(a){t(this).unbind("click"),e._go(i,-1)}),t("a.button.next",e.panel).bind("click",function(a){t(this).unbind("click"),e._go(i,1)}),t("a.button.pdf",e.panel).bind("click",function(t){e._generate_pdf(i)}),t("a.button.csv",e.panel).bind("click",function(t){e._generate_csv(i)}),e.options.data.allow_config_column){var a="item list column config changed",n=e.options.extra_data.config_column_options,o=e.config_column_plugin_name;n.after_save=function(){XPLAN.event.send(a)},t("a.config_button.config",e.panel)[o](n),XPLAN.event.listen(a,function(){e._load(i)})}e.options.data.allow_sort&&t("th.sortable",e.panel).click(function(a){e._sort(i,t(a.target))});for(var _=0;_<e.options.data.list_editable_fields.length;_++){var l=e.options.data.list_editable_fields[_];jQuery(':input[name="'+l+'"]',e.panel).bind("change",function(t){e._onChangeField(i,t)})}e._initExtraEvents(i)},_onChangeField:function(t,i){var e=jQuery(i.target),a=this._get_params_from_evt(t,i),n={};n[e.attr("name")]=e.val(),this._updateItem(t,a,n)},_updateItem:function(t,i,e){var a=this;XMLRPC.call(this.options.ajax_rpcs.update_item,[a.options.data,i,e],function(i){if(i.ok)a.reload(t);else{var e=_("Error: %a").replace("%a",i.error);alert(e)}},function(t){var i=_("Error: %a").replace("%a",t.message);alert(i)})},_init_extra_ui:function(t){},_init_tooltip_div:function(i){if(!(t("#info-div").length>0)){var e=this.$('table[data-xplan-elem="list_table"]');t('<div id="info-div" style="display:none; padding:2px; width:250px;\n                       position:absolute; background-color:#eeeeee; border:solid 1px;\n                       text-align:left;z-index:0;white-space:normal;word-wrap:break-word;"></div>').insertBefore(e)}},_beforeInitEvents:function(t){},_initExtraEvents:function(t){},_go:function(t,i){this.options.data.current_page+=i,this._load(t)},_sort:function(i,e){var a=t('input[type="hidden"][name="sort_field"]',e).val();e.hasClass("sortable-asc")?(this.options.data.sort_by=a,this.options.data.sort_dir=!0):(this.options.data.sort_by=a,this.options.data.sort_dir=!1),this.options.data.current_page=0,this._load(i)},_addItem:function(t){this._editItem(t)},_prepareEditItemParams:function(t,i){var e={};return XPLAN.util.update(e,this.options.extra_data.item_dialog_options),e.data={},XPLAN.util.update(e.data,this.options.extra_data.item_dialog_options.data),XPLAN.util.update(e.data,i),e},_editItem:function(i,e){var a=this,n=a._prepareViewItemParams(i,e),o=e&&e.dialog_title||"",l=a.options.data.list_title;l||(l=""),o||(o="undefined"!=typeof e?XPLAN.util.escape(_("Edit Existing %a").replace("%a",l)):XPLAN.util.escape(_("Add New %a").replace("%a",l))),n.afterload=function(e){a.editItemDialog.dialog({buttons:[{click:function(){t(a.editItemDialog)[a.item_plugin_name]("save",function(e){e.ok&&(a._handleEditItem(i,e),i&&i.trigger("xevent_on_add_item"),t(a.editItemDialog).dialog("close"))})},text:"^"+_("Ok"),"data-xplan-elem":"btn_ok"},{click:function(){t(this).dialog("close")},text:_("Cancel"),"data-xplan-elem":"btn_cancel"}],title:o,width:a.default_dialog_config.width,height:a.default_dialog_config.height,modal:!0,close:function(t,i){a.editItemDialog.html(""),a.editItemDialog.dialog("destroy")},open:function(t,i){a._build_extra_ui_item_dialog(t,i,a.editItemDialog)}}),t(a.editItemDialog).dialog().parent("div").attr("data-xplan-elem","item_list_dialog"),t(a.editItemDialog).dialog().parent("div").css("overflow","visible"),t(a.editItemDialog).dialog().css("overflow","visible"),a._resize_for_dialog()},a.editItemDialog[a.item_plugin_name](n)},_prepareViewItemParams:function(t,i){return this._prepareEditItemParams(t,i)},_viewItem:function(i,e){var a,n=this,o=n._prepareViewItemParams(i,e),l=n.options.data.list_title;l||(l=""),a=XPLAN.util.escape(_("View %a").replace("%a",l)),o.afterload=function(i){n.editItemDialog.dialog({buttons:[{click:function(){t(this).dialog("close")},text:_("Close")}],title:a,width:500,height:400,modal:!0,close:function(t,i){n.editItemDialog.html("")}}),t(n.editItemDialog)[n.view_plugin_name]("resize4Dialog")},n.editItemDialog[n.view_plugin_name](o)},_handleEditItem:function(t,i){this._load(t)},_removeItem:function(t,i){var e=this,a=!0;e.options.data.confirm_remove&&(a=confirm(e.options.data.confirm_remove_msg)),a&&(EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.remove_item,[this.options.data,i],function(i){EggTimer.hide(),e._handleRemoveItem(t,i),t&&t.trigger("xevent_on_remove_item")},function(t){EggTimer.hide();var i=_("Error: %a").replace("%a",t.message);alert(i)}))},_handleRemoveItem:function(t,i){if(i.ok)this._load(t);else{EggTimer.hide();var e=_("Error: could not remove item.");alert(e)}},_resize_for_dialog:function(){t(this.editItemDialog)[this.item_plugin_name]("resize4Dialog")},_build_extra_ui_item_dialog:function(t,i,e){}};XPLAN.namespace("XplanAjax").createClass(i)}(jQuery);
;Dependency._js['ajax/item_list']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/item_list"),function(e){var n={parent_plugin_name:"xplan_item_list",plugin_name:"xplan_docnote_prod_list",_initExtraEvents:function(n){e("span.icon-remove",this.panel).attr("title","Remove Product Association")},_removeItem:function(e,n){e.find('input[name="item_index"][value='+n.item_index+"]").closest("tr").remove(),XPLAN.event.send("xevent_prods_linked_changed")}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['docnote/docnote_product_list']=true;

;
XPLAN.namespace("docnote.container"),jQuery.extend(XPLAN.docnote.container,{_data:{},set_data:function(e){this._data=e},display:function(e,t){jQuery(e).html(this._data.html.threadid),this._data.html.container_benchmarkable&&jQuery(e).append(this._data.html.container_benchmarkable),jQuery("input,select",e).prop("disabled",!t)},get_benchmarkable:function(e){var t=parseInt(jQuery('input[name="container_benchmarkable"]',e).val(),10);return isNaN(t)&&(t=1),t},get_container_ids:function(e){return jQuery('select[name="threadid"] option[value!=""]:selected,input[name="threadid"]:checked',e).map(function(){return parseInt(this.value,10)}).get()},get_data:function(){return XPLAN.util.update({},this._data.data)}});
;Dependency._js['docnote/container']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("table"),function(e){var t=function(e){return this.init(e||this.default_options),this};t.default_options={container_id:"container",select_name_type:"type",select_name_subtype:"subtype",multi:!1},t.prototype={init:function(e){this.options=e,this._init_type()},_get_select_element:function(e){return(XPLAN.util.isString(this.options.container_id)?jQuery("#"+this.options.container_id):this.options.container_id).find('select[name="'+e+'"]')},_init_type:function(){var e=this,t=this._get_select_element(this.options.select_name_type);if(!t.data("docnote.dependency")&&XPLAN.docnote.dependency.Type.dependency_map&&!jQuery.isEmptyObject(XPLAN.docnote.dependency.Type.dependency_map)){var n=this._get_select_element(this.options.select_name_subtype),i=this._get_select_element("permission"),s=n.val(),p=i.val();t.bind("change",function(){e._handle_type_change(this)}).change(),n.val()!==s&&n.val(s),i.val()!==p&&i.val(p),t.data("docnote.dependency",!0)}},_get_dependent_subtypes:function(e){var t=jQuery(e).val();if(!t)return this.options.subtype_blank_if_type_blank?[]:XPLAN.docnote.dependency.Type.all_subtypes;this.options.multi||(t=[t]);var n=[],i=[];return jQuery.each(t,function(e,t){dependents=XPLAN.docnote.dependency.Type.dependency_map[t],dependents&&jQuery.each(dependents,function(e,t){-1==jQuery.inArray(t.toString(),n)&&(i.push(t),n.push(t.toString()))})}),i},_handle_type_change:function(e){var t=this._get_dependent_subtypes(e),n=this._get_select_element(this.options.select_name_subtype);SelectUtil.makeSelect(n.get(0),t),n.trigger("change"),n.trigger("liszt:updated")}},XPLAN.namespace("docnote.dependency"),XPLAN.docnote.dependency.Type=function(e){return new t(e)}}(jQuery,XPLAN);
;Dependency._js['docnote/dependency']=true;

;
function DocPriv(){this.owner_edit=0,this.owner_delete=0,this.owner_delete_attach=0,this.lock_on_save=0,this.creator=0,this.editor=0,this.order=DocPriv.order,this.constant=DocPriv.constant,this.desc=DocPriv.desc}DocPriv.order=["owner_edit","owner_delete","owner_delete_attach"],DocPriv.constant={owner_edit:1,owner_delete:2,owner_delete_attach:4,lock_on_save:8},DocPriv.desc={owner_edit:"Owner Edit Only",owner_delete:"Owner Delete Only",owner_delete_attach:"Owner Delete Attachment Only",lock_on_save:"Lock Note on Save"};var CatPriv=function(){this.owner_edit=0,this.owner_delete=0,this.owner_delete_attach=0,this.lock_on_save=0,this.creator=0,this.editor=0,this.order=CatPriv.order,this.constant=CatPriv.constant,this.desc=CatPriv.desc,this.published=!1};CatPriv.order=["owner_edit","owner_delete"],CatPriv.constant={owner_edit:1,owner_delete:2},CatPriv.desc={owner_edit:_("Owner Edit Only"),owner_delete:_("Owner Delete Only")},CatPriv.prototype=new DocPriv,DocPriv.prototype.isOwnerEditing=function(){return this.creator==this.editor},DocPriv.prototype.allow_delete=function(){return this.isOwnerEditing()||!this.owner_delete},DocPriv.prototype.allow_edit=function(){return this.isOwnerEditing()||!this.owner_edit},DocPriv.prototype.refinePriv=function(){if(this.lock_on_save)for(var t in this.constant)"lock_on_save"!=t&&(this[t]=0)},DocPriv.prototype.setEditPriv=function(t){for(var e in this.constant)this[e]=t&this.constant[e];this.refinePriv()},DocPriv.prototype.getEditPriv=function(){this.refinePriv();var t=0;for(var e in this.constant)t+=this[e];return t},DocPriv.prototype.setPublished=function(t){this.published=t},DocPriv.prototype.setEditPrivFromList=function(t){var e=0;if(t){XPLAN.util.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++)e+=parseInt(t[i])}this.setEditPriv(e)},DocPriv.prototype.getHTML=function(t){for(var e="",i=t?" ":' enabled="enabled" ',o=this.published?'disabled="disabled"':" ",r=0;r<this.order.length;r++){var n=this.order[r];this.published&&"owner_delete"==n||(e+='<input type="checkbox" id="edit_priv_'+this.constant[n]+'" name="edit_priv" value="'+this.constant[n]+'" '+(this[n]?'checked="checked"':"")+i+o+'/> <label for="edit_priv_'+this.constant[n]+'">'+this.desc[n]+"</label><br/>")}return e},DocPriv.prototype.showEditPriv=function(t){var e=this.allow_edit();void 0!=t&&(e=e&&!t);var i=this.getHTML(e),o=this,r={buttons:null,title:XPLAN.util.escape(_("Document Edit Privilege")),height:140,width:260,modal:!0,autoOpen:!1};t||(r.buttons={Cancel:function(){jQuery(this).dialog("close")},"^Ok":function(){var t=getFormPostData(jQuery("form",this).get(0),!0);o.setEditPrivFromList(t.edit_priv),jQuery(this).dialog("close")}},r.height=160);var n=jQuery("#dlg-docpriv");0===n.length?n=jQuery('<div id="dlg-docpriv"></div>').appendTo(jQuery("body")):n.empty(),jQuery("<form>"+i+"</form>").appendTo(n),n.dialog(r).dialog("open")},DocPriv.prototype.lock_docnote=function(t){var e=this.getEditPriv();t?e|=this.constant.lock_on_save:e&=~this.constant.lock_on_save,this.setEditPriv(e)},DocPriv.prototype.is_docnote_locked=function(){return this.getEditPriv()&this.constant.lock_on_save};
;Dependency._js['docnote/docpriv']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/ajax"),function(t){var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_templates",create:function(t){this._render(t)},_get_subject_text:function(t){return t||_("Not Selected")},_render:function(e){var a=this,n=['<button type="button" >',XPLAN.util.escape(a._get_subject_text(this.options.doc_subject)),"</button>",'<input type="hidden" name="',XPLAN.util.escape(this.options.name,"xmlq"),'" value="',XPLAN.util.escape(this.options.docid,"xmlq"),'" ></input>'].join("");e.html(n),t("button",e).click(function(n){window.set_note_template=function(n,i){t("button",e).text(a._get_subject_text(i)),t("input",e).val(n||"")},PopupURL2.show("/docnote/list_templates?task=1",{width:400,height:360,centre:!0})})}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery),function(t){var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_templates_list",create:function(e){this.parent_elm=e,this.elm=t("div.list_template_dialog",this.parent_elm),0===this.elm.length?this.elm=t('<div class="list_template_dialog"></div>').appendTo(this.parent_elm):this.elm.empty(),this.selected_cat=[],this.elm.hide().html(this.options.html),this._init()},_init:function(){var t=this;t._load_docs(null,function(){t.elm.dialog({title:XPLAN.util.escape(t._get_title()),dialogClass:"dialog__note-template-list",resizable:!1,close:function(){t.elm.remove()},modal:!0}),t._handle_button()}),this.callbacks={}},setCallback:function(t,e,a){this.callbacks[e]=a},_handle_button:function(){var e=this;t("a.button.clear").on("click",function(){e.callbacks.clearTemplate(),e.elm.dialog("close")}),t("a.button.back").click(function(){if(e.selected_cat.length>0){var t=e.selected_cat.pop();e._load_docs(t.parentid)}}),t("a.button.cancel").click(function(){e.elm.dialog("close")})},_handle_list_docs:function(e){var a=this,n=t("tbody.doclist",a.elm).empty();a.options.mode;var i=function(){t(this).data("doc").catid?a._select_category(t(this)):a._select_template(t(this))};for(var l in e){var c=e[l],o=t("<tr></tr>").appendTo(n);t('<td width="30%">%t</td><td class="docnote_subject">%n</td>'.replace("%t",c.catid?'<img src="'+getBaseURL()+'/img/treectrl/fc.png"/>':c.type).replace("%n",XPLAN.util.escape(c.catid?c.name:c.subject))).appendTo(o),o.data("doc",c),o.click(i)}},_select_category:function(t){var e=this,a=t.data("doc");e._load_docs(t.data("doc").catid,function(){e.selected_cat.push(a)})},_select_template:function(t){var e=t.data("doc").docid;this.callbacks.selectTemplate?this.callbacks.selectTemplate(e):this.parent_elm[this._get_docnote_edit_ajax()]("load_from_template",e),this.elm.dialog("close")},_get_docnote_edit_ajax:function(){return this.options.docnote_edit_ajax?this.options.docnote_edit_ajax:"xplan_docnote_edit"},_get_title:function(){return""===this.mode?_("Select a template"):_("Load Template into New Document")},_load_docs:function(t,e){var a=this;XMLRPC.call(a.options.ajax_rpcs.load_templates,[t],function(t){a._handle_list_docs(t.docs),e&&e()},HttpRequest.onerror)},_get_subject_text:function(t){return t||_("Not Selected")}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery);
;Dependency._js['docnote/templates']=true;

;
function DiaryDateBar(t){this.param=t||{},this.textid=""+Math.random()}function DiaryScheduleUtil(){}function DiaryScheduleTitle(t){this.panel=t,this.id=""+Math.random()}function DiaryScheduleRow(t,e,i){this.id=""+Math.random(),this.panel=t,this.index=e,this.blocks=[],this.styleblock=i}function DiaryScheduleRows(t){this.panel=t,this.default_rows=12,this.rows=this.initRows(),this.top_row=DiaryScheduleRow.getRow(this.panel,0,!0)}function DiarySchedule(){}function DiaryTimeSurface(t,e,i,a){this.panel=t,this.selector=e,this.mode=i,this.util=e.data.util,this.bg=this.makeSurface(),this.state={position:"",updown:"up",initialX:-1,origin:{start:this.selector.getStartTime(),end:this.selector.getEndTime()}},this.modified=a}function DiaryTimeSelector(t,e){this.panel=t,this.change=e}"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("datefield")),DiaryDateBar.prototype.init=function(t){for(var e in this.panel=jQuery("#"+t.parent),t)this.param[e]=t[e]},DiaryDateBar.prototype.format_date=function(t){var e=t||this.param.eventdate;return XPLAN.DateTimeUtil.strftime("%d %b %Y",XPLAN.DateTimeUtil.intToDate(e,0))},DiaryDateBar.prototype.format_time=function(t){return t?XPLAN.DateTimeUtil.strftime("%I:%M %p",t):""+t},DiaryDateBar.prototype.getDateElem=function(){return this.spans.eq(0)},DiaryDateBar.prototype.getStartElem=function(){return this.spans.eq(1)},DiaryDateBar.prototype.getEndElem=function(){return this.spans.eq(2)},DiaryDateBar.prototype.updateTime=function(t,e){this.getStartElem().text(this.format_time(t)),this.getEndElem().text(this.format_time(e))},DiaryDateBar.prototype.updateDate=function(t){t&&(this.param.eventdate=t),this.getDateElem().text(this.format_date())},DiaryDateBar.prototype.makeBar=function(){var t='<table width="100%" ><tr><td><button type="button">Previous</button>';t+='</td><td width="60%" align="center"><span />&nbsp;&nbsp;<span />-<span /></td>',t+='<td><button type="button">Next</button></td></tr>',t+="</table>",this.panel.append(t),this.spans=this.panel.find("td").eq(1).children("span"),this.attachEvent()},DiaryDateBar.prototype.attachEvent=function(){if(this.param.change){var t=this,e=this.panel.find("td");e.eq(0).click(function(){t.param.change(-1)}),e.eq(2).click(function(){t.param.change(1)})}},DiaryDateBar.prototype.display=function(t){this.init(t),this.makeBar(),this.updateDate()},DiaryScheduleUtil.getLength=function(t){var e=t;return e=e?parseInt(e.replace("px","")):0},DiaryScheduleUtil.prototype.init=function(t){this.param=t},DiaryScheduleUtil.prototype.getW=function(t,e){var i=this.getX(t);return this.getX(e)-i},DiaryScheduleUtil.prototype.getX=function(t){return t.getHours()*(this.param.one_hour_width+2*this.param.border_width)+t.getMinutes()*(1*this.param.one_hour_width/60)},DiaryScheduleUtil.prototype.getY=function(t){return t*(this.param.height+2*this.param.border_width)},DiaryScheduleUtil.prototype.getTime=function(t){var e=1*t/(1*(this.param.one_hour_width+2*this.param.border_width)/60);return new Date(2009,0,1,0,e,0)},DiaryScheduleUtil.prototype.getNearTimeByX=function(t){var e=this.getTime(t);return this.getNearTime(e)},DiaryScheduleUtil.prototype.getNearTime=function(t){var e=t.getMinutes(),i=t.getHours(),a=e;return e>=0&&e<=7.5?a=0:e>7.5&&e<=22.5?a=15:e>22.5&&e<=37.5?a=30:e>37.5&&e<=52.5?a=45:e>52.5&&e<60&&(i<23?(i+=1,a=0):a=59),new Date(t.getFullYear(),t.getMonth(),t.getDate(),i,a,0)},DiaryScheduleUtil.prototype.getRectangle=function(t,e,i){var a=this.getX(e),r=this.param.useDefaultWidth?this.param.one_hour_width:this.getW(e,i);return[a,this.param.starty+this.getY(t)+this.param.top_bottom_padding,r,this.param.height-2*this.param.top_bottom_padding]},DiaryScheduleUtil.prototype.getStyle=function(t,e,i,a){var r=this.getRectangle(t,e,i),o=a?this.param["backgroundcolor_"+a]:this.param.backgroundcolor,s=(a?this.param["zindex_"+a]:this.param.zindex,"position:absolute;font-size:10%;top:"+r[1]+"px;left:"+r[0]+"px;width:"+(r[2]-3)+"px;height:"+r[3]+"px;background-color:"+o);return s+=";z-index:"+this.param.zindex,s+=";border:"+this.param.border_width+"px solid transparent;"};var diary_schedule_background=new DiaryScheduleUtil;diary_schedule_background.init({one_hour_width:30,useDefaultWidth:!0,starty:29,height:29,backgroundcolor:"White",border_width:.1,zindex:50,top_bottom_padding:2,"width-padding":3});var diary_schedule_block=new DiaryScheduleUtil;diary_schedule_block.init({one_hour_width:30,useDefaultWidth:!1,starty:29,height:29,backgroundcolor_busy:"blue",backgroundcolor_slot:"green",backgroundcolor:"blue",border_width:.1,zindex:100,zindex_slot:101,zindex_busy:102,top_bottom_padding:5,"width-padding":0});var diary_schedule_top=new DiaryScheduleUtil;diary_schedule_top.init({one_hour_width:30,useDefaultWidth:!1,starty:15,height:20,backgroundcolor:"blue",backgroundcolor_busy:"blue",backgroundcolor_slot:"green",border_width:.1,zindex:100,zindex_slot:101,zindex_busy:102,top_bottom_padding:5,"width-padding":0}),DiaryScheduleTitle.prototype.ElementHTML=function(t,e){var i=diary_schedule_background.getX(t);return'<span name="'+this.id+'" style="position:absolute;font-size:80%;top:0px;left:0'+i+"px;width:"+diary_schedule_background.getW(t,e)+'px" >'+t.getHours()+"</span>"},DiaryScheduleTitle.prototype.display=function(){for(var t=0;t<24;t++){var e=new Date(2009,0,1,t,0,0),i=new Date(2009,0,1,t,59,59),a=this.ElementHTML(e,i);this.panel.append(a)}},DiaryScheduleTitle.prototype.setTop=function(t){var e=this.panel.children('span[name="'+this.id+'"]');e.css("top",t),e.css("z-index",200)},DiaryScheduleRow.getRow=function(t,e,i){return new DiaryScheduleRow(t,e,i?diary_schedule_top:diary_schedule_block)},DiaryScheduleRow.prototype.getTimeRange=function(){return this.blocks},DiaryScheduleRow.prototype._getSpans=function(){return this.panel.children('span[name="'+this.id+'"]')},DiaryScheduleRow.prototype._createBlock=function(t,e,i){var a=this.styleblock.getStyle(this.index,t,e,i);return'<span name="'+this.id+'" style="'+a+'" >&nbsp;</span>'},DiaryScheduleRow.prototype._displayBlock=function(){for(var t=this.blocks,e=this._getSpans(),i=0;i<e.length;i++)if(i<t.length){var a=this.styleblock.getStyle(this.index,t[i][0],t[i][1],t[i][2]);e.eq(i).attr("style",a)}else e.eq(i).hide();for(i=e.length;i<t.length;i++){var r=this._createBlock(t[i][0],t[i][1],t[i][2]);this.panel.append(r)}},DiaryScheduleRow.prototype.setTimeRange=function(t){this.blocks=t,this._displayBlock()},DiaryScheduleRow.prototype.BackgroundElementHTML=function(t,e){return'<span style="'+diary_schedule_background.getStyle(this.index,t,e)+'" >&nbsp;</span>'},DiaryScheduleRow.prototype.displayBackground=function(){for(var t=0;t<24;t++){var e=new Date(2009,0,1,t,0,0),i=new Date(2009,0,1,t,59,59),a=this.BackgroundElementHTML(e,i);this.panel.append(a)}},DiaryScheduleRows.prototype.length=function(){return this.rows.length},DiaryScheduleRows.prototype.initRows=function(){for(var t=[],e=0;e<this.default_rows;e++)t.push(DiaryScheduleRow.getRow(this.panel,e,!1));return t},DiaryScheduleRows.prototype.addRow=function(t){if(t>=this.rows.length-1){var e=DiaryScheduleRow.getRow(this.panel,this.rows.length,!1);this.rows.push(e),e.displayBackground()}},DiaryScheduleRows.prototype.displayBackground=function(){for(var t=0;t<this.rows.length;t++)this.rows[t].displayBackground()},DiaryScheduleRows.prototype.totalBlocks=function(){for(var t=[],e=0;e<this.rows.length;e++)for(var i=this.rows[e].blocks,a=0;a<i.length;a++)t.push(i[a]);return t},DiaryScheduleRows.prototype.setTimeRange=function(t,e){t<this.rows.length&&t>=0&&this.rows[t].setTimeRange(e),this.top_row.setTimeRange(this.totalBlocks())},DiarySchedule.prototype.init=function(t){this.param=t,this.panel=jQuery("#"+t.parent),this.initCss(),this.initBackground(),this.title=new DiaryScheduleTitle(this.panel),this.rows=new DiaryScheduleRows(this.panel),this.selector=this.makeSelector(),this.surface=this.makeSurface()},DiarySchedule.prototype.setTime=function(t,e){this.selector.setStartTime(100*t),this.selector.setEndTime(100*e),this.selector.move()},DiarySchedule.prototype.makeSelector=function(){var t=new DiaryTimeSelector(this.panel,this.param.change);return t.init({}),t.hide(),t},DiarySchedule.prototype.makeSurface=function(){return new DiaryTimeSurface(this.panel,this.selector,this.param.mode,this.param.modified)},DiarySchedule.prototype.initBackground=function(){var t=this.panel.css("width");t&&(t=t.replace("px",""))},DiarySchedule.prototype.initCss=function(){for(var t in this.param.css)this.panel.css(t,this.param.css[t])},DiarySchedule.prototype.getDate=function(){},DiarySchedule.prototype.setDate=function(t){},DiarySchedule.prototype.display=function(){this.title.display(),this.rows.displayBackground(),this.selector.display()},DiarySchedule.prototype.setParentScollTop=function(t){this.panel.attr("scrollTop",t),this.title.setTop(t),this.selector.setTop(t),this.surface.setTop(t)},DiarySchedule.prototype.updateRow=function(t,e,i,a,r){var o=this;this.checkEntity(0,e,i,a,r,function(i){return o.adjustLocationsPlain(e),o.handleAvailable(t,i.eventdate,e,i.data)})},DiarySchedule.prototype.updateAll=function(t,e,i,a,r,o){var s=this;0!=a&&this.checkEntity(t,e,i,a,r,function(t){for(var i=0;i<e.length;i++){var a=[e[i]];s.adjustLocationsPlain(a),s.handleAvailable(parseInt(i,10),t.eventdate,a,t.data,o)}})},DiarySchedule.prototype.adjustLocationsPlain=function(t){var e=this.get_entities_resources(t).locations,i=jQuery('input[name="locations_plain"]').val();try{XPLAN.net.makeRequest("diary.adjust_locations_plain",[e,i],function(t){jQuery('input[name="locations_plain"]').val(t)},function(t){alert(_("%a").replace("%a",t))})}catch(t){alert(_("Error: %a").replace("%a",t.message))}},DiarySchedule.prototype.get_entities_resources=function(t){for(var e=[],i=[],a=[],r=0;r<t.length;r++)"resource"===t[r].etype?i.push(t[r].value):"location"===t[r].etype?a.push(t[r].value):e.push(t[r].value);return{entityids:e,resources:i,locations:a}},DiarySchedule.prototype.checkEntity=function(t,e,i,a,r,o){var s=t||0,n=this.get_entities_resources(e);try{XPLAN.net.makeRequest("diary.checkAvailable",[i,a,s,r,n.entityids,[],n.locations,n.resources],o,function(t){alert(_("%a").replace("%a",t))})}catch(t){alert(_("Error: %a").replace("%a",t.message))}},DiarySchedule.prototype.makeBlock=function(t,e){return[new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.starttime/100,e.starttime%100,0),new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.endtime/100,e.endtime%100,0),e.type]},DiarySchedule.prototype.makeBlocks=function(t,e){for(var i=[],a=0;a<e.length;a++){var r=this.makeBlock(t,e[a]);r[1]>r[0]&&i.push(r)}return i},DiarySchedule.prototype.clearBlocks=function(t,e,i,a,r){for(var o=0;o<this.rows.length();o++)this.rows.setTimeRange(o,[])},DiarySchedule.prototype.isEntity=function(t){return"resource"!==t&&"location"!==t},DiarySchedule.prototype.handleAvailable=function(t,e,i,a,r){for(var o=XPLAN.DateTimeUtil.intToDate(e,0),s=0;s<i.length;s++){var n=i[s].etype+"s";this.isEntity(i[s].etype)&&(n="users");for(var h=a[n],l=0;l<h.length;l++)if(i[s].value==h[l].entityid&&t>=0){var c=this.makeBlocks(o,h[l].blocks);this.rows.addRow(t),this.rows.setTimeRange(t,c);break}}"function"==typeof r&&r(e)},DiarySchedule.prototype.testRow=function(){var t=[[new Date(2009,0,1,8,0,0),new Date(2009,0,1,9,0,0)],[new Date(2009,0,1,10,30,0),new Date(2009,0,1,11,0,0)]];this.rows.setTimeRange(1,t);var e=[[new Date(2009,0,1,8,0,0),new Date(2009,0,1,9,0,0)],[new Date(2009,0,1,10,30,0),new Date(2009,0,1,21,0,0)]];this.rows.setTimeRange(2,e)},DiaryTimeSurface.prototype.setTop=function(t){this.bg.css("top",t)},DiaryTimeSurface.prototype.getPanelHeight=function(){return DiaryScheduleUtil.getLength(this.panel.css("height"))},DiaryTimeSurface.prototype.getPanelWidth=function(){return DiaryScheduleUtil.getLength(this.panel.css("width"))},DiaryTimeSurface.prototype.data={zindex:250},DiaryTimeSurface.prototype.move=function(){this.selector.move(),this.modified&&this.modified(this.selector.getStartTime(),this.selector.getEndTime())},DiaryTimeSurface.prototype.getOffsetX=function(t){var e=jQuery(t.target).offset();return t.pageX-e.left},DiaryTimeSurface.prototype.makeSurface=function(){var t='<div style="position:absolute;top:0px;width:100%';t+=";height:100%;z-index:"+this.data.zindex,t+='" >&nbsp;</div>',this.panel.append(t),t=this.panel.children("div:last"),this.panel.bind("selectstart",function(t){return!1});var e=this;return t.css("background-color","white"),t.css("opacity",.1),t.css("-ms-filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"),t.addClass("zindex-important"),"edit"==this.mode&&(t.mousemove(function(i){var a=e.getOffsetX(i);if("up"==e.state.updown)e.selector.inLeft(a)?(e.state.position="left",t.css("cursor","e-resize")):e.selector.inRight(a)?(e.state.position="right",t.css("cursor","e-resize")):e.selector.inBg(a)?(e.state.position="center",t.css("cursor","move")):(e.state.position="",t.css("cursor",""));else{var r=e.util.getTime(a),o=e.selector.getStartTime(),s=e.selector.getEndTime();if("left"==e.state.position){var n=e.util.getNearTime(r);(n<o||n<s)&&(e.selector.setStartTime(n),e.move())}else if("right"==e.state.position){var h=e.util.getNearTime(r);h>o&&(e.selector.setEndTime(h),e.move())}else if("center"==e.state.position&&e.state.initialX>=0){var l=a-e.state.initialX,c=e.util.getX(e.state.origin.start)+l,p=e.util.getX(e.state.origin.end)+l,d=e.util.getNearTimeByX(c),u=e.util.getNearTimeByX(p),y=new Date(e.state.origin.start.getFullYear(),e.state.origin.start.getMonth(),e.state.origin.start.getDate(),23,59,59),g=new Date(e.state.origin.start.getFullYear(),e.state.origin.start.getMonth(),e.state.origin.start.getDate(),0,0,0);u<=y&&d>=g&&(e.selector.setStartTime(d),e.selector.setEndTime(u),e.move())}}}),t.mouseup(function(t){e.state.updown="up",e.state.initialX=-1}),t.mousedown(function(t){e.state.updown="down",e.state.initialX<0&&(e.state.initialX=e.getOffsetX(t),e.state.origin.start=e.selector.getStartTime(),e.state.origin.end=e.selector.getEndTime()),t.stopPropagation()}),t.mouseout(function(t){e.state.updown="up"})),t},DiaryTimeSelector.prototype.setTop=function(t){this.bg.css("top",this.data.starty+t)},DiaryTimeSelector.prototype.inLeft=function(t){var e=DiaryScheduleUtil.getLength(this.bg.css("left"));return t>=e&&t-e<=this.data["side-width"]},DiaryTimeSelector.prototype.inRight=function(t){var e=DiaryScheduleUtil.getLength(this.bg.css("left"))+DiaryScheduleUtil.getLength(this.bg.css("width"));return t<=e&&e-this.data["side-width"]<=t},DiaryTimeSelector.prototype.inBg=function(t){var e=DiaryScheduleUtil.getLength(this.bg.css("left"))+this.data["side-width"],i=e+DiaryScheduleUtil.getLength(this.bg.css("width"))-2*this.data["side-width"];return t>=e&&t<=i},DiaryTimeSelector.prototype.makeBg=function(){var t=this.panel.css("height");t?(t=parseInt(t.replace("px","")),t-=this.data.starty):t="0pt";var e='<div style="position:absolute;top:'+this.data.starty+"pt;width:200px;height:"+t+'pt;cursor:move" >&nbsp;</div>';this.panel.append(e);var i=this.panel.children("div:last");return i.css("background-color",this.data["background-color"]),i.css("z-index",this.data["background-zindex"]),i.css("opacity",this.data.opacity),i.css("-ms-filter",this.data["-ms-filter"]),i.addClass("zindex-important"),i},DiaryTimeSelector.prototype.makeLeftRight=function(){var t=this.bg.css("width");if(t){var e=parseInt(t.replace("pt",""))-this.data["side-width"];this.bg.append('<div style="position:absolute;left:0px;height:100%;width:'+this.data["side-width"]+'px;background-color:green;cursor:e-resize" ></div>'),this.bg.append('<div style="position:absolute;left:'+e+"px;height:100%;width:"+this.data["side-width"]+'px;background-color:red;cursor:w-resize"></div>'),this.adjustLeft(),this.adjustRight()}},DiaryTimeSelector.prototype.getLeft=function(){return this.bg.children("div:first")},DiaryTimeSelector.prototype.getRight=function(){return this.bg.children("div:last")},DiaryTimeSelector.prototype.init=function(t){for(var e in t)this.data[e]=t[e];this.bg=this.makeBg(),this.makeLeftRight()},DiaryTimeSelector.prototype.adjustLeft=function(){var t=this.getLeft();t.css("opacity",this.data["side-opacity"]),t.css("-ms-filter",this.data["side-ms-filter"])},DiaryTimeSelector.prototype.adjustRight=function(){var t=this.bg.css("width");if(t){var e=parseInt(t.replace("px",""))-this.data["side-width"];this.getRight().css("left",e)}},DiaryTimeSelector.prototype.move=function(){var t=this.data.util.getX(this.data.start),e=this.data.util.getW(this.data.start,this.data.end);e+=this.data["side-width"],t-=this.data["side-width"]/2,this.bg.css("left",t),this.bg.css("width",e),this.adjustRight(),this.change&&this.change(this.data.start,this.data.end)},DiaryTimeSelector.prototype.display=function(){this.bg.show(),this.move()},DiaryTimeSelector.prototype.getStartTime=function(){return this.data.start},DiaryTimeSelector.prototype.setStartTime=function(t){"int"==XPLAN.util.getType(t)?this.data.start=XPLAN.DateTimeUtil.intToDate(20090101,t):XPLAN.util.isDate(t)&&(this.data.start=t)},DiaryTimeSelector.prototype.setEndTime=function(t){"int"==XPLAN.util.getType(t)?this.data.end=XPLAN.DateTimeUtil.intToDate(20090101,t):XPLAN.util.isDate(t)&&(this.data.end=t)},DiaryTimeSelector.prototype.hide=function(){this.bg.hide()},DiaryTimeSelector.prototype.show=function(){this.bg.show()},DiaryTimeSelector.prototype.getEndTime=function(){return this.data.end},DiaryTimeSelector.prototype.getStartY=function(){return this.data.starty},DiaryTimeSelector.prototype.data={"side-width":3,starty:0,start:new Date(2009,0,1,8,0,0),end:new Date(2009,0,1,9,0,0),util:diary_schedule_block,"background-zindex":225,"background-color":"yellow",opacity:.4,"-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)","side-opacity":1,"side-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)",zindex:150};
;Dependency._js['diary_schedule']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addCSS("dashboard/widget/widget")),function(a){var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_summary_panel",create:function(a){this.options.config.load_on_create&&this._load_summary(a)},_load_summary:function(n,e){var t=this;t.connection.call("load_summary",[t.options.model,t.options.config]).done(function(i){n.html(i),a("span.widget-min, span.widget-max",n).click(function(e){t._toggle(n,a(e.target))}),t._init_after_load(n),e&&e()}).fail(function(a){alert(_("Error:")+a.message)})},_init_after_load:function(a){},_toggle:function(a,n){var e=n.hasClass("widget-max"),t=n.parents("tr:first").find("div.widget-panel-output");e?(t.show(),n.removeClass("widget-max").addClass("widget-min")):(t.hide(),n.removeClass("widget-min").addClass("widget-max"))}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['ajax/summary_panel']=true;

;
function getInfoDivId(e,t){return t||(e?"info-div-big":"info-div")}function showFieldTooltip(e,t,o,n){var i=getInfoDivId(jQuery(t).hasClass("icon"),n);e=e.replace(/\\n/g,"<br/>");var r=jQuery("#"+i,t.ownerDocument);r.html(e.replace(String.fromCharCode(13),"<br/>")),r.css({color:"#434343","font-size":"12px","z-index":9999}).show();var d=jQuery(t).offset(),a=d.left+25,l=d.top;if(jQuery(t).hasClass("icon")){var p=jQuery("div.content",t.ownerDocument);if(0!=p.length){var c=(p=p.get(0)).offsetWidth+p.offsetLeft-10,u=o>0?o:Math.max(c-a,100);a+u>c&&(a=c-u,l+=jQuery(t).height()+5),r.width(u)}}r.offset({left:a,top:l})}function hideFieldTooltip(e,t){var o=getInfoDivId(jQuery(e).hasClass("icon"),t);jQuery("#"+o,e.ownerDocument).hide()}function createToolTip(e,t,o,n,i,r,d,a){var l=(e=jQuery(e)).attr("title"),p={};"undefined"!=typeof l&&l&&!t&&(t=l),p.text=t,e.attr("title","");var c,u=getInfoDivId(o,a),f=function(e){e.target||(e.target=e.srcElement),showFieldTooltip(p.text,e.target,p.fixed_width,u)},s=function(e){e.target||(e.target=e.srcElement),hideFieldTooltip(e.target,u)};if(n)c=jQuery(d?parent.document.body:document.body),e.bind("click",f).bind("mousemove",f).bind("mouseout",s);else{c=e,e.append("&nbsp;");var g=jQuery('<span style="cursor:pointer;vertical-align:middle"></span>').bind("click",f).bind("mousemove",f).bind("mouseout",s);o?(g.addClass("icon icon-info"),i&&"after"==i?g.appendTo(c):g.prependTo(c)):(g.addClass("icon16 icon16-info"),i&&"before"==i?g.prependTo(c):g.appendTo(c))}p.fixed_width="number"==typeof r?r:0;var m="string"==typeof r?r:("number"==typeof r?r:300)+"px",y=jQuery("#"+u,d?window.parent.document:e.ownerDocument);return 0==y.length?jQuery("body",d?window.parent.document:e.ownerDocument).append('<div id="'+u+'" style="padding-left:2px;padding-right:2px;display:none;width:'+m+';position:absolute;background-color:#eeeeee;border:solid 1px;text-align:left;z-index:99999;white-space:normal;word-wrap:break-word"></div>'):y.width(r),p}function createToolTipBig(e,t){createToolTip(e,t,!0),jQuery("#info-div-big",e.ownerDocument).attr("style","position:absolute;background-color:#eeeeee;border:solid 1px;display:none;text-align:left;white-space:normal;word-wrap:break-word;width:95%;z-index:99999")}function createMFTitleToolTip(e){var t=getMainFrame().jQuery("#mf-titlecontent");"undefined"!=typeof t&&createToolTip(t,e,!1,!1)}
;Dependency._js['tooltip']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("tooltip"),ManagedContent={init:function(e,t){this.type=e,this.id=t},map_title:{},getSiteList:function(e,t){var i=this;XMLRPC.call("managed_content.get_site_list",[e],function(n){jQ=parent.jQuery?parent.jQuery:jQuery;var a=jQ("#managed_content");if(a.length>0?a.empty():a=jQ('<div id="managed_content"></div>').appendTo(jQ("body")),n.is_publishing_redesign_enabled){var s=n.data.dest_site_list,l=[{text:_("Ok"),disabled:!0,"data-xplan-elem":"publish-ok-button",click:function(){var l=[],o=[];a.find("td input").each(function(t){jQ(this).is(":checked")&&jQ(this).is(":visible")&&("Default"===n.name&&"assumption_set"===e?confirm(_("Publishing the default Assumption Set will override the current default on the destination site."))&&(l.push(s[t].recipient_url),o.push(jQ(this).data("sitename"))):(l.push(s[t].recipient_url),o.push(jQ(this).data("sitename"))))}),l.length>0&&i.publish(e,t,jQ("#publish_editable input").is(":checked"),l,o),a.dialog("close"),a.empty()}},{text:_("Cancel"),click:function(){a.dialog("close"),a.empty()}}],o=a.html(n.html).dialog({title:_("Destination Sites for %a Publish Routine").replace("%a",i.getTitle(e)),width:720,height:320,modal:!0,resizable:!1,buttons:l}),r=o.parents(".ui-dialog").find(".ui-dialog-buttonset"),d=r.find("#publish-editable-id");0===d.length&&(d=jQ('<span id="publish_editable"><input type="checkbox" id="publish-editable-id" /><label for="publish-editable-id">'+_("Make Content Editable on Recipient Site")+"</label></span>").prependTo(r)),n.supports_publish_editable?d.show():d.hide(),o.find("th input").each(function(){jQ(this).on("change",i.checkAll)});var c=[];o.find("td input").each(function(e){c.push(s[e].recipient_url)}),c.length>0&&i.inquire(e,t,c)}else{var u=n.data.dest_site_list;l=[{text:"Ok",click:function(){var n=[];a.find("td input").each(function(e){jQ(this).is(":checked")&&n.push(u[e].recipient_url)}),n.length>0&&(i.inquire(e,t,n),EggTimer.show()),a.dialog("close"),a.empty()}},{text:"Cancel",click:function(){a.dialog("close"),a.empty()}}];a.html(n.html).dialog({title:"Destination Sites for %a Publish Routine".replace("%a",i.getTitle(e)),width:540,height:320,modal:!0,resizable:!1,buttons:l}).find("th input").each(function(){jQ(this).on("change",i.checkAll)})}},HttpRequest.onerror)},checkAll:function(){var e=parent.jQuery?parent.jQuery:jQuery,t=e(this).is(":checked");e(this).parents("table").find("td input").each(function(){e(this).prop("checked",t)})},inquire:function(e,t,i){var n=this;XMLRPC.call("managed_content.inquire",[e,t,i],function(i){n.handleInquiry(e,t,i)},function(e){EggTimer.hide(),HttpRequest.onerror(e)})},handleInquiry:function(e,t,i){var n=this;EggTimer.hide();var a=parent.jQuery?parent.jQuery:jQuery,s=a("#managed_content");if(i.is_publishing_redesign_enabled){for(var l=0;l<i.messages.length;l++){var o=s.find('td:contains("'+i.messages[l].dest_site+'")').parent();o.find('td[data-xplan-elem="version"]').text(i.messages[l].dest_version),o.find("input[type=checkbox]").attr("data-sitename",i.messages[l].dest_site_name);var r=o.find('td[data-xplan-elem="status"]');if(i.messages[l].reply_result)r.find(".fa.fa-spinner").attr("class","fa fa-check status-ok"),r.find(".fa.fa-question-circle").hide();else{var d=r.find(".fa.fa-question-circle");d.show(),r.find(".fa.fa-spinner").attr("class","fa fa-times status-fail"),o.find("input[type=checkbox]").hide(),createToolTip(d,i.messages[l].reply_message,!1,!0,"before","200px",!0)}}a('button[data-xplan-elem="publish-ok-button"]').button("enable")}else{s.length>0?s.empty():s=a('<div id="managed_content"></div>').appendTo(parent.document);var c='<div><table><tr><td class="key">'+XPLAN.util.escape(n.getTitle(e))+"</td><td>"+XPLAN.util.escape(i.name)+'</td></tr><tr><td class="key">'+_("Version")+"</td><td>"+XPLAN.util.escape(i.content_source_version)+"</td></tr></table></div>";c+=i.html;var u=[{text:_("Ok"),click:function(){var l=[],o=[];s.find("td input").each(function(t){if(a(this).is(":checked"))if("Default"===i.name&&"assumption_set"===e){if(confirm(_("Publishing the default Assumption Set will override the current default on the destination site."))){var n=a(this);l.push(n.val()),o.push(n.data("sitename"))}}else{n=a(this);l.push(n.val()),o.push(n.data("sitename"))}}),l.length>0&&n.publish(e,t,l,o),s.dialog("close"),s.empty()}},{text:_("Cancel"),click:function(){s.dialog("close"),s.empty()}}];s.html(c).dialog({title:"Publish %a Routine".replace("%a",n.getTitle(e)),width:640,height:480,modal:!0,resizable:!1,buttons:u})}},publish:function(e,t,i,n,a){EggTimer.show(),XMLRPC.call("managed_content.publish",[e,t,i,n,a],function(e){EggTimer.hide(),getMainFrame().XPLAN.framemain.alert(e)},HttpRequest.onerror)},getTitle:function(e){return map={alert:_("Alert Rule"),platform:_("Disclosure Fee"),apl:_("Product List"),report:_("Xmerge Report"),email:_("Email Template"),tasktpl:_("Task Template"),threadtpl:_("Thread Template"),search_criteria:_("Search Criteria"),assumption_set:_("Assumption Set"),targetset:_("Target Set"),custom_report:_("Custom Report"),docnotes:_("Docnote"),custom_dictionary:_("Custom Dictionary"),access_levels:_("Access Level"),accreditation_settings:_("Accreditation Settings"),bank_branch_database:_("Bank Branch Database"),xport:_("xport")},void 0==map[e]?e:map[e]}};
;Dependency._js['xpt/managed_content/content']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addJS("ajax/jumpback"),Dependency.addJS("ajax/summary_panel"),Dependency.addJS("commonui"),Dependency.addJS("xpt/managed_content/content"),Dependency.addJS("xpt/multicurrency/currency_code_controller")),function(e){var t={parent_plugin_name:"xplan_summary_panel",plugin_name:"xplan_thread_summary",load_thread:function(e,t,a){this.options.model.threadid=t,this._load_summary(e,a)},_init_after_load:function(t){var a=this;a.$("a.last-tasks").on("click",function(t){t.stopPropagation();var i=e(t.target).data("taskid");a._goto_task(i)})},_goto_task:function(e){var t=getBaseURL()+"/xtasks/view/"+e+"?option=todo&threadid="+this.options.model.threadid;XPLAN.jumpback.jumpto({forward_url:t,domain:"task",backward_url:window.location.href})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery),function(e){XPLAN.namespace("Thread");var t=Backbone.Model.extend({show_activation_mesage:function(e,t){t.splice(0,0,e),alert(t.join("\n"))},activate_thread:function(e,t){var a=this,i=jQuery.Deferred();return t?(alert(_("Thread Assignee is Required. Please nominate an assignee for the thread!")),i.reject()):XMLRPC.call("xtask.can_thread_be_activated",[e],function(e){e.prevent_passed?(e.warning_passed||a.show_activation_mesage(_("Warning: The thread will be allowed to activate but the following breaches have been raised."),e.warnings),i.resolve()):(a.show_activation_mesage(_("Error: The thread has been prevented from being activated, please review the following breaches."),e.errors),i.reject())},function(e){alert(e),i.reject()}),i.promise()},can_thread_be_completed:function(e){return XMLRPC.call("xtask.can_thread_be_completed",[e])},complete_thread:function(e,t,a,i){i="undefined"!=typeof i&&i,XMLRPC.call("xtask.complete_thread",[e,t,i],function(e){a&&a(e)},function(e){a&&a(!1,e.message)})},check_review_creation:function(e,t,a,i){var n=XMLRPC.call("xtask.should_check_review_for_thread",[t]);if(!(XPLAN.util.hasFeature("auto_create_new_review_bm")&&n>0))return a.apply(e,i);if(2===n)return XPLAN.Thread.Common._create_review_with_rpc(t,a,e,i);var r={title:XPLAN.util.escape(_("Create New Review")),width:370,modal:!0,buttons:[{text:XPLAN.util.escape(_("OK")),click:function(){XPLAN.Thread.Common._create_new_review(o,t,a,e,i)}}],close:function(){o.dialog("destroy"),a.apply(e,i)}},o=XPLAN.Thread.Common._get_review_dialog();o.dialog(r)},_create_review_with_rpc:function(e,t,a,i){XMLRPC.call("xtask.create_new_review_for_thread",[e],function(e){e.ok||PopupMsgBox.show_error_text(e.error),t.apply(a,i)})},_create_new_review:function(e,t,a,i,n){var r=XPLAN.Thread.Common._get_create_new_review(e);e.dialog("destroy"),1===r?XPLAN.Thread.Common._create_review_with_rpc(t,a,i,n):a.apply(i,n)},_get_review_dialog:function(){var e=XMLRPC.call("xtask.get_container_create_new_review_template",[]),t=XPLAN.ui.Popup.get_dialog("thread_check_new_review_dialog");return t.html(e),t},_get_create_new_review:function(e){var t=XPLAN.util.elem2object(e);return parseInt(t.create_new_review,10)},open_complete_dialog:function(t,a,i,n){var r=e("<div></div>").appendTo(t);if(i)var o=["<table>","<tr><td>",XPLAN.util.escape(_("Are you sure you want to complete this Case? ")),"</td></tr></table>"];else o=["<table>","<tr><td>",XPLAN.util.escape(_("Non-compulsory benchmarks have not been completed. ")),XPLAN.util.escape(_("Are you sure you want to complete this Case? ")),"<br/>",XPLAN.util.escape(_("Please leave comments if you want to continue this operation.")),"</td></tr><tr><td><br/></td></tr>","<tr><td>",'<textarea name="optional_benchmark_comment" rows="10" cols="60"></textarea>',"</td></tr></table>"];r.html(o.join("\n"));var s=function(e,t){e?t(!0):(t(!1),alert(_("Case could not be completed. %a").replace("%s",void 0!==error?_("Error: ")+error:"")))};return r.dialog({title:XPLAN.util.escape(_("Complete Case")),buttons:[{text:_("Cancel"),click:function(){n(!1),r.dialog("close"),r.dialog("destroy")}},{text:"^"+_("Ok"),click:function(){var t="";if(e("textarea",r).length>0&&""===(t=e.trim(e("textarea",r).val())))return alert(_("Please enter your comments.")),!1;!function(e){EggTimer.show();XPLAN.Thread.Common.complete_thread(a,{optional_benchmark_comment:e},function(e,t){EggTimer.hide(),XPLAN.Thread.Common.check_review_creation(this,a,s,[e,n])},!0)}(t),r.dialog("close"),r.dialog("destroy")}}],width:400}),!1}});XPLAN.Thread.Common=new t}(jQuery),function(e){var t=Backbone.Model.extend({option:"current",currentpast:"current",iframe_url:"",iframe_id:"iframe_threads",dayrange_text:"",page_handler:null,stats:{},_get_iframe:function(){return e("#"+this.iframe_id)},show_thread_summary:function(t){var a=this._get_thread_summary_panel();a.xplan_thread_summary("load_thread",t,function(){XPLAN.ui.showSlideOutPanel(e("div.thread_summary_boundary"),a)})},show_thread_tasks:function(t,a,i){var n=this._get_iframe(),r=e('tr.thread_tasks[data-threadid="'+a+'"]',n.contents());t.hasClass("icon-expand")?(r.show(),t.removeClass("icon-expand").addClass("icon-collapse"),this._show_thread_tasks(r,a,i)):(r.hide(),t.addClass("icon-expand").removeClass("icon-collapse"))},apply_task_criteria:function(e){this._get_iframe().get(0).contentWindow.apply_task_criteria(e)},_show_thread_tasks:function(t,a,i){var n=this._get_iframe(),r={};e.extend(r,this.task_list_ajax_options),r.afterload=function(){n.height(e("table",n.contents()).height())},r.summary_boundary_panel=e("div.thread_summary_boundary"),n.get(0).contentWindow.show_thread_tasks(r,t,a,i)},_get_thread_summary_panel:function(t){var a=e("div.thread_summary_panel");return 0===a.length&&(a=e("<div></div>").hide().addClass("panelbox").addClass("thread_summary_panel").prependTo(e("div.thread_summary_boundary"))).xplan_thread_summary(this.thread_summary_ajax_options),XPLAN.ui.createSlideOutPanel(e("div.thread_summary_boundary"),a),a},changeTypeList:function(e){var t=getBaseURL()+"/xtasks/tframelist/"+XPLAN.util.escape(e,"url"),a=jQuery('select[name="filter_type"]').val();void 0!==a&&(t+="?filter_type="+a),getMainFrame(t)},search:function(e,t){EggTimer.show();var a=this._get_iframe();a.hide();var i=XPLAN.util.encodeObject({field:e,value:t}),n=this;a.attr("src",XPLAN.util.appendUrl(this.iframe_url,i)),a.on("load",function(){n.retrieve_statistics(a),EggTimer.hide()})},changeClientPartner:function(e){this.search("thread_clientpartner",e)},changeOwnership:function(e){this.search("ownership",e)},search_external_id:function(){var e=jQuery('input[name="filter_external_id"]').val();this.search("external_id",e)},handle_external_id_key_press:function(e){13==e.keyCode&&this.search_external_id()},changeThreadOwnership:function(t){e("#thread_owner_user_div").hide(),e("#thread_owner_role_div").hide(),e("#thread_owner_role_select_div").hide(),"user"===t?e("#thread_owner_user_div").show():"role"===t&&(e("#thread_owner_role_div").show(),e("#thread_owner_role_select_div").show()),this.search("thread_ownership",t)},changeOwner:function(e){this.search("owner",e)},changeCriteria:function(e){this.search("criteria",e)},changeActivationCriteria:function(e){this.search("activation_criteria",e)},changeCurrentPast:function(e){this.search("currentpast",e)},showThreadReassignDialog:function(){PopupURL.showCentre("/xtasks/reassign_threads_dialog",400,300,!1)},initFilterLinkedProduct:function(){var t=this;e('select[name="filter_linked_product"]').on("change",function(){t.search("filter_linked_product",e(this).val())})},initFilterTemplate:function(){var t=this;e('select[name="filter_template"]').on("change",function(){t.search("filter_template",e(this).val())}),e('select[name="filter_status"]').on("change",function(){t.search("filter_status",e(this).val())}),e('select[name="filter_task_status"]','div[data-xplan-elem="container_summary_search"]').on("change",function(){t.search("filter_task_status",e(this).val())})},initThreadOwnership:function(){e('select[name="thread_ownership"]').length>0&&this.changeThreadOwnership(e('select[name="thread_ownership"]').val())},initLeadStage:function(){var t=this;e('select[name="filter_lead_stage"]').on("change",function(){t.search("filter_lead_stage",e(this).val())})},initThreadType:function(){e('select[name="filter_type"]').on("change",function(){var t=parseInt(e(this).val(),10);e("#filter_lead_stage_row").toggle(200===t),e("#filter_current_past_row").toggle(200!==t),200===t&&e('select[name="currentpast"]').val("current"),e("#filter_task_criteria_row").toggle(200!==t),e("#thread_owner_row").toggle(200===t),e("#owner_row").toggle(200!==t),200===t?("past"==e('select[name="threadtypelist"]').val()&&e('select[name="threadtypelist"]').val("current").change(),e('select[name="threadtypelist"] option[value="past"]').remove(),e("button.btn_reassign").hide()):(0===e('select[name="threadtypelist"] option[value="past"]').length&&e("<option></option>").val("past").text(_("Past")).insertAfter(e('select[name="threadtypelist"] option[value="current"]')),e('select[name="threadtypelist"] option').show(),e("button.btn_reassign").show())}).change()},initCriteria:function(){e('select[name="criteria"] option:first').text(this.dayrange_text)},initActionButton:function(){var t=this;e("button.btn_reassign").click(function(){t.showThreadReassignDialog()}),e("a.panelbutton.download").click(function(e){var a=[new PopupMenuOption(_("Report/Export"),function(){var e=getBaseURL()+"/xtasks/thread_report?option="+XPLAN.util.escape(t.option,"query")+"&random="+Math.random();getMainFrame(e)},!1,!1)];PopupMenu.showByClick(a,e)})},init:function(t){e.extend(this,t),this.initCriteria(),this.initThreadType(),this.initLeadStage(),this.initFilterTemplate(),this.initThreadOwnership(),this.initActionButton(),this.search("","")},unlock_in_progress:function(t){var a=this._get_iframe(),i=e(a.contents()).find("table").find('tr[data-threadid="'+t+'"] span[data-xplan-elem="icon_unlock"]');i.addClass("disabled").css("pointer-events","none"),i.parent().attr("title","Unlocking in progress")},retrieve_statistics:function(t){var a=parseInt(e('select[name="filter_type"]').val(),10),i=e('span[data-xplan-elem="thread_list_stats"]');if(200==a||"lead"==this.option){var n=XPLAN.util.get_qs_from_url(this.iframe_url),r=e(t.contents()).find("table"),o=this;XMLRPC.call("xtask.get_thread_statistics",[XPLAN.util.encodeQS(n.qs)],function(e){e&&(r.find('span[data-xplan-elem="forecast_fua_total"]').text(e.forecast_fua),r.find('span[data-xplan-elem="forecast_revenue_total"]').text(e.forecast_revenue),r.find('span[data-xplan-elem="forecast_ongoing_total"]').text(e.forecast_ongoing));var t=o.stats.end_pos,a=o.stats.start_pos;t>e.total&&(t=e.total),a>e.total&&(a=1),i.text(" "+_("(%a to %b of %c)").replace("%a",a).replace("%b",t).replace("%c",e.total)),i.toggle(e.total>0)})}else i.hide()},handlePageResult:function(e){this.page_handler&&this.page_handler(e),this.stats.start_pos=e[2],this.stats.end_pos=e[3],EggTimer.hide(),this._get_iframe().show()},setDateRange:function(){var e="/xtasks/threadanydays?option="+this.option;PopupURL.showCentre(e,440,250,!1)}});XPLAN.Thread.FrameList=new t,window.ThreadFrameList=XPLAN.Thread.FrameList}(jQuery),function(e){var t=Backbone.Model.extend({table:"list_table",option:"current",url_param:"",has_prev:!1,has_next:!1,start_pos:0,end_pos:50,frame_list:XPLAN.Thread.FrameList,initialize:function(){underscore.bindAll(this,"downloadPDF","remove","activate","abort","getURLParam","rename")},getURLParam:function(e){return(e||"?")+this.url_param},sort:function(e,t){this.frame_list.search("sort",e+":"+t)},rename:function(e,t){PopupMsgBox.show_generic_text(_("Enter the new name for this case:"),_("Rename Case"),{icon:"icon-info.png",prompt:t,onclose:function(t){XMLRPC.call("xtask.set_thread_fields",[e,{name:t}],function(){XPLAN.util.reload()},function(e){alert(_("Error:")+e)})}})},remove:function(e,t){var a=this;t&&t.isTemplate&&t.is_mifid_tpl?PopupMsgBox.show_warning_text(_("You cannot remove this template as it is currently in use for creating MiFID compliance cases.")):confirm(_("Do you really want to remove this item?"))&&(t&&t.isTemplate&&t.isAdviceThread&&XPLAN.XplanAjax.hasPluginApplied(jQuery("body"),"xplan_remove_thread_tpl_warning")?jQuery("body").xplan_remove_thread_tpl_warning("load",e,function(t){a.frame_list.search("remove",e)}):a.frame_list.search("remove",e))},showThreadSummary:function(e){this.frame_list.show_thread_summary(e)},showThreadTasks:function(t,a){var i=e(t.target),n=e('select[name="filter_task_criteria"]').val();this.frame_list.show_thread_tasks(i,a,n)},activate:function(e,t){var a=this;getMainFrame().XPLAN.Thread.Common.activate_thread(e,t).done(function(){a.frame_list.search("activate",e)})},abort:function(e){this.frame_list.search("abort",e)},downloadPDF:function(e){var t=this.url_param+"&random="+Math.random();t=XPLAN.util.appendUrl(getBaseURL()+"/xtasks/threadpdf/"+e,t),XPLAN.util.deviceSpecificDownload(t)},init:function(t){e.extend(this,t),this.frame_list.handlePageResult([this.has_prev,this.has_next,this.start_pos,this.end_pos])},lock:function(e){confirm([_("Do you really want to lock this case?"),"\n",_("Note: XTOOLS scenarios cannot be unlocked after this point.")].join(""))&&this.frame_list.search("lock",e)},unlock:function(e,t){XPLAN.util.hasFeature("case_lock_background_job")?confirm([_("All locked items will now be unlocked.                             However, if the items were manually locked, they will remain locked.                             Unlocking process will run in the background and on completion,                             you will receive a notification.                             Please refresh the case list page to see the latest status.")].join(""))&&XMLRPC.call("xtask.unlock_case",[e,t],function(e){e.ok&&XPLAN.Thread.FrameList.unlock_in_progress(t)},HttpRequest.onerror):confirm([_("All locked items will now unlock. This does not include items                                 that were manually locked before the case was locked, notes                                 that are locked by another case or xtools locked in a previous                                 release. Do you wish to continue?")].join(""))&&this.frame_list.search("unlock",t)},createMenu:function(e,t){var a,i=this,n=jQuery(e).data("threadid"),r=jQuery(e).data("menu"),o=jQuery(e).data("assigneeRequired"),s=jQuery(e).data("primeUrl"),l=jQuery(e).data("primePlusUrl"),d=jQuery(e).data("primePlusLabel");a={remove:{"data-xplan-elem":"remove"},edit:{"data-xplan-elem":"edit"}};var c={menu_thread_open_prime:{title:_("Open in Prime"),action:function(){s&&window.open(getBaseURL()+s,"_blank")}},menu_thread_open_prime_plus:{title:_("Open in")+" "+d,action:function(){l&&window.open(getBaseURL()+l,"_blank")}},menu_thread_remove:{title:_("Remove"),options:{attributes:a.remove},action:function(){i.remove(n,t)}},menu_thread_view:{title:_("View"),action:function(){redirectURL(getBaseURL()+"/xtasks/viewthread/"+n+i.getURLParam()+"&refresh=1")}},menu_thread_edit:{title:_("Edit"),options:{attributes:a.edit},action:function(){redirectURL(getBaseURL()+"/xtasks/editthread/"+n+i.getURLParam()+"&refresh=1")}},menu_thread_activate:{title:_("Activate"),action:function(){i.activate(n,o)}},menu_thread_abort:{title:_("Abort"),action:function(){i.abort(n)}},menu_thread_export:{title:_("Export"),action:function(){redirectURL(getBaseURL()+"/xtasks/threadexport/"+n)}},menu_thread_update:{title:_("Update"),action:function(){redirectURL(getBaseURL()+"/xtasks/updatethreads/"+n)}},menu_thread_pdf:{title:_("PDF"),action:function(){i.downloadPDF(n)}},menu_thread_publish:{title:_("Publish"),action:function(){ManagedContent.getSiteList("threadtpl",n)}}},h=jQuery.map(r,function(e){var t=c[e];return new PopupMenuItem(t.title,t.action,!1,null,null,null,t.options)});PopupMenu.showDropdown(h,e)}});XPLAN.Thread.List=new t}(jQuery),function(e){var t=Backbone.Model.extend({has_logic_table:!1,loadTemplate:function(){this.setLoadTemplate(),this.form.submit()},_do_action:function(e,t){var a={};a[e]=t;var i=this.url_param+"&"+XPLAN.util.encodeObject(a);i=getBaseURL()+"/xtasks/threadcancel/"+this.id+"?"+i,getMainFrame(i)},_disable_button_link:function(t){e(t).attr("disabled",!0),e(t).click(function(e){e.preventDefault()})},activate:function(t,a){XPLAN.Thread.Common.activate_thread(t,a).done(e.proxy(function(){this._disable_button_link("#activate_button"),this._disable_button_link("#abort_button"),this._do_action("activate",this.id)},this))},abort:function(e){this._disable_button_link("#activate_button"),this._disable_button_link("#abort_button"),this._do_action("abort",this.id)},validateDate1:function(){var e=new Array(getDateCheck("fixeddate","Base Date"));if(validateFormFields("form_edit_thread",e)){var t=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#fixeddate")),a=document.getElementsByName("dob")[0];return!(a&&0===a.selectedIndex&&t<this.today&&!confirm(_("Base Date is earlier than today, save anyway?")))}return!1},validateDate2:function(){var e=new Array(getDateCheck("fixeddate2","Base Date2"));if(validateFormFields("form_edit_thread",e)){var t=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#fixeddate2")),a=document.getElementsByName("dob2")[0];return!(a&&0===a.selectedIndex&&t<this.today&&!confirm(_("Base Date2 is earlier than today, save anyway?")))}return!1},setSaveFlag:function(){document.getElementsByName("save")[0].value="1"},entityRequired:function(){return e("[data-entity_required]").data("entity_required")},save:function(){var t=this;if(""!==e("input[name='name']").val()){var a=e("input[name='external_id']");if(a.length>0&&""===a.val())alert(_("Please fill in external id."));else{var i=parseInt(e("input[name='client']").val(),10);if(i>0||!this.entityRequired()){if(!this.published){var n=jQuery("#td_rule");if(this.has_logic_table&&n.length>0&&(jQuery("#tabmain").tabs("option","active",0),!n.xplan_task_logic_table("validate")))return void alert(_('Invalid "Complete When" expression.'));var r=document.getElementsByName("fixeddate")[0],o=document.getElementsByName("fixeddate2")[0];if(r&&o){if(!this.validateDate1()||!this.validateDate2())return}else if(this.fixdate&&this.fixdate2){if(!this.validateDate1()||!this.validateDate2())return}else if(this.fixdate){if(!this.validateDate1())return}else if(this.fixdate2&&!this.validateDate2())return}var s=function(a){var i=e("#form_edit_thread");e("input[name=case_id_for_thread_link]",i).val(a>0?a:-1),this._disable_button_link("#save_button"),t.setSaveFlag(),i.submit()}.bind(this),l=jQuery('div[data-xplan-ele="link_thread_multi_ajax"]');i>0&&l.length>0?l.xplan_link_thread_multi_ajax("reload_show",i,function(e){s(e)}):s()}else alert(_("Please specify an entity."))}}else alert(_("Please fill in thread name."))},threadImport:function(){e("#form_edit_thread").submit()},changeTaskAssignee:function(t,a){e("#iframe_linked_tasks").attr("src",this.tasks_url+"&set_assignee="+t+"&assignee="+a)},showBaseDate:function(t,a){a||(a=""),e("#span_fixeddate"+a).toggle(t)},showEditableFields:function(t){e("#tr_editable_after_creation_fields").toggle("0"==t)},setEditableFieldDefaults:function(){var t=document.getElementsByName("editable_after_creation_fields"),a=document.getElementById("editable_after_creation_fields_all");a&&e(a).prop("checked",!0);for(var i=0;i<t.length;i++){var n=document.getElementById("editable_after_creation_fields_"+i);n&&e(n).prop("checked",!0)}},changeDOB:function(){var e=document.getElementsByName("dob");1==e.length&&(e=e[0],this.showBaseDate(0===e.selectedIndex))},changeFieldsEditable:function(){var e=document.getElementsByName("editable_after_creation");1===e.length&&this.showEditableFields(e[0].value),this.isNew&&-1==this.id&&this.setEditableFieldDefaults()},changeDOB2:function(){var e=document.getElementsByName("dob2");1==e.length&&(e=e[0],this.showBaseDate(0===e.selectedIndex,"2"))},hasUserMember:function(e,t){return XMLRPC.call("factfind.hasUserMember",[e,t])},setAssigneeGroup:function(){if(this.assignee_plugin&&this.assignee_plugin.length>0){var t=parseInt(e('[name="egroup"]').val(),10),a=this.groupid_of_assignee;this.groupid_of_assignee=t;var i=parseInt(this.assignee_plugin.xplan_entity_search("get_value"),10);t>0&&a!=t&&i>0&&(this.hasUserMember(t,i)||this.assignee_plugin.xplan_entity_search("clear"))}},initGroup:function(){var t=this;t.groupid_of_assignee=t.egroup,t.assignee_plugin=e('div[id^="assignee_"]'),FactFind.addEntityLookup({field_id:"div_thread_egroup",can_clear:!0,defaultval:"-1",defaulttext:"",value:t.egroup,name:"egroup",type:"group",width:118,close:function(){t.setAssigneeGroup()}})},onClickClient:function(t){if(t&&t.type){this.showEntityViewable("user"==t.type);var a='<input type="hidden" name="entitytype"value="'+t.type+'" >';e("#div_thread_client").append(a)}},initClient:function(){var t=this;if(e("#div_thread_client").length>0){FactFind.addEntityLookup({can_clear:!0,defaultval:"-1",field_id:"div_thread_client",clientlisting:2,value:this.clientid,allow_archived:!0,preserve_entity_if_visible:!0,name:"client",type:["client","user","group","supplier","profadviser","referral"],width:200,close:function(e){t.onClickClient(e)}}),this.selector=!0}},initCreateInvoice:function(){var t=document.getElementsByName("create_invoice")[0];t&&e(t).change(e.proxy(this.showCreateInvoice,this)),this.showCreateInvoice()},initFUACalculation:function(){var t=this,a=function(){if(1===parseInt(e(':input[name="forecast_level"]').val(),10)){var a=parseFloat(e('input:text[name="fua"]').val()),i=parseFloat(e('input:text[name="likelihood"]').val());if(isNaN(a)||isNaN(i))e("td.forecast_fua_td span").text("");else{var n=(a.toFixed(2)*i.toFixed(2)/100).toFixed(2);if(t.has_feature_multi_currency)n=n+" ("+e(':input[name="currency_type"]').val()+")";e("td.forecast_fua_td span").text(n)}}};e('input:text[name="fua"]').bind("change",a),e('input:text[name="likelihood"]').bind("change",a),e(':input[name="forecast_level"]').bind("change",function(){if(1===parseInt(e(this).val(),10))e("tr.thread_level_fua_row").show(),a();else{e("tr.thread_level_fua_row").hide();var t=e('input[name="estimated_fum_by_tasks"]').val();e("td.forecast_fua_td span").text(t)}}),this.has_feature_multi_currency&&e('select[name="currency_type"]').bind("change",a);var i=e(':input[name="forecast_level"]');if(1===parseInt(i.val(),10)&&i.is(":visible"))e("tr.thread_level_fua_row").show();else{e("tr.thread_level_fua_row").hide();var n=e('input[name="estimated_fum_by_tasks"]').val();e("td.forecast_fua_td span").text(n)}},initFeeCalculation:function(){var t=function(){var t=parseFloat(e(':input[name="fixed_fee"]').val()),a=parseFloat(e('input:text[name="fee_likelihood"]').val());if(isNaN(t)||isNaN(a))e("td.forecast_fee_td").text("");else{var i=t.toFixed(2)*a.toFixed(2)/100;e("td.forecast_fee_td").text(i.toFixed(2))}};e(':input[name="fixed_fee"]').bind("change",t),e('input:text[name="fee_likelihood"]').bind("change",t)},initDOB:function(){var t=document.getElementsByName("dob")[0];t&&e(t).change(e.proxy(this.changeDOB,this)),this.changeDOB(),(t=document.getElementsByName("dob2")[0])&&e(t).change(e.proxy(this.changeDOB2,this)),this.changeDOB2()},initEditableFields:function(){var t=document.getElementsByName("editable_after_creation")[0];t&&e(t).change(e.proxy(this.changeFieldsEditable,this)),this.changeFieldsEditable()},setLoadTemplate:function(){document.getElementsByName("loadtemplate")[0].value="1"},getEntityType:function(){var e=document.getElementsByName("entitytype");return 1===e.length?e[0]:null},showCreateInvoice:function(t){var a=document.getElementsByName("create_invoice")[0];a&&e("tr.create_invoice_row").toggle("1"===e(a).val())},showAdviser:function(t){e("#a_adviser").toggle(t)},showEntityViewable:function(t){e("#tr_entity_viewable").toggle(t)},handleLoadCategories:function(e,t){"undefined"!=typeof t&&null!==t||(t="templates");var a=document.getElementsByName(t);1===a.length&&(a=a[0],SelectUtil.makeSelect(a,e))},loadCategories:function(e,t){var a={};void 0!==t&&(a.thread_type=t),this.loadThreadsByCategory(e,null,a)},loadThreadsByCategory:function(e,t,a){var i=this;e=parseInt(e,10);try{XMLRPC.call("xtask.load_threads_by_category",[e,a],function(e){i.handleLoadCategories(e,t)})}catch(e){alert(_("Error:")+e.message)}},modifyOwner:function(){this._creator_selector||(FactFind.addEntityLookup({can_clear:!0,defaultval:"-1",defaulttext:_("Select a user"),field_id:"creator_div",value:this.creator,name:"creator",type:"user",width:118}),this._creator_selector=True)},specifyGroupChange:function(){var t=e('select[name="specifygroup"]');0!==t.length&&(1==((t=t.get(0)).selectedIndex<0?0:t.selectedIndex)?(this._shared_groups||(FactFind.addEntityLookup({type:"group",name:"groups",multi:!0,can_clear:!0,field_id:"shared_groups_div",value:this.groups,enable_include_subgroups:!0,width:600}),this._shared_groups=True),e("#shared_groups_div").show()):e("#shared_groups_div").hide())},initSpecifyGroup:function(){jQuery('select[name="specifygroup"]').change(e.proxy(this.specifyGroupChange,this))},templateChange:function(){var t=document.getElementsByName("template")[0],a=document.getElementById("tr_specifygroup"),i=document.getElementById("tr_editable"),n="2"==t.value;e(a).toggle(n),e(i).toggle(n),this.specifyGroupChange()},initTemplateField:function(){var t=this;e('select[name="template"]').on("change",function(){t.templateChange()}).change(),this.initSpecifyGroup()},_init_lead_template_multicurrency:function(){if(this.isTemplate&&200==this.thread_type){var t={fieldStatus:"view",position:"append",selector:':input[name="currency_type"]'};underscore.each(["fua","revenue","ongoing","actfum"],function(a,i){e('td[data-xplan-elem="'+a+'"]').xplan_currency_code_controller(t)})}},initCaseThreadLinkTpl:function(){var t=e('tr[data-xplan-elem="tr_case_thread_link_tpl"]');e(':input[name="can_link_threads"]').change(function(){t.toggle("1"==this.value)}),t.toggle("1"==t.data("xplan-init"))},_init:function(){e("#tabmain").css("visibility","visible").tabs(this.tab_options).bind("tabsselect",function(t,a){e("#panel_links").css("display",a.index<2?"":"none")}),e("#tabLinks").tabs(),this.initGroup(),this.initClient(),this.initDOB(),this.initFeeCalculation(),this.initFUACalculation(),this.initEditableFields(),this._init_lead_template_multicurrency(),this.initTemplateField&&this.initTemplateField(),this.initCaseThreadLinkTpl(),this.is_container_available&&(XPLAN.Task.Container.init("#div-advicecontainer-list",{container_id:this.id,mode:this.mode,has_benchmark:this.has_benchmark}),XPLAN.AuditSample.auditQuestionnaireEventList("#tabs-audit",{container_id:this.id,mode:this.mode}));var t=_('Setting restricts the "Add" of threads to Service Packages only');createToolTip(jQuery("span.icon16-info"),t,!1,!0,"before",200)},init:function(t){e.extend(this,t),this._init()},updateThreads:function(){confirm(_("Threads will be updated to the current thread template format.\n Only those threads that have all tasks NOT activated will be updated\n Do you want to continue?\n"))&&XMLRPC.call("xtask.update_threads",[this.id],function(e){if(e){var t=[_("Threads will be updated in the background."),"\n",_("You will be notified by the bouncing bell")];alert(t.join(""))}else alert(_("You are not allowed to update threads"))})}});XPLAN.Thread.viewedit=new t,window.XThread=XPLAN.Thread.viewedit}(jQuery),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_remove_thread_tpl_warning",create:function(e){this.connection.auto_eggtimer=!0,this.dialog=null},_display:function(t,a,i){var n=this;this.dialog||(this.dialog=e("<div></div>").appendTo(t),this.dialog.dialog({title:_("Delete thread template"),modal:!0,width:500,buttons:[{text:_("Cancel"),click:function(){n.dialog.dialog("close")}},{text:"^"+_("Delete"),click:function(){n.dialog.dialog("close"),i("delete")}}]})),this.dialog.html(a),this.dialog.dialog("open")},load:function(e,t,a){var i=this;this.connection.call("load",[t]).done(function(t){t.html?i._display(e,t.html,a):a("delete")})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['xpt/task/thread']=true;

;
function DiaryAttendees(){}function set_report_client_id(e){try{return XMLRPC.call("report.set_client_id",[e]),!0}catch(e){return alert(_("Could not set client id in report state due to: %a").replace("%a",e.message)),!1}}function toggle_xmerge_options(){var e,t=this.getEntities(),i=t.length>0,a=jQuery("#xmergelist").contents().find("#add_to_note").get(0),r=jQuery("#xmergelist").contents().find("#send_to_post").get(0);if(parseInt(jQuery("#eventid").val(),10)>0){var n=[];for(e in t)n.push(t[e].value);var s=0;try{s=XMLRPC.call("diary.check_clients_for_ptp",[n])}catch(e){return void alert(_("Could not check print-to-post settings for existing reportsdue to: %a").replace("%a",e.message))}s>0&&alert(_("Print-to-post has been set for %a report(s) but at least one client does not have a preferred address. Note that if this event is saved with the current clients, print-to-post will be unset for those reports").replace("%a",""+s))}if(a&&r){var o=0;try{o=XMLRPC.call("report.report_state_initialised",[])}catch(e){return alert(_("Could not check report state due to: %a").replace("%a",e.message)),a.checked=!1,void(r.checked=!1)}if(o)if(i){for(e in t){var l=t[e].value;if(!set_report_client_id(l))return;if(r.checked)try{XMLRPC.call("report.set_print_to_post",[!0])}catch(e){return alert(_("Could not set print-to-post for client %a due to : %b. Unchecking print-to-post option now.").replace("%a",""+l).replace("%b",e.message)),r.checked=!1,void XMLRPC.call("report.set_print_to_post",[!1])}}jQuery("#xmergelist").contents().find("#doc_note_section").show(),jQuery("#xmergelist").contents().find("#print_to_post_section").show()}else a.checked=!1,jQuery("#xmergelist").contents().find("#doc_note_section").hide(),r.checked=!1,jQuery("#xmergelist").contents().find("#print_to_post_section").hide()}}function DiaryOrganiser(){}function DiaryAttendeesUser(){}function DiaryAttendeesClient(){}function DiaryFieldMap(e){this.data=void 0===e?{depend:{},values:{}}:e}var client_list;"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("datefield"),Dependency.addJS("diary_schedule"),Dependency.addJS("ajax/ajax"),Dependency.addJS("xpt/task/thread"));var client_data={},client_order=[];DiaryAttendees.prototype.data={},DiaryAttendees.prototype.getTimeZone=function(){try{return Diary.getTimeZone()}catch(e){return Diary.event.event_timezone}},DiaryAttendees.prototype.init=function(e){var t=this;for(var i in this.entities=new EntitiesSelection,e)this.data[i]=e[i];"edit"===this.data.mode&&"diary_clients"===this.data.name&&(this.entities.post_entity_change=toggle_xmerge_options),this.schedule=new DiarySchedule,this.schedule.init({parent:this.data.schedule_parent,css:this.data.schedule_css,rolekey:this.data.schedule_rolekey,mode:this.data.mode,change:function(e,i){t.date_bar&&t.date_bar.updateTime(e,i)},modified:function(e,t){var i=XPLAN.DateTimeUtil.timeToInt(e),a=XPLAN.DateTimeUtil.timeToInt(t);Diary.setStartTime(parseInt(i,10)),Diary.setEndTime(parseInt(a,10)),Diary.sameStartEndDate()}}),this.data.entity_change=function(e,i){var a={value:i.getValue(),etype:i.getEtype()};t.schedule.updateRow(e,[a],Diary.getEventId(),Diary.getStartDateEx(),t.getTimeZone()),t.schedule.setParentScollTop(t.entities.getParentScrollTop())},this.data.on_scroll=function(){t.schedule.setParentScollTop(t.entities.getParentScrollTop())},this.entities.init(this.data)},DiaryAttendees.prototype.setMaxEntities=function(e){if(this.entities.setMaxEntities(e),e){var t=this.entities.getEntities();t=t.splice(0,e),this.entities.setEntities(t)}},DiaryAttendees.prototype.setAllDay=function(e){e&&this.schedule.setTime(0,2359)},DiaryAttendees.prototype.date_change=function(e){if(this.date_bar.updateDate(e),Diary.setStartDate(e),Diary.setEndDate(e),"edit"==Diary.mode)this.schedule.setTime(Diary.getStartTime()/100,Diary.get_adjusted_endtime(Diary.getEndTime()/100));else{var t=0,i=235900;Diary.event.startdate==e&&(t=Diary.event.starttime),Diary.event.enddate==e&&(i=Diary.event.endtime),Diary.event.startdate>e||Diary.event.enddate<e?this.schedule.setTime(0,0):this.schedule.setTime(t/100,i/100)}},DiaryAttendees.prototype.show=function(e){var t=this;if(this.init(e),this.entities.display(),this.schedule.display(),this.data.attendee_datebar){this.date_bar=new DiaryDateBar,this.date_bar.display({eventdate:Diary.event.startdate,parent:this.data.attendee_datebar,change:function(e){t.schedule.updateAll(e,t.entities.getEntityMap(),Diary.getEventId(),t.date_bar.param.eventdate,t.getTimeZone(),function(e){t.date_change(e)})}}),this.schedule.setTime(Diary.event.starttime/100,Diary.get_adjusted_endtime(Diary.event.endtime/100))}this.schedule.updateAll(0,this.entities.getEntityMap(),Diary.getEventId(),Diary.getStartDateEx(),this.getTimeZone())},DiaryAttendees.prototype.getLocationAttendeesIds=function(e){var t=this.entities.getCollection();return(t=t.getCollectionByType("location")).getListIds()},DiaryAttendees.prototype.getResourceAttendeesIds=function(e){var t=this.entities.getCollection();return(t=t.getCollectionByType("resource")).getListIds()},DiaryAttendees.prototype.getUserAttendeesIds=function(e){var t=this.entities.getCollection();return(t=t.getCollectionByUserType()).getListIds()},DiaryAttendees.prototype.getClientAttendeesIds=function(e){var t=this.entities.getCollection();return(t=t.getCollectionByType("client")).getListIds()},DiaryAttendees.prototype.getWidgetClientAttendeesIds=function(e){var t=jQuery("input[name='client_entities']").val();t=t.split(",");for(var i=[],a=0;a<t.length;a++){var r=parseInt(t[a],10);isNaN(r)||i.push(r)}return i},DiaryAttendees.prototype.getEntities=function(e){return this.entities.getEntities()},DiaryAttendees.prototype.setAttendees=function(e){this.entities.setEntities(e)},DiaryOrganiser.prototype.initPage=function(){this.org=SingleEntity.create(jQuery("#td_organiser"),"user",["user"]),this.org.do_search=function(e,t){var i=e.getElmName();XMLRPC.call("diary.searchOrgniserDelegate",[i.val()],t)},this.org.setEntity(Diary.organiser_data),Diary.allowOrganizerChanged()?this.org.setState("choose"):this.org.setState("text_readonly")},DiaryOrganiser.prototype.getEntityId=function(){return this.org.getValue()},DiaryAttendeesUser.prototype=new DiaryAttendees,DiaryAttendeesUser.constant={video_meeting_etypes:["user","referral","profadviser"],standard_meeting_etypes:["user","group","referral","profadviser","supplier","resource","location"]},DiaryAttendeesUser.prototype.data={parent:"div_users",title:_("Please select the diary attendees"),name:"diary_users",autopartner:!1,etypes:DiaryAttendeesUser.constant.standard_meeting_etypes,existing:[],event:null,mode:"edit",row_style:"width:179pt;border-bottom-color:white;border-bottom-style:solid;border-bottom-width:1px",title_style:"height:29px;font-weight:bold",schedule_parent:"div_users_schedule",schedule_css:{},schedule_rolekey:"users",attendee_datebar:"div_datebar",width:190},DiaryAttendeesUser.prototype.initPage=function(e){e||(jQuery("#div_users").empty(),this.show({mode:Diary.mode,existing:Diary.attendees_data})),this.setAllDay(Diary.event.isAllDayEvent),Diary.is_video_meeting()?(Diary.updateAttendeeUIForVideoMeeting(),Diary.hideRecurrenceSetting(),Diary.setVideoMeetingLocations(),Diary.setTitleMaxLength()):(Diary.showRecurrenceSetting(),Diary.setOrdinaryLocations(),Diary.removeTitleMaxLength())},DiaryAttendeesUser.prototype.hasInitialized=function(){return!!this.entities},DiaryAttendeesUser.prototype.updateSchedule=function(e,t){var i=this;this.schedule.updateAll(0,this.entities.getEntityMap(),e,t,this.getTimeZone(),function(e){i.date_bar.updateDate(e)})},DiaryAttendeesClient.prototype=new DiaryAttendees,DiaryAttendeesClient.prototype.data={parent:"td_clients",name:"diary_clients",autopartner:!0,etypes:["client"],width:300,existing:[],event:null,mode:"edit"},DiaryAttendeesClient.prototype.initPage=function(){for(var e={},t=0;t<Diary.client_attendees_data.length;t++){var i=Diary.client_attendees_data[t].value;e[i]="/factfind/view/"+i+"?role=client&refresh=1"}Diary.attendees_clients.show({mode:Diary.mode,existing:Diary.client_attendees_data,autopartner:Diary.allowAutoPartner(),existing_urls:e})},DiaryAttendeesClient.prototype.setMaxEntities=function(e){var t=this.getWidgetClientAttendeesIds(),i=t.splice(e,t.length);jQuery.each(i,function(e,t){Diary.removeClient(t)})},DiaryFieldMap.prototype.getSubItems=function(e){var t=this.data.depend[e];void 0===t&&(t=[]);for(var i=[],a=0;a<t.length;a++){var r=this.data.values[t[a]];void 0!==r&&i.push([t[a],r,!1])}return i},DiaryFieldMap.prototype.updateSubItemField=function(e,t){jQuery(e).html("");for(var i=this.getSubItems(t),a=0;a<i.length;a++){var r=i[a],n=jQuery('<option value="'+r[0]+'" />').appendTo(e).html(r[1]);r.length>2&&r[2]&&n.prop("selected",!0)}},DiaryFieldMap.prototype.setCurrent=function(e,t){jQuery(e).val(t)},Diary={event:{},form_name:"form_event",mode:"view",shared_specified:200,attendees_data:[],client_attendees_data:[],attendees_users:new DiaryAttendeesUser,attendees_clients:new DiaryAttendeesClient,organiser:new DiaryOrganiser,map_subcategory:new DiaryFieldMap,video_meeting_max_attendees:0,video_meeting_platform:"",from_container_item:""},Diary.stencil_fields=["title","description","category","subcategory","priority","priv","locations","resources","users","clients","outcome","notifications","attaches","client_attaches","threadid","email_client","dynamic_participant","client_accessible","is_video_meeting","locations_plain"],Diary.constant={reset:-2,rangechange:-3},Diary.urlparam="choice=my",Diary.stateparam={choice:"my"},Diary.urlstencilparam="",Diary.addNewEvent=function(e,t,i,a,r){var n=getBaseURL()+"/diary/event/edit/-1?startdate="+e+"&"+Diary.urlparam;r&&(n=n+"&user="+r),a?n+="&all_day=1":(t&&(n=n+"&starttime="+t),i&&(n=n+"&setendtime="+XPLAN.DateTimeUtil.addIntTime(t,100*i))),window.location.href=n},Diary.showDayMenu=function(e,t,i,a){var r=[new PopupMenuItem(_("View Day Schedule"),getBaseURL()+"/diary/search/day?date="+t+"&"+Diary.urlparam)];parseInt(i,10)||a||(r[1]=new PopupMenuItem(_("Add New Event"),function(){Diary.addNewEvent(t)})),PopupMenu.showByClick(r,e)},Diary.showDaySchedule=function(e){var t="/diary/search/day?date="+e+"&"+Diary.urlparam;window.location.href=getBaseURL()+t},Diary.showWeekSchedule=function(e){var t="/diary/search/week?date="+e+"&"+Diary.urlparam;window.location.href=getBaseURL()+t},Diary.getClientDetail=function(e,t){if(""===t.title){try{XMLRPC.call("diary.getClientDetail",[e],function(e){t.title=e})}catch(e){alert(_("Get Client Detail Error: %a").replace("%a",e.message))}}},Diary.getClientDetail2=function(e,t){var i=jQuery(t);if(""===i.attr("title"))try{XMLRPC.call("diary.getClientDetail2",[e],function(e){i.attr("title",e)})}catch(e){alert(_("Get Client Detail Error: %a").replace("%a",e.message))}},Diary.loadEmailPage=function(e,t,i){var a=getBaseURL()+"/diary/email/"+e+"?cparticipants=1&tplid="+t;i&&(a+="&notnow="+i),a+="&"+Diary.urlparam,window.location.href=a},Diary.loadEmailPageFunc=function(e,t){return function(){Diary.loadEmailPage(e,t)}},Diary.getEmailTemplates=function(){var e=XMLRPC.call("email.getTemplatesByKind",[1e3]);html='<select name="tplid" style="width:300px" >';for(var t=0;t<e.length;t++){var i=e[t];html+='<option value="'+i.id+'" >'+i.desc+"</option>"}return html+="</select>",html},Diary.handleGetEmailTemplates=function(e,t){Diary.loadEmailPage(e,jQuery('select[name="tplid"] option:selected').val(),t)},Diary.getStencilsElement=function(){var e=document.getElementsByName("stencils");return 1==e.length?e[0]:null},Diary.reloadMergeList=function(){document.getElementById("xmergelist").src=getBaseURL()+"/diary/mergelist?random="+Math.random()+"&"+Diary.urlparam},Diary.reloadOutcomeList=function(e){Diary.urlstencilparam="&stencil="+e;var t=document.getElementById("iframe_outcome"),i=getBaseURL()+"/diary/outcomelist/"+Diary.event.eventid+"?"+Diary.urlparam;i+=Diary.urlstencilparam,t.src=i},Diary.loadFromStencilHandler=function(e){for(var t=e.event,i=0;i<Diary.stencil_fields.length;i++){var a=Diary.stencil_fields[i];Diary.event[a]=t[a]}Diary.set_title(Diary.event.title),Diary.set_description(Diary.event.description),Diary.set_category(Diary.event.category),Diary.set_subcategory(Diary.event.subcategory),Diary.set_outcome(Diary.event.outcome),Diary.set_priority(Diary.event.priority),Diary.set_priv(Diary.event.priv),Diary.set_notifications(Diary.event.notifications),Diary.set_attaches(),Diary.set_clients(e.clients,True,False),Diary.set_dynamic_participant(Diary.event.dynamic_participant),Diary.set_client_accessible(Diary.event.client_accessible),Diary.set_is_video_meeting(Diary.event.is_video_meeting),Diary.initVideoMeetingOption(True),Diary.set_attendees(e.attendees_data),Diary.reloadMergeList(),Diary.reloadOutcomeList(e.stencilid),Diary.reminder_list.loadFromStencil(e.stencilid),Diary.event.stencilid=e.stencilid,Diary.event.from_stencil=e.from_stencil,Diary.set_locations_plain(Diary.event.locations_plain)},Diary.loadFromStencil=function(e){Diary.setData(),XMLRPC.call("diary.loadfromstencil",[Diary.stateparam,Diary.event,e],Diary.loadFromStencilHandler)},Diary.onchangeStencils=function(){var e=Diary.getStencilsElement();if(e&&"-1"!=e.value){var t=parseInt(e.value,10);isNaN(t)||Diary.loadFromStencil(t)}},Diary.setStencilsOnchange=function(){var e=Diary.getStencilsElement();e&&(e.onchange=Diary.onchangeStencils)},Diary.isStencil=function(){return Diary.event.stencil>0},Diary.getUsers=function(){return Diary.attendees_users.getUserAttendeesIds()},Diary.getLocations=function(){return Diary.attendees_users.getLocationAttendeesIds()},Diary.getResources=function(){return Diary.attendees_users.getResourceAttendeesIds()},Diary.getClients=function(){return Diary.attendees_clients.getClientAttendeesIds()},Diary.getWidgetClients=function(){var e=Diary.attendees_clients.getWidgetClientAttendeesIds();return isNaN(e[0])&&(e=[]),e},Diary.set_attendees=function(e){var t=Diary.attendees_users.getEntities();if(e.length>0){var i=Diary.merge_entities(t,e);Diary.attendees_users.setAttendees(i)}},Diary.getTimeZone=function(){return document.getElementsByName("event_timezone")[0].value},Diary.getEventId=function(){return parseInt(document.getElementById("eventid").value,10)},Diary.getCategory=function(){return parseInt(document.getElementsByName("category")[0].value,10)},Diary.getSubcategory=function(){var e=parseInt(document.getElementsByName("subcategory")[0].value,10);return isNaN(e)&&(e=100),e},Diary.set_category=function(e){jQuery('input[name="category"]').parent().parent().xplan_color_select("set_value",e)},Diary.set_subcategory=function(e){return document.getElementsByName("subcategory")[0].value=e},Diary.set_outcome=function(e){jQuery('select[name="outcome"]').val(e)},Diary.setSelect=function(e,t){for(var i=document.getElementsByName(e)[0],a=0;a<i.options.length;a++)if(t==i.options[a].value){i.options[a].selected=!0;break}},Diary.getPriority=function(){return parseInt(document.getElementsByName("priority")[0].value,10)},Diary.set_priority=function(e){Diary.setSelect("priority",e)},Diary.getPriv=function(){return parseInt(document.getElementsByName("priv")[0].value,10)},Diary.getStencil=function(){return parseInt(document.getElementsByName("stencil")[0].value,10)},Diary.getThreadid=function(){return parseInt(document.getElementsByName("threadid")[0].value,10)},Diary.getEmailClient=function(){return document.getElementsByName("email_client")[0].value},Diary.getOutcome=function(){return parseInt(document.getElementsByName("outcome")[0].value,10)},Diary.getOwnerEdit=function(){return parseInt(document.getElementsByName("owner_edit")[0].value,10)},Diary.getAvailableToReferral=function(){return parseInt(document.getElementsByName("available_to_referral")[0].value,10)},Diary.getAvailableToProfAdviser=function(){return parseInt(document.getElementsByName("available_to_profadviser")[0].value,10)},Diary.set_priv=function(e){Diary.setSelect("priv",e)},Diary.setCheckboxes=function(e,t){for(var i=document.getElementsByName(e),a=0;a<i.length;a++){var r=i[a];r.checked=!1;for(var n=0;n<t.length;n++)if(r.value==t[n]){r.checked=!0;break}}},Diary.checkSharedGroups=function(){return Diary.getStencil()!=Diary.shared_specified||(""!==jQuery("input[name='sharedgrouplookup']").val()||(alert(_("You must specify a shared group")),!1))},Diary.getSharedHierarchyGroups=function(){var e=[],t="";if(Diary.getStencil()==Diary.shared_specified){t=jQuery("input[name='sharedgrouplookup']").val().split(",");for(var i=0;i<t.length;i++)e.push(parseInt(t[i],10))}return e},Diary.getSharedgroups=function(){var e=[];if(Diary.getStencil()==Diary.shared_specified)for(var t=document.getElementsByName("sharedgroups"),i=0;i<t.length;i++)t[i].checked&&e.push(parseInt(t[i].value,10));return e},Diary.getNotifications=function(){for(var e=document.getElementsByName("notifications"),t=[],i=0;i<e.length;i++)e[i].checked&&t.push(e[i].value);return t},Diary.set_notifications=function(e){Diary.setCheckboxes("notifications",e)},Diary.set_attaches=function(){$("iframe_attaches").src=getBaseURL()+"/attach/list?mode=edit&random="+Math.random()},Diary.merge_entities=function(e,t){var i,a,r,n=[],s={};for(i=0;i<e.length;i++){var o=e[i];a=o.etype,r=o.value,void 0===s[a]&&(s[a]={}),s[a][r]=1,n.push(o)}for(i=0;i<t.length;i++){var l=t[i];a=l.etype,r=l.value,s[a]||(s[a]={}),s[a][r]||(s[a][r]=1,n.push(l))}return n},Diary.setStartDate=function(e){return XPLAN.DateField.setDate("#startdate",e)},Diary.getStartDate=function(){var e=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#startdate"));return null===e&&(e=0),e},Diary.getStartDateEx=function(){var e=Diary.getStartDate();return 0===e&&(e=Diary.event.startdate),e},Diary.getDynamicParticipant=function(){var e=jQuery('select[name="dynamic_participant"]');return 0===e.length?[]:null===(e=e.val())?[]:jQuery.map(e,function(e){return parseInt(e,10)})},Diary.set_dynamic_participant=function(e){jQuery('select[name="dynamic_participant"] option').each(function(){var t=parseInt(jQuery(this).val(),10);jQuery.inArray(t,e)>=0?jQuery(this).prop("selected","selected"):jQuery(this).removeAttr("selected")}),jQuery('select[name="dynamic_participant"]').trigger("liszt:updated")},Diary.get_client_accessible=function(e){return jQuery('input[type="checkbox"][name="client_accessible"]').is(":checked")},Diary.set_client_accessible=function(e){jQuery('input[type="checkbox"][name="client_accessible"]').prop("checked",e)},Diary.is_video_meeting=function(){return jQuery('input[type="checkbox"][name="is_video_meeting"]').is(":checked")},Diary.set_is_video_meeting=function(e){jQuery('input[type="checkbox"][name="is_video_meeting"]').prop("checked",e)},Diary.setEndDate=function(e){XPLAN.DateField.setDate("#enddate",e)},Diary.getEndDate=function(){var e=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate("#enddate"));return null===e&&(e=0),e},Diary.getStartTime=function(){return Diary.starttime.xplan_time_dropdown("getValue")},Diary.getEndTime=function(){return Diary.endtime.xplan_time_dropdown("getValue")},Diary.setStartTime=function(e){return Diary.starttime.xplan_time_dropdown("setValue",e)},Diary.setEndTime=function(e){return Diary.endtime.xplan_time_dropdown("setValue",e)},Diary.getTitleElement=function(){return document.getElementsByName("title")[0]},Diary.getTitleSelector=function(){return jQuery(Diary.getTitleElement())},Diary.getTitle=function(){return Diary.getTitleElement().value},Diary.set_title=function(e){Diary.getTitleElement().value=e},Diary.getDescription=function(){return document.getElementsByName("description")[0].value},Diary.getLocationsSelector=function(){return jQuery('input[name="locations_plain"]')},Diary.getLocationsPlain=function(){return Diary.getLocationsSelector().val()},Diary.set_locations_plain=function(e){Diary.getLocationsSelector().val(e)},Diary.set_description=function(e){document.getElementsByName("description")[0].value=e},Diary.getTaskLinkId=function(){var e=document.getElementsByName("tasklinkid"),t=-1;return e.length>0&&(t=parseInt(e[0].value,10),isNaN(t)&&(t=-1)),t},Diary.getQuickMerge=function(){var e=document.getElementsByName("diary_quickmerge"),t=-1;return e.length>0&&(t=parseInt(e[0].value,10),isNaN(t)&&(t=-1)),t},Diary.getIsAllDayEvent=function(){return document.getElementsByName("isAllDayEvent")[0].checked},Diary.checkTitle=function(){var e=Diary.getTitleElement(),t=!1;if(""===e.value)if(e.getAttribute("disabled"))alert(_("Please fill in event's details using a template. "));else{alert(_("Please fill in title. "));try{e.focus(),e.select()}catch(e){}}else t=!0;return t},Diary.checkOrganiser=function(){var e=!0;return Diary.organiser.getEntityId()<0&&(alert(_("Please select an organiser")),e=!1),e},Diary.checkUsers=function(){var e=!0;if(0===Diary.getUsers().length){var t=Diary.getDynamicParticipant();0!==Diary.getWidgetClients().length&&0!==t.length||(alert(_("Please select at least one user as participant.")),e=!1)}return e},Diary.checkSchedule=function(){if(!XPLAN.DateField.isValid("#startdate"))return alert(_("start date incorrect.")),!1;if(!XPLAN.DateField.isValid("#enddate"))return alert(_("end date incorrect.")),!1;var e=Diary.getStartDate(),t=Diary.getEndDate(),i=Diary.getStartTime(),a=Diary.getEndTime(),r=Diary.getIsAllDayEvent(),n=!1;return Diary.isStencil()||Diary.event.isTemplate?n=!0:e>t?alert(_("Start Date must be smaller than End Date.")):e==t&&i>=a&&!r?alert(_("Start time must be smaller than End Time.")):n=!0,n},Diary.prepareToSave=function(){return!!Diary.checkTitle()&&(Diary.isStencil()?Diary.checkSharedGroups():Diary.checkOrganiser()&&Diary.checkUsers()&&Diary.checkSchedule())},Diary._process_saved=function(e){e.info&&e.info.thread_fixeddate_changed&&alert(_("Changing the Diary Date will update the base date of the thread attached to this Diary Event. Please review the thread for required changes.")),XPLAN.util.startswith(e.value,"/")?getMainFrame(getBaseURL()+e.value):getMainFrame(e.value)},Diary.saveEventHandler=function(e){if(e.warning)Diary.loading(!1),XPLAN.framemain.alert_text(e.warning);else if("saved"==e.flag){if(Diary.loading(!1),""!==Diary.from_container_item)return XPLAN.Thread.Common.check_review_creation(null,parseInt(Diary.from_container_item,10),Diary._process_saved,[e]);Diary._process_saved(e)}else if("email"==e.flag)Diary.event.eventid=e.eventid,Diary.reminder_list._handleAddReminder();else if("saved_error"==e.flag)Diary.loading(!1),e.info&&e.info.invalid_rrule?alert(_("Recurrence setup is invalid!")):e.info&&e.info.error?alert(e.info.error):alert(_("Error occurs in saving diary event!"));else{Diary.showConflict(e.value,function(t){t&&Diary.saveViaRpc(!0,e.eventtype)},e)}},Diary.saveViaRpc=function(e,t,i){i||(i=Diary.saveEventHandler),XMLRPC.call("diary.saveevent",[Diary.stateparam,Diary.event,e,t],i)},Diary.cacheEvent=function(e){Diary.setData(),XMLRPC.call("diary.cache_event",[Diary.stateparam,Diary.event],function(t){e&&e(t)})},Diary.getClientMulti=function(){var e,t=Diary.attendees_clients.getWidgetClientAttendeesIds(),i=null,a=[];for(e=0;e<t.length;e++)i=t[e],a.push([i,client_data[i].name]);var r=[];for(e=0;e<a.length;e++){var n='<li><input name="thread_clients" type="checkbox" checked value="';n+=a[e][0]+'" >',n+=XPLAN.util.escape(a[e][1],"xmlq"),n+="</li>",r.push(n)}return r.join("")},Diary.showThreadClientChoice=function(e){if(Diary.isNormalNew()&&Diary.templateLoaded())if(Diary.moreThanOneClient()){var t='<div style="height:auto;margin-top:1ex;overflow:auto;">';t+=Diary.getClientMulti(),t+="</div>",PopupForm2.show(t,_("Select clients for thread!"),{width:"auto",height:"auto",onclose:function(t){Diary.event.thread_entities=[];var i=[];XPLAN.util.isArray(t.thread_clients)?i=t.thread_clients:"undefined"==typeof t.thread_clients||(i=[t.thread_clients]);for(var a=0;a<i.length;a++){var r=parseInt(i[a],10);isNaN(r)||Diary.event.thread_entities.push(r)}e()}})}else 1==Diary.event.clients.length?(Diary.event.thread_entities=[Diary.event.clients[0]],e()):(Diary.event.thread_entities=[],e());else e()},Diary.allowAutoPartner=function(){return Diary.event.eventid<0&&!Diary.event.isOccurrence&&"edit"==Diary.mode},Diary.allowOrganizerChanged=function(){return Diary.event.eventid<0&&!Diary.event.isOccurrence&&"edit"==Diary.mode&&!Diary.isStencil()&&!Diary.isReferral},Diary.isNormalNew=function(){return Diary.event.eventid<0&&!Diary.event.isTemplate&&!Diary.event.isOccurrence},Diary.templateLoaded=function(){return!Diary.isStencil()&&Diary.event.threadid>0},Diary.moreThanOneClient=function(){return Diary.event.clients.length>1},Diary.setData=function(){var e=Diary.event;if(e.eventid=Diary.getEventId(),e.title=Diary.getTitle(),e.description=Diary.getDescription(),e.category=Diary.getCategory(),e.subcategory=Diary.getSubcategory(),e.priority=Diary.getPriority(),e.priv=Diary.getPriv(),e.startdate=Diary.getStartDate(),e.enddate=Diary.getEndDate(),e.starttime=Diary.getStartTime(),e.endtime=Diary.getEndTime(),e.event_timezone=Diary.getTimeZone(),e.isAllDayEvent=Diary.getIsAllDayEvent(),e.users=Diary.getUsers(),e.clients=Diary.getWidgetClients(),e.locations=Diary.getLocations(),e.resources=Diary.getResources(),e.notifications=Diary.getNotifications(),e.tasklinkid=Diary.getTaskLinkId(),e.diarymerge=Diary.getQuickMerge(),e.outcome=Diary.getOutcome(),null===e.parent&&(e.parent=-1),Diary.isStencil()&&(e.email_client=Diary.getEmailClient(),e.stencil=Diary.getStencil(),e.threadid=Diary.getThreadid(),e.owner_edit=Diary.getOwnerEdit(),e.sharedgroups=Diary.getSharedHierarchyGroups(),e.available_to_referral=Diary.getAvailableToReferral(),e.available_to_profadviser=Diary.getAvailableToProfAdviser()),Diary.allowOrganizerChanged()){var t=Diary.organiser.getEntityId();e.organiser=parseInt(t,10)}e.container_dialog=XPLAN.Diary.ContainerDialog.get_dialog_data(),e.dynamic_participant=Diary.getDynamicParticipant(),e.client_accessible=Diary.get_client_accessible(),e.is_video_meeting=Diary.is_video_meeting(),void 0!==Diary.getMeetingAgendaData&&(e.meeting_agenda=Diary.getMeetingAgendaData()),e.locations_plain=Diary.getLocationsPlain()},Diary.getRecurrence=function(){Diary.event.isTemplate&&(Diary.event.recurrence=Recurrence.data)},Diary.saveEvent=function(e){Diary.prepareToSave()&&(Diary.setData(),Diary.is_video_meeting()&&"suitebox"===Diary.video_meeting_platform?jQuery("#diary_event_save").xplan_tnc("show_tnc",function(){Diary.saveSuccess(e)}):Diary.saveSuccess(e))},Diary.saveSuccess=function(e){Diary.loading(!0),Diary.showThreadClientChoice(function(){Diary.saveViaRpc(!1,e)})},Diary.loading=function(e){e?EggTimer.show():EggTimer.hide(),jQuery("#diary_event_save").prop("disabled",e)},Diary.showRecurrenceString=function(){var e=Diary.buildRecurrenceString();jQuery("#td_recurrence").text(e)},Diary.strfdatetime=function(e){return XPLAN.DateTimeUtil.strftime("%d/%b/%Y",d)},Diary.strftime=function(e){var t=XPLAN.DateTimeUtil.intToDate(e,0);return XPLAN.DateTimeUtil.strftime("%d/%b/%Y",t)},Diary.buildTimeString=function(){var e="";if(!Diary.event.isTemplate){var t=XPLAN.DateTimeUtil.intToDate(Diary.event.startdate,Diary.event.starttime),i=XPLAN.DateTimeUtil.intToDate(Diary.event.enddate,Diary.event.endtime);e=Diary.event.startdate==Diary.event.enddate?XPLAN.DateTimeUtil.strftime("%d/%b/%Y",t)+" "+XPLAN.DateTimeUtil.strftime("%I:%M %p",t)+" -- "+XPLAN.DateTimeUtil.strftime("%I:%M %p",i):XPLAN.DateTimeUtil.strftime("%d/%b/%Y",t)+" "+XPLAN.DateTimeUtil.strftime("%I:%M %p",t)+" -- "+XPLAN.DateTimeUtil.strftime("%d/%b/%Y",i)+" "+XPLAN.DateTimeUtil.strftime("%I:%M %p",i)}return e},Diary.showTimeString=function(){jQuery("#td_time").text(Diary.buildTimeString())},Diary.setRecurrence=function(){Diary.event.isTemplate?Recurrence.setData(Diary.event.recurrence):"edit"==Diary.mode&&(Recurrence.data.starttime=Diary.getStartTime(),Recurrence.data.endtime=Diary.getEndTime(),Recurrence.data.startdate=Diary.event.startdate,Recurrence.data.until=Diary.event.startdate)},Diary.initSubcategory=function(){if("edit"==Diary.mode){Diary.map_subcategory.updateSubItemField("select[name=subcategory]",Diary.event.category),Diary.map_subcategory.setCurrent("select[name=subcategory]",Diary.event.subcategory);var e=jQuery('input[name="category"]');e.length>0&&(e=e.eq(0)).change(function(){var t=e.val();Diary.map_subcategory.updateSubItemField("select[name=subcategory]",t)})}},Diary.getAvailableAttendeeSlotsForVideoMeeting=function(){var e=Diary.attendees_clients.getWidgetClientAttendeesIds(),t=Diary.attendees_users.getEntities(),i=e.length+t.length;return Diary.video_meeting_max_attendees-i},Diary.updateAttendeeUIForVideoMeeting=function(){Diary.attendees_users.hasInitialized()&&(Diary._updateAttendeeClientUIForVideoMeeting(),Diary._updateAttendeeUserUIForVideoMeeting())},Diary._updateAttendeeUserUIForVideoMeeting=function(){var e=Diary.getAvailableAttendeeSlotsForVideoMeeting(),t=Diary.attendees_users.getEntities().length+e;Diary.attendees_users.setMaxEntities(t)},Diary._updateAttendeeClientUIForVideoMeeting=function(){var e=Diary.getAvailableAttendeeSlotsForVideoMeeting(),t=Diary.attendees_clients.getWidgetClientAttendeesIds().length+e;Diary.attendees_clients.setMaxEntities(t)},Diary.initVideoMeetingOption=function(e){var t=jQuery("input[name=is_video_meeting]"),i=function(){Diary.is_video_meeting()?(Diary.attendees_users.data.max_entities=Diary.video_meeting_max_attendees,Diary.attendees_users.data.etypes=DiaryAttendeesUser.constant.video_meeting_etypes,Diary.changePermissionStatus(!0)):(Diary.attendees_users.data.max_entities=0,Diary.attendees_users.data.etypes=DiaryAttendeesUser.constant.standard_meeting_etypes,Diary.changePermissionStatus(!1)),Diary.attendees_users.initPage(e)};Diary.getEventId()>=0?t.prop("disabled",!0):t.change(function(e){i()}),i()},Diary.changePermissionStatus=function(e){e?(jQuery('select[name="priv"]').val("100"),jQuery('select[name="priv"]').prop("disabled",!0)):jQuery('select[name="priv"]').prop("disabled",!1)},Diary.checkOutcome=function(){if(!Diary.event.stencil){var e=Diary.event.setoutcomedone;jQuery('select[name="outcome"]').prop("disabled",e)}},Diary.handleEntityChange=function(e){for(var t=[],i=0;i<e.length;i++){if("client"==e[i].type){var a=XMLRPC.call("factfind.searchPartner",[e[i].id]);if(void 0!==a[0]){confirm(_("Also add the partner %a for client\n%b?").replace("%a",a[1]).replace("%b",e[i].name))?(t.push({value:e[i].id,text:e[i].name,etype:e[i].type}),t.push({value:a[0],text:a[1],etype:"client"})):t.push({value:e[i].id,text:e[i].name,etype:e[i].type})}else t.push({value:e[i].id,text:e[i].name,etype:e[i].type})}}return t},Diary.initPage=function(e){var t=(e=e||{}).video_meeting_max_participants||0;this.video_meeting_platform=e.video_meeting_platform,this.video_meeting_max_attendees=t+1,"edit"==Diary.mode&&(Diary.setStencilsOnchange(),Diary.InitSchedule(Diary.event.isAllDayEvent),Diary.showSchedule(!Diary.event.isTemplate)),Diary.initSubcategory(),"view"==Diary.mode&&Diary.attendees_clients.initPage(),Diary.organiser.initPage(),Diary.initStencil(Diary.event.stencil),Diary.setRecurrence(),Diary.event.isTemplate?Diary.showRecurrenceString():Diary.showTimeString(),jQuery('textarea[name="description"]').width("95%"),Diary.reminder_list&&Diary.reminder_list.load("edit"==Diary.mode),Diary._showContainer(),Diary.initVideoMeetingOption()},Diary.initStencil=function(e){if(e>0){var t=document.getElementsByName("stencil")[0];t&&XPLAN.event.connect(t,"change",Diary.changeStencil)}Diary.displaySharedGroups(e)},Diary.changeStencil=function(){var e=document.getElementsByName("stencil")[0];e&&Diary.displaySharedGroups(e.value)},Diary.displaySharedGroups=function(e){var t=document.getElementById("tr_sharedgroups");t&&(t.style.display=e==Diary.shared_specified?"":"none")},Diary.showConflict=function(e,t,i){Diary.loading(!1);var a=XPLAN.ui.Popup.get_dialog("diary_conflict_dialog").css("z-index",3e4),r=[{text:_("Cancel"),click:function(){a.dialog("close")}},{text:"^"+_("Ok"),click:function(){Diary.loading(!0),t(!0),a.dialog("close")}}];a.html(e);var n={modal:!0,title:_("Confirm"),width:500,close:function(){a.dialog("destroy")},buttons:r};jQuery=getMainFrame().jQuery,(a=jQuery(a)).dialog(n)},Diary.listFavouriteTemplate=function(){var e=jQuery("select[name='diary_quickmerge']");if(e.children("option").length<=1){e.append("<option />").children("option:last").val("-1").text(_("Do not run quick merge"));for(var t=XMLRPC.call("report.getFavouriteTemplates",["diary"]),i=0;i<t.length;i++)for(var a=t[i],r=0;r<a.tpls.length;r++)e.append("<option />").children("option:last").val(""+a.tpls[r].entityid).text(a.tpls[r].name)}},Diary.showSchedule=function(e){var t=document.getElementById("tr_startdate");t.style.display=e?"":"none",(t=document.getElementById("tr_enddate")).style.display=e?"":"none",(t=document.getElementById("span_isalldayevent")).style.display=e?"":"none"},Diary.isEndDateChanged=function(){for(var e in Recurrence.data)if("starttime"!=e&&"endtime"!=e&&"count"!=e&&"until"!=e){var t=Recurrence.data[e],i=Diary.event.recurrence[e];void 0===i&&(i=""),void 0===t&&(t="");var a=XPLAN.util.getType(t);if(a==XPLAN.util.getType(i)&&"string"==a&&(t=t.toLowerCase(),i=i.toLowerCase()),t!=i)return!0}return!1},Diary.recurrenceclose=function(e){if("ok"==e.status){if(Diary.event.isTemplate&&Diary.event.eventid>0)if(Diary.isEndDateChanged()){if(!confirm(_("Any exceptions associated with this recurring appointment will be lost. Is this ok?")))return;Diary.event.reset_recurrence=Diary.constant.reset}else Diary.event.reset_recurrence=Diary.constant.rangechange;Diary.event.isTemplate=!0,Diary.getRecurrence()}else"cancel"==e.status||"remove"==e.status&&(Diary.event.isTemplate=!1);Diary.showSchedule(!Diary.event.isTemplate),Diary.showRecurrenceString(),Diary._showContainer()},Diary._showContainer=function(){XPLAN.Diary.ContainerDialog.toggle(!Diary.event.isTemplate&&!Diary.event.isOccurrence)},Diary._showRecurrence=function(){Recurrence.onclose=Diary.recurrenceclose,Recurrence.showDialog({onCheckAllDay:function(e){jQuery("#span_isalldayevent input").prop("checked",e)}})},Diary.showRecurrence=function(){Diary.setRecurrence(),Diary._showRecurrence()},Diary.buildRecurrenceString=function(){return Diary.event.isTemplate?Recurrence.getText():"No Recurrence"},Diary.showRecurrenceSetting=function(){jQuery("#tr_recurrence").show(),jQuery("#td_recurrence").text(_("No Recurrence")),Recurrence.updateActionText()},Diary.hideRecurrenceSetting=function(){jQuery("#tr_recurrence").hide(),Recurrence.setData()},Diary.setOrdinaryLocations=function(){Diary.set_locations_plain(Diary.event.locations_plain),Diary.getLocationsSelector().prop("disabled",!1)},Diary.setVideoMeetingLocations=function(){Diary.set_locations_plain(XPLAN.util.escape(_("Video Meeting Room"))),Diary.getLocationsSelector().prop("disabled",!0)},Diary.setTitleMaxLength=function(){Diary.set_title(Diary.getTitle().substr(0,128)),Diary.getTitleSelector().attr("maxlength","128")},Diary.removeTitleMaxLength=function(){Diary.getTitleSelector().removeAttr("maxlength")},Diary.setAllDay=function(e){var t=document.getElementById("td_starttime"),i=document.getElementById("td_endtime");t.style.display=e?"none":"inline-block",i.style.display=e?"none":"inline-block"},Diary.clickRecurrence=function(e){document.getElementById("tr_recurrence").style.display=e?"":"none",e&&Diary.showRecurrence()},Diary.sameStartEndDate=function(){Diary.setEndDate(XPLAN.DateTimeUtil.intToDate(Diary.getStartDate())),Diary.adjustStartDate()},Diary.isSameStartEndDate=function(){return Diary.getStartDate()==Diary.getEndDate()},Diary.adjustStartDate=function(){var e=Diary.getStartDate();e>Diary.getEndDate()?Diary.sameStartEndDate():(Diary.attendees_users.updateSchedule(Diary.getEventId(),e),Diary.attendees_users.schedule.setTime(Diary.getStartTime()/100,Diary.get_adjusted_endtime(Diary.getEndTime()/100)))},Diary.get_adjusted_endtime=function(e){var t=e;return("view"==Diary.mode&&Diary.event.enddate>Diary.event.startdate||"edit"==Diary.mode&&Diary.getEndDate()>Diary.getStartDate())&&(t=2359),t},Diary.createStartEndTime=function(){Diary.starttime=jQuery("#td_starttime").xplan_time_dropdown({name:"starttime",value:Diary.event.starttime,onchange:function(e){Diary.isSameStartEndDate()&&Diary.endtime.xplan_time_dropdown("getValue")<=e&&Diary.endtime.xplan_time_dropdown("setNextValue",e),Diary.attendees_users.schedule.setTime(e/100,Diary.get_adjusted_endtime(Diary.endtime.xplan_time_dropdown("getValue")/100))}}),Diary.endtime=jQuery("#td_endtime").xplan_time_dropdown({name:"endtime",value:Diary.event.endtime,onchange:function(e){Diary.isSameStartEndDate()&&Diary.starttime.xplan_time_dropdown("getValue")>=e&&Diary.starttime.xplan_time_dropdown("setPrevValue",e),Diary.attendees_users.schedule.setTime(Diary.starttime.xplan_time_dropdown("getValue")/100,Diary.get_adjusted_endtime(e/100))}})},Diary.InitSchedule=function(e){Diary.createStartEndTime();for(var t=document.getElementsByName("startdate"),i=document.getElementsByName("enddate"),a=0;a<t.length;a++)t[a].onchange=Diary.adjustStartDate,i[a].onchange=Diary.adjustStartDate;Diary.setAllDay(e)},Diary.join=function(e){for(var t="",i=0;i<e.length;i++)0!==i&&(t+=","),t+=e[i];return t},Diary.onShow_outcomelist=function(){},Diary.InitClientGrid=function(){var e=document.getElementById("client_list_elem");e&&(client_list=new ListTable(e))},Diary.set_clients=function(e,t,i,a){if(void 0!==e){if(i){client_data=[];for(var r=0;r<e.length;r++)client_data.push({id:e[r].value,name:e[r].text,type:e[r].etype});client_data.length>0&&!a&&(e=Diary.handleEntityChange(client_data))}Diary.addClient(e,t)}},Diary.addClient=function(e,t){if(Diary.is_video_meeting()&&Diary.attendees_users.hasInitialized()){var i=Diary.getAvailableAttendeeSlotsForVideoMeeting();i<e.length&&PopupMsgBox.show_warning_text(_("Partner has not been added as the maximum number of attendees for this type of meeting has been reached.")),e=e.slice(0,i)}for(var a=client_order.slice(0),r=0;r<e.length;r++){Diary.clientExists(e[r].value)||(client_data[e[r].value]={name:e[r].text,order:client_order.length},client_order.push(e[r].value))}t||(XPLAN.event.send("diary client changed",{old_clients:a,clients:client_order,action:"add"}),Diary.reminder_list&&Diary.reminder_list.on_client_changed()),Diary.refreshClients(),Diary.is_video_meeting()&&Diary.updateAttendeeUIForVideoMeeting()},Diary.clientExists=function(e){for(var t=0;t<client_order.length;t++)if(client_order[t]==e)return!0;return!1},Diary.removeClient=function(e){var t=client_order.slice(0),i=client_data[e].order;client_order.splice(i,1),delete client_data[e],XPLAN.event.send("diary client changed",{old_clients:t,clients:client_order,action:"deleted"}),Diary.reminder_list&&Diary.reminder_list.on_client_changed(),Diary.refreshClients(),Diary.is_video_meeting()&&Diary.updateAttendeeUIForVideoMeeting()},Diary.refreshClients=function(){if(client_list){for(var e=[],t=0;t<client_order.length;t++){var i=client_order[t],a=client_data[i.toString()],r=a.name,n='<span class="icon icon-remove" onclick="javascript:Diary.removeClient('+i+');"></span>&nbsp;&nbsp;<span>'+XPLAN.util.escape(r)+"</span>";a.order=t,e.push(["<html>"+n+"</html>"])}client_list.loadData(client_order,e),document.getElementsByName("client_entities")[0].value=client_order}},function(e){e.XPLAN.namespace("diary"),XPLAN.diary.outcomeHandler=function(t){if(t)if(t.params.show_opportunity_modal)XPLAN.apex.globalnav.receiver.launchCreateOpportunityModal({clientId:t.params.client_id,templateId:t.params.template_id});else if(t.url){var i=getBaseURL()+t.url;if(t.inpopup){e.open(i,"","height=500,width=700,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no")}else getMainFrame(i)}};var t=function(e,i){return t.fn.init(e,i)};t.fn=t.prototype={constructor:t,data:"",selector:"",init:function(e,t){return this.width="auto",this.height="auto","undefined"!=typeof t&&(this.data=t.data,t.width&&(this.width=t.width),t.height&&(this.height=t.height),this.on_before_upload=t.on_before_upload||null),this.selector=e,this},_defaultOptions:function(){return{title:_("Select a file"),autoOpen:!1,modal:!0,height:this.height,width:this.width,overlay:{"background-color":"#454545",opacity:.9},close:function(e,t){jQuery(this.selector).html("")}}},show:function(){jQuery(this.selector).html("");var e=this,t=[];t.push('<form id="diary_attachment_form" enctype="multipart/form-data" ','method="post" action="',this.data.action_uri,'"'),void 0!=this.data.target&&t.push(' target="',this.data.target,'"'),t.push("><div>",_("Choose a file to upload"),': <input type="file" name="attachfile" id="attachfile"></input></div></form>'),t=t.join("");var i=jQuery(this.selector).dialog(this._defaultOptions());jQuery(t).appendTo(i);var a={Upload:function(){jQuery("#attachfile").val().length<1?alert(_("Please select a file to attach!")):(null!==e.on_before_upload&&e.on_before_upload(),jQuery("#diary_attachment_form").submit(),jQuery(this).dialog("close"))},Cancel:function(){jQuery(this).dialog("close")}};return i.dialog("option","buttons",a),i.dialog("open"),jQuery(this.selector).css("height",""),this}},e.XPLAN.diary.attachment=t}(window);
;Dependency._js['diary']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("diary"),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_diary",create:function(e){this.elm=e,this._load()},_load:function(){var e=this;e.elm.html(e.options.html),e.elm.dialog({title:XPLAN.util.escape(_("Add Diary Entry")),width:400,height:250,resizable:!1,buttons:[{text:_("More..."),click:function(){var t=e._get_diary_fields();if(t){var a="choice=my&docid="+e.options.docid+"&user="+t.adviserid+"&startdate="+t.diary_date+"&starttime="+t.starttime+"&setendtime="+t.endtime+"&category="+t.diary_category;getMainFrame(getBaseURL()+"/diary/event/edit/-1?"+a),e.elm.dialog("close")}}},{text:_("Cancel"),click:function(){e.elm.dialog("close")}},{text:_("^Ok"),click:function(){var t=e._get_diary_fields();t&&XMLRPC.call(e.options.ajax_rpcs.query_diary,[t.adviserid,t.diary_date,t.starttime,t.endtime],function(t){if(t){Diary.showConflict(t,function(t){t&&e._add_diary()})&&e._add_diary()}else e._add_diary()},function(e){alert(XPLAN.util.escape(_("Cannot add diary:"))+e.message)})}}],close:function(){e.elm.remove()},modal:!0})},_add_diary:function(){var e=this,t=e._get_diary_fields();t&&XMLRPC.call(e.options.ajax_rpcs.add_diary,[e.options.docid,t.adviserid,t.diary_date,t.starttime,t.endtime,t.diary_category],function(t){t&&(alert(XPLAN.util.escape(_("Diary entry added."))),e.elm.dialog("close"))},function(e){alert(XPLAN.util.escape(_("Cannot add diary:"))+e.message)})},_get_diary_fields:function(){var e=parseInt(this._get_elm("adviserid").val(),10);if(isNaN(e)||-1==e)return alert(XPLAN.util.escape(_("Please select a user."))),!1;var t=XPLAN.DateField.getDate(this._get_elm("diary_date"));return{adviserid:e,diary_category:this._get_elm("diary_category").val(),diary_date:XPLAN.DateTimeUtil.dateToInt(t),starttime:DateField.getTime2(this._get_elm("starttime")[0]),endtime:DateField.getTime2(this._get_elm("endtime")[0])}},_get_elm:function(t){return e(':input[name="'+t+'"]',this.elm)}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['docnote/docnote_diary']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addJS("table")),function(e){var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_dependency",create:function(e){e.is("select")&&this._init_type(e)},_handle_type_change:function(n){var t=e(this.options.child_selector),a=e(n).prop("multiple"),i=this._get_dependent_subtypes(e(n).val()?e(n).val():[],a),p=t.val();t.each(function(e,n){SelectUtil.makeSelect(n,i)}),SelectUtil.setValue(t,p),this.options.default_to_first_option&&t.each(function(n,t){var a=e(t);if(null==a.val()){var i=a.find("option:first");i&&i.length&&SelectUtil.setValue(a,i.val())}}),t.trigger("change"),t.trigger("liszt:updated")},_init_type:function(n){var t=this,a="xplan_dependency_dependency"+this.options.ajax_id;if(!n.data(a)&&this.options.dependency_map&&!jQuery.isEmptyObject(this.options.dependency_map)){var i=e(this.options.child_selector),p=i.val();n.bind("change",function(){t._handle_type_change(this)}).change(),null!=p&&i.val()!==p&&i.val(p),n.data(a,!0)}},_get_dependent_subtypes:function(n,t){var a=this;t||(n=[n]);var i=[],p=[],s=e.grep(n,function(e){return e==a.options.master_blank});return n.length===s.length?p=this.options.empty_blank_category?[]:this.options.all_subtypes:n.length>0&&(a.options.always_show_blank_child&&a.options.all_subtypes.length>0&&p.push(a.options.all_subtypes[0]),jQuery.each(n,function(n,t){dependents=a.options.dependency_map[t],dependents&&jQuery.each(dependents,function(n,t){-1==e.inArray(t.toString(),i)&&(p.push(t),i.push(t.toString()))})})),p},get_map:function(e){return this.options.dependency_map}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery),jQuery,XPLAN.namespace("XplanAjax").createClass({parent_plugin_name:"xplan_dependency",plugin_name:"xplan_dependency_with_input_element",create:function(e){this._init_type(e)}});
;Dependency._js['ajax/dependency']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/dependency"),Dependency.addCSS("ipstable")),function(e){var n={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_link_listitem",create:function(e){this.panel=e},show_dialog:function(e,n){var i=this;EggTimer.show(),i.options.data.docid=n,i.connection.call("html",[i.options.data]).done(function(n){EggTimer.hide(),i._show_dialog(e,n.html)}).fail(function(e){EggTimer.hide();var n=_("Error: %a").replace("%a",e.message);alert(n)})},_save_links:function(n){var i=e('form[name="link_table"] table',this.panel),a=i.find("tr").length-1,t=XPLAN.util.elem2object(i),l=e('input[name="docid"]',this.panel).val();this.connection.call("save",[t,l,a]).done(function(e){EggTimer.hide()}).fail(function(e){EggTimer.hide();var n=_("Error: %a").replace("%a",e.message);alert(n)})},_show_dialog:function(n,i){var a=this,t=e("div.link-listitem-dialog",a.panel);0===t.length&&(t=e('<div class="link-listitem-dialog"></div>').appendTo(a.panel)),t.empty().html(i),t.dialog({modal:!0,width:800,height:400,maxHeight:800,title:XPLAN.util.escape(_("Link to Holding(s)"),"xml"),buttons:[{text:_("^Ok"),click:function(){a._save_links(n),t.dialog("close")}},{text:_("Cancel"),click:function(){t.dialog("close")}}],close:function(){t.empty()}})}};XPLAN.namespace("XplanAjax").createClass(n)}(jQuery);
;Dependency._js['docnote/link_listitem']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("main"),Dependency.addJS("lib/stacktrace/stacktrace")),XPLAN.namespace("util"),XPLAN.util.log=function(e){XPLAN.debugmode&&window.console&&console.log(e)},XPLAN.util.assert=function(e,t){if(!e){var n="XPLAN.util.assert failed: "+(t||"(no msg)");XPLAN.util.log(n);try{var a=printStackTrace();XPLAN.util.log(a.join("\n"))}catch(e){XPLAN.util.log("(error getting stack trace)")}throw new Error(n)}};
;Dependency._js['assert']=true;

;
!function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(t){for(var s=e([0]),i=-1,n=this.length;++i<n&&(s.context=s[0]=this[i])&&!1!==t.call(s[0],i,s););return this}})}(jQuery),function(e,t){"use strict";function s(e,t){for(var s=0,n=t.length;s<n;s+=1)if(i(e,t[s]))return s;return-1}function i(e,s){return e===s||e!==t&&s!==t&&(null!==e&&null!==s&&(e.constructor===String?e+""==s+"":s.constructor===String&&s+""==e+""))}function n(t,s){var i,n,o;if(null===t||t.length<1)return[];for(n=0,o=(i=t.split(s)).length;n<o;n+=1)i[n]=e.trim(i[n]);return i}function o(e){return e.outerWidth(!1)-e.width()}function a(s){var i="keyup-change-value";s.on("keydown",function(){e.data(s,i)===t&&e.data(s,i,s.val())}),s.on("keyup",function(){var n=e.data(s,i);n!==t&&s.val()!==n&&(e.removeData(s,i),s.trigger("keyup-change"))})}function c(e,s,i){var n;return i=i||t,function(){var t=arguments;window.clearTimeout(n),n=window.setTimeout(function(){s.apply(i,t)},e)}}function l(e){e.preventDefault(),e.stopPropagation()}function r(t,s,i){var n,o=[];(n=t.attr("class"))&&e((n=""+n).split(" ")).each2(function(){0===this.indexOf("select2-")&&o.push(this)}),(n=s.attr("class"))&&e((n=""+n).split(" ")).each2(function(){0!==this.indexOf("select2-")&&i(this)&&o.push(this)}),t.attr("class",o.join(" "))}function h(e,t,s,i){var n=e.toUpperCase().indexOf(t.toUpperCase()),o=t.length;n<0?s.push(i(e)):(s.push(i(e.substring(0,n))),s.push("<span class='select2-match'>"),s.push(i(e.substring(n,n+o))),s.push("</span>"),s.push(i(e.substring(n+o,e.length))))}function d(s){var i,n=0,o=null,a=s.quietMillis||100,c=s.url,l=this;return function(r){window.clearTimeout(i),i=window.setTimeout(function(){var i=n+=1,a=s.data,h=c,d=s.transport||e.fn.select2.ajaxDefaults.transport,u={type:s.type||"GET",cache:s.cache||!1,jsonpCallback:s.jsonpCallback||t,dataType:s.dataType||"json"},p=e.extend({},e.fn.select2.ajaxDefaults.params,u);a=a?a.call(l,r.term,r.page,r.context):null,h="function"==typeof h?h.call(l,r.term,r.page,r.context):h,null!==o&&o.abort(),s.params&&(e.isFunction(s.params)?e.extend(p,s.params.call(l)):e.extend(p,s.params)),e.extend(p,{url:h,dataType:s.dataType,data:a,success:function(e){if(!(i<n)){var t=s.results(e,r.page);r.callback(t)}}}),o=d.call(l,p)},a)}}function u(t){var s,i,n=t,o=function(e){return""+e.text};e.isArray(n)&&(n={results:i=n}),!1===e.isFunction(n)&&(i=n,n=function(){return i});var a=n();return a.text&&(o=a.text,e.isFunction(o)||(s=a.text,o=function(e){return e[s]})),function(t){var s,i=t.term,a={results:[]};""!==i?(s=function(n,a){var c,l;if((n=n[0]).children){for(l in c={},n)n.hasOwnProperty(l)&&(c[l]=n[l]);c.children=[],e(n.children).each2(function(e,t){s(t,c.children)}),(c.children.length||t.matcher(i,o(c),n))&&a.push(c)}else t.matcher(i,o(n),n)&&a.push(n)},e(n().results).each2(function(e,t){s(t,a.results)}),t.callback(a)):t.callback(n())}}function p(s){var i=e.isFunction(s);return function(n){var o=n.term,a={results:[]};e(i?s():s).each(function(){var e=this.text!==t,s=e?this.text:this;(""===o||n.matcher(o,s))&&a.results.push(e?this:{id:this,text:this})}),n.callback(a)}}function f(t,s){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function g(t){return e.isFunction(t)?t():t}function m(t,s){var i=function(){};return(i.prototype=new t).constructor=i,i.prototype.parent=t.prototype,i.prototype=e.extend(i.prototype,s),i}if(window.Select2===t){var v,w,b,C,S,y,x,E,T,k={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){switch(e=e.which?e.which:e){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},P="<div class='select2-measure-scrollbar'></div>";x=e(document),T=1,C=function(){return T++},x.on("mousemove",function(e){y={x:e.pageX,y:e.pageY}}),v=m(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,o,h,d,u,p,f;this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&this.destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+C()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=(h=function(){return i.element.closest("body")},u=!1,function(){return!1===u&&(d=h(),u=!0),d}),r(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(g(i.containerCss)),this.container.addClass(g(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(g(i.dropdownCssClass)),this.dropdown.data("select2",this),this.results=n=this.container.find(".select2-results"),this.search=o=this.container.find("input.select2-input"),this.resultsPage=0,this.context=null,this.initContainer(),this.results.on("mousemove",function(s){var i=y;i!==t&&i.x===s.pageX&&i.y===s.pageY||e(s.target).trigger("mousemove-filtered",s)}),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",".select2-results",this.bind(this.highlightUnderEvent)),function(e,t){var i=c(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){s(e.target,t.get())>=0&&i(e)})}(80,this.results),this.dropdown.on("scroll-debounced",".select2-results",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()}),e.fn.mousewheel&&n.mousewheel(function(e,t,s,i){var o=n.scrollTop();i>0&&o-i<=0?(n.scrollTop(0),l(e)):i<0&&n.get(0).scrollHeight-n.scrollTop()+i<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),l(e))}),a(o),o.on("keyup-change input paste",this.bind(this.updateResults)),o.on("focus",function(){o.addClass("select2-focused")}),o.on("blur",function(){o.removeClass("select2-focused")}),this.dropdown.on("mouseup",".select2-results",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength),(p=i.element.prop("disabled"))===t&&(p=!1),this.enable(!p),(f=i.element.prop("readonly"))===t&&(f=!1),this.readonly(f),E=E||function(){var t=e(P);t.appendTo("body");var s={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),s}(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").off(".select2").attr({tabindex:this.elementTabIndex}).prop("autofocus",this.autofocus||!1).show())},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:i(e.attr("locked"),"locked")}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(s){var o,a,c,l,r=this;if("select"===(o=s.element).get(0).tagName.toLowerCase()&&(this.select=a=s.element),a&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in s)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),"function"!=typeof(s=e.extend({},{populateResults:function(i,n,o){var a,c=this.opts.id;(a=function(i,n,l){var h,d,u,p,f,g,m,v,w,b;for(h=0,d=(i=s.sortResults(i,n,o)).length;h<d;h+=1)p=!(f=!0===(u=i[h]).disabled)&&c(u)!==t,g=u.children&&u.children.length>0,(m=e("<li></li>")).addClass("select2-results-dept-"+l),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),f&&m.addClass("select2-disabled"),g&&m.addClass("select2-result-with-children"),m.addClass(r.opts.formatResultCssClass(u)),(v=e(document.createElement("div"))).addClass("select2-result-label"),(b=s.formatResult(u,v,o,r.opts.escapeMarkup))!==t&&v.html(b),m.append(v),g&&((w=e("<ul></ul>")).addClass("select2-result-sub"),a(u.children,w,l+1),m.append(w)),m.data("select2-data",u),n.append(m)})(n,i,0)}},e.fn.select2.defaults,s)).id&&(c=s.id,s.id=function(e){return e[c]}),e.isArray(s.element.data("select2Tags"))){if("tags"in s)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+s.element.attr("id");s.tags=s.element.data("select2Tags")}if(a?(s.query=this.bind(function(s){var i,n,a,c={results:[],more:!1},l=s.term;a=function(e,t){var i;e.is("option")?s.matcher(l,e.text(),e)&&t.push(r.optionToData(e)):e.is("optgroup")&&(i=r.optionToData(e),e.children().each2(function(e,t){a(t,i.children)}),i.children.length>0&&t.push(i))},i=o.children(),this.getPlaceholder()!==t&&i.length>0&&(n=i[0],""===e(n).text()&&(i=i.not(n))),i.each2(function(e,t){a(t,c.results)}),s.callback(c)}),s.id=function(e){return e.id},s.formatResultCssClass=function(e){return e.css}):"query"in s||("ajax"in s?((l=s.element.data("ajax-url"))&&l.length>0&&(s.ajax.url=l),s.query=d.call(s.element,s.ajax)):"data"in s?s.query=u(s.data):"tags"in s&&(s.query=p(s.tags),s.createSearchChoice===t&&(s.createSearchChoice=function(e){return{id:e,text:e}}),s.initSelection===t&&(s.initSelection=function(t,o){var a=[];e(n(t.val(),s.separator)).each(function(){var t=this,n=this,o=s.tags;e.isFunction(o)&&(o=o()),e(o).each(function(){if(i(this.id,t))return n=this.text,!1}),a.push({id:t,text:n})}),o(a)}))),"function"!=typeof s.query)throw"query function not defined for Select2 "+s.element.attr("id");return s},monitorSource:function(){var e,s=this.opts.element;s.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),e=this.bind(function(){var e,i=s.prop("disabled");i===t&&(i=!1),this.enable(!i),(e=s.prop("readonly"))===t&&(e=!1),this.readonly(e),r(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(g(this.opts.containerCssClass)),r(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(g(this.opts.dropdownCssClass))}),s.on("propertychange.select2 DOMAttrModified.select2",e),this.mutationCallback===t&&(this.mutationCallback=function(t){t.forEach(e)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(s.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var s=e.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(s),!s.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){return e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface(),!0)},readonly:function(e){return e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,s,i,n,o=this.dropdown,a=this.container.offset(),c=this.container.outerHeight(!1),l=this.container.outerWidth(!1),r=o.outerHeight(!1),h=e(window).scrollLeft()+e(window).width(),d=e(window).scrollTop()+e(window).height(),u=a.top+c,p=a.left,f=u+r<=d,m=a.top-r>=this.body().scrollTop(),v=o.outerWidth(!1),w=p+v<=h,b=o.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(n=e(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),(v=o.outerWidth(!1)+(n.scrollHeight===n.clientHeight?0:E.width))>l?l=v:v=l,w=p+v<=h):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(u-=(t=this.body().offset()).top,p-=t.left),b?(s=!0,!m&&f&&(s=!1)):(s=!1,!f&&m&&(s=!0)),w||(p=a.left+l-v),s?(u=a.top-r,this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),i=e.extend({top:u,left:p,width:l},g(this.opts.dropdownCss)),o.css(i)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),!0)},opening:function(){function t(){return{width:Math.max(document.documentElement.scrollWidth,e(window).width()),height:Math.max(document.documentElement.scrollHeight,e(window).height())}}var s,i=this.containerId,n="scroll."+i,o="resize."+i,a="orientationchange."+i,c=this;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),0==(s=e("#select2-drop-mask",this.container[0].ownerDocument)).length&&((s=e(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.on("mousedown touchstart",function(t){var s,i=c.dropdown;!i.is(":visible")&&c.body()&&(i=e("#select2-drop",c.body())),i.is(":visible")||(i=e("#select2-drop")),i.length>0&&((s=i.data("select2")).opts&&s.opts.selectOnBlur&&s.selectHighlighted({noFocus:!0}),s.close(),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css(t()),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible(),this.container.parents().add(window).each(function(){e(this).on(o+" "+n+" "+a,function(s){e("#select2-drop-mask",c.container[0].ownerDocument).css(t()),c.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerId,s="scroll."+t,i="resize."+t,n="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(s).off(i).off(n)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask",this.container[0].ownerDocument).hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},clearSearch:function(){},getMaximumSelectionSize:function(){return g(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t,s,i,n,o,a,c,l=this.results;(s=this.highlight())<0||(0!=s?(t=this.findHighlightableChoices().find(".select2-result-label"),n=(i=e(t[s])).offset().top+i.outerHeight(!0),s===t.length-1&&(c=l.find("li.select2-more-results")).length>0&&(n=c.offset().top+c.outerHeight(!0)),n>(o=l.offset().top+l.outerHeight(!0))&&l.scrollTop(l.scrollTop()+(n-o)),(a=i.offset().top-l.offset().top)<0&&"none"!=i.css("display")&&l.scrollTop(l.scrollTop()+a)):l.scrollTop(0))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){for(var s=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<s.length;){var n=e(s[i+=t]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(t){var i,n,o=this.findHighlightableChoices();if(0===arguments.length)return s(o.filter(".select2-highlighted")[0],o.get());t>=o.length&&(t=o.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),(i=e(o[t])).addClass("select2-highlighted"),this.ensureHighlightVisible(),(n=i.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var s=e(t.target).closest(".select2-result-selectable");if(s.length>0&&!s.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(s))}else 0==s.length&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),s=this.resultsPage+1,i=this,n=this.search.val(),o=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:n,page:s,context:o,matcher:this.opts.matcher,callback:this.bind(function(a){i.opened()&&(i.opts.populateResults.call(this,e,a.results,{term:n,page:s,context:o}),i.postprocessResults(a,!1,!1),!0===a.more?(t.detach().appendTo(e).text(i.opts.formatLoadMore(s+1)),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):t.remove(),i.positionDropdown(),i.resultsPage=s,i.context=a.context)})}))},tokenize:function(){},updateResults:function(s){function n(){r.scrollTop(0),l.removeClass("select2-active"),d.positionDropdown()}function o(e){r.html(e),n()}var a,c,l=this.search,r=this.results,h=this.opts,d=this,u=l.val(),p=e.data(this.container,"select2-last-term");if((!0===s||!p||!i(u,p))&&(e.data(this.container,"select2-last-term",u),!0===s||!1!==this.showSearchInput&&this.opened())){var g=this.getMaximumSelectionSize();if(!(g>=1&&(a=this.data(),e.isArray(a)&&a.length>=g&&f(h.formatSelectionTooBig))))return l.val().length<h.minimumInputLength?(f(h.formatInputTooShort)?o("<li class='select2-no-results'>"+h.formatInputTooShort(l.val(),h.minimumInputLength)+"</li>"):o(""),void(s&&this.showSearch(!0))):void(h.maximumInputLength&&l.val().length>h.maximumInputLength?f(h.formatInputTooLong)?o("<li class='select2-no-results'>"+h.formatInputTooLong(l.val(),h.maximumInputLength)+"</li>"):o(""):(h.formatSearching&&0===this.findHighlightableChoices().length&&o("<li class='select2-searching'>"+h.formatSearching()+"</li>"),l.addClass("select2-active"),(c=this.tokenize())!=t&&null!=c&&l.val(c),this.resultsPage=1,h.query({element:h.element,term:l.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(a){var c;this.opened()?(this.context=a.context===t?null:a.context,this.opts.createSearchChoice&&""!==l.val()&&(c=this.opts.createSearchChoice.call(null,l.val(),a.results))!==t&&null!==c&&d.id(c)!==t&&null!==d.id(c)&&0===e(a.results).filter(function(){return i(d.id(this),d.id(c))}).length&&a.results.unshift(c),0===a.results.length&&f(h.formatNoMatches)?o("<li class='select2-no-results'>"+h.formatNoMatches(l.val())+"</li>"):(r.empty(),d.opts.populateResults.call(this,r,a.results,{term:l.val(),page:this.resultsPage,context:null}),!0===a.more&&f(h.formatLoadMore)&&(r.append("<li class='select2-more-results'>"+d.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){d.loadMoreIfNeeded()},10)),this.postprocessResults(a,s),n(),this.opts.element.trigger({type:"select2-loaded",data:a}))):this.search.removeClass("select2-active")})})));o("<li class='select2-selection-limit'>"+h.formatSelectionTooBig(g)+"</li>")}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var e;(e=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var t,s=e[0],i=e.val().length;e.focus(),e.is(":visible")&&s===document.activeElement&&(s.setSelectionRange?s.setSelectionRange(i,i):s.createTextRange&&((t=s.createTextRange()).collapse(!1),t.select()))},0)},selectHighlighted:function(e){var t=this.highlight(),s=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");s&&(this.highlight(t),this.onSelect(s,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){var s=function(){var s,i,n,o,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if((s=this.opts.element.attr("style"))!==t)for(o=0,a=(i=s.split(";")).length;o<a;o+=1)if(null!==(n=i[o].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&n.length>=1)return n[1];return(s=this.opts.element.css("width"))&&s.length>0?s:"resolve"===this.opts.width?0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==s&&this.container.css("width",s)}}),w=m(v,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>","   <span>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>","   <div class='select2-choice__dropdown-icon'><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <input type='text' autocomplete='off' autocorrect='off' autocapitilize='off' spellcheck='false' class='select2-input'/>","   </div>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var t,s;this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.search.focus(),(t=this.search.get(0)).createTextRange&&((s=t.createTextRange()).collapse(!1),s.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var t,s=this.container,i=this.dropdown;this.showSearch(!1),this.selection=t=s.find(".select2-choice"),this.focusser=s.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+C()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled())if(e.which!==k.PAGE_UP&&e.which!==k.PAGE_DOWN)switch(e.which){case k.UP:case k.DOWN:return this.moveHighlight(e.which===k.UP?-1:1),void l(e);case k.ENTER:return this.selectHighlighted(),void l(e);case k.TAB:return void this.selectHighlighted({noFocus:!0});case k.ESC:return this.cancel(e),void l(e)}else l(e)})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==k.TAB&&!k.isControl(e)&&!k.isFunctionKey(e)&&e.which!==k.ESC){if(!1!==this.opts.openOnEnter||e.which!==k.ENTER)return e.which==k.DOWN||e.which==k.UP||e.which==k.ENTER&&this.opts.openOnEnter?(this.open(),void l(e)):e.which==k.DELETE||e.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),void l(e)):void 0;l(e)}})),a(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){e.stopPropagation(),this.opened()||this.open()})),t.on("mousedown","abbr",this.bind(function(e){var t;this.isInterfaceEnabled()&&(this.clear(),(t=e).preventDefault(),t.stopImmediatePropagation(),this.close(),this.selection.focus())})),t.on("mousedown",this.bind(function(t){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),l(t)})),i.on("mousedown",this.bind(function(){this.search.focus()})),t.on("focus",this.bind(function(e){l(e)})),this.focusser.on("focus",this.bind(function(){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(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){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.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");t&&(this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==e&&(this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t})))},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text())this.updateSelection([]),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.setPlaceholder())})}},prepareOpts:function(){var s=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===s.element.get(0).tagName.toLowerCase()?s.initSelection=function(e,t){var s=e.find(":selected");t(n.optionToData(s))}:"data"in s&&s.initSelection===t&&(s.initSelection=function(t,n){var o=t.val(),a=null;s.query({matcher:function(e,t,n){var c=i(o,s.id(n));return c&&(a=n),c},callback:e.isFunction(n)?function(){n(a)}:e.noop})}),s},getPlaceholder:function(){return this.select&&""!==this.select.find("option").first().text()?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(""===this.opts.element.val()&&e!==t){if(this.select&&""!==this.select.find("option:first").text())return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(t,s,n){var o=0,a=this;if(this.findHighlightableChoices().each2(function(e,t){if(i(a.id(t.data("select2-data")),a.opts.element.val()))return o=e,!1}),!1!==n&&this.highlight(o),!0===s&&!1===this.showSearchInput){var c=this.opts.minimumResultsForSearch;c>=0&&this.showSearch(function t(s){var i=0;return e.each(s,function(e,s){s.children?i+=t(s.children):i++}),i}(t.results)>=c)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t)},onSelect:function(e,t){if(this.triggerSelect(e)){var s=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.close(),t&&t.noFocus||this.selection.focus(),i(s,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var s,i=this.selection.find("span");this.selection.data("select2-data",e),i.empty(),(s=this.opts.formatSelection(e,i))!==t&&i.append(this.opts.escapeMarkup(s)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,s=!1,i=null,n=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(s=arguments[1]),this.select)this.select.val(e).find(":selected").each2(function(e,t){return i=n.optionToData(t),!1}),this.updateSelection(i),this.setPlaceholder(),s&&this.triggerChange({added:i,removed:o});else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&0!==e)return void this.clear(s);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(),s&&n.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e,s){var i;if(0===arguments.length)return(i=this.selection.data("select2-data"))==t&&(i=null),i;e&&""!==e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),s&&this.triggerChange({added:e,removed:i})):this.clear(s)}}),b=m(v,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["    <ul class='select2-choices'>","  <li class='select2-search-field'>","    <input type='text' autocomplete='off' autocorrect='off' autocapitilize='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(""))},prepareOpts:function(){var s=this.parent.prepareOpts.apply(this,arguments),o=this;return"select"===s.element.get(0).tagName.toLowerCase()?s.initSelection=function(e,t){var s=[];e.find(":selected").each2(function(e,t){s.push(o.optionToData(t))}),t(s)}:"data"in s&&s.initSelection===t&&(s.initSelection=function(t,o){var a=n(t.val(),s.separator),c=[];s.query({matcher:function(t,n,o){var l=e.grep(a,function(e){return i(e,s.id(o))}).length;return l&&c.push(o),l},callback:e.isFunction(o)?function(){for(var e=[],t=0;t<a.length;t++)for(var n=a[t],l=0;l<c.length;l++){var r=c[l];if(i(n,s.id(r))){e.push(r),c.splice(l,1);break}}o(e)}:e.noop})}),s},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},initContainer:function(){var t,s=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(s);var i=this;this.selection.on("mousedown",".select2-search-choice",function(t){i.search[0].focus(),i.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+C()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(s){if(this.isInterfaceEnabled()){++this.keydowns;var i=t.find(".select2-search-choice-focus"),n=i.prev(".select2-search-choice:not(.select2-locked)"),o=i.next(".select2-search-choice:not(.select2-locked)"),a=function(t){var s=0,i=0;if("selectionStart"in(t=e(t)[0]))s=t.selectionStart,i=t.selectionEnd-s;else if("selection"in document){t.focus();var n=document.selection.createRange();i=document.selection.createRange().text.length,n.moveStart("character",-t.value.length),s=n.text.length-i}return{offset:s,length:i}}(this.search);if(i.length&&(s.which==k.LEFT||s.which==k.RIGHT||s.which==k.BACKSPACE||s.which==k.DELETE||s.which==k.ENTER)){var c=i;return s.which==k.LEFT&&n.length?c=n:s.which==k.RIGHT?c=o.length?o:null:s.which===k.BACKSPACE?(this.unselect(i.first()),this.search.width(10),c=n.length?n:o):s.which==k.DELETE?(this.unselect(i.first()),this.search.width(10),c=o.length?o:null):s.which==k.ENTER&&(c=null),this.selectChoice(c),l(s),void(c&&c.length||this.open())}if((s.which===k.BACKSPACE&&1==this.keydowns||s.which==k.LEFT)&&0==a.offset&&!a.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void l(s);if(this.selectChoice(null),this.opened())switch(s.which){case k.UP:case k.DOWN:return this.moveHighlight(s.which===k.UP?-1:1),void l(s);case k.ENTER:return this.selectHighlighted(),void l(s);case k.TAB:return void this.selectHighlighted({noFocus:!0});case k.ESC:return this.cancel(s),void l(s)}if(s.which!==k.TAB&&!k.isControl(s)&&!k.isFunctionKey(s)&&s.which!==k.BACKSPACE&&s.which!==k.ESC){if(s.which===k.ENTER){if(!1===this.opts.openOnEnter)return;if(s.altKey||s.ctrlKey||s.shiftKey||s.metaKey)return}this.open(),s.which!==k.PAGE_UP&&s.which!==k.PAGE_DOWN||l(s),s.which===k.ENTER&&l(s)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("mousedown",s,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",s,this.bind(function(){this.isInterfaceEnabled()&&(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.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),s=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(s>0?s:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){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(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],o=this;e(t).each(function(){s(o.id(this),i)<0&&(i.push(o.id(this)),n.push(this))}),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){o.addSelectedChoice(this)}),o.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),!this.select&&this.opts.closeOnSelect||this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(s){var i,n=!s.locked,o=e("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),a=e("<li class='select2-search-choice select2-locked'><div></div></li>"),c=n?o:a,r=this.id(s),h=this.getVal();(i=this.opts.formatSelection(s,c.find("div")))!=t&&c.find("div").replaceWith("<div title='"+this.opts.escapeMarkup(i)+"'>"+this.opts.escapeMarkup(i)+"</div>"),n&&c.find(".select2-search-choice-close").on("mousedown",l).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),l(t))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),c.data("select2-data",s),c.insertBefore(this.searchContainer),h.push(r),this.setVal(h)},unselect:function(e){var t,i,n=this.getVal();if(0===(e=e.closest(".select2-search-choice")).length)throw"Invalid argument: "+e+". Must be .select2-search-choice";(t=e.data("select2-data"))&&((i=s(this.id(t),n))>=0&&(n.splice(i,1),this.setVal(n),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))},postprocessResults:function(e,t,i){var n=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),c=this;o.each2(function(e,t){s(c.id(t.data("select2-data")),n)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==i&&c.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&this.results.append("<li class='select2-no-results'>"+c.opts.formatNoMatches(c.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-o(this.search)},resizeSearch:function(){var t,s,i,n,a=o(this.search);t=function(t){if(!S){var s=t[0].currentStyle||window.getComputedStyle(t[0],null);(S=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:s.fontSize,fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,textTransform:s.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),e("body").append(S)}return S.text(t.val()),S.width()}(this.search)+10,s=this.search.offset().left,(n=(i=this.selection.width())-(s-this.selection.offset().left)-a)<t&&(n=i-a),n<40&&(n=i-a),n<=0&&(n=t),this.search.width(n)},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:n(e=this.opts.element.val(),this.opts.separator)},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){s(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){t=t.slice(0),e=e.slice(0);for(var s=0;s<t.length;s++)for(var n=0;n<e.length;n++)i(this.opts.id(t[s]),this.opts.id(e[n]))&&(t.splice(s,1),s--,e.splice(n,1),n--);return{added:t,removed:e}},val:function(s,i){var n,o=this;if(0===arguments.length)return this.getVal();if((n=this.data()).length||(n=[]),!s&&0!==s)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:n}));if(this.setVal(s),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(n,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var s=e(t).map(o.id);o.setVal(s),o.updateSelection(t),o.clearSearch(),i&&o.triggerChange(this.buildChangeDetails(n,this.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 t=[],s=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(s.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,s){var i,n,o=this;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();n=this.data(),t||(t=[]),i=e.map(t,function(e){return o.opts.id(e)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),s&&this.triggerChange(this.buildChangeDetails(n,this.data()))}}),e.fn.select2=function(){var i,n,o,a,c=Array.prototype.slice.call(arguments,0),l=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","readonly","positionDropdown","data"],r=["val","opened","isFocused","container","data"];return this.each(function(){if(0===c.length||"object"==typeof c[0])(i=0===c.length?{}:e.extend({},c[0])).element=e(this),"select"===i.element.get(0).tagName.toLowerCase()?a=i.element.prop("multiple"):(a=i.multiple||!1,"tags"in i&&(i.multiple=a=!0)),(n=a?new b:new w).init(i);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(s(c[0],l)<0)throw"Unknown method: "+c[0];if(o=t,(n=e(this).data("select2"))===t)return;if(o="container"===c[0]?n.container:n[c[0]].apply(n,c.slice(1)),s(c[0],r)>=0)return!1}}),o===t?this:o},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,s,i){var n=[];return h(e.text,s.term,n,i),n.join("")},formatSelection:function(e,s){return e?e.text:t},sortResults:function(e,t,s){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var s=t-e.length;return"Please enter "+s+" more character"+(1==s?"":"s")},formatInputTooLong:function(e,t){var s=e.length-t;return"Please delete "+s+" character"+(1==s?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return(""+t).toUpperCase().indexOf((""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:function(e,s,n,o){var a,c,l,r,h,d=e,u=!1;if(!o.createSearchChoice||!o.tokenSeparators||o.tokenSeparators.length<1)return t;for(;;){for(c=-1,l=0,r=o.tokenSeparators.length;l<r&&(h=o.tokenSeparators[l],!((c=e.indexOf(h))>=0));l++);if(c<0)break;if(a=e.substring(0,c),e=e.substring(c+h.length),a.length>0&&(a=o.createSearchChoice(a,s))!==t&&null!==a&&o.id(a)!==t&&null!==o.id(a)){for(u=!1,l=0,r=s.length;l<r;l++)if(i(o.id(a),o.id(s[l]))){u=!0;break}u||n(a)}}return d!==e?e:void 0},escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}},e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:d,local:u,tags:p},util:{debounce:c,markMatch:h},class:{abstract:v,single:w,multi:b},jQuery:e}}}(jQuery);
;Dependency._js['lib/jquery/plugins/select2/select2']=true;

;
Dependency.addJS("assert"),Dependency.addCSS("autocomplete"),Dependency.addJS("lib/jquery/plugins/select2/select2"),Dependency.addCSS("jquery/plugins/select2/select2"),Dependency.load_dependencies(function(){XPLAN.namespace("Backbone.Util.Autocomplete").AutocompleteView=Backbone.View.extend({initialize:function(e){XPLAN.util.assert("searcher"in e),this.searcher=e.searcher,XPLAN.util.assert("advanced_searcher"in e),this.advanced_searcher=e.advanced_searcher,XPLAN.util.assert("select_result"in e),this.select_result=e.select_result,XPLAN.util.assert("allow_advanced_search"in e),this.allow_advanced_search=e.allow_advanced_search,this.advanced_search_id="__advanced_search__",this.widget_options=underscore.defaults(e.widget_options,{containerCssClass:"xplan-autocomplete",dropdownCssClass:"xplan-autocomplete-dropdown",width:"200px",minimumInputLength:2,allowClear:!0,formatResult:underscore.bind(this.format_search_result,this),query:underscore.bind(this.on_search,this),initSelection:function(e,t){t({id:e.val(),text:e.val()})}}),this.last_searched_term=null,this.select2el=Select2.jQuery(this.el),Select2.jQuery(this.el).select2(this.widget_options).on("change",underscore.bind(this.on_select,this)).on("select2-loaded",underscore.bind(this.on_load_styling,this)).on("select2-removed",underscore.bind(this.on_remove,this))},set_text:function(e){Select2.jQuery(this.el).select2("val",e)},on_remove:function(){this.set_text(""),this.select_result()},on_search:underscore.debounce(function(e){var t=(e.term||"").trim();t.length<this.widget_options.minimumInputLength||(this.last_searched_term=t,this.searcher(t,underscore.bind(function(s){e.callback({results:this.handle_results(s,t)})},this)))},500),handle_results:function(e,t){var s=underscore.map(e,function(e){return{id:e.id,text:e.text}},this);return this.allow_advanced_search&&s.push({id:this.advanced_search_id,text:""}),s},on_advanced_search:function(){if(!this.allow_advanced_search)return!1;this.advanced_searcher(this.last_searched_term.trim())},on_select:function(e){return e.val===this.advanced_search_id?this.on_advanced_search():this.select_result(e.val),!1},format_search_result:function(e,t,s){if(e.id===this.advanced_search_id)return"<span class='advanced-search match'>%a</span>".replace("%a",_("Advanced Search"));for(var a=s.term,n=e.text,c=[],i=a.length,r=n.toUpperCase(),d=a.toUpperCase();;){var l=r.indexOf(d);if(-1===l||""===d){c.push(n);break}c.push(n.slice(0,l)),c.push("<span class='match'>%a</span>".replace("%a",n.slice(l,l+i))),r=r.slice(l+i),n=n.slice(l+i)}return c.join("")},on_load_styling:function(e){this.select2el.data("select2").dropdown.find(".advanced-search.match").closest("li").addClass("advanced-search-container")},destroy:function(){Select2.jQuery(this.el).select2("destroy")}})});
;Dependency._js['xpt/backbone/util/autocomplete']=true;

;
Dependency.addJS("assert"),Dependency.load_dependencies(function(){var e=XPLAN.namespace("resourceful.portfolio.group"),o=XPLAN.namespace("Portfolio.Groups.AccountGroups.Reporting_Preferences"),t=function(){return XPLAN.util.assert(this.resource_name,"resource_name is required"),getBaseURL()+"/resourceful/portfolio/group/"+this.resource_name};e.BaseGroup=Backbone.Model.extend({idAttribute:"code",resource_name:null,urlRoot:t,url:function(){var e=underscore.result(this,"urlRoot")||underscore.result(this.collection,"url");return this.isNew()?e:e.replace(/([^\/])$/,"$1/code/")+encodeURIComponent(this.id)},isNew:function(){return null==this.get("group_id")}}),e.BaseGroupCollection=Backbone.Collection.extend({resource_name:"",url:t}),e.PortfolioGroup=e.BaseGroup.extend({resource_name:"portfolio"}),e.PortfolioGroupCollection=e.BaseGroupCollection.extend({model:e.PortfolioGroup,resource_name:"portfolio"}),e.PortfolioGroupSearchCollection=e.BaseGroupCollection.extend({model:e.PortfolioGroup,resource_name:"portfolio/multi_search"}),e.AccountGroup=e.BaseGroup.extend({resource_name:"account"}),e.AccountGroupCollection=e.BaseGroupCollection.extend({model:e.AccountGroup,resource_name:"account"}),e.GroupSearchCollection=e.BaseGroupCollection.extend({model:e.AccountGroup,resource_name:"account/multi_search"}),e.AccountGroupRecipientModel=Backbone.Model.extend({idAttribute:"entityid",initialize:function(e,o){this.is_new=o.is_new},isNew:function(){return!!this.is_new},parse:function(e,t){return e.entityrole_name=o.entityrole_name_map[e.entityrole],e},get_save_data:function(e){return underscore.pick(this.attributes,["entityid","entityrole","is_joint_recipient"])}}),e.AccountGroupRecipientsCollection=Backbone.Collection.extend({model:e.AccountGroupRecipientModel,url:function(){return underscore.result(this.group,"url")+"/recipient"},initialize:function(e,o){Backbone.Collection.prototype.initialize.apply(this,arguments),XPLAN.util.assert("group"in o),this.group=o.group,this.recipients=o.recipients},comparator:function(e){return e.get("entityid")},save:function(){var e=[];if(this.forEach(function(o){e.push(underscore.clone(o.attributes));var t=o.get_save_data();o.clear(),o.set(t)}),this.group.get("code")){var o=Backbone.sync("update",this),t=0;return this.forEach(function(o){o.clear(),o.set(e[t]),t+=1}),o}},parse:function(e,o){return null!=this.recipients?this.recipients:Backbone.Collection.prototype.parse.apply(this,arguments)}})});
;Dependency._js['resourceful/portfolio/group']=true;

;
Dependency.addJS("xpt/backbone/util/autocomplete"),Dependency.addJS("resourceful/portfolio/group"),Dependency.load_dependencies(function(){var e=XPLAN.namespace("Portfolio.Groups.Search"),t=XPLAN.namespace("Backbone.Util.Autocomplete"),i=XPLAN.namespace("resourceful.portfolio.group");e.GroupAutocompleteView=Backbone.View.extend({initialize:function(e){XPLAN.util.assert("field_name"in e),this.field_name=e.field_name,XPLAN.util.assert("group"in e),this.group=e.group,this.group_searcher=new(e.group_searcher?i[e.group_searcher]:i.AccountGroupCollection),this.template=e.template?e.template:"autocomplete",this.width=e.width?e.width:"300px",this.page_size=this.page_size?this.page_size:5,this.group_elem=null,this.autocomplete_view=null},render:function(){return this.$el.html(XPLAN.Template.get("portfolio/groups/search/"+this.template).render({field_name:this.field_name,value:null!=this.group?this.format_group_title(this.group):"",escape:XPLAN.util.escape})),this.group_elem=this.$("input"),this.autocomplete_view=new t.AutocompleteView({el:this.group_elem,searcher:underscore.bind(this.on_search,this),select_result:underscore.bind(this.select_group_by_id,this),advanced_searcher:null,allow_advanced_search:!1,widget_options:{placeholder:_("Search group code..."),width:this.width}}),this},on_search:function(e,t){this.group_searcher.fetch({data:{term:"%s".replace("%s",e),contains_condition:1},show_egg_timer:!1,success:underscore.bind(function(e){var i=e.map(function(e){return{id:e.id,text:this.format_group_title(e)}},this);t(i)},this)})},handle_search_result:function(e){this.select_group(e)},format_group_title:function(e){return e.get("name")},select_group_by_id:function(e){this.select_group(this.group_searcher.get(null==e?null:e))},select_group:function(e,t){null!=e&&this.autocomplete_view.set_text(this.format_group_title(e)),this.group=e,t||this.trigger("selected",e)},destroy:function(){this.autocomplete_view.destroy()}})});
;Dependency._js['xpt/portfolio/groups/search/autocomplete']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("popup"),Dependency.addJS("ajax/item_dialog"),Dependency.addJS("xpt/portfolio/groups/search/autocomplete")),function(e){var o={parent_plugin_name:"xplan_item_list",plugin_name:"xplan_docnote_account_group",_onChangeField:function(e,o){},_initEvents:function(e){var o=this;this.$('button[data-xplan-elem="btn_add_account_group"]').on("click",function(){o._add_account_group(e)}),this.$('button[data-xplan-elem="btn_remove_account_group"]').on("click",function(){o._remove_account_group(e)}),this.autocomplete=XPLAN.namespace("Portfolio.Groups.Search")},_get_account_group_search_dialog:function(o){return void 0===this.account_group_search_dialog&&(this.account_group_search_dialog=e('<div data-xplan-elem="account_group_search"></div>').appendTo(e("body"))),this.account_group_search_dialog},_open_account_group_search:function(e,o){var n=this;n.selected_group_code="";var t=n._get_account_group_search_dialog(e),c=new n.autocomplete.GroupAutocompleteView({field_name:"group_code",group:null,el:t,width:"300px",page_size:20}).render();c.on("selected",function(e){n.selected_group_code=e.id}),t.dialog({title:XPLAN.util.escape(_("Add Account Group")),width:350,height:120,modal:!0,resizable:!1,buttons:[{text:_("Cancel"),click:function(){t.dialog("close"),c.destroy(),t.empty()},"data-xplan-elem":"btn_cancel"},{text:_("Ok"),click:function(){t.dialog("close"),c.destroy(),t.empty(),o&&n.selected_group_code&&o(n.selected_group_code)},"data-xplan-elem":"btn_ok"}]})},_add_account_group:function(e){var o=this;o._open_account_group_search(e,function(n){n&&o._perform_add_account_group(e,n)})},_perform_add_account_group:function(e,o){var n=this;PopupMsgBox.show_confirm_text(_("Do you want to add this note to all entities in the account group?"),function(t){var c=t===_("Yes");n.connection.call("add_link",[n.options.data,o,c]).done(function(o){n._load(e),e.trigger("xevent_on_add_item")}).fail(function(e){PopupMsgBox.show_error_text(e.message)})})},_remove_account_group:function(o){var n=this,t=underscore.map(this.$('input:checkbox[name="selected"]:checked').closest("tr").find('input:hidden[name="group_code"]'),function(o){return e(o).val()});t.length>0&&n.connection.call("remove_links",[n.options.data,t]).done(function(e){n._load(o),o.trigger("xevent_on_remove_item")}).fail(function(e){PopupMsgBox.show_error_text(e.message)})},val:function(o){return underscore.map(this.$('input:checkbox[name="selected"]').closest("tr").find('input:hidden[name="group_code"]'),function(o){return e(o).val()})}};XPLAN.namespace("XplanAjax").createClass(o)}(jQuery);
;Dependency._js['docnote/portfolio_account_group']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/ajax"),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_preview",TIMEOUT:2e3,MAX_RETRIES:8,DOCPART_PREVIEW_UNSUPPORTED_FILE:-3,NO_PREVIEW_AVAILABLE_CONTENT:'<table class="docnote-no-preview-available"><tbody><tr><td><b>'+XPLAN.util.escape(_("No preview available"))+'</b></td></tr></tbody></table><div class="docnote-preview-attachment-name"><div id="attachment_filename" class="docnote_attach_filename"></div><div class="docnote_preview_download_icon"><img id="docnote_preview_download_icon" class="docnote_preview_download_icon" src="'+getBaseURL()+'/img/download_icon.svg" height="40" width="25"></div></div>',OVERLAY_DIV:'<div class="ui-widget-overlay overlay-preview-content"></div>',create:function(e){this._load()},_load:function(e){this._show_loading(),this._retry_preview(this,this.MAX_RETRIES)},_retry_preview:function(e,t){if(t<=0)return e._process_failed(e),void delete e.options.params.set_timeout;e.connection.call("get_preview_url",[e.options.params]).done(function(a){a.html?(e.$el.html(a.html),e._hide_loading(),e._enable_download_and_show_attachment_filename(e),delete e.options.params.set_timeout):(a.conversion_status&&(e.options.params.conversion_status=a.conversion_status),e.options.params.set_timeout=setTimeout(e._retry_preview,e.TIMEOUT,e,t-1))}).fail(function(t){e._process_failed(e)})},_show_loading:function(){EggTimer.show(),this.$el.html(this.OVERLAY_DIV)},_hide_loading:function(){EggTimer.hide()},_render_no_preview_available:function(e){e.$el.html(e.NO_PREVIEW_AVAILABLE_CONTENT)},reload_attachment:function(e,t){var a=this;this.options.params.docpartid=t,this.connection.call("get_filename",[this.options.params]).done(function(e){a.options.params.docpartfilename=e.docpartfilename}).fail(function(e){a._hide_loading()}),this.connection.call("reload_attachment",[this.options.params]).done(function(e){a.options.params.conversion_status=e.conversion_status,a._load()}).fail(function(e){a._process_failed(a)})},_enable_download_and_show_attachment_filename:function(e){var t=e.options.params;e.$("#attachment_filename").text(t.docpartfilename),e.$("#docnote_preview_download_icon").on("click",function(){XPLAN.attach.download_docpart(t.docid,t.docpartid)})},_process_failed:function(e){e.options.params.conversion_status=e.DOCPART_PREVIEW_UNSUPPORTED_FILE,e._hide_loading(),e._render_no_preview_available(e),e._enable_download_and_show_attachment_filename(e)},get_timeout_id:function(){return this.options.params.set_timeout}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['docnote/docnote_preview']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addCSS("dashboard/widget/widget")),function(t){var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_attachment_list",create:function(t){this.connection.auto_eggtimer=!0,this._load()},_init_events:function(e){var a=this;this.$("table.attachment-list").on("click","tr",function(){a._set_selected_docpart_bg_color(this),a._set_selected_docpart_id(t(this).find('input[name="docpartid"]').val()),a.options.on_attachment_changed&&a.options.on_attachment_changed()})},_init_selected_docpart_status:function(){var t=this.$('input[value="'+this.options.params.selected_docpartid+'"]').closest("tr");this._set_selected_docpart_bg_color(t),this._set_selected_docpart_position(t)},_load:function(t){var e=this;this.connection.call("html",[this.options.params]).done(function(a){e.$el.html(a.html),e._init_events(t),e._init_selected_docpart_status()}).fail(function(t){var e=_("Error: %a").replace("%a",t.message);alert(e)})},_set_selected_docpart_bg_color:function(e){this.$("table.attachment-list tr").removeClass("docnote_attach_selected_text"),t(e).addClass("docnote_attach_selected_text")},_set_selected_docpart_position:function(t){var e=this.$("div.docnote_attach_preview_attach_list"),a=this.$(t).position().top;a>=e.height()+e.position().top&&e.scrollTop(a)},_set_selected_docpart_id:function(t){this.options.params.docpartid=t},get_selected_docpart_id:function(){return this.options.params.docpartid}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery);
;Dependency._js['docnote/docnote_attachment_list']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addJS("docnote/docnote_preview"),Dependency.addJS("docnote/docnote_attachment_list")),function(e){var t={parent_plugin_name:"xplan_ajaxes",plugin_name:"xplan_docnote_preview_container",_before_created:function(){var e=this;this.plugins.docnote_attachment_list&&(this.options.ajaxes.ajaxes.docnote_attachment_list.on_attachment_changed=function(){e._on_attachment_changed()})},_on_attachment_changed:function(){var e=this.plugins.docnote_attachment_list,t=this.plugins.docnote_preview;if(e&&t){clearTimeout(t.call("get_timeout_id"));var n=e.call("get_selected_docpart_id");t.call("reload_attachment",n)}}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['docnote/docnote_preview_container']=true;

;
﻿/*
Copyright (c) 2003-2025, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function(){if(!window.CKEDITOR||!window.CKEDITOR.dom)window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,f={timestamp:"P0FK",version:"4.2 Xplan",revision:"0",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var g=document.getElementsByTagName("script"),c=0;c<g.length;c++){var d=g[c].src.match(a);if(d){b=d[1];break}}-1==b.indexOf(":/")&&"//"!=b.slice(0,
2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+b:location.href.match(/^[^\?]*\/(?:)/)[0]+b);if(!b)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return b}(),getUrl:function(b){-1==b.indexOf(":/")&&0!==b.indexOf("/")&&(b=this.basePath+b);this.timestamp&&("/"!=b.charAt(b.length-1)&&!/[&?]t=/.test(b))&&(b+=(0<=b.indexOf("?")?"&":"?")+"t="+this.timestamp);return b},domReady:function(){function b(){try{document.addEventListener?
(document.removeEventListener("DOMContentLoaded",b,!1),a()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",b),a())}catch(c){}}function a(){for(var b;b=c.shift();)b()}var c=[];return function(a){function g(){try{document.documentElement.doScroll("left")}catch(k){setTimeout(g,1);return}b()}c.push(a);"complete"===document.readyState&&setTimeout(b,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",b,!1),window.addEventListener("load",
b,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",b);window.attachEvent("onload",b);a=!1;try{a=!window.frameElement}catch(e){}document.documentElement.doScroll&&a&&g()}}}()},c=window.CKEDITOR_GETURL;if(c){var e=f.getUrl;f.getUrl=function(b){return c.call(f,b)||e.call(f,b)}}return f}()),CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var f=CKEDITOR.event.prototype,c;for(c in f)a[c]==null&&(a[c]=f[c])},CKEDITOR.event.prototype=function(){function a(a){var b=
f(this);return b[a]||(b[a]=new c(a))}var f=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},c=function(a){this.name=a;this.listeners=[]};c.prototype={getListenerIndex:function(a){for(var b=0,g=this.listeners;b<g.length;b++)if(g[b].fn==a)return b;return-1}};return{define:function(c,b){var g=a.call(this,c);CKEDITOR.tools.extend(g,b,true)},on:function(c,b,g,i,d){function h(k,a,d,h){k={name:c,sender:this,editor:k,data:a,listenerData:i,stop:d,cancel:h,removeListener:f};
return b.call(g,k)===false?false:k.data}function f(){m.removeListener(c,b)}var k=a.call(this,c);if(k.getListenerIndex(b)<0){k=k.listeners;g||(g=this);isNaN(d)&&(d=10);var m=this;h.fn=b;h.priority=d;for(var o=k.length-1;o>=0;o--)if(k[o].priority<=d){k.splice(o+1,0,h);return{removeListener:f}}k.unshift(h)}return{removeListener:f}},once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=
1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,b=function(){a=1},g=0,c=function(){g=1};return function(d,h,j){var k=f(this)[d],d=a,m=g;a=g=0;if(k){var o=k.listeners;if(o.length)for(var o=o.slice(0),p,n=0;n<o.length;n++){if(k.errorProof)try{p=o[n].call(this,j,h,b,c)}catch(l){}else p=o[n].call(this,j,h,b,c);p===false?g=1:typeof p!="undefined"&&(h=p);if(a||g)break}}h=g?false:typeof h=="undefined"?true:h;a=d;g=m;return h}}(),fireOnce:function(a,b,g){b=
this.fire(a,b,g);delete f(this)[a];return b},removeListener:function(a,b){var g=f(this)[a];if(g){var c=g.getListenerIndex(b);c>=0&&g.listeners.splice(c,1)}},removeAllListeners:function(){var a=f(this),b;for(b in a)delete a[b]},hasListeners:function(a){return(a=f(this)[a])&&a.listeners.length>0}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=
true);return CKEDITOR.event.prototype.fire.call(this,a,f,this)},CKEDITOR.editor.prototype.fireOnce=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,f,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),f={ie:a.indexOf("trident/")>-1,webkit:a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode==
"BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var b=document.domain,a=window.location.hostname;return b!=a&&b!="["+a+"]"},secure:location.protocol=="https:"};f.gecko=navigator.product=="Gecko"&&!f.webkit&&!f.ie;if(f.webkit)a.indexOf("chrome")>-1?f.chrome=true:f.safari=true;var c=0;if(f.ie){c=f.quirks||!document.documentMode?parseFloat(a.match(/(msie |rv:)(\d+)/)[2]):
document.documentMode;f.ie9Compat=c==9;f.ie8Compat=c==8;f.ie7Compat=c==7;f.ie6Compat=c<7||f.quirks}if(f.gecko){var e=a.match(/rv:([\d\.]+)/);if(e){e=e[1].split(".");c=e[0]*1E4+(e[1]||0)*100+(e[2]||0)*1}}f.air&&(c=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));f.webkit&&(c=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));f.version=c;f.isCompatible=f.iOS&&c>=534||!f.mobile&&(f.ie&&c>6||f.gecko&&c>=2E4||f.air&&c>=1||f.webkit&&c>=522||false);f.hidpi=window.devicePixelRatio>=2;f.needsBrFiller=f.gecko||f.webkit||
f.ie&&c>10;f.needsNbspFiller=f.ie&&c<11;f.cssClass="cke_browser_"+(f.ie?"ie":f.gecko?"gecko":f.webkit?"webkit":"unknown");if(f.quirks)f.cssClass=f.cssClass+" cke_browser_quirks";if(f.ie)f.cssClass=f.cssClass+(" cke_browser_ie"+(f.quirks?"6 cke_browser_iequirks":f.version));if(f.air)f.cssClass=f.cssClass+" cke_browser_air";if(f.iOS)f.cssClass=f.cssClass+" cke_browser_ios";if(f.hidpi)f.cssClass=f.cssClass+" cke_hidpi";return f}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);
CKEDITOR.loadFullCore=function(){if(CKEDITOR.status!="basic_ready")CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;if(a){CKEDITOR.status=
"basic_ready";a&&a._load?a():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},f*1E3)}})})();CKEDITOR.status="basic_loaded"}(),CKEDITOR.dom={},function(){var a=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",c=/&/g,e=/>/g,b=/</g,g=/"/g,i=/&amp;/g,d=/&gt;/g,h=/&lt;/g,j=/&quot;/g;CKEDITOR.on("reset",function(){a=[]});CKEDITOR.tools={arrayCompare:function(b,a){if(!b&&!a)return true;if(!b||!a||b.length!=a.length)return false;for(var g=0;g<
b.length;g++)if(b[g]!=a[g])return false;return true},clone:function(b){var a;if(b&&b instanceof Array){a=[];for(var g=0;g<b.length;g++)a[g]=CKEDITOR.tools.clone(b[g]);return a}if(b===null||typeof b!="object"||b instanceof String||b instanceof Number||b instanceof Boolean||b instanceof Date||b instanceof RegExp||b.nodeType||b.window===b)return b;a=new b.constructor;for(g in b)a[g]=CKEDITOR.tools.clone(b[g]);return a},capitalize:function(b,a){return b.charAt(0).toUpperCase()+(a?b.slice(1):b.slice(1).toLowerCase())},
extend:function(b){var a=arguments.length,g,c;if(typeof(g=arguments[a-1])=="boolean")a--;else if(typeof(g=arguments[a-2])=="boolean"){c=arguments[a-1];a=a-2}for(var d=1;d<a;d++){var e=arguments[d],i;for(i in e)if(g===true||b[i]==null)if(!c||i in c)b[i]=e[i]}return b},prototypedCopy:function(b){var a=function(){};a.prototype=b;return new a},copy:function(b){var a={},g;for(g in b)a[g]=b[g];return a},isArray:function(b){return Object.prototype.toString.call(b)=="[object Array]"},isEmpty:function(b){for(var a in b)if(b.hasOwnProperty(a))return false;
return true},cssVendorPrefix:function(b,a,g){if(g)return f+b+":"+a+";"+b+":"+a;g={};g[b]=a;g[f+b]=a;return g},cssStyleToDomStyle:function(){var b=document.createElement("div").style,a=typeof b.cssFloat!="undefined"?"cssFloat":typeof b.styleFloat!="undefined"?"styleFloat":"float";return function(b){return b=="float"?a:b.replace(/-./g,function(b){return b.substr(1).toUpperCase()})}}(),buildStyleHtml:function(b){for(var b=[].concat(b),a,g=[],c=0;c<b.length;c++)if(a=b[c])/@import|[{}]/.test(a)?g.push("<style>"+
a+"</style>"):g.push('<link type="text/css" rel=stylesheet href="'+a+'">');return g.join("")},htmlEncode:function(a){return(""+a).replace(c,"&amp;").replace(e,"&gt;").replace(b,"&lt;")},htmlDecode:function(b){return b.replace(i,"&").replace(d,">").replace(h,"<")},htmlEncodeAttr:function(a){return a.replace(g,"&quot;").replace(b,"&lt;").replace(e,"&gt;")},htmlDecodeAttr:function(b){return b.replace(j,'"').replace(h,"<").replace(d,">")},getNextNumber:function(){var b=0;return function(){return++b}}(),
getNextId:function(){return"cke_"+this.getNextNumber()},override:function(b,a){var g=a(b);g.prototype=b.prototype;return g},setTimeout:function(b,a,g,c,d){d||(d=window);g||(g=d);return d.setTimeout(function(){c?b.apply(g,[].concat(c)):b.apply(g)},a||0)},trim:function(){var b=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(a){return a.replace(b,"")}}(),ltrim:function(){var b=/^[ \t\n\r]+/g;return function(a){return a.replace(b,"")}}(),rtrim:function(){var b=/[ \t\n\r]+$/g;return function(a){return a.replace(b,
"")}}(),indexOf:function(b,a){if(typeof a=="function")for(var g=0,c=b.length;g<c;g++){if(a(b[g]))return g}else{if(b.indexOf)return b.indexOf(a);g=0;for(c=b.length;g<c;g++)if(b[g]===a)return g}return-1},search:function(b,a){var g=CKEDITOR.tools.indexOf(b,a);return g>=0?b[g]:null},bind:function(b,a){return function(){return b.apply(a,arguments)}},createClass:function(b){var a=b.$,g=b.base,c=b.privates||b._,d=b.proto,b=b.statics;!a&&(a=function(){g&&this.base.apply(this,arguments)});if(c)var e=a,a=function(){var b=
this._||(this._={}),a;for(a in c){var g=c[a];b[a]=typeof g=="function"?CKEDITOR.tools.bind(g,this):g}e.apply(this,arguments)};if(g){a.prototype=this.prototypedCopy(g.prototype);a.prototype.constructor=a;a.base=g;a.baseProto=g.prototype;a.prototype.base=function(){this.base=g.prototype.base;g.apply(this,arguments);this.base=arguments.callee}}d&&this.extend(a.prototype,d,true);b&&this.extend(a,b,true);return a},addFunction:function(b,g){return a.push(function(){return b.apply(g||this,arguments)})-1},
removeFunction:function(b){a[b]=null},callFunction:function(b){var g=a[b];return g&&g.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var b=/^-?\d+\.?\d*px$/,a;return function(g){a=CKEDITOR.tools.trim(g+"")+"px";return b.test(a)?a:g||""}}(),convertToPx:function(){var b;return function(a){if(!b){b=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(b)}if(!/%$/.test(a)){b.setStyle("width",
a);return b.$.clientWidth}return a}}(),repeat:function(b,a){return Array(a+1).join(b)},tryThese:function(){for(var b,a=0,g=arguments.length;a<g;a++){var c=arguments[a];try{b=c();break}catch(d){}}return b},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(b){return function(){var a=arguments,g=this;window.setTimeout(function(){b.apply(g,a)},0)}},normalizeCssText:function(b,a){var g=[],c,d=CKEDITOR.tools.parseCssText(b,true,a);for(c in d)g.push(c+":"+d[c]);g.sort();
return g.length?g.join(";")+";":""},convertRgbToHex:function(b){return b.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(b,a,g,c){b=[a,g,c];for(a=0;a<3;a++)b[a]=("0"+parseInt(b[a],10).toString(16)).slice(-2);return"#"+b.join("")})},parseCssText:function(b,a,g){var c={};if(g){g=new CKEDITOR.dom.element("span");g.setAttribute("style",b);b=CKEDITOR.tools.convertRgbToHex(g.getAttribute("style")||"")}if(!b||b==";")return c;b.replace(/&quot;/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
function(b,g,d){if(a){g=g.toLowerCase();g=="font-family"&&(d=d.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,","));d=CKEDITOR.tools.trim(d)}c[g]=d});return c},writeCssText:function(b,a){var g,c=[];for(g in b)c.push(g+":"+b[g]);a&&c.sort();return c.join("; ")},objectCompare:function(b,a,g){var c;if(!b&&!a)return true;if(!b||!a)return false;for(c in b)if(b[c]!=a[c])return false;if(!g)for(c in a)if(b[c]!=a[c])return false;return true},objectKeys:function(b){var a=[],g;for(g in b)a.push(g);return a},
convertArrayToObject:function(b,a){var g={};arguments.length==1&&(a=true);for(var c=0,d=b.length;c<d;++c)g[b[c]]=a;return g},fixDomain:function(){for(var b;;)try{b=window.parent.document.domain;break}catch(a){b=b?b.replace(/.+?(?:\.|$)/,""):document.domain;if(!b)break;document.domain=b}return!!b},eventsBuffer:function(b,a){function g(){d=(new Date).getTime();c=false;a()}var c,d=0;return{input:function(){if(!c){var a=(new Date).getTime()-d;a<b?c=setTimeout(g,b-a):g()}},reset:function(){c&&clearTimeout(c);
c=d=0}}},enableHtml5Elements:function(b,a){for(var g=["abbr","article","aside","audio","bdi","canvas","data","datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],c=g.length,d;c--;){d=b.createElement(g[c]);a&&b.appendChild(d)}},checkIfAnyArrayItemMatches:function(b,a){for(var g=0,c=b.length;g<c;++g)if(b[g].match(a))return true;return false},checkIfAnyObjectPropertyMatches:function(b,a){for(var g in b)if(g.match(a))return true;
return false},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}}(),CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,f=function(b,a){for(var g=CKEDITOR.tools.clone(b),c=1;c<arguments.length;c++){var a=arguments[c],d;for(d in a)delete g[d]}return g},c={},e={},b={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,
pre:1,section:1,table:1,ul:1},g={command:1,link:1,meta:1,noscript:1,script:1,style:1},i={},d={"#":1},h={center:1,dir:1,noframes:1};a(c,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},d,
{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(e,b,c,h);f={a:f(c,{a:1,button:1}),abbr:c,address:e,area:i,article:e,aside:e,audio:a({source:1,track:1},e),b:c,base:i,bdi:c,bdo:c,blockquote:e,body:e,br:i,button:f(c,{a:1,button:1}),canvas:c,caption:e,cite:c,code:c,col:i,colgroup:{col:1},command:i,datalist:a({option:1},c),dd:e,del:c,details:a({summary:1},e),dfn:c,div:e,dl:{dt:1,dd:1},dt:e,em:c,embed:i,fieldset:a({legend:1},e),figcaption:e,figure:a({figcaption:1},e),footer:e,
form:e,h1:c,h2:c,h3:c,h4:c,h5:c,h6:c,head:a({title:1,base:1},g),header:e,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:i,html:a({head:1,body:1},e,g),i:c,iframe:d,img:i,input:i,ins:c,kbd:c,keygen:i,label:c,legend:c,li:e,link:i,main:e,map:e,mark:c,menu:a({li:1},e),meta:i,meter:f(c,{meter:1}),nav:e,noscript:a({link:1,meta:1,style:1},c),object:a({param:1},c),ol:{li:1},optgroup:{option:1},option:d,output:c,p:c,param:i,pre:c,progress:f(c,{progress:1}),q:c,rp:c,rt:c,ruby:a({rp:1,rt:1},c),s:c,samp:c,script:d,
section:e,select:{optgroup:1,option:1},small:c,source:i,span:c,strong:c,style:d,sub:c,summary:c,sup:c,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:e,textarea:d,tfoot:{tr:1},th:e,thead:{tr:1},time:f(c,{time:1}),title:d,tr:{th:1,td:1},track:i,u:c,ul:{li:1},"var":c,video:a({source:1,track:1},e),wbr:i,acronym:c,applet:a({param:1},e),basefont:i,big:c,center:e,dialog:i,dir:{li:1},font:c,isindex:i,noframes:e,strike:c,tt:c};a(f,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},
b,h),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,
dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:c,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},f.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,
del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,
tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return f}(),CKEDITOR.dom.event=function(a){this.$=a},CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a=a+CKEDITOR.CTRL;this.$.shiftKey&&(a=a+CKEDITOR.SHIFT);this.$.altKey&&(a=a+CKEDITOR.ALT);return a},preventDefault:function(a){var f=this.$;f.preventDefault?f.preventDefault():f.returnValue=false;a&&this.stopPropagation()},stopPropagation:function(){var a=
this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=true},getTarget:function(){var a=this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}},CKEDITOR.CTRL=1114112,CKEDITOR.SHIFT=2228224,CKEDITOR.ALT=
4456448,CKEDITOR.EVENT_PHASE_CAPTURING=1,CKEDITOR.EVENT_PHASE_AT_TARGET=2,CKEDITOR.EVENT_PHASE_BUBBLING=3,CKEDITOR.dom.domObject=function(a){if(a)this.$=a},CKEDITOR.dom.domObject.prototype=function(){var a=function(a,c){return function(e){typeof CKEDITOR!="undefined"&&a.fire(c,new CKEDITOR.dom.event(e))}};return{getPrivate:function(){var a;if(!(a=this.getCustomData("_")))this.setCustomData("_",a={});return a},on:function(f){var c=this.getCustomData("_cke_nativeListeners");if(!c){c={};this.setCustomData("_cke_nativeListeners",
c)}if(!c[f]){c=c[f]=a(this,f);this.$.addEventListener?this.$.addEventListener(f,c,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+f,c)}return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var c=this.getCustomData("_cke_nativeListeners"),e=c&&c[a];if(e){this.$.removeEventListener?this.$.removeEventListener(a,e,false):this.$.detachEvent&&this.$.detachEvent("on"+
a,e);delete c[a]}}},removeAllListeners:function(){var a=this.getCustomData("_cke_nativeListeners"),c;for(c in a){var e=a[c];this.$.detachEvent?this.$.detachEvent("on"+c,e):this.$.removeEventListener&&this.$.removeEventListener(c,e,false);delete a[c]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}(),function(a){var f={};CKEDITOR.on("reset",function(){f={}});a.equals=function(a){try{return a&&a.$===this.$}catch(e){return false}};a.setCustomData=function(a,e){var b=this.getUniqueId();(f[b]||
(f[b]={}))[a]=e;return this};a.getCustomData=function(a){var e=this.$["data-cke-expando"];return(e=e&&f[e])&&a in e?e[a]:null};a.removeCustomData=function(a){var e=this.$["data-cke-expando"],e=e&&f[e],b,g;if(e){b=e[a];g=a in e;delete e[a]}return g?b:null};a.clearCustomData=function(){this.removeAllListeners();var a=this.$["data-cke-expando"];a&&delete f[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)}(CKEDITOR.dom.domObject.prototype),
CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this},CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject,CKEDITOR.NODE_ELEMENT=1,CKEDITOR.NODE_DOCUMENT=9,CKEDITOR.NODE_TEXT=3,CKEDITOR.NODE_COMMENT=8,CKEDITOR.NODE_DOCUMENT_FRAGMENT=11,CKEDITOR.POSITION_IDENTICAL=
0,CKEDITOR.POSITION_DISCONNECTED=1,CKEDITOR.POSITION_FOLLOWING=2,CKEDITOR.POSITION_PRECEDING=4,CKEDITOR.POSITION_IS_CONTAINED=8,CKEDITOR.POSITION_CONTAINS=16,CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,f){a.append(this,f);return a},clone:function(a,f){var c=this.$.cloneNode(a),e=function(b){b["data-cke-expando"]&&(b["data-cke-expando"]=false);if(b.nodeType==CKEDITOR.NODE_ELEMENT){f||b.removeAttribute("id",false);if(a)for(var b=b.childNodes,g=0;g<b.length;g++)e(b[g])}};e(c);
return new CKEDITOR.dom.node(c)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var f=[],c=this.getDocument().$.documentElement,e=this.$;e&&e!=c;){var b=e.parentNode;b&&f.unshift(this.getIndex.call({$:e},
a));e=b}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function f(b,a){var c=a?b.nextSibling:b.previousSibling;return!c||c.nodeType!=CKEDITOR.NODE_TEXT?null:c.nodeValue?c:f(c,a)}var c=this.$,e=-1,b;if(!this.$.parentNode||a&&c.nodeType==CKEDITOR.NODE_TEXT&&!c.nodeValue&&!f(c)&&!f(c,true))return-1;do if(!a||!(c!=this.$&&c.nodeType==CKEDITOR.NODE_TEXT&&(b||!c.nodeValue))){e++;b=c.nodeType==CKEDITOR.NODE_TEXT}while(c=
c.previousSibling);return e},getNextSourceNode:function(a,f,c){if(c&&!c.call)var e=c,c=function(b){return!b.equals(e)};var a=!a&&this.getFirst&&this.getFirst(),b;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&c&&c(this,true)===false)return null;a=this.getNext()}for(;!a&&(b=(b||this).getParent());){if(c&&c(b,true)===false)return null;a=b.getNext()}return!a||c&&c(a)===false?null:f&&f!=a.type?a.getNextSourceNode(false,f,c):a},getPreviousSourceNode:function(a,f,c){if(c&&!c.call)var e=c,c=function(b){return!b.equals(e)};
var a=!a&&this.getLast&&this.getLast(),b;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&c&&c(this,true)===false)return null;a=this.getPrevious()}for(;!a&&(b=(b||this).getParent());){if(c&&c(b,true)===false)return null;a=b.getPrevious()}return!a||c&&c(a)===false?null:f&&a.type!=f?a.getPreviousSourceNode(false,f,c):a},getPrevious:function(a){var f=this.$,c;do c=(f=f.previousSibling)&&f.nodeType!=10&&new CKEDITOR.dom.node(f);while(c&&a&&!a(c));return c},getNext:function(a){var f=this.$,c;do c=(f=f.nextSibling)&&
new CKEDITOR.dom.node(f);while(c&&a&&!a(c));return c},getParent:function(a){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||a&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(f):null},getParents:function(a){var f=this,c=[];do c[a?"push":"unshift"](f);while(f=f.getParent());return c},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var f=this.contains?this:this.getParent();do if(f.contains(a))return f;while(f=
f.getParent());return null},getPosition:function(a){var f=this.$,c=a.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(c);if(f==c)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(c))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(c.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in f)return f.sourceIndex<0||c.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:
f.sourceIndex<c.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var f=this.getAddress(),a=a.getAddress(),c=Math.min(f.length,a.length),e=0;e<=c-1;e++)if(f[e]!=a[e]){if(e<c)return f[e]<a[e]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return f.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,f){var c=this.$,e,b;if(!f)c=c.parentNode;if(typeof a=="function"){b=
true;e=a}else{b=false;e=function(b){b=typeof b.nodeName=="string"?b.nodeName.toLowerCase():"";return typeof a=="string"?b==a:b in a}}for(;c;){if(e(b?new CKEDITOR.dom.node(c):c))return new CKEDITOR.dom.node(c);try{c=c.parentNode}catch(g){c=null}}return null},hasAscendant:function(a,f){var c=this.$;if(!f)c=c.parentNode;for(;c;){if(c.nodeName&&c.nodeName.toLowerCase()==a)return true;c=c.parentNode}return false},move:function(a,f){a.append(this.remove(),f)},remove:function(a){var f=this.$,c=f.parentNode;
if(c){if(a)for(;a=f.firstChild;)c.insertBefore(f.removeChild(a),f);c.removeChild(f)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.ltrim(a.getText()),c=a.getLength();if(f){if(f.length<c){a.split(c-f.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=
this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.rtrim(a.getText()),c=a.getLength();if(f){if(f.length<c){a.split(f.length);this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&a.parentNode.removeChild(a)},isReadOnly:function(){var a=this;this.type!=CKEDITOR.NODE_ELEMENT&&(a=this.getParent());if(a&&typeof a.$.isContentEditable!="undefined")return!(a.$.isContentEditable||
a.data("cke-editable"));for(;a;){if(a.data("cke-editable"))break;if(a.getAttribute("contentEditable")=="false")return true;if(a.getAttribute("contentEditable")=="true")break;a=a.getParent()}return!a}}),CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,f=a.compatMode=="CSS1Compat";return{width:(f?
a.documentElement.clientWidth:a.body.clientWidth)||0,height:(f?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}}),CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,
a)},CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var f=new CKEDITOR.dom.element("link");f.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(f)}},appendStyleText:function(a){if(this.$.createStyleSheet){var f=this.$.createStyleSheet("");f.cssText=a}else{var c=new CKEDITOR.dom.element("style",
this);c.append(new CKEDITOR.dom.text(a,this));this.getHead().append(c)}return f||c.$.sheet},createElement:function(a,f){var c=new CKEDITOR.dom.element(a,this);if(f){f.attributes&&c.setAttributes(f.attributes);f.styles&&c.setStyles(f.styles)}return c},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){var a;try{a=this.$.activeElement}catch(f){return null}return new CKEDITOR.dom.element(a)},getById:function(a){return(a=this.$.getElementById(a))?
new CKEDITOR.dom.element(a):null},getByAddress:function(a,f){for(var c=this.$.documentElement,e=0;c&&e<a.length;e++){var b=a[e];if(f)for(var g=-1,i=0;i<c.childNodes.length;i++){var d=c.childNodes[i];if(!(f===true&&d.nodeType==3&&d.previousSibling&&d.previousSibling.nodeType==3)){g++;if(g==b){c=d;break}}}else c=c.childNodes[b]}return c?new CKEDITOR.dom.node(c):null},getElementsByTag:function(a,f){!(CKEDITOR.env.ie&&document.documentMode<=8)&&f&&(a=f+":"+a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},
getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,
'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+")();<\/script>"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");if(!a){a=this.$.createDocumentFragment();CKEDITOR.tools.enableHtml5Elements(a,true);this.setCustomData("html5ShivFrag",a)}return a}}),CKEDITOR.dom.nodeList=
function(a){this.$=a},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){if(a<0||a>=this.$.length)return null;return(a=this.$[a])?new CKEDITOR.dom.node(a):null}},CKEDITOR.dom.element=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.element.get=function(a){return(a=typeof a=="string"?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))},CKEDITOR.dom.element.prototype=
new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(a,f){var c=new CKEDITOR.dom.element("div",f);c.setHtml(a);return c.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(a,f,c,e){var b=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),g=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[b]=f;g[c]=1;return f.setCustomData(c,e)},CKEDITOR.dom.element.clearAllMarkers=
function(a){for(var f in a)CKEDITOR.dom.element.clearMarkers(a,a[f],1)},CKEDITOR.dom.element.clearMarkers=function(a,f,c){var e=f.getCustomData("list_marker_names"),b=f.getCustomData("list_marker_id"),g;for(g in e)f.removeCustomData(g);f.removeCustomData("list_marker_names");if(c){f.removeCustomData("list_marker_id");delete a[b]}},function(){function a(b){var a=true;if(!b.$.id){b.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber();a=false}return function(){a||b.removeAttribute("id")}}function f(b,a){return"#"+
b.$.id+" "+a.split(/,\s*/).join(", #"+b.$.id+" ")}function c(b){for(var a=0,c=0,d=e[b].length;c<d;c++)a=a+(parseInt(this.getComputedStyle(e[b][c])||0,10)||0);return a}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(b){var a=this.$.className;a&&(RegExp("(?:^|\\s)"+b+"(?:\\s|$)","").test(a)||(a=a+(" "+b)));this.$.className=a||b;return this},removeClass:function(b){var a=this.getAttribute("class");if(a){b=RegExp("(?:^|\\s+)"+b+"(?=\\s|$)","i");if(b.test(a))(a=
a.replace(b,"").replace(/^\s+/,""))?this.setAttribute("class",a):this.removeAttribute("class")}return this},hasClass:function(b){return RegExp("(?:^|\\s+)"+b+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(b,a){typeof b=="string"&&(b=this.getDocument().createElement(b));a?this.$.insertBefore(b.$,this.$.firstChild):this.$.appendChild(b.$);return b},appendHtml:function(b){if(this.$.childNodes.length){var a=new CKEDITOR.dom.element("div",this.getDocument());a.setHtml(b);a.moveChildren(this)}else this.setHtml(b)},
appendText:function(b){this.$.text!=null?this.$.text=this.$.text+b:this.append(new CKEDITOR.dom.text(b))},appendBogus:function(b){if(b||CKEDITOR.env.needsBrFiller){for(b=this.getLast();b&&b.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(b.getText());)b=b.getPrevious();if(!b||!b.is||!b.is("br")){b=this.getDocument().createElement("br");CKEDITOR.env.gecko&&b.setAttribute("type","_moz");this.append(b)}}},breakParent:function(b){var a=new CKEDITOR.dom.range(this.getDocument());a.setStartAfter(this);
a.setEndAfter(b);b=a.extractContents();a.insertNode(this.remove());b.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(b){var a=this.$;return b.type!=CKEDITOR.NODE_ELEMENT?a.contains(b.getParent().$):a!=b.$&&a.contains(b.$)}:function(b){return!!(this.$.compareDocumentPosition(b.$)&16)},focus:function(){function b(){try{this.$.focus()}catch(b){}}return function(a){a?CKEDITOR.tools.setTimeout(b,100,this):b.call(this)}}(),getHtml:function(){var b=this.$.innerHTML;return CKEDITOR.env.ie?
b.replace(/<\?[^>]*>/g,""):b},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var b=this.$.ownerDocument.createElement("div");b.appendChild(this.$.cloneNode(true));return b.innerHTML},getClientRect:function(){var b=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!b.width&&(b.width=b.right-b.left);!b.height&&(b.height=b.bottom-b.top);return b},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(b){try{var a=this.$;if(this.getParent())return a.innerHTML=
b;var c=this.getDocument()._getHtml5ShivFrag();c.appendChild(a);a.innerHTML=b;c.removeChild(a);return b}catch(d){this.$.innerHTML="";a=new CKEDITOR.dom.element("body",this.getDocument());a.$.innerHTML=b;for(a=a.getChildren();a.count();)this.append(a.getItem(0));return b}}:function(b){return this.$.innerHTML=b},setText:function(){var b=document.createElement("p");b.innerHTML="x";b=b.textContent;return function(a){this.$[b?"textContent":"innerText"]=a}}(),getAttribute:function(){var b=function(b){return this.$.getAttribute(b,
2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b){switch(b){case "class":b="className";break;case "http-equiv":b="httpEquiv";break;case "name":return this.$.name;case "tabindex":b=this.$.getAttribute(b,2);b!==0&&this.$.tabIndex===0&&(b=null);return b;case "checked":b=this.$.attributes.getNamedItem(b);return(b.specified?b.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[b];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?
this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(b,2)}:b}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(b){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(b)]}:function(b){var a=this.getWindow().$.getComputedStyle(this.$,null);return a?a.getPropertyValue(b):""},getDtd:function(){var b=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return b};return b},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,
getTabIndex:CKEDITOR.env.ie?function(){var b=this.$.tabIndex;b===0&&(!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0)&&(b=-1);return b}:CKEDITOR.env.webkit?function(){var b=this.$.tabIndex;if(b===void 0){b=parseInt(this.getAttribute("tabindex"),10);isNaN(b)&&(b=-1)}return b}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||
null},getNameAtt:function(){return this.$.name||null},getName:function(){var b=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&document.documentMode<=8){var a=this.$.scopeName;a!="HTML"&&(b=a.toLowerCase()+":"+b)}this.getName=function(){return b};return this.getName()},getValue:function(){return this.$.value},getFirst:function(b){var a=this.$.firstChild;(a=a&&new CKEDITOR.dom.node(a))&&(b&&!b(a))&&(a=a.getNext(b));return a},getLast:function(b){var a=this.$.lastChild;(a=a&&new CKEDITOR.dom.node(a))&&
(b&&!b(a))&&(a=a.getPrevious(b));return a},getStyle:function(b){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(b)]},is:function(){var b=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][b];for(var a=0;a<arguments.length;a++)if(arguments[a]==b)return true;return false},isEditable:function(b){var a=this.getName();if(this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[a]||CKEDITOR.dtd.$empty[a]||
this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount())return false;if(b!==false){b=CKEDITOR.dtd[a]||CKEDITOR.dtd.span;return!(!b||!b["#"])}return true},isIdentical:function(b){var a=this.clone(0,1),b=b.clone(0,1);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);b.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(a.$.isEqualNode){a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText);
b.$.style.cssText=CKEDITOR.tools.normalizeCssText(b.$.style.cssText);return a.$.isEqualNode(b.$)}a=a.getOuterHtml();b=b.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var c=this.getParent();if(c.type==CKEDITOR.NODE_ELEMENT){c=c.clone();c.setHtml(a);a=c.getHtml();c.setHtml(b);b=c.getHtml()}}return a==b},isVisible:function(){var b=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",a,c;if(b&&CKEDITOR.env.webkit){a=this.getWindow();if(!a.equals(CKEDITOR.document.getWindow())&&
(c=a.$.frameElement))b=(new CKEDITOR.dom.element(c)).isVisible()}return!!b},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return false;for(var b=this.getChildren(),a=0,c=b.count();a<c;a++){var d=b.getItem(a);if(!(d.type==CKEDITOR.NODE_ELEMENT&&d.data("cke-bookmark"))&&(d.type==CKEDITOR.NODE_ELEMENT&&!d.isEmptyInlineRemoveable()||d.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(d.getText())))return false}return true},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||
CKEDITOR.env.quirks)?function(){for(var b=this.$.attributes,a=0;a<b.length;a++){var c=b[a];switch(c.nodeName){case "class":if(this.getAttribute("class"))return true;case "data-cke-expando":continue;default:if(c.specified)return true}}return false}:function(){var b=this.$.attributes,a=b.length,c={"data-cke-expando":1,_moz_dirty:1};return a>0&&(a>2||!c[b[0].nodeName]||a==2&&!c[b[1].nodeName])},hasAttribute:function(){function b(b){var a=this.$.attributes.getNamedItem(b);if(this.getName()=="input")switch(b){case "class":return this.$.className.length>
0;case "checked":return!!this.$.checked;case "value":b=this.getAttribute("type");return b=="checkbox"||b=="radio"?this.$.value!="on":!!this.$.value}return!a?false:a.specified}return CKEDITOR.env.ie?CKEDITOR.env.version<8?function(a){return a=="name"?!!this.$.name:b.call(this,a)}:b:function(b){return!!this.$.attributes.getNamedItem(b)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(b,a){var c=this.$,b=b.$;if(c!=b){var d;if(a)for(;d=c.lastChild;)b.insertBefore(c.removeChild(d),
b.firstChild);else for(;d=c.firstChild;)b.appendChild(c.removeChild(d))}},mergeSiblings:function(){function b(b,a,c){if(a&&a.type==CKEDITOR.NODE_ELEMENT){for(var e=[];a.data("cke-bookmark")||a.isEmptyInlineRemoveable();){e.push(a);a=c?a.getNext():a.getPrevious();if(!a||a.type!=CKEDITOR.NODE_ELEMENT)return}if(b.isIdentical(a)){for(var f=c?b.getLast():b.getFirst();e.length;)e.shift().move(b,!c);a.moveChildren(b,!c);a.remove();f&&f.type==CKEDITOR.NODE_ELEMENT&&f.mergeSiblings()}}}return function(a){if(a===
false||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a")){b(this,this.getNext(),true);b(this,this.getPrevious())}}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var b=function(b,a){this.$.setAttribute(b,a);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a,c){a=="class"?this.$.className=c:a=="style"?this.$.style.cssText=c:a=="tabindex"?this.$.tabIndex=c:a=="checked"?this.$.checked=c:a=="contenteditable"?b.call(this,
"contentEditable",c):b.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(a,c){if(a=="src"&&c.match(/^http:\/\//))try{b.apply(this,arguments)}catch(d){}else b.apply(this,arguments);return this}:b}(),setAttributes:function(b){for(var a in b)this.setAttribute(a,b[a]);return this},setValue:function(b){this.$.value=b;return this},removeAttribute:function(){var b=function(b){this.$.removeAttribute(b)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?
function(b){b=="class"?b="className":b=="tabindex"?b="tabIndex":b=="contenteditable"&&(b="contentEditable");this.$.removeAttribute(b)}:b}(),removeAttributes:function(b){if(CKEDITOR.tools.isArray(b))for(var a=0;a<b.length;a++)this.removeAttribute(b[a]);else for(a in b)b.hasOwnProperty(a)&&this.removeAttribute(a)},removeStyle:function(b){var a=this.$.style;if(!a.removeProperty&&(b=="border"||b=="margin"||b=="padding")){var c=["top","left","right","bottom"],d;b=="border"&&(d=["color","style","width"]);
for(var a=[],e=0;e<c.length;e++)if(d)for(var f=0;f<d.length;f++)a.push([b,c[e],d[f]].join("-"));else a.push([b,c[e]].join("-"));for(b=0;b<a.length;b++)this.removeStyle(a[b])}else{a.removeProperty?a.removeProperty(b):a.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(b));this.$.style.cssText||this.removeAttribute("style")}},setStyle:function(b,a){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(b)]=a;return this},setStyles:function(b){for(var a in b)this.setStyle(a,b[a]);return this},setOpacity:function(b){if(CKEDITOR.env.ie&&
CKEDITOR.env.version<9){b=Math.round(b*100);this.setStyle("filter",b>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")")}else this.setStyle("opacity",b)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var b,a=this.getElementsByTag("*"),c=0,d=a.count();c<d;c++){b=a.getItem(c);b.setAttribute("unselectable","on")}}},getPositionedAncestor:function(){for(var b=this;b.getName()!="html";){if(b.getComputedStyle("position")!=
"static")return b;b=b.getParent()}return null},getDocumentPosition:function(b){var a=0,c=0,d=this.getDocument(),e=d.getBody(),f=d.$.compatMode=="BackCompat";if(document.documentElement.getBoundingClientRect){var k=this.$.getBoundingClientRect(),m=d.$.documentElement,o=m.clientTop||e.$.clientTop||0,p=m.clientLeft||e.$.clientLeft||0,n=true;if(CKEDITOR.env.ie){n=d.getDocumentElement().contains(this);d=d.getBody().contains(this);n=f&&d||!f&&n}if(n){a=k.left+(!f&&m.scrollLeft||e.$.scrollLeft);a=a-p;c=
k.top+(!f&&m.scrollTop||e.$.scrollTop);c=c-o}}else{e=this;for(d=null;e&&!(e.getName()=="body"||e.getName()=="html");){a=a+(e.$.offsetLeft-e.$.scrollLeft);c=c+(e.$.offsetTop-e.$.scrollTop);if(!e.equals(this)){a=a+(e.$.clientLeft||0);c=c+(e.$.clientTop||0)}for(;d&&!d.equals(e);){a=a-d.$.scrollLeft;c=c-d.$.scrollTop;d=d.getParent()}d=e;e=(k=e.$.offsetParent)?new CKEDITOR.dom.element(k):null}}if(b){e=this.getWindow();d=b.getWindow();if(!e.equals(d)&&e.$.frameElement){b=(new CKEDITOR.dom.element(e.$.frameElement)).getDocumentPosition(b);
a=a+b.x;c=c+b.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!f){a=a+(this.$.clientLeft?1:0);c=c+(this.$.clientTop?1:0)}return{x:a,y:c}},scrollIntoView:function(a){var c=this.getParent();if(c){do{(c.$.clientWidth&&c.$.clientWidth<c.$.scrollWidth||c.$.clientHeight&&c.$.clientHeight<c.$.scrollHeight)&&!c.is("body")&&this.scrollIntoParent(c,a,1);if(c.is("html")){var e=c.getWindow();try{var d=e.$.frameElement;d&&(c=new CKEDITOR.dom.element(d))}catch(f){}}}while(c=c.getParent())
}},scrollIntoParent:function(a,c,e){var d,f,j,k;function m(c,d){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(c,d);else{a.$.scrollLeft=a.$.scrollLeft+c;a.$.scrollTop=a.$.scrollTop+d}}function o(a,b){var c={x:0,y:0};if(!a.is(n?"body":"html")){var d=a.$.getBoundingClientRect();c.x=d.left;c.y=d.top}d=a.getWindow();if(!d.equals(b)){d=o(CKEDITOR.dom.element.get(d.$.frameElement),b);c.x=c.x+d.x;c.y=c.y+d.y}return c}function p(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&
(a=this.getWindow());j=a.getDocument();var n=j.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=n?j.getBody():j.getDocumentElement());j=a.getWindow();f=o(this,j);var l=o(a,j),q=this.$.offsetHeight;d=this.$.offsetWidth;var r=a.$.clientHeight,u=a.$.clientWidth;j=f.x-p(this,"left")-l.x||0;k=f.y-p(this,"top")-l.y||0;d=f.x+d+p(this,"right")-(l.x+u)||0;f=f.y+q+p(this,"bottom")-(l.y+r)||0;if(k<0||f>0)m(0,c===true?k:c===false?f:k<0?k:f);if(e&&(j<0||d>0))m(j<0?j:d,0)},setState:function(a,c,
e){c=c||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(c+"_on");this.removeClass(c+"_off");this.removeClass(c+"_disabled");e&&this.setAttribute("aria-pressed",true);e&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(c+"_disabled");this.removeClass(c+"_off");this.removeClass(c+"_on");e&&this.setAttribute("aria-disabled",true);e&&this.removeAttribute("aria-pressed");break;default:this.addClass(c+"_off");this.removeClass(c+"_on");this.removeClass(c+
"_disabled");e&&this.removeAttribute("aria-pressed");e&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(c){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,c){for(var e=this.$.attributes,c=c||{},d=0;d<e.length;d++){var f=e[d],j=f.nodeName.toLowerCase(),k;if(!(j in c))if(j=="checked"&&(k=this.getAttribute(j)))a.setAttribute(j,k);else if(!CKEDITOR.env.ie||this.hasAttribute(j)){k=this.getAttribute(j);
if(k===null)k=f.nodeValue;a.setAttribute(j,k)}}if(this.$.style.cssText!=="")a.$.style.cssText=this.$.style.cssText},renameNode:function(a){if(this.getName()!=a){var c=this.getDocument(),a=new CKEDITOR.dom.element(a,c);this.copyAttributes(a);this.moveChildren(a);this.getParent()&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var d=b.childNodes;if(c>=0&&c<d.length)return d[c]}return function(c){var e=
this.$;if(c.slice)for(;c.length>0&&e;)e=a(e,c.shift());else e=a(e,c);return e?new CKEDITOR.dom.node(e):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(a){a.data.getTarget().hasClass("cke_enable_context_menu")||a.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||
this.getAttribute("dir")},data:function(a,c){a="data-"+a;if(c===void 0)return this.getAttribute(a);c===false?this.removeAttribute(a):this.setAttribute(a,c);return null},getEditor:function(){var a=CKEDITOR.instances,c,e;for(c in a){e=a[c];if(e.element.equals(this)&&e.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return e}return null},find:function(b){var c=a(this),b=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(f(this,b)));c();return b},findOne:function(b){var c=a(this),b=this.$.querySelector(f(this,
b));c();return b?new CKEDITOR.dom.element(b):null},forEach:function(a,c,e){if(!e&&(!c||this.type==c))var d=a(this);if(d!==false)for(var e=this.getChildren(),f=0;f<e.count();f++){d=e.getItem(f);d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,c):(!c||d.type==c)&&a(d)}}});var e={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,e,f){if(typeof e==
"number"){if(f&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks))e=e-c.call(this,a);this.setStyle(a,e+"px")}};CKEDITOR.dom.element.prototype.getSize=function(a,e){var f=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;e&&(f=f-c.call(this,a));return f}}(),CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a},CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,
{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)}},!0,{append:1,appendBogus:1,getFirst:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1}),function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed){this.end();return null}c.optimize()}var d,
e=c.startContainer;d=c.endContainer;var k=c.startOffset,g=c.endOffset,f,h=this.guard,i=this.type,j=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var w=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),s=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(g):d.getNext();this._.guardLTR=function(a,b){return(!b||!w.equals(a))&&(!s||!a.equals(s))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var y=e.type==CKEDITOR.NODE_ELEMENT?e:e.getParent(),z=e.type==CKEDITOR.NODE_ELEMENT?
k?e.getChild(k-1):null:e.getPrevious();this._.guardRTL=function(a,b){return(!b||!y.equals(a))&&(!z||!a.equals(z))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var B=a?this._.guardRTL:this._.guardLTR;f=h?function(a,b){return B(a,b)===false?false:h(a,b)}:B;if(this.current)d=this.current[j](false,i,f);else{if(a)d.type==CKEDITOR.NODE_ELEMENT&&(d=g>0?d.getChild(g-1):f(d,true)===false?null:d.getPreviousSourceNode(true,i,f));else{d=e;if(d.type==CKEDITOR.NODE_ELEMENT&&!(d=d.getChild(k)))d=f(e,
true)===false?null:e.getNextSourceNode(true,i,f)}d&&f(d)===false&&(d=null)}for(;d&&!this._.end;){this.current=d;if(!this.evaluator||this.evaluator(d)!==false){if(!b)return d}else if(b&&this.evaluator)return false;d=d[j](false,i,f)}this.end();return this.current=null}function f(b){for(var c,d=null;c=a.call(this,b);)d=c;return d}function c(a){if(j(a))return false;if(a.type==CKEDITOR.NODE_TEXT)return true;if(a.type==CKEDITOR.NODE_ELEMENT){if(a.is(CKEDITOR.dtd.$inline)||a.is("hr")||a.getAttribute("contenteditable")==
"false")return true;var b;if(b=!CKEDITOR.env.needsBrFiller)if(b=a.is(k))a:{b=0;for(var c=a.getChildCount();b<c;++b)if(!j(a.getChild(b))){b=false;break a}b=true}if(b)return true}return false}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return a.call(this,0,1)!==false},checkBackward:function(){return a.call(this,1,1)!==false},
lastForward:function(){return f.call(this)},lastBackward:function(){return f.call(this,1)},reset:function(){delete this.current;this._={}}}});var e={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},b={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return this.getComputedStyle("float")=="none"&&!(this.getComputedStyle("position")in b)&&
e[this.getComputedStyle("display")]?true:!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a))};CKEDITOR.dom.walker.blockBoundary=function(a){return function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=function(a,b){function c(a){return a&&a.getName&&a.getName()=="span"&&a.data("cke-bookmark")}return function(d){var e,k;e=d&&d.type!=CKEDITOR.NODE_ELEMENT&&(k=d.getParent())&&
c(k);e=a?e:e||c(d);return!!(b^e)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(b){var c;b&&b.type==CKEDITOR.NODE_TEXT&&(c=!CKEDITOR.tools.trim(b.getText())||CKEDITOR.env.webkit&&b.getText()=="​");return!!(a^c)}};CKEDITOR.dom.walker.invisible=function(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.env.webkit?1:0;return function(d){if(b(d))d=1;else{d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());d=d.$.offsetWidth<=c}return!!(a^d)}};CKEDITOR.dom.walker.nodeType=function(a,b){return function(c){return!!(b^
c.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function b(a){return!i(a)&&!d(a)}return function(c){var d=CKEDITOR.env.needsBrFiller?c.is&&c.is("br"):c.getText&&g.test(c.getText());if(d){d=c.getParent();c=c.getNext(b);d=d.isBlockBoundary()&&(!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary())}return!!(a^d)}};CKEDITOR.dom.walker.temp=function(a){return function(b){b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b=b&&b.hasAttribute("data-cke-temp");return!!(a^b)}};var g=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
i=CKEDITOR.dom.walker.whitespaces(),d=CKEDITOR.dom.walker.bookmark(),h=CKEDITOR.dom.walker.temp();CKEDITOR.dom.walker.ignored=function(a){return function(b){b=i(b)||d(b)||h(b);return!!(a^b)}};var j=CKEDITOR.dom.walker.ignored(),k=function(a){var b={},c;for(c in a)CKEDITOR.dtd[c]["#"]&&(b[c]=1);return b}(CKEDITOR.dtd.$block);CKEDITOR.dom.walker.editable=function(a){return function(b){return!!(a^c(b))}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(d(a)||
i(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&g.test(a.getText()))?a:false}}(),CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=true;var f=a instanceof CKEDITOR.dom.document;this.document=f?a:a.getDocument();this.root=f?a.getBody():a},function(){function a(){var a=false,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(true),
d=CKEDITOR.dom.walker.bogus();return function(e){if(c(e)||b(e))return true;if(d(e)&&!a)return a=true;return e.type==CKEDITOR.NODE_TEXT&&(e.hasAscendant("pre")||CKEDITOR.tools.trim(e.getText()).length)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(g)?false:true}}function f(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?true:!a&&i(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function c(a){return function(){var b;return this[a?
"getPreviousNode":"getNextNode"](function(a){!b&&j(a)&&(b=a);return h(a)&&!(i(a)&&a.equals(b))})}}var e=function(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset},b=function(a,b,c,d){a.optimizeBookmark();var e=a.startContainer,g=a.endContainer,f=a.startOffset,h=a.endOffset,i,j;if(g.type==CKEDITOR.NODE_TEXT)g=g.split(h);else if(g.getChildCount()>0)if(h>=g.getChildCount()){g=g.append(a.document.createText(""));j=true}else g=g.getChild(h);
if(e.type==CKEDITOR.NODE_TEXT){e.split(f);e.equals(g)&&(g=e.getNext())}else if(f)if(f>=e.getChildCount()){e=e.append(a.document.createText(""));i=true}else e=e.getChild(f).getPrevious();else{e=e.append(a.document.createText(""),1);i=true}var f=e.getParents(),h=g.getParents(),v,x,w;for(v=0;v<f.length;v++){x=f[v];w=h[v];if(!x.equals(w))break}for(var s=c,y,z,B,A=v;A<f.length;A++){y=f[A];s&&!y.equals(e)&&(z=s.append(y.clone()));for(y=y.getNext();y;){if(y.equals(h[A])||y.equals(g))break;B=y.getNext();
if(b==2)s.append(y.clone(true));else{y.remove();b==1&&s.append(y)}y=B}s&&(s=z)}s=c;for(c=v;c<h.length;c++){y=h[c];b>0&&!y.equals(g)&&(z=s.append(y.clone()));if(!f[c]||y.$.parentNode!=f[c].$.parentNode)for(y=y.getPrevious();y;){if(y.equals(f[c])||y.equals(e))break;B=y.getPrevious();if(b==2)s.$.insertBefore(y.$.cloneNode(true),s.$.firstChild);else{y.remove();b==1&&s.$.insertBefore(y.$,s.$.firstChild)}y=B}s&&(s=z)}if(b==2){x=a.startContainer;if(x.type==CKEDITOR.NODE_TEXT){x.$.data=x.$.data+x.$.nextSibling.data;
x.$.parentNode.removeChild(x.$.nextSibling)}a=a.endContainer;if(a.type==CKEDITOR.NODE_TEXT&&a.$.nextSibling){a.$.data=a.$.data+a.$.nextSibling.data;a.$.parentNode.removeChild(a.$.nextSibling)}}else{if(x&&w&&(e.$.parentNode!=x.$.parentNode||g.$.parentNode!=w.$.parentNode)){b=w.getIndex();i&&w.$.parentNode==e.$.parentNode&&b--;if(d&&x.type==CKEDITOR.NODE_ELEMENT){d=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',a.document);d.insertAfter(x);x.mergeSiblings(false);
a.moveToBookmark({startNode:d})}else a.setStart(w.getParent(),b)}a.collapse(true)}i&&e.remove();j&&g.$.parentNode&&g.remove()},g={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},i=CKEDITOR.dom.walker.bogus(),d=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,h=CKEDITOR.dom.walker.editable(),j=CKEDITOR.dom.walker.ignored(true);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);
a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){if(a){this._setEndContainer(this.startContainer);this.endOffset=this.startOffset}else{this._setStartContainer(this.endContainer);this.startOffset=this.endOffset}this.collapsed=true},cloneContents:function(){var a=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||b(this,2,a);return a},deleteContents:function(a){this.collapsed||
b(this,0,null,a)},extractContents:function(a){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||b(this,1,c,a);return c},createBookmark:function(a){var b,c,d,e,g=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml("&nbsp;");if(a){d="cke_bm_"+CKEDITOR.tools.getNextNumber();b.setAttribute("id",d+(g?"C":"S"))}if(!g){c=b.clone();c.setHtml("&nbsp;");a&&c.setAttribute("id",d+"E");e=this.clone();e.collapse();e.insertNode(c)}e=
this.clone();e.collapse(true);e.insertNode(b);if(c){this.setStartAfter(b);this.setEndBefore(c)}else this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(g?"C":"S"):b,endNode:a?d+"E":c,serializable:a,collapsed:g}},createBookmark2:function(){function a(c){var d=c.container,e=c.offset,g;g=d;var k=e;g=g.type!=CKEDITOR.NODE_ELEMENT||k===0||k==g.getChildCount()?0:g.getChild(k-1).type==CKEDITOR.NODE_TEXT&&g.getChild(k).type==CKEDITOR.NODE_TEXT;if(g){d=d.getChild(e-1);e=d.getLength()}d.type==
CKEDITOR.NODE_ELEMENT&&e>1&&(e=d.getChild(e-1).getIndex(true)+1);if(d.type==CKEDITOR.NODE_TEXT){g=d;for(k=0;(g=g.getPrevious())&&g.type==CKEDITOR.NODE_TEXT;)k=k+g.getLength();g=k;if(d.getText())e=e+g;else{k=d.getPrevious(b);if(g){e=g;d=k?k.getNext():d.getParent().getFirst()}else{d=d.getParent();e=k?k.getIndex(true)+1:0}}}c.container=d;c.offset=e}var b=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,true);return function(b){var c=this.collapsed,d={container:this.startContainer,offset:this.startOffset},
e={container:this.endContainer,offset:this.endOffset};if(b){a(d);c||a(e)}return{start:d.container.getAddress(b),end:c?null:e.container.getAddress(b),startOffset:d.offset,endOffset:e.offset,normalized:b,collapsed:c,is2:true}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized),a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(true)}else{b=(c=a.serializable)?this.document.getById(a.startNode):
a.startNode;a=c?this.document.getById(a.endNode):a.endNode;this.setStartBefore(b);b.remove();if(a){this.setEndBefore(a);a.remove()}else this.collapse(true)}},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT){e=a.getChildCount();if(e>c)a=a.getChild(c);else if(e<1)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}}if(b.type==CKEDITOR.NODE_ELEMENT){e=
b.getChildCount();if(e>d)b=b.getChild(d).getPreviousSourceNode(true);else if(e<1)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():
c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&(a.is("span")&&a.data("cke-bookmark"))&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&(b.is&&b.is("span")&&b.data("cke-bookmark"))&&
this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength()){d=c.getIndex()+1;c=c.getParent()}else{var g=c.split(d),d=c.getIndex()+1,c=c.getParent();if(this.startContainer.equals(this.endContainer))this.setEnd(g,this.endOffset-this.startOffset);else if(c.equals(this.endContainer))this.endOffset=this.endOffset+1}else{d=c.getIndex();c=c.getParent()}this.setStart(c,d);
if(e){this.collapse(true);return}}c=this.endContainer;d=this.endOffset;if(!b&&!e&&c&&c.type==CKEDITOR.NODE_TEXT){if(d){d>=c.getLength()||c.split(d);d=c.getIndex()+1}else d=c.getIndex();c=c.getParent();this.setEnd(c,d)}},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var g=this.getCommonAncestor(),f=this.root,
h,i,j,v,x,w=false,s,y;s=this.startContainer;var z=this.startOffset;if(s.type==CKEDITOR.NODE_TEXT){if(z){s=!CKEDITOR.tools.trim(s.substring(0,z)).length&&s;w=!!s}if(s&&!(v=s.getPrevious()))j=s.getParent()}else{z&&(v=s.getChild(z-1)||s.getLast());v||(j=s)}for(j=c(j);j||v;){if(j&&!v){!x&&j.equals(g)&&(x=true);if(e?j.isBlockBoundary():!f.contains(j))break;if(!w||j.getComputedStyle("display")!="inline"){w=false;x?h=j:this.setStartBefore(j)}v=j.getPrevious()}for(;v;){s=false;if(v.type==CKEDITOR.NODE_COMMENT)v=
v.getPrevious();else{if(v.type==CKEDITOR.NODE_TEXT){y=v.getText();d.test(y)&&(v=null);s=/[\s\ufeff]$/.test(y)}else if((v.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&v.is("br"))&&!v.data("cke-bookmark"))if(w&&CKEDITOR.dtd.$removeEmpty[v.getName()]){y=v.getText();if(d.test(y))v=null;else for(var z=v.$.getElementsByTagName("*"),B=0,A;A=z[B++];)if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]){v=null;break}v&&(s=!!y.length)}else v=null;s&&(w?x?h=j:j&&this.setStartBefore(j):w=true);if(v){s=v.getPrevious();
if(!j&&!s){j=v;v=null;break}v=s}else j=null}}j&&(j=c(j.getParent()))}s=this.endContainer;z=this.endOffset;j=v=null;x=w=false;var F=function(a,b){var c=new CKEDITOR.dom.range(f);c.setStart(a,b);c.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),e;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};e=c.next();){if(e.type!=CKEDITOR.NODE_TEXT)return false;y=e!=a?e.getText():e.substring(b);if(d.test(y))return false}return true};if(s.type==CKEDITOR.NODE_TEXT)if(CKEDITOR.tools.trim(s.substring(z)).length)w=
true;else{w=!s.getLength();if(z==s.getLength()){if(!(v=s.getNext()))j=s.getParent()}else F(s,z)&&(j=s.getParent())}else(v=s.getChild(z))||(j=s);for(;j||v;){if(j&&!v){!x&&j.equals(g)&&(x=true);if(e?j.isBlockBoundary():!f.contains(j))break;if(!w||j.getComputedStyle("display")!="inline"){w=false;x?i=j:j&&this.setEndAfter(j)}v=j.getNext()}for(;v;){s=false;if(v.type==CKEDITOR.NODE_TEXT){y=v.getText();F(v,0)||(v=null);s=/^[\s\ufeff]/.test(y)}else if(v.type==CKEDITOR.NODE_ELEMENT){if((v.$.offsetWidth>0||
b&&v.is("br"))&&!v.data("cke-bookmark"))if(w&&CKEDITOR.dtd.$removeEmpty[v.getName()]){y=v.getText();if(d.test(y))v=null;else{z=v.$.getElementsByTagName("*");for(B=0;A=z[B++];)if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]){v=null;break}}v&&(s=!!y.length)}else v=null}else s=1;s&&w&&(x?i=j:this.setEndAfter(j));if(v){s=v.getNext();if(!j&&!s){j=v;v=null;break}v=s}else j=null}j&&(j=c(j.getParent()))}if(h&&i){g=h.contains(i)?i:h;this.setStartBefore(g);this.setEndAfter(g)}break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:j=
new CKEDITOR.dom.range(this.root);f=this.root;j.setStartAt(f,CKEDITOR.POSITION_AFTER_START);j.setEnd(this.startContainer,this.startOffset);j=new CKEDITOR.dom.walker(j);var C,I,G=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),E=null,D=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="false")if(E){if(E.equals(a)){E=null;return}}else E=a;else if(E)return;var b=G(a);b||(C=a);return b},e=function(a){var b=D(a);!b&&(a.is&&a.is("br"))&&
(I=a);return b};j.guard=D;j=j.lastBackward();C=C||f;this.setStartAt(C,!C.is("br")&&(!j&&this.checkStartOfBlock()||j&&C.contains(j))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){j=this.clone();j=new CKEDITOR.dom.walker(j);var J=CKEDITOR.dom.walker.whitespaces(),L=CKEDITOR.dom.walker.bookmark();j.evaluator=function(a){return!J(a)&&!L(a)};if((j=j.previous())&&j.type==CKEDITOR.NODE_ELEMENT&&j.is("br"))break}j=this.clone();j.collapse();j.setEndAt(f,
CKEDITOR.POSITION_BEFORE_END);j=new CKEDITOR.dom.walker(j);j.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:D;C=E=I=null;j=j.lastForward();C=C||f;this.setEndAt(C,!j&&this.checkEndOfBlock()||j&&C.contains(j)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);I&&this.setEndAfter(I)}},shrink:function(a,b,c){if(!this.collapsed){var a=a||CKEDITOR.SHRINK_TEXT,d=this.clone(),e=this.startContainer,g=this.endContainer,f=this.startOffset,h=this.endOffset,j=1,i=1;if(e&&e.type==CKEDITOR.NODE_TEXT)if(f)if(f>=
e.getLength())d.setStartAfter(e);else{d.setStartBefore(e);j=0}else d.setStartBefore(e);if(g&&g.type==CKEDITOR.NODE_TEXT)if(h)if(h>=g.getLength())d.setEndAfter(g);else{d.setEndAfter(g);i=0}else d.setEndBefore(g);var d=new CKEDITOR.dom.walker(d),v=CKEDITOR.dom.walker.bookmark();d.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var x;d.guard=function(b,d){if(v(b))return true;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(x)||
c===false&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return false;!d&&b.type==CKEDITOR.NODE_ELEMENT&&(x=b);return true};if(j)(e=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(e,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);if(i){d.reset();(d=d[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(d,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)}return!(!j&&
!i)}},insertNode:function(a){this.optimizeBookmark();this.trim(false,true);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(true)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,
a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex();a=a.getParent()}this._setStartContainer(a);this.startOffset=b;if(!this.endContainer){this._setEndContainer(a);this.endOffset=b}e(this)},setEnd:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex()+1;a=a.getParent()}this._setEndContainer(a);this.endOffset=b;if(!this.startContainer){this._setStartContainer(a);
this.startOffset=b}e(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setStart(a,a.getLength()):this.setStart(a,
a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(a)}e(this)},setEndAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setEnd(a,a.getLength()):this.setEnd(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(a)}e(this)},fixBlock:function(a,
b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();d.appendBogus();this.insertNode(d);this.moveToBookmark(c);return d},splitBlock:function(a){var b=new CKEDITOR.dom.elementPath(this.startContainer,this.root),c=new CKEDITOR.dom.elementPath(this.endContainer,this.root),d=b.block,e=c.block,g=null;if(!b.blockLimit.equals(c.blockLimit))return null;if(a!="br"){if(!d){d=this.fixBlock(true,
a);e=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block}e||(e=this.fixBlock(false,a))}a=d&&this.checkStartOfBlock();b=e&&this.checkEndOfBlock();this.deleteContents();if(d&&d.equals(e))if(b){g=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END);e=null}else if(a){g=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d=null}else{e=this.splitElement(d);d.is("ul","ol")||
d.appendBogus()}return{previousBlock:d,nextBlock:e,wasStartOfBlock:a,wasEndOfBlock:b,elementPath:g}},splitElement:function(a){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var b=this.extractContents(),c=a.clone(false);b.appendTo(c);c.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return c},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||(c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable())||d.is("table")&&
a.is("caption")?false:true}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(false);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||d.blockLimit,g;e&&!e.equals(d.root)&&!e.getFirst(a(e));){g=e.getParent();this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END);e.remove(1);e=g}this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,
this.root)},checkBoundaryOfElement:function(a,b){var c=b==CKEDITOR.START,d=this.clone();d.collapse(c);d[c?"setStartAt":"setEndAt"](a,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=f(c);return d[c?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var b=this.startContainer,c=this.startOffset;if(CKEDITOR.env.ie&&c&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.ltrim(b.substring(0,c));d.test(b)&&this.trim(0,1)}this.trim();b=new CKEDITOR.dom.elementPath(this.startContainer,
this.root);c=this.clone();c.collapse(true);c.setStartAt(b.block||b.blockLimit,CKEDITOR.POSITION_AFTER_START);b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkBackward()},checkEndOfBlock:function(){var b=this.endContainer,c=this.endOffset;if(CKEDITOR.env.ie&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.rtrim(b.substring(c));d.test(b)&&this.trim(1,0)}this.trim();b=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(false);c.setEndAt(b.block||b.blockLimit,CKEDITOR.POSITION_BEFORE_END);
b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==
CKEDITOR.NODE_ELEMENT){if(b.getAttribute("contentEditable")=="false"&&!b.data("cke-editable"))return 0;if(b.is("html")||b.getAttribute("contentEditable")=="true"&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(false)){this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);return true}for(var c=
0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&d.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable()){this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START);c=1}else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);
else if(a.getAttribute("contenteditable")=="false"&&a.is(CKEDITOR.dtd.$block)){this.setStartBefore(a);this.setEndAfter(a);return true}var e=a,g=c,f=void 0;e.type==CKEDITOR.NODE_ELEMENT&&e.isEditable(false)&&(f=e[b?"getLast":"getFirst"](j));!g&&!f&&(f=e[b?"getPrevious":"getNext"](j));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c=new CKEDITOR.dom.range(this.root),d=0,e,g=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];c.moveToPosition(a,g[b?0:1]);if(a.is(CKEDITOR.dtd.$block)){if(e=
c[b?"getNextEditableNode":"getPreviousEditableNode"]()){d=1;if(e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block)&&e.getAttribute("contenteditable")=="false"){c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START);c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)}else c.moveToPosition(e,g[b?1:0])}}else d=1;d&&this.moveToRange(c);return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,true)},getEnclosedNode:function(){var a=
this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(false,true),c=CKEDITOR.dom.walker.whitespaces(true);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=
this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:c(),getPreviousEditableNode:c(1),scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",this.document),b,c,d,e=this.clone();e.optimize();if(d=e.startContainer.type==CKEDITOR.NODE_TEXT){c=e.startContainer.getText();b=e.startContainer.split(e.startOffset);a.insertAfter(e.startContainer)}else e.insertNode(a);a.scrollIntoView();if(d){e.startContainer.setText(c);
b.remove()}a.remove()},_setStartContainer:function(a){this.startContainer=a},_setEndContainer:function(a){this.endContainer=a}}}(),CKEDITOR.POSITION_AFTER_START=1,CKEDITOR.POSITION_BEFORE_END=2,CKEDITOR.POSITION_BEFORE_START=3,CKEDITOR.POSITION_AFTER_END=4,CKEDITOR.ENLARGE_ELEMENT=1,CKEDITOR.ENLARGE_BLOCK_CONTENTS=2,CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3,CKEDITOR.ENLARGE_INLINE=4,CKEDITOR.START=1,CKEDITOR.END=2,CKEDITOR.SHRINK_ELEMENT=1,CKEDITOR.SHRINK_TEXT=2,"use strict",function(){function a(a){if(!(arguments.length<
1)){this.range=a;this.forceBrBreak=0;this.enlargeBr=1;this.enforceRealBlocks=0;this._||(this._={})}}function f(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")=="true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function c(a,b,d,e){a:{e==null&&(e=f(d));for(var g;g=e.shift();)if(g.getDtd().p){e={element:g,remaining:e};break a}e=null}if(!e)return 0;if((g=CKEDITOR.filter.instances[e.element.data("cke-filter")])&&!g.check(b))return c(a,b,d,e.remaining);b=new CKEDITOR.dom.range(e.element);
b.selectNodeContents(e.element);b=b.createIterator();b.enlargeBr=a.enlargeBr;b.enforceRealBlocks=a.enforceRealBlocks;b.activeFilter=b.filter=g;a._.nestedEditable={element:e.element,container:d,remaining:e.remaining,iterator:b};return 1}function e(a,b,c){if(!b)return false;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var b=/^[\r\n\t ]+$/,g=CKEDITOR.dom.walker.bookmark(false,true),i=CKEDITOR.dom.walker.whitespaces(true),d=function(a){return g(a)&&i(a)},
h={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var f,i,o,p,n,a=a||"p";if(this._.nestedEditable){if(f=this._.nestedEditable.iterator.getNextParagraph(a)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return f}this.activeFilter=this.filter;if(c(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return this._.nestedEditable.iterator.getNextParagraph(a)}this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;
if(!this._.started){var l=this.range.clone();i=l.startPath();var q=l.endPath(),r=!l.collapsed&&e(l,i.block),u=!l.collapsed&&e(l,q.block,1);l.shrink(CKEDITOR.SHRINK_ELEMENT,true);r&&l.setStartAt(i.block,CKEDITOR.POSITION_BEFORE_END);u&&l.setEndAt(q.block,CKEDITOR.POSITION_AFTER_START);i=l.endContainer.hasAscendant("pre",true)||l.startContainer.hasAscendant("pre",true);l.enlarge(this.forceBrBreak&&!i||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!l.collapsed){i=
new CKEDITOR.dom.walker(l.clone());q=CKEDITOR.dom.walker.bookmark(true,true);i.evaluator=q;this._.nextNode=i.next();i=new CKEDITOR.dom.walker(l.clone());i.evaluator=q;i=i.previous();this._.lastNode=i.getNextSourceNode(true,null,l.root);if(this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()){q=this.range.clone();q.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END);if(q.checkEndOfBlock()){q=
new CKEDITOR.dom.elementPath(q.endContainer,q.root);this._.lastNode=(q.block||q.blockLimit).getNextSourceNode(true)}}if(!this._.lastNode||!l.root.contains(this._.lastNode)){this._.lastNode=this._.docEndMarker=l.document.createText("");this._.lastNode.insertAfter(i)}l=null}this._.started=1;i=l}q=this._.nextNode;l=this._.lastNode;for(this._.nextNode=null;q;){var r=0,u=q.hasAscendant("pre"),t=q.type!=CKEDITOR.NODE_ELEMENT,v=0;if(t)q.type==CKEDITOR.NODE_TEXT&&b.test(q.getText())&&(t=0);else{var x=q.getName();
if(CKEDITOR.dtd.$block[x]&&q.getAttribute("contenteditable")=="false"){f=q;c(this,a,f);break}else if(q.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){if(x=="br")t=1;else if(!i&&!q.getChildCount()&&x!="hr"){f=q;o=q.equals(l);break}if(i){i.setEndAt(q,CKEDITOR.POSITION_BEFORE_START);if(x!="br")this._.nextNode=q}r=1}else{if(q.getFirst()){if(!i){i=this.range.clone();i.setStartAt(q,CKEDITOR.POSITION_BEFORE_START)}q=q.getFirst();continue}t=1}}if(t&&!i){i=this.range.clone();i.setStartAt(q,CKEDITOR.POSITION_BEFORE_START)}o=
(!r||t)&&q.equals(l);if(i&&!r)for(;!q.getNext(d)&&!o;){x=q.getParent();if(x.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){r=1;t=0;o||x.equals(l);i.setEndAt(x,CKEDITOR.POSITION_BEFORE_END);break}q=x;t=1;o=q.equals(l);v=1}t&&i.setEndAt(q,CKEDITOR.POSITION_AFTER_END);q=this._getNextSourceNode(q,v,l);if((o=!q)||r&&i)break}if(!f){if(!i){this._.docEndMarker&&this._.docEndMarker.remove();return this._.nextNode=null}f=new CKEDITOR.dom.elementPath(i.startContainer,i.root);q=f.blockLimit;r={div:1,th:1,td:1};
f=f.block;if(!f&&q&&!this.enforceRealBlocks&&r[q.getName()]&&i.checkStartOfBlock()&&i.checkEndOfBlock()&&!q.equals(i.root))f=q;else if(!f||this.enforceRealBlocks&&f.is(h)){f=this.range.document.createElement(a);i.extractContents().appendTo(f);f.trim();i.insertNode(f);p=n=true}else if(f.getName()!="li"){if(!i.checkStartOfBlock()||!i.checkEndOfBlock()){f=f.clone(false);i.extractContents().appendTo(f);f.trim();n=i.splitBlock();p=!n.wasStartOfBlock;n=!n.wasEndOfBlock;i.insertNode(f)}}else if(!o)this._.nextNode=
f.equals(l)?null:this._getNextSourceNode(i.getBoundaryNodes().endNode,1,l)}if(p)(p=f.getPrevious())&&p.type==CKEDITOR.NODE_ELEMENT&&(p.getName()=="br"?p.remove():p.getLast()&&p.getLast().$.nodeName.toLowerCase()=="br"&&p.getLast().remove());if(n)(p=f.getLast())&&p.type==CKEDITOR.NODE_ELEMENT&&p.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||p.getPrevious(g)||p.getNext(g))&&p.remove();if(!this._.nextNode)this._.nextNode=o||f.equals(l)||!l?null:this._getNextSourceNode(f,1,l);return f},_getNextSourceNode:function(a,
b,c){function d(a){return!(a.equals(c)||a.equals(e))}for(var e=this.range.root,a=a.getNextSourceNode(b,null,d);!g(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}}(),CKEDITOR.command=function(a,f){this.uiItems=[];this.exec=function(c){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return false;this.editorFocus&&a.focus();return this.fire("exec")===false?true:f.exec.call(this,a,c)!==false};this.refresh=function(a,
b){if(!this.readOnly&&a.readOnly)return true;if(this.context&&!b.isContextFor(this.context)){this.disable();return true}if(!this.checkAllowed(true)){this.disable();return true}this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return this.fire("refresh",{editor:a,path:b})===false?true:f.refresh&&f.refresh.apply(this,arguments)!==false};var c;this.checkAllowed=function(e){return!e&&typeof c=="boolean"?c:c=a.activeFilter.checkFeature(this)};CKEDITOR.tools.extend(this,
f,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!f.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)},CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(!this.preserveState||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return false;
this.previousState=this.state;this.state=a;this.fire("state");return true},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,
forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function a(a,b,c,d,e){var g,f,a=[];for(g in b){f=b[g];f=typeof f=="boolean"?{}:typeof f=="function"?{match:f}:F(f);if(g.charAt(0)!="$")f.elements=g;if(c)f.featureName=c.toLowerCase();var h=f;h.elements=i(h.elements,
/\s+/)||null;h.propertiesOnly=h.propertiesOnly||h.elements===true;var j=/\s*,\s*/,q=void 0;for(q in E){h[q]=i(h[q],j)||null;var k=h,n=D[q],x=i(h[D[q]],j),u=h[q],m=[],l=true,v=void 0;x?l=false:x={};for(v in u)if(v.charAt(0)=="!"){v=v.slice(1);m.push(v);x[v]=true;l=false}for(;v=m.pop();){u[v]=u["!"+v];delete u["!"+v]}k[n]=(l?false:x)||null}h.match=h.match||null;d.push(f);a.push(f)}for(var b=e.elements,e=e.generic,G,c=0,d=a.length;c<d;++c){g=F(a[c]);f=g.classes===true||g.styles===true||g.attributes===
true;h=g;q=n=j=void 0;for(j in E)h[j]=r(h[j]);k=true;for(q in D){j=D[q];n=h[j];x=[];u=void 0;for(u in n)u.indexOf("*")>-1?x.push(RegExp("^"+u.replace(/\*/g,".*")+"$")):x.push(u);n=x;if(n.length){h[j]=n;k=false}}h.nothingRequired=k;h.noProperties=!(h.attributes||h.classes||h.styles);if(g.elements===true||g.elements===null)e[f?"unshift":"push"](g);else{h=g.elements;delete g.elements;for(G in h)if(b[G])b[G][f?"unshift":"push"](g);else b[G]=[g]}}}function f(a,b,e,g){if(!a.match||a.match(b))if(g||d(a,
b)){if(!a.propertiesOnly)e.valid=true;if(!e.allAttributes)e.allAttributes=c(a.attributes,b.attributes,e.validAttributes);if(!e.allStyles)e.allStyles=c(a.styles,b.styles,e.validStyles);if(!e.allClasses){a=a.classes;b=b.classes;g=e.validClasses;if(a)if(a===true)a=true;else{for(var f=0,h=b.length,i;f<h;++f){i=b[f];g[i]||(g[i]=a(i))}a=false}else a=false;e.allClasses=a}}}function c(a,b,c){if(!a)return false;if(a===true)return true;for(var d in b)c[d]||(c[d]=a(d));return false}function e(a,c,d){if(!a.match||
a.match(c)){if(a.noProperties)return false;d.hadInvalidAttribute=b(a.attributes,c.attributes)||d.hadInvalidAttribute;d.hadInvalidStyle=b(a.styles,c.styles)||d.hadInvalidStyle;a=a.classes;c=c.classes;if(a){for(var e=false,g=a===true,f=c.length;f--;)if(g||a(c[f])){c.splice(f,1);e=true}a=e}else a=false;d.hadInvalidClass=a||d.hadInvalidClass}}function b(a,b){if(!a)return false;var c=false,d=a===true,e;for(e in b)if(d||a(e)){delete b[e];c=true}return c}function g(a,b,c){if(a.disabled||a.customConfig&&
!c||!b)return false;a._.cachedChecks={};return true}function i(a,b){if(!a)return false;if(a===true)return a;if(typeof a=="string"){a=C(a);return a=="*"?true:CKEDITOR.tools.convertArrayToObject(a.split(b))}if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):false;var c={},d=0,e;for(e in a){c[e]=a[e];d++}return d?c:false}function d(a,b){if(a.nothingRequired)return true;var c,d,e,g;if(e=a.requiredClasses){g=b.classes;for(c=0;c<e.length;++c){d=e[c];if(typeof d=="string"){if(CKEDITOR.tools.indexOf(g,
d)==-1)return false}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(g,d))return false}}return h(b.styles,a.requiredStyles)&&h(b.attributes,a.requiredAttributes)}function h(a,b){if(!b)return true;for(var c=0,d;c<b.length;++c){d=b[c];if(typeof d=="string"){if(!(d in a))return false}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return false}return true}function j(a){if(!a)return{};for(var a=a.split(/\s*,\s*/).sort(),b={};a.length;)b[a.shift()]=I;return b}function k(a){for(var b,c,d,
e,g={},f=1,a=C(a);b=a.match(J);){if(c=b[2]){d=m(c,"styles");e=m(c,"attrs");c=m(c,"classes")}else d=e=c=null;g["$"+f++]={elements:b[1],classes:c,styles:d,attributes:e};a=a.slice(b[0].length)}return g}function m(a,b){var c=a.match(L[b]);return c?C(c[1]):null}function o(a){var b=a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];if(!a.styles)a.styles=CKEDITOR.tools.parseCssText(b||"",1);if(!a.classes)a.classes=c?c.split(/\s+/):[]}function p(a,b,c,d){var g=0,h;if(d.toHtml)b.name=b.name.replace(H,
"$1");if(d.doCallbacks&&a.elementCallbacks){a:for(var i=a.elementCallbacks,j=0,k=i.length,n;j<k;++j)if(n=i[j](b)){h=n;break a}if(h)return h}if(d.doTransform)if(h=a._.transformations[b.name]){o(b);for(i=0;i<h.length;++i)x(a,b,h[i]);l(b)}if(d.doFilter){a:{i=b.name;j=a._;a=j.allowedRules.elements[i];h=j.allowedRules.generic;i=j.disallowedRules.elements[i];j=j.disallowedRules.generic;k=d.skipRequired;n={valid:false,validAttributes:{},validClasses:{},validStyles:{},allAttributes:false,allClasses:false,
allStyles:false,hadInvalidAttribute:false,hadInvalidClass:false,hadInvalidStyle:false};var r,u;if(!a&&!h)a=null;else{o(b);if(i){r=0;for(u=i.length;r<u;++r)if(e(i[r],b,n)===false){a=null;break a}}if(j){r=0;for(u=j.length;r<u;++r)e(j[r],b,n)}if(a){r=0;for(u=a.length;r<u;++r)f(a[r],b,n,k)}if(h){r=0;for(u=h.length;r<u;++r)f(h[r],b,n,k)}a=n}}if(!a){c.push(b);return A}if(!a.valid){c.push(b);return A}u=a.validAttributes;var m=a.validStyles;h=a.validClasses;var i=b.attributes,v=b.styles,j=b.classes,k=b.classBackup,
G=b.styleBackup,w,E,t=[];n=[];var p=/^data-cke-/;r=false;delete i.style;delete i["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(w in i)if(!u[w])if(p.test(w)){if(w!=(E=w.replace(/^data-cke-saved-/,""))&&!u[E]){delete i[w];r=true}}else{delete i[w];r=true}if(!a.allStyles||a.hadInvalidStyle){for(w in v)a.allStyles||m[w]?t.push(w+":"+v[w]):r=true;if(t.length)i.style=t.sort().join("; ")}else if(G)i.style=G;if(!a.allClasses||a.hadInvalidClass){for(w=0;w<j.length;++w)(a.allClasses||
h[j[w]])&&n.push(j[w]);n.length&&(i["class"]=n.sort().join(" "));k&&n.length<k.split(/\s+/).length&&(r=true)}else k&&(i["class"]=k);r&&(g=A);if(!d.skipFinalValidation&&!q(b)){c.push(b);return A}}if(d.toHtml)b.name=b.name.replace(Q,"cke:$1");return g}function n(a){var b=[],c;for(c in a)c.indexOf("*")>-1&&b.push(c.replace(/\*/g,".*"));return b.length?RegExp("^(?:"+b.join("|")+")$"):null}function l(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,true))b.style=
c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function q(a){switch(a.name){case "a":if(!a.children.length&&!a.attributes.name)return false;break;case "img":if(!a.attributes.src)return false}return true}function r(a){if(!a)return false;if(a===true)return true;var b=n(a);return function(c){return c in a||b&&c.match(b)}}function u(){return new CKEDITOR.htmlParser.element("br")}function t(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.name=="br"||B.$block[a.name])}function v(a,b,c){var d=a.name;
if(B.$empty[d]||!a.children.length)if(d=="hr"&&b=="br")a.replaceWith(u());else{a.parent&&c.push({check:"it",el:a.parent});a.remove()}else if(B.$block[d]||d=="tr")if(b=="br"){if(a.previous&&!t(a.previous)){b=u();b.insertBefore(a)}if(a.next&&!t(a.next)){b=u();b.insertAfter(a)}a.replaceWithChildren()}else{var d=a.children,e;b:{e=B[b];for(var g=0,f=d.length,h;g<f;++g){h=d[g];if(h.type==CKEDITOR.NODE_ELEMENT&&!e[h.name]){e=false;break b}}e=true}if(e){a.name=b;a.attributes={};c.push({check:"parent-down",
el:a})}else{e=a.parent;for(var g=e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||e.name=="body",i,j,f=d.length;f>0;){h=d[--f];if(g&&(h.type==CKEDITOR.NODE_TEXT||h.type==CKEDITOR.NODE_ELEMENT&&B.$inline[h.name])){if(!i){i=new CKEDITOR.htmlParser.element(b);i.insertAfter(a);c.push({check:"parent-down",el:i})}i.add(h,0)}else{i=null;j=B[e.name]||B.span;h.insertAfter(a);e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(h.type==CKEDITOR.NODE_ELEMENT&&!j[h.name])&&c.push({check:"el-up",el:h})}}a.remove()}}else if(d=="style")a.remove();
else{a.parent&&c.push({check:"it",el:a.parent});a.replaceWithChildren()}}function x(a,b,c){var d,e;for(d=0;d<c.length;++d){e=c[d];if((!e.check||a.check(e.check,false))&&(!e.left||e.left(b))){e.right(b,O);break}}}function w(a,b){var c=b.getDefinition(),d=c.attributes,e=c.styles,g,f,h,i;if(a.name!=c.element)return false;for(g in d)if(g=="class"){c=d[g].split(/\s+/);for(h=a.classes.join("|");i=c.pop();)if(h.indexOf(i)==-1)return false}else if(a.attributes[g]!=d[g])return false;for(f in e)if(a.styles[f]!=
e[f])return false;return true}function s(a,b){var c,d;if(typeof a=="string")c=a;else if(a instanceof CKEDITOR.style)d=a;else{c=a[0];d=a[1]}return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function y(a){return function(b){return w(b,a)}}function z(a){return function(b,c){c[a](b)}}var B=CKEDITOR.dtd,A=1,F=CKEDITOR.tools.copy,C=CKEDITOR.tools.trim,I="cke-test",G=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];
this.elementCallbacks=null;this.disabled=false;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=this.editor=a;this.customConfig=true;var b=a.config.allowedContent;if(b===true)this.disabled=true;else{if(!b)this.customConfig=false;this.allow(b,"config",1);this.allow(a.config.extraAllowedContent,"extra",
1);this.allow(G[a.enterMode]+" "+G[a.shiftEnterMode],"default",1);this.disallow(a.config.disallowedContent)}}else{this.customConfig=false;this.allow(a,"default",1)}};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,d){if(!g(this,b,d))return false;var e,f;if(typeof b=="string")b=k(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,d);e=b.getDefinition();b={};d=e.attributes;b[e.element]=e={styles:e.styles,
requiredStyles:e.styles&&CKEDITOR.tools.objectKeys(e.styles)};if(d){d=F(d);e.classes=d["class"]?d["class"].split(/\s+/):null;e.requiredClasses=e.classes;delete d["class"];e.attributes=d;e.requiredAttributes=d&&CKEDITOR.tools.objectKeys(d)}}else if(CKEDITOR.tools.isArray(b)){for(e=0;e<b.length;++e)f=this.allow(b[e],c,d);return f}a(this,b,c,this.allowedContent,this._.allowedRules);return true},applyTo:function(a,b,c,d){if(this.disabled)return false;var e=this,g=[],f=this.editor&&this.editor.config.protectedSource,
h,i=false,j={doFilter:!c,doTransform:true,doCallbacks:true,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if(a.attributes["data-cke-filter"]=="off")return false;if(!b||!(a.name=="span"&&~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))){h=p(e,a,g,j);if(h&A)i=true;else if(h&2)return false}}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var q,
k,n;if(f)for(k=0;k<f.length;++k)if((n=d.match(f[k]))&&n[0].length==d.length){c=true;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length==1&&(q=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&p(e,q,c,j);c=!c.length}c||g.push(a)}},null,true);g.length&&(i=true);for(var k,a=[],d=G[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],n;c=g.pop();)c.type==CKEDITOR.NODE_ELEMENT?v(c,d,a):c.remove();for(;k=a.pop();){c=k.el;if(c.parent){n=B[c.parent.name]||B.span;switch(k.check){case "it":B.$removeEmpty[c.name]&&
!c.children.length?v(c,d,a):q(c)||v(c,d,a);break;case "el-up":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!n[c.name]&&v(c,d,a);break;case "parent-down":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!n[c.name]&&v(c.parent,d,a)}}}return i},checkFeature:function(a){if(this.disabled||!a)return true;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=true},disallow:function(b){if(!g(this,b,true))return false;typeof b==
"string"&&(b=k(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return true},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],e;for(b=0;b<a.length&&!e;++b){c=a[b];if((typeof c=="string"||c instanceof CKEDITOR.style)&&this.check(c))e=c}if(e){for(b=0;b<a.length;++b)d.push(s(a[b],e));this.addTransformations(d)}}},addElementCallback:function(a){if(!this.elementCallbacks)this.elementCallbacks=[];this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return true;
a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):true},addTransformations:function(a){var b,c;if(!this.disabled&&a){var d=this._.transformations,e;for(e=0;e<a.length;++e){b=a[e];var g=void 0,f=void 0,h=void 0,i=void 0,j=void 0,q=void 0;c=[];for(f=0;f<b.length;++f){h=b[f];if(typeof h==
"string"){h=h.split(/\s*:\s*/);i=h[0];j=null;q=h[1]}else{i=h.check;j=h.left;q=h.right}if(!g){g=h;g=g.element?g.element:i?i.match(/^([a-z0-9]+)/i)[0]:g.left.getDefinition().element}j instanceof CKEDITOR.style&&(j=y(j));c.push({check:i==g?null:i,left:j,right:typeof q=="string"?z(q):q})}b=g;d[b]||(d[b]=[]);d[b].push(c)}}},check:function(a,b,c){if(this.disabled)return true;if(CKEDITOR.tools.isArray(a)){for(var d=a.length;d--;)if(this.check(a[d],b,c))return true;return false}var e,g;if(typeof a=="string"){g=
a+"<"+(b===false?"0":"1")+(c?"1":"0")+">";if(g in this._.cachedChecks)return this._.cachedChecks[g];d=k(a).$1;e=d.styles;var f=d.classes;d.name=d.elements;d.classes=f=f?f.split(/\s*,\s*/):[];d.styles=j(e);d.attributes=j(d.attributes);d.children=[];f.length&&(d.attributes["class"]=f.join(" "));if(e)d.attributes.style=CKEDITOR.tools.writeCssText(d.styles);e=d}else{d=a.getDefinition();e=d.styles;f=d.attributes||{};if(e){e=F(e);f.style=CKEDITOR.tools.writeCssText(e,true)}else e={};e={name:d.element,attributes:f,
classes:f["class"]?f["class"].split(/\s+/):[],styles:e,children:[]}}var f=CKEDITOR.tools.clone(e),h=[],i;if(b!==false&&(i=this._.transformations[e.name])){for(d=0;d<i.length;++d)x(this,e,i[d]);l(e)}p(this,f,h,{doFilter:true,doTransform:b!==false,skipRequired:!c,skipFinalValidation:!c});b=h.length>0?false:CKEDITOR.tools.objectCompare(e.attributes,f.attributes,true)?true:false;typeof a=="string"&&(this._.cachedChecks[g]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,
div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var e=a.slice(),g;if(this.check(G[c]))return c;for(d||(e=e.reverse());g=e.pop();)if(this.check(g))return b[g];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;delete this.disallowedContent}};var E={styles:1,attributes:1,classes:1},D={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},J=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
L={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},H=/^cke:(object|embed|param)$/,Q=/^(object|embed|param)$/,O=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];if(d){/^\d+$/.test(d)&&(d=d+"px");a.styles[c]=d}}delete a.attributes[b]},
lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],e=d&&d.match(/^(\d+)(?:\.\d*)?px$/);e?a.attributes[c]=e[1]:d==I&&(a.attributes[c]=I)}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=a.attributes.align;if(b=="left"||b=="right")a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if(b=="left"||b=="right")a.attributes.align=b}delete a.styles["float"]},matchesStyle:w,
transform:function(a,b){if(typeof b=="string")a.name=b;else{var c=b.getDefinition(),d=c.styles,e=c.attributes,g,f,h,i;a.name=c.element;for(g in e)if(g=="class"){c=a.classes.join("|");for(h=e[g].split(/\s+/);i=h.pop();)c.indexOf(i)==-1&&a.classes.push(i)}else a.attributes[g]=e[g];for(f in d)a.styles[f]=d[f]}}}}(),function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=false;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};
CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);if(a)this.currentActive=a;if(!this.hasFocus&&!this._.locked){(a=CKEDITOR.currentInstance)&&a.focusManager.blur(1);this.hasFocus=true;(a=this._.editor.container)&&a.addClass("cke_focus");this._.editor.fire("focus")}},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function f(){if(this.hasFocus){this.hasFocus=false;var a=this._.editor.container;a&&a.removeClass("cke_focus");
this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var c=CKEDITOR.focusManager._.blurDelay;a||!c?f.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;f.call(this)},c,this)}},add:function(a,f){var c=a.getCustomData("focusmanager");if(!c||c!=this){c&&c.remove(a);var c="focus",e="blur";if(f)if(CKEDITOR.env.ie){c="focusin";e="focusout"}else CKEDITOR.event.useCapture=1;var b={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};
a.on(c,b.focus,this);a.on(e,b.blur,this);if(f)CKEDITOR.event.useCapture=0;a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",b)}},remove:function(a){a.removeCustomData("focusmanager");var f=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",f.blur);a.removeListener("focus",f.focus)}}}(),CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this},function(){var a,
f=function(c){var c=c.data,b=c.getKeystroke(),g=this.keystrokes[b],f=this._.editor;a=f.fire("key",{keyCode:b,domEvent:c})===false;if(!a){g&&(a=f.execCommand(g,{from:"keystrokeHandler"})!==false);a||(a=!!this.blockedKeystrokes[b])}a&&c.preventDefault(true);return!a},c=function(c){if(a){a=false;c.data.preventDefault(true)}};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",f,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",c,this)}}}(),function(){CKEDITOR.lang={languages:{af:1,
ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,f,c){if(!a||!CKEDITOR.lang.languages[a])a=this.detect(f,a);var e=this,f=function(){e[a].dir=
e.rtl[a]?"rtl":"ltr";c(a,e[a])};this[a]?f():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),f,this)},detect:function(a,f){var c=this.languages,f=f||navigator.userLanguage||navigator.language||a,e=f.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),b=e[1],e=e[2];c[b+"-"+e]?b=b+"-"+e:c[b]||(b=null);CKEDITOR.lang.detect=b?function(){return b}:function(a){return a};return b||a}}}(),CKEDITOR.scriptLoader=function(){var a={},f={};return{load:function(c,e,b,g){var i=typeof c=="string";i&&(c=[c]);
b||(b=CKEDITOR);var d=c.length,h=[],j=[],k=function(a){e&&(i?e.call(b,a):e.call(b,h,j))};if(d===0)k(true);else{var m=function(a,b){(b?h:j).push(a);if(--d<=0){g&&CKEDITOR.document.getDocumentElement().removeStyle("cursor");k(b)}},o=function(b,c){a[b]=1;var d=f[b];delete f[b];for(var e=0;e<d.length;e++)d[e](b,c)},p=function(b){if(a[b])m(b,true);else{var c=f[b]||(f[b]=[]);c.push(m);if(!(c.length>1)){var d=new CKEDITOR.dom.element("script");d.setAttributes({type:"text/javascript",src:b});if(e)if(CKEDITOR.env.ie&&
CKEDITOR.env.version<11)d.$.onreadystatechange=function(){if(d.$.readyState=="loaded"||d.$.readyState=="complete"){d.$.onreadystatechange=null;o(b,true)}};else{d.$.onload=function(){setTimeout(function(){o(b,true)},0)};d.$.onerror=function(){o(b,false)}}d.appendTo(CKEDITOR.document.getHead())}}};g&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var n=0;n<d;n++)p(c[n])}},queue:function(){function a(){var b;(b=e[0])&&this.load(b.scriptUrl,b.callback,CKEDITOR,0)}var e=[];return function(b,
g){var f=this;e.push({scriptUrl:b,callback:function(){g&&g.apply(this,arguments);e.shift();a.call(f)}});e.length==1&&a.call(this)}}()}}(),CKEDITOR.resourceManager=function(a,f){this.basePath=a;this.fileName=f;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}},CKEDITOR.resourceManager.prototype={add:function(a,f){if(this.registered[a])throw'[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.';var c=this.registered[a]=f||{};c.name=a;c.path=this.getPath(a);
CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",c);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var f=this.externals[a];return CKEDITOR.getUrl(f&&f.dir||this.basePath+a+"/")},getFilePath:function(a){var f=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(f?f.file:this.fileName+".js"))},addExternal:function(a,f,c){for(var a=a.split(","),e=0;e<a.length;e++){var b=a[e];c||(f=f.replace(/[^\/]+$/,function(a){c=a;return""}));this.externals[b]=
{dir:f,file:c||this.fileName+".js"}}},load:function(a,f,c){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var e=this.loaded,b=this.registered,g=[],i={},d={},h=0;h<a.length;h++){var j=a[h];if(j)if(!e[j]&&!b[j]){var k=this.getFilePath(j);g.push(k);k in i||(i[k]=[]);i[k].push(j)}else d[j]=this.get(j)}CKEDITOR.scriptLoader.load(g,function(a,b){if(b.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+i[b[0]].join(",")+'" was not found at "'+b[0]+'".';for(var g=0;g<a.length;g++)for(var h=i[a[g]],
j=0;j<h.length;j++){var q=h[j];d[q]=this.get(q);e[q]=1}f.call(c,d)},this)}},CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin"),CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var f={};return function(c,e,b){var g={},i=function(c){a.call(this,c,function(a){CKEDITOR.tools.extend(g,a);var c=[],d;for(d in a){var m=a[d],o=m&&m.requires;if(!f[d]){if(m.icons)for(var p=m.icons.split(","),n=p.length;n--;)CKEDITOR.skin.addIcon(p[n],m.path+"icons/"+(CKEDITOR.env.hidpi&&
m.hidpi?"hidpi/":"")+p[n]+".png");f[d]=1}if(o){o.split&&(o=o.split(","));for(m=0;m<o.length;m++)g[o[m]]||c.push(o[m])}}if(c.length)i.call(this,c);else{for(d in g){m=g[d];if(m.onLoad&&!m.onLoad._called){m.onLoad()===false&&delete g[d];m.onLoad._called=1}}e&&e.call(b||window,g)}},this)};i.call(this,c)}}),CKEDITOR.plugins.setLang=function(a,f,c){var e=this.get(a),a=e.langEntries||(e.langEntries={}),e=e.lang||(e.lang=[]);e.split&&(e=e.split(","));CKEDITOR.tools.indexOf(e,f)==-1&&e.push(f);a[f]=c},CKEDITOR.ui=
function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this},CKEDITOR.ui.prototype={add:function(a,f,c){c.name=a.toLowerCase();var e=this.items[a]={type:f,command:c.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(e,c)},get:function(a){return this.instances[a]},create:function(a){var f=this.items[a],c=f&&this._.handlers[f.type],e=f&&f.command&&this.editor.getCommand(f.command),c=c&&c.create.apply(this,f.args);this.instances[a]=
c;e&&e.uiItems.push(c);if(c&&!c.type)c.type=f.type;return c},addHandler:function(a,f){this._.handlers[a]=f},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}},CKEDITOR.event.implementOn(CKEDITOR.ui),function(){function a(a,d,e){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(d!==void 0){if(d instanceof CKEDITOR.dom.element){if(!e)throw Error("One of the element modes must be specified.");}else throw Error("Expect element of type CKEDITOR.dom.element.");
if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&e==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(e==CKEDITOR.ELEMENT_MODE_INLINE?d.is(CKEDITOR.dtd.$editable)||d.is("textarea"):e==CKEDITOR.ELEMENT_MODE_REPLACE?!d.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+d.getName()+'".');this.element=d;this.elementMode=e;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(d.getId()||d.getNameAtt())}else this.elementMode=
CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||f();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",c);this.on("selectionChange",function(a){b(this,a.data.path)});this.on("activeFilterChange",function(){b(this,this.elementPath(),true)});
this.on("mode",c);this.on("instanceReady",function(){this.config.startupFocus&&this.focus()});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){i(this,a)},0,this)}function f(){do var a="editor"+ ++o;while(CKEDITOR.instances[a]);return a}function c(){var a=this.commands,b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function b(a,b,c){if(b){var d,e,g=a.commands;
for(e in g){d=g[e];(c||d.contextSensitive)&&d.refresh(a,b)}}}function g(a){var b=a.config.customConfig;if(!b)return false;var b=CKEDITOR.getUrl(b),c=p[b]||(p[b]={});if(c.fn){c.fn.call(a,a.config);(CKEDITOR.getUrl(a.config.customConfig)==b||!g(a))&&a.fireOnce("customConfigLoaded")}else CKEDITOR.scriptLoader.queue(b,function(){c.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};g(a)});return true}function i(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);
CKEDITOR.tools.extend(a.config,b,true);delete a.config.on}c=a.config;a.readOnly=!(!c.readOnly&&!(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled"):a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&a.element.hasAttribute("disabled")));a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):false;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||
0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;if(c.skin)CKEDITOR.skinName=c.skin;a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);d(a)});if(b&&b.customConfig!=null)a.config.customConfig=b.customConfig;g(a)||a.fireOnce("customConfigLoaded")}function d(a){CKEDITOR.skin.loadPart("editor",function(){h(a)})}function h(a){CKEDITOR.lang.load(a.config.language,
a.config.defaultLanguage,function(b,c){var d=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title=typeof d=="string"||d===false?d:[a.lang.editor,a.name].join(", ");if(!a.config.contentsLangDirection)a.config.contentsLangDirection=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir;a.fire("langLoaded");j(a)})}function j(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);k(a)})}function k(a){var b=
a.config,c=b.plugins,d=b.extraPlugins,e=b.removePlugins;if(d)var g=RegExp("(?:^|,)(?:"+d.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(g,""),c=c+(","+d);if(e)var f=RegExp("(?:^|,)(?:"+e.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(f,"");CKEDITOR.env.air&&(c=c+",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],e=[],g=[];a.plugins=c;for(var h in c){var i=c[h],j=i.lang,k=null,q=i.requires,r;CKEDITOR.tools.isArray(q)&&(q=q.join(","));if(q&&(r=q.match(f)))for(;q=r.pop();)CKEDITOR.tools.setTimeout(function(a,
b){throw Error('Plugin "'+a.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+b+'" plugin.');},0,null,[q,h]);if(j&&!a.lang[h]){j.split&&(j=j.split(","));if(CKEDITOR.tools.indexOf(j,a.langCode)>=0)k=a.langCode;else{k=a.langCode.replace(/-.*/,"");k=k!=a.langCode&&CKEDITOR.tools.indexOf(j,k)>=0?k:CKEDITOR.tools.indexOf(j,"en")>=0?"en":j[0]}if(!i.langEntries||!i.langEntries[k])g.push(CKEDITOR.getUrl(i.path+"lang/"+k+".js"));else{a.lang[h]=i.langEntries[k];k=null}}e.push(k);
d.push(i)}CKEDITOR.scriptLoader.load(g,function(){for(var c=["beforeInit","init","afterInit"],g=0;g<c.length;g++)for(var f=0;f<d.length;f++){var h=d[f];g===0&&(e[f]&&h.lang&&h.langEntries)&&(a.lang[h.name]=h.langEntries[e[f]]);if(h[c[g]])h[c[g]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(f=0;f<a.config.blockedKeystrokes.length;f++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[f]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",
null,a)})})}function m(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return true}return false}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var o=0,p={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var c=new CKEDITOR.command(this,b);this.mode&&e(this,c);return this.commands[a]=c},
_attachToForm:function(){function a(d){b.updateElement();b._.required&&(!c.getValue()&&b.fire("required")===false)&&d.data.preventDefault()}var b=this,c=b.element,d=new CKEDITOR.dom.element(c.$.form);if(c.is("textarea")&&d){d.on("submit",a);if(d.$.submit&&d.$.submit.call&&d.$.submit.apply)d.$.submit=CKEDITOR.tools.override(d.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}});b.on("destroy",function(){d.removeListener("submit",a)})}},destroy:function(a){this.fire("beforeDestroy");
!a&&m.call(this);this.editable(null);this.filter.destroy();delete this.filter;delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,
b){var c=this.getCommand(a),d={name:a,commandData:b,command:c};if(c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",d)!==false){d.returnValue=c.exec(d.commandData);if(!c.async&&this.fire("afterCommandExec",d)!==false)return d.returnValue}return false},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;if(typeof b!="string")b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():
b.getHtml():"";b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");if(typeof a!="string"){var b=this.element;b&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(a=b.is("textarea")?b.getValue():b.getHtml())}return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,c){var d=true,e=b;if(b&&typeof b=="object"){c=b.internal;e=b.callback;d=!b.noSnapshot}!c&&d&&this.fire("saveSnapshot");if(e||!c)this.once("dataReady",
function(a){!c&&d&&this.fire("saveSnapshot");e&&e.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;!c&&this.fire("afterSetData",a)},setReadOnly:function(a){a=a==null||a;if(this.readOnly!=a){this.readOnly=a;this.keystrokeHandler.blockedKeystrokes[8]=+a;this.editable().setReadOnly(a);this.fire("readOnly")}},insertHtml:function(a,b){this.fire("insertHtml",{dataValue:a,mode:b})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",
a)},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return m.call(this)},setKeystroke:function(){for(var a=this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],c,d,e=b.length;e--;){c=b[e];d=0;if(CKEDITOR.tools.isArray(c)){d=c[1];c=c[0]}d?a[c]=d:delete a[c]}},addFeature:function(a){return this.filter.addFeature(a)},
setActiveFilter:function(a){if(!a)a=this.filter;if(this.activeFilter!==a){this.activeFilter=a;this.fire("activeFilterChange");a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,true))}},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b){this.activeEnterMode=
a;this.activeShiftEnterMode=b;this.fire("activeEnterModeChange")}}})}(),CKEDITOR.ELEMENT_MODE_NONE=0,CKEDITOR.ELEMENT_MODE_REPLACE=1,CKEDITOR.ELEMENT_MODE_APPENDTO=2,CKEDITOR.ELEMENT_MODE_INLINE=3,CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,f={checked:1,
compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(c){for(var e,b,g=0,i;e=this._.htmlPartsRegex.exec(c);){b=e.index;if(b>g){g=c.substring(g,b);if(i)i.push(g);else this.onText(g)}g=this._.htmlPartsRegex.lastIndex;if(b=e[1]){b=b.toLowerCase();if(i&&CKEDITOR.dtd.$cdata[b]){this.onCDATA(i.join(""));
i=null}if(!i){this.onTagClose(b);continue}}if(i)i.push(e[0]);else if(b=e[3]){b=b.toLowerCase();if(!/="/.test(b)){var d={},h,j=e[4];e=!!e[5];if(j)for(;h=a.exec(j);){var k=h[1].toLowerCase();h=h[2]||h[3]||h[4]||"";d[k]=!h&&f[k]?k:CKEDITOR.tools.htmlDecodeAttr(h)}this.onTagOpen(b,d,e);!i&&CKEDITOR.dtd.$cdata[b]&&(i=[])}}else if(b=e[2])this.onComment(b)}if(c.length>g)this.onText(c.substring(g,c.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},
proto:{openTag:function(a){this._.output.push("<",a)},openTagClose:function(a,f){f?this._.output.push(" />"):this._.output.push(">")},attribute:function(a,f){typeof f=="string"&&(f=CKEDITOR.tools.htmlEncodeAttr(f));this._.output.push(" ",a,'="',f,'"')},closeTag:function(a){this._.output.push("</",a,">")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("<\!--",a,"--\>")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=false},getHtml:function(a){var f=
this._.output.join("");a&&this.reset();return f}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,f=CKEDITOR.tools.indexOf(a,this),c=this.previous,e=this.next;c&&(c.next=e);e&&(e.previous=c);a.splice(f,1);this.parent=null},replaceWith:function(a){var f=this.parent.children,c=CKEDITOR.tools.indexOf(f,this),e=a.previous=this.previous,b=a.next=this.next;e&&(e.next=a);b&&(b.previous=a);f[c]=a;a.parent=this.parent;
this.parent=null},insertAfter:function(a){var f=a.parent.children,c=CKEDITOR.tools.indexOf(f,a),e=a.next;f.splice(c+1,0,this);this.next=a.next;this.previous=a;a.next=this;e&&(e.previous=this);this.parent=a.parent},insertBefore:function(a){var f=a.parent.children,c=CKEDITOR.tools.indexOf(f,a);f.splice(c,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var f=typeof a=="function"?a:typeof a=="string"?function(c){return c.name==
a}:function(c){return c.name in a},c=this.parent;for(;c&&c.type==CKEDITOR.NODE_ELEMENT;){if(f(c))return c;c=c.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}}(),"use strict",CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:false}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,
{type:CKEDITOR.NODE_COMMENT,filter:function(a,f){var c=this.value;if(!(c=a.onComment(f,c,this))){this.remove();return false}if(typeof c!="string"){this.replaceWith(c);return false}this.value=c;return true},writeHtml:function(a,f){f&&this.filter(f);a.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:false}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,
f){if(!(this.value=a.onText(f,this.value,this))){this.remove();return false}},writeHtml:function(a,f){f&&this.filter(f);a.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})}(),"use strict",CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,
hasInlineStarted:false}},function(){function a(a){return a.attributes["data-cke-survive"]?false:a.name=="a"&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var f=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),c={ol:1,ul:1},e=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),b={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=
function(g,i,d){function h(a){var b;if(q.length>0)for(var c=0;c<q.length;c++){var d=q[c],e=d.name,g=CKEDITOR.dtd[e],f=u.name&&CKEDITOR.dtd[u.name];if((!f||f[e])&&(!a||!g||g[a]||!CKEDITOR.dtd[a])){if(!b){j();b=1}d=d.clone();d.parent=u;u=d;q.splice(c,1);c--}else if(e==u.name){m(u,u.parent,1);c--}}}function j(){for(;r.length;)m(r.shift(),u)}function k(a){if(a._.isBlockLike&&a.name!="pre"&&a.name!="textarea"){var b=a.children.length,c=a.children[b-1],d;if(c&&c.type==CKEDITOR.NODE_TEXT)(d=CKEDITOR.tools.rtrim(c.value))?
c.value=d:a.children.length=b-1}}function m(b,c,e){var c=c||u||l,g=u;if(b.previous===void 0){if(o(c,b)){u=c;n.onTagOpen(d,{});b.returnPoint=c=u}k(b);(!a(b)||b.children.length)&&c.add(b);b.name=="pre"&&(v=false);b.name=="textarea"&&(t=false)}if(b.returnPoint){u=b.returnPoint;delete b.returnPoint}else u=e?c:g}function o(a,b){if((a==l||a.name=="body")&&d&&(!a.name||CKEDITOR.dtd[a.name][d])){var c,e;return(c=b.attributes&&(e=b.attributes["data-cke-real-element-type"])?e:b.name)&&c in CKEDITOR.dtd.$inline&&
!(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function p(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||a=="dt"&&b=="dd"||a=="dd"&&b=="dt":false}var n=new CKEDITOR.htmlParser,l=i instanceof CKEDITOR.htmlParser.element?i:typeof i=="string"?new CKEDITOR.htmlParser.element(i):new CKEDITOR.htmlParser.fragment,q=[],r=[],u=l,t=l.name=="textarea",v=l.name=="pre";n.onTagOpen=function(b,d,g,i){d=new CKEDITOR.htmlParser.element(b,d);if(d.isUnknown&&g)d.isEmpty=
true;d.isOptionalClose=i;if(a(d))q.push(d);else{if(b=="pre")v=true;else{if(b=="br"&&v){u.add(new CKEDITOR.htmlParser.text("\n"));return}b=="textarea"&&(t=true)}if(b=="br")r.push(d);else{for(;;){i=(g=u.name)?CKEDITOR.dtd[g]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):e;if(!d.isUnknown&&!u.isUnknown&&!i[b])if(u.isOptionalClose)n.onTagClose(g);else if(b in c&&g in c){g=u.children;(g=g[g.length-1])&&g.name=="li"||m(g=new CKEDITOR.htmlParser.element("li"),u);!d.returnPoint&&(d.returnPoint=u);
u=g}else if(b in CKEDITOR.dtd.$listItem&&!p(b,g))n.onTagOpen(b=="li"?"ul":"dl",{},0,1);else if(g in f&&!p(b,g)){!d.returnPoint&&(d.returnPoint=u);u=u.parent}else{g in CKEDITOR.dtd.$inline&&q.unshift(u);if(u.parent)m(u,u.parent,1);else{d.isOrphan=1;break}}else break}h(b);j();d.parent=u;d.isEmpty?m(d):u=d}}};n.onTagClose=function(a){for(var b=q.length-1;b>=0;b--)if(a==q[b].name){q.splice(b,1);return}for(var c=[],e=[],g=u;g!=l&&g.name!=a;){g._.isBlockLike||e.unshift(g);c.push(g);g=g.returnPoint||g.parent}if(g!=
l){for(b=0;b<c.length;b++){var f=c[b];m(f,f.parent)}u=g;g._.isBlockLike&&j();m(g,g.parent);if(g==u)u=u.parent;q=q.concat(e)}a=="body"&&(d=false)};n.onText=function(a){if((!u._.hasInlineStarted||r.length)&&!v&&!t){a=CKEDITOR.tools.ltrim(a);if(a.length===0)return}var c=u.name,g=c?CKEDITOR.dtd[c]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):e;if(!t&&!g["#"]&&c in f){n.onTagOpen(b[c]||"");n.onText(a)}else{j();h();!v&&!t&&(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);
if(o(u,a))this.onTagOpen(d,{},0,1);u.add(a)}};n.onCDATA=function(a){u.add(new CKEDITOR.htmlParser.cdata(a))};n.onComment=function(a){j();h();u.add(new CKEDITOR.htmlParser.comment(a))};n.parse(g);for(j();u!=l;)m(u,u.parent,1);k(l);return l};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=b>0?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT){c.value=CKEDITOR.tools.rtrim(c.value);if(c.value.length===
0){this.children.pop();this.add(a);return}}c.next=a}a.previous=c;a.parent=this;this.children.splice(b,0,a);if(!this._.hasInlineStarted)this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,false,b)},filterChildren:function(a,b,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)this.children[b].filter(a,
c)===false&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var e=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(e,this);b&&this.filterChildren(b,false,e);b=0;c=this.children;for(e=c.length;b<e;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var e=a(this);if(e!==false)for(var c=this.children,f=0;f<c.length;f++){e=c[f];e.type==CKEDITOR.NODE_ELEMENT?e.forEach(a,b):(!b||e.type==b)&&a(e)}},getFilterContext:function(a){return a||
{}}}}(),"use strict",function(){function a(){this.rules=[]}function f(c,e,b,g){var f,d;for(f in e){(d=c[f])||(d=c[f]=new a);d.add(e[f],b,g)}}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(c){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;c&&this.addRules(c,10)},proto:{addRules:function(a,e){var b;if(typeof e=="number")b=
e;else if(e&&"priority"in e)b=e.priority;typeof b!="number"&&(b=10);typeof e!="object"&&(e={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,b,e);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,b,e);a.elements&&f(this.elementsRules,a.elements,b,e);a.attributes&&f(this.attributesRules,a.attributes,b,e);a.text&&this.textRules.add(a.text,b,e);a.comment&&this.commentRules.add(a.comment,b,e);a.root&&this.rootRules.add(a.root,b,e)},applyTo:function(a){a.filter(this)},onElementName:function(a,
e){return this.elementNameRules.execOnName(a,e)},onAttributeName:function(a,e){return this.attributeNameRules.execOnName(a,e)},onText:function(a,e,b){return this.textRules.exec(a,e,b)},onComment:function(a,e,b){return this.commentRules.exec(a,e,b)},onRoot:function(a,e){return this.rootRules.exec(a,e)},onElement:function(a,e){for(var b=[this.elementsRules["^"],this.elementsRules[e.name],this.elementsRules.$],g,f=0;f<3;f++)if(g=b[f]){g=g.exec(a,e,this);if(g===false)return null;if(g&&g!=e)return this.onNode(a,
g);if(e.parent&&!e.name)break}return e},onNode:function(a,e){var b=e.type;return b==CKEDITOR.NODE_ELEMENT?this.onElement(a,e):b==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,e.value)):b==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,e.value)):null},onAttribute:function(a,e,b,g){return(b=this.attributesRules[b])?b.exec(a,g,e,this):g}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,e,b){this.rules.splice(this.findIndex(e),0,{value:a,priority:e,
options:b})},addMany:function(a,e,b){for(var g=[this.findIndex(e),0],f=0,d=a.length;f<d;f++)g.push({value:a[f],priority:e,options:b});this.rules.splice.apply(this.rules,g)},findIndex:function(a){for(var e=this.rules,b=e.length-1;b>=0&&a<e[b].priority;)b--;return b+1},exec:function(a,e){var b=e instanceof CKEDITOR.htmlParser.node||e instanceof CKEDITOR.htmlParser.fragment,g=Array.prototype.slice.call(arguments,1),f=this.rules,d=f.length,h,j,k,m;for(m=0;m<d;m++){if(b){h=e.type;j=e.name}k=f[m];if(!(a.nonEditable&&
!k.options.applyToAll||a.nestedEditable&&k.options.excludeNestedEditable)){k=k.value.apply(null,g);if(k===false||b&&k&&(k.name!=j||k.type!=h))return k;k!=null&&(g[0]=e=k)}}return e},execOnName:function(a,e){for(var b=0,g=this.rules,f=g.length,d;e&&b<f;b++){d=g[b];!(a.nonEditable&&!d.options.applyToAll||a.nestedEditable&&d.options.excludeNestedEditable)&&(e=e.replace(d.value[0],d.value[1]))}return e}}}(),function(){function a(a,d){function f(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):
new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function h(a,b){return function(d){if(d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var h=[],i=c(d),k,q;if(i)for(j(i,1)&&h.push(i);i;){if(g(i)&&(k=e(i))&&j(k))if((q=e(k))&&!g(q))h.push(k);else{f(r).insertAfter(k);k.remove()}i=i.previous}for(i=0;i<h.length;i++)h[i].remove();if(h=(typeof b=="function"?b(d):b)!==false)if(!r&&!CKEDITOR.env.needsBrFiller&&d.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)h=false;else if(!r&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>
7||d.name in CKEDITOR.dtd.tr||d.name in CKEDITOR.dtd.$listItem))h=false;else{h=c(d);h=!h||d.name=="form"&&h.name=="input"}h&&d.add(f(a))}}}function j(a,b){if((!r||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&a.name=="br"&&!a.attributes["data-cke-eol"])return true;var c;if(a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(q))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&r&&(!b||a.parent.name in n))return true;
if(!r)if((c=a.previous)&&c.name=="br"||!c||g(c))return true}return false}var k={elements:{}},r=d=="html",n=CKEDITOR.tools.extend({},v),m;for(m in n)"#"in u[m]||delete n[m];for(m in n)k.elements[m]=h(r,a.config.fillEmptyBlocks);k.root=h(r,false);k.elements.br=function(a){return function(c){if(c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=c.attributes;if("data-cke-bogus"in d||"data-cke-eol"in d)delete d["data-cke-bogus"];else{for(d=c.next;d&&b(d);)d=d.next;var h=e(c);!d&&g(c.parent)?i(c.parent,
f(a)):g(d)&&(h&&!g(h))&&f(a).insertBefore(d)}}}}(r);return k}function f(a,b){return a!=CKEDITOR.ENTER_BR&&b!==false?a==CKEDITOR.ENTER_DIV?"div":"p":false}function c(a){for(a=a.children[a.children.length-1];a&&b(a);)a=a.previous;return a}function e(a){for(a=a.previous;a&&b(a);)a=a.previous;return a}function b(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function g(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in
v||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function i(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;if(c){c.next=b;b.previous=c}}function d(a){a=a.attributes;a.contenteditable!="false"&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function h(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function j(a){return a.replace(z,function(a,b,c){return"<"+b+c.replace(B,
function(a,b){return A.test(b)&&c.indexOf("data-cke-saved-"+b)==-1?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+">"})}function k(a,b){return a.replace(b,function(a,b,c){a.indexOf("<textarea")===0&&(a=b+p(c).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>");return"<cke:encoded>"+encodeURIComponent(a)+"</cke:encoded>"})}function m(a){return a.replace(I,function(a,b){return decodeURIComponent(b)})}function o(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(a){return"<\!--"+
r+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function p(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function n(a,b){var c=b._.dataStore;return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function l(a,b){for(var c=[],d=b.config.protectedSource,e=b._.dataStore||(b._.dataStore={id:1}),g=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,
d=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),f=0;f<d.length;f++)a=a.replace(d[f],function(a){a=a.replace(g,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"<\!--{cke_temp}"+(c.push(a)-1)+"--\>"});a=a.replace(g,function(a,b,d){return"<\!--"+r+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+"--\>"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,
function(a){return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(a,b){e[e.id]=decodeURIComponent(b);return"{cke_protected_"+e.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"<"+c+d+">"+n(p(e),b)+"</"+c+">"})}CKEDITOR.htmlDataProcessor=function(b){var c,d,e=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(x);
c.addRules(w,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});d.addRules(s);d.addRules(y,{applyToAll:true});d.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,d,c=l(c,b),c=k(c,C),c=j(c),c=k(c,F),c=c.replace(G,"$1cke:$2"),c=c.replace(D,"<cke:$1$2></cke:$1>"),c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");d=a.context||b.editable().getName();var e;if(CKEDITOR.env.ie&&
CKEDITOR.env.version<9&&d=="pre"){d="div";c="<pre>"+c+"</pre>";e=1}d=b.document.createElement(d);d.setHtml("a"+c);c=d.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(E,"$1$2");c=m(c);c=p(c);d=a.fixForBody===false?false:f(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,d);if(d){e=c;if(!e.children.length&&CKEDITOR.dtd[e.name][d]){d=new CKEDITOR.htmlParser.element(d);e.add(d)}}a.dataValue=
c},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,true,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,true)},null,null,10);b.on("toHtml",function(a){var a=a.data,b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(true);a.dataValue=o(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&
(c=c.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,true)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,false,true)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=e.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=p(c);c=n(c,b);a.data.dataValue=
c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var e=this.editor,g,f,h;if(b&&typeof b=="object"){g=b.context;c=b.fixForBody;d=b.dontFilter;f=b.filter;h=b.enterMode}else g=b;!g&&g!==null&&(g=e.editable().getName());return e.fire("toHtml",{dataValue:a,context:g,fixForBody:c,dontFilter:d,filter:f||e.filter,enterMode:h||e.enterMode}).dataValue},toDataFormat:function(a,b){var c,d,e;if(b){c=b.context;d=b.filter;e=b.enterMode}!c&&c!==null&&(c=this.editor.editable().getName());
return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue}};var q=/(?:&nbsp;|\xa0)$/,r="{cke_protected}",u=CKEDITOR.dtd,t=["caption","colgroup","col","thead","tfoot","tbody"],v=CKEDITOR.tools.extend({},u.$blockLimit,u.$block),x={elements:{input:d,textarea:d}},w={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},s={elements:{embed:function(a){var b=a.parent;if(b&&b.name=="object"){var c=b.attributes.width,
b=b.attributes.height;if(c)a.attributes.width=c;if(b)a.attributes.height=b}},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false}}},y={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],d,e=0;e<c.length;e++){d="data-cke-saved-"+c[e];d in b&&delete b[c[e]]}}return a},
table:function(a){a.children.slice(0).sort(function(a,b){var c,d;if(a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type){c=CKEDITOR.tools.indexOf(t,a.name);d=CKEDITOR.tools.indexOf(t,b.name)}if(!(c>-1&&d>-1&&c!=d)){c=a.parent?a.getIndex():-1;d=b.parent?b.getIndex():-1}return c>d?1:-1})},param:function(a){a.children=[];a.isEmpty=true;return a},span:function(a){a.attributes["class"]=="Apple-style-span"&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;
delete a.attributes.contenteditable},style:function(a){var b=a.children[0];if(b&&b.value)b.value=CKEDITOR.tools.trim(b.value);if(!a.attributes.type)a.attributes.type="text/css"},title:function(a){var b=a.children[0];!b&&i(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:h,textarea:h},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)y.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,
function(a){return a.toLowerCase()})};var z=/<(a|area|img|input|source)\b([^>]*)>/gi,B=/([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,A=/^(href|src|name)$/i,F=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,C=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,I=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,G=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,E=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,D=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi}(),
"use strict",CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children=[];var c=a||"",e=c.match(/^cke:(.*)/);e&&(c=e[1]);c=!(!CKEDITOR.dtd.$nonBodyContent[c]&&!CKEDITOR.dtd.$block[c]&&!CKEDITOR.dtd.$listItem[c]&&!CKEDITOR.dtd.$tableContent[c]&&!(CKEDITOR.dtd.$nonEditable[c]||c=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:c,hasInlineStarted:this.isEmpty||!c}},CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof
CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,e,b){e=="font-family"&&(b=b.replace(/["']/g,""));f[e.toLowerCase()]=b});return{rules:f,populate:function(a){var e=this.toString();if(e)a instanceof CKEDITOR.dom.element?a.setAttribute("style",e):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=e:a.style=e},toString:function(){var a=[],e;for(e in f)f[e]&&a.push(e,":",f[e],";");return a.join("")}}},function(){function a(a){return function(b){return b.type==
CKEDITOR.NODE_ELEMENT&&(typeof a=="string"?b.name==a:b.name in a)}}var f=function(a,b){a=a[0];b=b[0];return a<b?-1:a>b?1:0},c=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:c.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var c=this,f,d,b=c.getFilterContext(b);if(b.off)return true;if(!c.parent)a.onRoot(b,c);for(;;){f=c.name;
if(!(d=a.onElementName(b,f))){this.remove();return false}c.name=d;if(!(c=a.onElement(b,c))){this.remove();return false}if(c!==this){this.replaceWith(c);return false}if(c.name==f)break;if(c.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(c);return false}if(!c.name){this.replaceWithChildren();return false}}f=c.attributes;var h,j;for(h in f){j=h;for(d=f[h];;)if(j=a.onAttributeName(b,h))if(j!=h){delete f[h];h=j}else break;else{delete f[h];break}j&&((d=a.onAttribute(b,c,j,d))===false?delete f[j]:f[j]=d)}c.isEmpty||
this.filterChildren(a,false,b);return true},filterChildren:c.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var c=this.name,i=[],d=this.attributes,h,j;a.openTag(c,d);for(h in d)i.push([h,d[h]]);a.sortAttributes&&i.sort(f);h=0;for(j=i.length;h<j;h++){d=i[h];a.attribute(d[0],d[1])}a.openTagClose(c,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(c)},writeChildrenHtml:c.writeChildrenHtml,replaceWithChildren:function(){for(var a=this.children,b=a.length;b;)a[--b].insertAfter(this);
this.remove()},forEach:c.forEach,getFirst:function(c){if(!c)return this.children.length?this.children[0]:null;typeof c!="function"&&(c=a(c));for(var b=0,g=this.children.length;b<g;++b)if(c(this.children[b]))return this.children[b];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){for(var a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children,b=0,c=a.length;b<c;++b)a[b].parent=this},getOuterHtml:function(){var a=
new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var b=this.children.splice(a,this.children.length-a),c=this.clone(),f=0;f<b.length;++f)b[f].parent=c;c.children=b;if(b[0])b[0].previous=null;if(a>0)this.children[a-1].next=null;this.parent.add(c,this.getIndex()+1);return c},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ":"")+a}},removeClass:function(a){var b=this.attributes["class"];if(b)(b=
CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"]},hasClass:function(a){var b=this.attributes["class"];return!b?false:RegExp("(?:^|\\s)"+a+"(?=\\s|$)").test(b)},getFilterContext:function(a){var b=[];a||(a={off:false,nonEditable:false,nestedEditable:false});!a.off&&this.attributes["data-cke-processor"]=="off"&&b.push("off",true);!a.nonEditable&&this.attributes.contenteditable=="false"?b.push("nonEditable",true):a.nonEditable&&
(!a.nestedEditable&&this.attributes.contenteditable=="true")&&b.push("nestedEditable",true);if(b.length)for(var a=CKEDITOR.tools.copy(a),c=0;c<b.length;c=c+2)a[b[c]]=b[c+1];return a}},true)}(),function(){var a={},f=/{([^}]+)}/g,c=/([\\'])/g,e=/\n/g,b=/\r/g;CKEDITOR.template=function(g){if(a[g])this.output=a[g];else{var i=g.replace(c,"\\$1").replace(e,"\\n").replace(b,"\\r").replace(f,function(a,b){return"',data['"+b+"']==undefined?'{"+b+"}':data['"+b+"'],'"});this.output=a[g]=Function("data","buffer",
"return buffer?buffer.push('"+i+"'):['"+i+"'].join('');")}}}(),delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(a){CKEDITOR.instances[a.name]=a;a.on("focus",function(){if(CKEDITOR.currentInstance!=a){CKEDITOR.currentInstance=a;CKEDITOR.fire("currentInstance")}});a.on("blur",function(){if(CKEDITOR.currentInstance==a){CKEDITOR.currentInstance=null;CKEDITOR.fire("currentInstance")}});CKEDITOR.fire("instance",null,a)},CKEDITOR.remove=
function(a){delete CKEDITOR.instances[a.name]},function(){var a={};CKEDITOR.addTemplate=function(f,c){var e=a[f];if(e)return e;e={name:f,source:c};CKEDITOR.fire("template",e);return a[f]=new CKEDITOR.template(e.source)};CKEDITOR.getTemplate=function(f){return a[f]}}(),function(){var a=[];CKEDITOR.addCss=function(f){a.push(f)};CKEDITOR.getCss=function(){return a.join("\n")}}(),CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")}),CKEDITOR.TRISTATE_ON=
1,CKEDITOR.TRISTATE_OFF=2,CKEDITOR.TRISTATE_DISABLED=0,function(){CKEDITOR.inline=function(a,f){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var c=new CKEDITOR.editor(f,a,CKEDITOR.ELEMENT_MODE_INLINE),e=a.is("textarea")?a:null;if(e){c.setData(e.getValue(),null,true);a=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!c.readOnly+'" class="cke_textarea_inline">'+
e.getValue()+"</div>",CKEDITOR.document);a.insertAfter(e);e.hide();e.$.form&&c._attachToForm()}else c.setData(a.getHtml(),null,true);c.on("loaded",function(){c.fire("uiReady");c.editable(a);c.container=a;c.setData(c.getData(1));c.resetDirty();c.fire("contentDom");c.mode="wysiwyg";c.fire("mode");c.status="ready";c.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,c)},null,null,1E4);c.on("destroy",function(){if(e){c.container.clearCustomData();c.container.remove();e.show()}c.element.clearCustomData();
delete c.element});return c};CKEDITOR.inlineAll=function(){var a,f,c;for(c in CKEDITOR.dtd.$editable)for(var e=CKEDITOR.document.getElementsByTag(c),b=0,g=e.count();b<g;b++){a=e.getItem(b);if(a.getAttribute("contenteditable")=="true"){f={element:a,config:{}};CKEDITOR.fire("inline",f)!==false&&CKEDITOR.inline(a,f.config)}}};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})}(),CKEDITOR.replaceClass="ckeditor",function(){function a(a,b,g,i){if(!CKEDITOR.env.isCompatible)return null;
a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var d=new CKEDITOR.editor(b,a,i);if(i==CKEDITOR.ELEMENT_MODE_REPLACE){a.setStyle("visibility","hidden");d._.required=a.hasAttribute("required");a.removeAttribute("required")}g&&d.setData(g,null,true);d.on("loaded",function(){c(d);i==CKEDITOR.ELEMENT_MODE_REPLACE&&(d.config.autoUpdateElement&&a.$.form)&&d._attachToForm();d.setMode(d.config.startupMode,function(){d.resetDirty();
d.status="ready";d.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,d)})});d.on("destroy",f);return d}function f(){var a=this.container,b=this.element;if(a){a.clearCustomData();a.remove()}if(b){b.clearCustomData();if(this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE){b.show();this._.required&&b.setAttribute("required","required")}delete this.element}}function c(a){var b=a.name,c=a.element,f=a.elementMode,d=a.fire("uiSpace",{space:"top",html:""}).html,h=a.fire("uiSpace",{space:"bottom",html:""}).html,
j=new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'"  dir="{langDir}" lang="{langCode}" role="application"'+(a.title?' aria-labelledby="cke_{name}_arialbl"':"")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),
b=CKEDITOR.dom.element.createFromHtml(j.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:d?'<span id="'+a.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+d+"</span>":"",contentId:a.ui.spaceId("contents"),bottomHtml:h?'<span id="'+a.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+h+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(f==CKEDITOR.ELEMENT_MODE_REPLACE){c.hide();b.insertAfter(c)}else c.append(b);
a.container=b;d&&a.ui.space("top").unselectable();h&&a.ui.space("bottom").unselectable();c=a.config.width;f=a.config.height;c&&b.setStyle("width",CKEDITOR.tools.cssLength(c));f&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(f));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(c,b){return a(c,b,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(c,b,f){return a(c,b,f,CKEDITOR.ELEMENT_MODE_APPENDTO)};
CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b<a.length;b++){var c=null,f=a[b];if(f.name||f.id){if(typeof arguments[0]=="string"){if(!RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)").test(f.className))continue}else if(typeof arguments[0]=="function"){c={};if(arguments[0](f,c)===false)continue}this.replace(f,c)}}};CKEDITOR.editor.prototype.addMode=function(a,b){(this._.modes||(this._.modes={}))[a]=b};CKEDITOR.editor.prototype.setMode=function(a,b){var c=this,f=
this._.modes;if(!(a==c.mode||!f||!f[a])){c.fire("beforeSetMode",a);if(c.mode){var d=c.checkDirty(),f=c._.previousModeData,h,j=0;c.fire("beforeModeUnload");c.editable(0);c._.previousMode=c.mode;c._.previousModeData=h=c.getData(1);if(c.mode=="source"&&f==h){c.fire("lockSnapshot",{forceUpdate:true});j=1}c.ui.space("contents").setHtml("");c.mode=""}else c._.previousModeData=c.getData(1);this._.modes[a](function(){c.mode=a;d!==void 0&&!d&&c.resetDirty();j?c.fire("unlockSnapshot"):a=="wysiwyg"&&c.fire("saveSnapshot");
setTimeout(function(){c.fire("mode");b&&b.call(c)},0)})}};CKEDITOR.editor.prototype.resize=function(a,b,c,f){var d=this.container,h=this.ui.space("contents"),j=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement,f=f?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):d;f.setSize("width",a,true);j&&(j.style.width="1%");h.setStyle("height",Math.max(b-(c?0:(f.$.offsetHeight||0)-(h.$.clientHeight||0)),0)+"px");j&&(j.style.width=
"100%");this.fire("resize")};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})}(),CKEDITOR.config.startupMode="wysiwyg",function(){function a(a){var b=a.editor,c=a.data.path,d=c.blockLimit,g=a.data.selection,h=g.getRanges()[0],j;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(g=f(g,c)){g.appendBogus();j=CKEDITOR.env.ie}if(i(b,c.block,
d)&&h.collapsed&&!h.getCommonAncestor().isReadOnly()){c=h.clone();c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);d=new CKEDITOR.dom.walker(c);d.guard=function(a){return!e(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()};if(!d.checkForward()||c.checkStartOfBlock()&&c.checkEndOfBlock()){b=h.fixBlock(true,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p");if(!CKEDITOR.env.needsBrFiller)(b=b.getFirst(e))&&(b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/))&&b.remove();
j=1;a.cancel()}}j&&h.select()}function f(a,b){if(a.isFake)return 0;var c=b.block||b.blockLimit,d=c&&c.getLast(e);if(c&&c.isBlockBoundary()&&(!d||!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()))&&!c.is("pre")&&!c.getBogus())return c}function c(a){var b=a.data.getTarget();if(b.is("input")){b=b.getAttribute("type");(b=="submit"||b=="reset")&&a.data.preventDefault()}}function e(a){return o(a)&&p(a)}function b(a,b){return function(c){var d=CKEDITOR.dom.element.get(c.data.$.toElement||c.data.$.fromElement||
c.data.$.relatedTarget);(!d||!b.equals(d)&&!b.contains(d))&&a.call(this,c)}}function g(a){function b(a){return function(b,d){d&&(b.type==CKEDITOR.NODE_ELEMENT&&b.is(f))&&(c=b);if(!d&&e(b)&&(!a||!k(b)))return false}}var c,d=a.getRanges()[0],a=a.root,f={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(f)){var g=d.clone();g.collapse(1);g.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(g);a.guard=b();a.checkBackward();if(c){g=d.clone();g.collapse();g.setEndAt(c,CKEDITOR.POSITION_AFTER_END);
a=new CKEDITOR.dom.walker(g);a.guard=b(true);c=false;a.checkForward();return c}}return null}function i(a,b,c){return a.config.autoParagraph!==false&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&a.editable().equals(c)&&!b||b&&b.getAttribute("contenteditable")=="true"}function d(a){a.editor.focus();a.editor.fire("saveSnapshot")}function h(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function j(a,b,c){for(var d=a.getCommonAncestor(b),b=a=c?b:a;(a=a.getParent())&&
!d.equals(a)&&a.getChildCount()==1;)b=a;b.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=false;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus){a=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(a)){a.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(b){if(!CKEDITOR.env.ie)throw b;
}if(CKEDITOR.env.safari&&!this.isInline()){a=CKEDITOR.document.getActive();a.equals(this.getWindow().getFrame())||this.getWindow().focus()}},on:function(a,c){var d=Array.prototype.slice.call(arguments,0);if(CKEDITOR.env.ie&&/^focus|blur$/.exec(a)){a=a=="focus"?"focusin":"focusout";c=b(c,this);d[0]=a;d[1]=c}return CKEDITOR.dom.element.prototype.on.apply(this,d)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);
return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=this._.attrChanges,b,c;for(c in a)if(a.hasOwnProperty(c)){b=a[c];b!==null?this.setAttribute(c,b):this.removeAttribute(c)}},attachClass:function(a){var b=this.getCustomData("classes");if(!this.hasClass(a)){!b&&(b=[]);b.push(a);this.setCustomData("classes",b);this.addClass(a)}},changeAttr:function(a,b){var c=this.getAttribute(a);if(b!==c){!this._.attrChanges&&
(this._.attrChanges={});a in this._.attrChanges||(this._.attrChanges[a]=c);this.setAttribute(a,b)}},insertHtml:function(a,b){d(this);n(this,b||"html",a)},insertText:function(a){d(this);var b=this.editor,c=b.getSelection().getStartElement().hasAscendant("pre",true)?CKEDITOR.ENTER_BR:b.activeEnterMode,b=c==CKEDITOR.ENTER_BR,e=CKEDITOR.tools,a=e.htmlEncode(a.replace(/\r\n/g,"\n")),a=a.replace(/\t/g,"&nbsp;&nbsp; &nbsp;"),c=c==CKEDITOR.ENTER_P?"p":"div";if(!b){var f=/\n{2}/g;if(f.test(a))var g="<"+c+
">",h="</"+c+">",a=g+a.replace(f,function(){return h+g})+h}a=a.replace(/\n/g,"<br>");b||(a=a.replace(RegExp("<br>(?=</"+c+">)"),function(a){return e.repeat(a,2)}));a=a.replace(/^ | $/g,"&nbsp;");a=a.replace(/(>|\s) /g,function(a,b){return b+"&nbsp;"}).replace(/ (?=<)/g,"&nbsp;");n(this,"text",a)},insertElement:function(a,b){b?this.insertElementIntoRange(a,b):this.insertElementIntoSelection(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e];
if(b.checkReadOnly())return false;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&l(b);var g,h;if(f)for(;(g=b.getCommonAncestor(0,1))&&(h=CKEDITOR.dtd[g.getName()])&&(!h||!h[e]);)if(g.getName()in CKEDITOR.dtd.span)b.splitElement(g);else if(b.checkStartOfBlock()&&b.checkEndOfBlock()){b.setStartBefore(g);b.collapse(true);g.remove()}else b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return true},
insertElementIntoSelection:function(a){d(this);var b=this.editor,c=b.activeEnterMode,b=b.getSelection(),f=b.getRanges()[0],g=a.getName(),g=CKEDITOR.dtd.$block[g];if(this.insertElementIntoRange(a,f)){f.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(g)if((g=a.getNext(function(a){return e(a)&&!k(a)}))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is(CKEDITOR.dtd.$block))g.getDtd()["#"]?f.moveToElementEditStart(g):f.moveToElementEditEnd(a);else if(!g&&c!=CKEDITOR.ENTER_BR){g=f.fixBlock(true,c==CKEDITOR.ENTER_DIV?
"div":"p");f.moveToElementEditStart(g)}}b.selectRanges([f]);h(this)},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();if(this.status=="unloaded")this.status="ready";this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");this.status="detached";var a=this.editor;
this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),e;if(d.anchorNode&&d.anchorNode==c.$)e=true;else if(CKEDITOR.env.webkit){var f=c.getDocument().getActive();f&&(f.equals(c)&&!d.anchorNode)&&(e=true)}if(e){e=new CKEDITOR.dom.range(c);e.moveToElementEditStart(c);b=b.createRange();b.setStart(e.startContainer.$,e.startOffset);b.collapse(true);
d.removeAllRanges();d.addRange(b)}}function b(){var a=c.getDocument().$,d=a.selection,e=c.getDocument().getActive();if(d.type=="None"&&e.equals(c)){d=new CKEDITOR.dom.range(c);a=a.body.createTextRange();d.moveToElementEditStart(c);d=d.startContainer;d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent());a.moveToElementText(d.$);a.collapse(true);a.select()}}var c=this;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9){if(this.hasFocus){this.focus();b()}}else if(this.hasFocus){this.focus();a()}else this.once("focus",
function(){a()},null,null,-999)},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||a.config.ignoreEmptyParagraph!==false&&(b=b.replace(m,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);
this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&b.type=="Control"||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");this.attachClass(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?
"cke_editable_inline":a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":"");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=false},null,null,-1);this.on("focus",function(){this.hasFocus=true},null,null,-1);a.focusManager.add(this);if(this.equals(CKEDITOR.document.getActive())){this.hasFocus=true;
a.once("contentDom",function(){a.focusManager.focus(this)},this)}this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var b=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var d=a.config.contentsLangDirection;this.getDirection(1)!=d&&this.changeAttr("dir",d);var f=CKEDITOR.getCss();if(f){d=b.getHead();if(!d.getCustomData("stylesheet")){f=b.appendStyleText(f);f=new CKEDITOR.dom.element(f.ownerNode||
f.owningElement);d.setCustomData("stylesheet",f);f.data("cke-temp",1)}}d=b.getCustomData("stylesheet_ref")||0;b.setCustomData("stylesheet_ref",d+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){var a=a.data,b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});var h={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return true;var c=b.data.domEvent.getKey(),
d;if(c in h){var b=a.getSelection(),e,f=b.getRanges()[0],j=f.startPath(),i,k,n,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(e=b.getSelectedElement())||(e=g(b))){a.fire("saveSnapshot");f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();f.select();a.fire("saveSnapshot");d=1}else if(f.collapsed)if((i=j.block)&&(n=i[c?"getPrevious":"getNext"](o))&&n.type==CKEDITOR.NODE_ELEMENT&&n.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");f[c?"checkEndOfBlock":
"checkStartOfBlock"]()&&i.remove();f["moveToElementEdit"+(c?"End":"Start")](n);f.select();a.fire("saveSnapshot");d=1}else if(j.blockLimit&&j.blockLimit.is("td")&&(k=j.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(n=k[c?"getPrevious":"getNext"](o))){a.fire("saveSnapshot");f["moveToElementEdit"+(c?"End":"Start")](n);f.checkStartOfBlock()&&f.checkEndOfBlock()?n.remove():f.select();a.fire("saveSnapshot");d=1}else if((k=j.contains(["td","th","caption"]))&&
f.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END))d=1}return!d});a.blockless&&(CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)&&this.attachListener(this,"keyup",function(b){if(b.data.getKeystroke()in h&&!this.getFirst(e)){this.appendBogus();b=a.createRange();b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START);b.select()}});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return false;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,
"click",c);CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();if(c.is("img","hr","input","textarea","select")&&!c.isReadOnly()){a.getSelection().selectElement(c);c.is("input","textarea","select")&&b.data.preventDefault()}});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(b.data.$.button==2){b=b.data.getTarget();if(!b.getOuterHtml().replace(m,"")){var c=a.createRange();c.moveToElementEditStart(b);c.select(true)}}});if(CKEDITOR.env.webkit){this.attachListener(this,
"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()});this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()})}CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){b=b.data.domEvent.getKey();if(b in h){var c=b==8,d=a.getSelection().getRanges()[0],b=d.startPath();if(d.collapsed){var e;a:{var f=b.block;if(f)if(d[c?"checkStartOfBlock":"checkEndOfBlock"]())if(!d.moveToClosestEditablePosition(f,!c)||!d.collapsed)e=
false;else{if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=d.startContainer.getChild(d.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();e=true;break a}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");var i;(i=(c?d:f).getBogus())&&i.remove();e=a.getSelection();i=e.createBookmarks();(c?f:d).moveChildren(c?d:f,false);b.lastElement.mergeSiblings();j(f,d,!c);e.selectBookmarks(i);e=true}}else e=false;else e=false}if(!e)return}else{c=
d;e=b.block;i=c.endPath().block;if(!e||!i||e.equals(i))b=false;else{a.fire("saveSnapshot");(f=e.getBogus())&&f.remove();c.deleteContents();if(i.getParent()){i.moveChildren(e,false);b.lastElement.mergeSiblings();j(e,i,true)}c=a.getSelection().getRanges()[0];c.collapse(1);c.select();b=true}if(!b)return}a.getSelection().scrollIntoView();a.fire("saveSnapshot");return false}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();
var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");if(--c)a.setCustomData("stylesheet_ref",c);else{a.removeCustomData("stylesheet_ref");b.removeCustomData("stylesheet").remove()}}}this.editor.fire("contentDomUnload");delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(arguments.length)b=
this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null);return b};var k=CKEDITOR.dom.walker.bogus(),m=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,o=CKEDITOR.dom.walker.whitespaces(true),p=CKEDITOR.dom.walker.bookmark(false,true);CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;if(a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||
a.is("textarea"))){a.getAttribute("contentEditable")!="false"&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1");a.setAttribute("contentEditable",false)}});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();if(d&&!d.isLocked){d=c.checkDirty();c.fire("lockSnapshot");a(b);c.fire("unlockSnapshot");!d&&c.resetDirty()}}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role",
"textbox");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d)if(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('<span id="'+e+'" class="cke_voice_label">'+d+"</span>");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
var n=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,g,h,i=[],k=d.range.startContainer;e=d.range.startPath();for(var k=j[k.getName()],n=0,m=c.getChildren(),v=m.count(),u=-1,x=-1,l=0,p=e.contains(j.$list);n<v;++n){e=m.getItem(n);if(a(e)){g=e.getName();if(p&&g in CKEDITOR.dtd.$list)i=i.concat(b(e,d));else{h=!!k[g];if(g=="br"&&e.data("cke-eol")&&(!n||n==v-1)){l=(f=n?i[n-1].node:m.getItem(n+1))&&(!a(f)||!f.is("br"));f=f&&a(f)&&j.$block[f.getName()]}u==-1&&!h&&(u=
n);h||(x=n);i.push({isElement:1,isLineBreak:l,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:g,allowed:h});f=l=0}}else i.push({isElement:0,node:e,allowed:1})}if(u>-1)i[u].firstNotAllowed=1;if(x>-1)i[x].lastNotAllowed=1;return i}function c(b,d){var e=[],f=b.getChildren(),g=f.count(),h,i=0,k=j[d],n=!b.is(j.$inline)||b.is("br");for(n&&e.push(" ");i<g;i++){h=f.getItem(i);a(h)&&!h.is(k)?e=e.concat(c(h,d)):e.push(h)}n&&e.push(" ");return e}function d(b){return b&&a(b)&&(b.is(j.$removeEmpty)||
b.is("a")&&!b.isBlockBoundary())}function f(b,c,d,e){var g=b.clone(),h,j;g.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);if((h=(new CKEDITOR.dom.walker(g)).next())&&a(h)&&k[h.getName()]&&(j=h.getPrevious())&&a(j)&&!j.getParent().equals(b.startContainer)&&d.contains(j)&&e.contains(h)&&h.isIdentical(j)){h.moveChildren(j);h.remove();f(b,c,d,e)}}function g(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br")){b.remove();return 1}}var e=c.endContainer.getChild(c.endOffset),f=c.endContainer.getChild(c.endOffset-
1);e&&d(e,b[b.length-1]);if(f&&d(f,b[0])){c.setEnd(c.endContainer,c.endOffset-1);c.collapse()}}var j=CKEDITOR.dtd,k={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},n={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},m=CKEDITOR.tools.extend({},j.$inline);delete m.br;return function(k,l,p){var o=k.editor,s=o.getSelection().getRanges()[0],G=false;if(l=="unfiltered_html"){l="html";G=true}if(!s.checkReadOnly()){var E=(new CKEDITOR.dom.elementPath(s.startContainer,s.root)).blockLimit||
s.root,l={type:l,dontFilter:G,editable:k,editor:o,range:s,blockLimit:E,mergeCandidates:[],zombies:[]},o=l.range,G=l.mergeCandidates,D,J,L,H;if(l.type=="text"&&o.shrink(CKEDITOR.SHRINK_ELEMENT,true,false)){D=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",o.document);o.insertNode(D);o.setStartAfter(D)}J=new CKEDITOR.dom.elementPath(o.startContainer);l.endPath=L=new CKEDITOR.dom.elementPath(o.endContainer);if(!o.collapsed){var E=L.block||L.blockLimit,Q=o.getCommonAncestor();E&&(!E.equals(Q)&&
!E.contains(Q)&&o.checkEndOfBlock())&&l.zombies.push(E);o.deleteContents()}for(;(H=a(o.startContainer)&&o.startContainer.getChild(o.startOffset-1))&&a(H)&&H.isBlockBoundary()&&J.contains(H);)o.moveToPosition(H,CKEDITOR.POSITION_BEFORE_END);f(o,l.blockLimit,J,L);if(D){o.setEndBefore(D);o.collapse();D.remove()}D=o.startPath();if(E=D.contains(d,false,1)){o.splitElement(E);l.inlineStylesRoot=E;l.inlineStylesPeak=D.lastElement}D=o.createBookmark();(E=D.startNode.getPrevious(e))&&a(E)&&d(E)&&G.push(E);
(E=D.startNode.getNext(e))&&a(E)&&d(E)&&G.push(E);for(E=D.startNode;(E=E.getParent())&&d(E);)G.push(E);o.moveToBookmark(D);if(D=p){D=l.range;if(l.type=="text"&&l.inlineStylesRoot){H=l.inlineStylesPeak;o=H.getDocument().createText("{cke-peak}");for(G=l.inlineStylesRoot.getParent();!H.equals(G);){o=o.appendTo(H.clone());H=H.getParent()}p=o.getOuterHtml().split("{cke-peak}").join(p)}H=l.blockLimit.getName();if(/^\s+|\s+$/.test(p)&&"span"in CKEDITOR.dtd[H])var O='<span data-cke-marker="1">&nbsp;</span>',
p=O+p+O;p=l.editor.dataProcessor.toHtml(p,{context:null,fixForBody:false,dontFilter:l.dontFilter,filter:l.editor.activeFilter,enterMode:l.editor.activeEnterMode});H=D.document.createElement("body");H.setHtml(p);if(O){H.getFirst().remove();H.getLast().remove()}if((O=D.startPath().block)&&!(O.getChildCount()==1&&O.getBogus()))a:{var M;if(H.getChildCount()==1&&a(M=H.getFirst())&&M.is(n)){O=M.getElementsByTag("*");D=0;for(G=O.count();D<G;D++){o=O.getItem(D);if(!o.is(m))break a}M.moveChildren(M.getParent(1));
M.remove()}}l.dataWrapper=H;D=p}if(D){M=l.range;var O=M.document,K,p=l.blockLimit;D=0;var R;H=[];var N,T,G=o=0,P,V;J=M.startContainer;var E=l.endPath.elements[0],W;L=E.getPosition(J);Q=!!E.getCommonAncestor(J)&&L!=CKEDITOR.POSITION_IDENTICAL&&!(L&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED);J=b(l.dataWrapper,l);for(g(J,M);D<J.length;D++){L=J[D];if(K=L.isLineBreak){K=M;P=p;var S=void 0,Y=void 0;if(L.hasBlockSibling)K=1;else{S=K.startContainer.getAscendant(j.$block,1);if(!S||!S.is({div:1,
p:1}))K=0;else{Y=S.getPosition(P);if(Y==CKEDITOR.POSITION_IDENTICAL||Y==CKEDITOR.POSITION_CONTAINS)K=0;else{P=K.splitElement(S);K.moveToPosition(P,CKEDITOR.POSITION_AFTER_START);K=1}}}}if(K)G=D>0;else{K=M.startPath();if(!L.isBlock&&i(l.editor,K.block,K.blockLimit)&&(T=l.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&l.editor.config.autoParagraph!==false?l.editor.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":false)){T=O.createElement(T);T.appendBogus();M.insertNode(T);CKEDITOR.env.needsBrFiller&&(R=T.getBogus())&&
R.remove();M.moveToPosition(T,CKEDITOR.POSITION_BEFORE_END)}if((K=M.startPath().block)&&!K.equals(N)){if(R=K.getBogus()){R.remove();H.push(K)}N=K}L.firstNotAllowed&&(o=1);if(o&&L.isElement){K=M.startContainer;for(P=null;K&&!j[K.getName()][L.name];){if(K.equals(p)){K=null;break}P=K;K=K.getParent()}if(K){if(P){V=M.splitElement(P);l.zombies.push(V);l.zombies.push(P)}}else{P=p.getName();W=!D;K=D==J.length-1;P=c(L.node,P);for(var S=[],Y=P.length,Z=0,ba=void 0,X=0,aa=-1;Z<Y;Z++){ba=P[Z];if(ba==" "){if(!X&&
(!W||Z)){S.push(new CKEDITOR.dom.text(" "));aa=S.length}X=1}else{S.push(ba);X=0}}K&&aa==S.length&&S.pop();W=S}}if(W){for(;K=W.pop();)M.insertNode(K);W=0}else M.insertNode(L.node);if(L.lastNotAllowed&&D<J.length-1){(V=Q?E:V)&&M.setEndAt(V,CKEDITOR.POSITION_AFTER_START);o=0}M.collapse()}}l.dontMoveCaret=G;l.bogusNeededBlocks=H}R=l.range;var U;V=l.bogusNeededBlocks;for(W=R.createBookmark();N=l.zombies.pop();)if(N.getParent()){T=R.clone();T.moveToElementEditStart(N);T.removeEmptyBlocksAtEnd()}if(V)for(;N=
V.pop();)CKEDITOR.env.needsBrFiller?N.appendBogus():N.append(R.document.createText(" "));for(;N=l.mergeCandidates.pop();)N.mergeSiblings();R.moveToBookmark(W);if(!l.dontMoveCaret){for(N=a(R.startContainer)&&R.startContainer.getChild(R.startOffset-1);N&&a(N)&&!N.is(j.$empty);){if(N.isBlockBoundary())R.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END);else{if(d(N)&&N.getHtml().match(/(\s|&nbsp;)$/g)){U=null;break}U=R.clone();U.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END)}N=N.getLast(e)}U&&R.moveToRange(U)}s.select();
h(k)}}}(),l=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return false;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;b-- >0;){d=a.getItem(b);if(!CKEDITOR.tools.trim(d.getHtml())){d.appendBogus();CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&d.getChildCount())&&
d.getFirst().remove()}}}return function(d){var e=d.startContainer,f=e.getAscendant("table",1),g=false;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();if(!f){f=d.clone();f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);f=a(f).lastForward();g=true}f||(f=e);if(f.is("table")){d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);f.remove()}else{f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",g));f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":
"td",g));(e=f.getBogus())&&e.remove();d.moveToPosition(f,g?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}()}(),function(){function a(){var a=this._.fakeSelection,b;if(a){b=this.getSelection(1);if(!b||!b.isHidden()){a.reset();a=0}}if(!a){a=b||this.getSelection(1);if(!a||a.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",a);b=this.elementPath();if(!b.compare(this._.selectionPreviousPath)){if(CKEDITOR.env.webkit)this._.previousActive=this.document.getActive();this._.selectionPreviousPath=
b;this.fire("selectionChange",{selection:a,path:b})}}function f(){n=true;if(!p){c.call(this);p=CKEDITOR.tools.setTimeout(c,200,this)}}function c(){p=null;if(n){CKEDITOR.tools.setTimeout(a,0,this);n=false}}function e(a){return l(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function b(a){function b(c,d){return!c||c.type==CKEDITOR.NODE_TEXT?false:a.clone()["moveToElementEdit"+(d?"End":"Start")](c)}if(!(a.root instanceof CKEDITOR.editable))return false;var c=a.startContainer,
d=a.getPreviousNode(e,null,c),f=a.getNextNode(e,null,c);return b(d)||b(f,1)||!d&&!f&&!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?true:false}function g(a){return a.getCustomData("cke-fillingChar")}function i(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(b!==false){var e,f=a.getDocument().getSelection().getNative(),g=f&&f.type!="None"&&f.getRangeAt(0);if(c.getLength()>1&&g&&g.intersectsNode(c.$)){e=h(f);g=f.focusNode==c.$&&f.focusOffset>0;f.anchorNode==c.$&&f.anchorOffset>
0&&e[0].offset--;g&&e[1].offset--}}c.setText(d(c.getText()));e&&j(a.getDocument().$,e)}}function d(a){return a.replace(/\u200B( )?/g,function(a){return a[1]?" ":""})}function h(a){return[{node:a.anchorNode,offset:a.anchorOffset},{node:a.focusNode,offset:a.focusOffset}]}function j(a,b){var c=a.getSelection(),d=a.createRange();d.setStart(b[0].node,b[0].offset);d.collapse(true);c.removeAllRanges();c.addRange(d);c.extend(b[1].node,b[1].offset)}function k(a){var b=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+
(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'">&nbsp;</div>',a.document);a.fire("lockSnapshot");a.editable().append(b);var c=a.getSelection(1),d=a.createRange(),e=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);d.setStartAt(b,CKEDITOR.POSITION_AFTER_START);d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([d]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=b}function m(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=
c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];if(e.length==1&&f.collapsed)if((d=f[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}function o(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d;){if((e=d.type==
CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly())break;e&&d.getAttribute("contentEditable")=="false"&&c.setStartAfter(d);d=d.getParent()}d=c.startContainer;e=c.endContainer;var f=c.startOffset,g=c.endOffset,h=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(g?h.setEndAfter(e):h.setEndBefore(e));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();
c.setEndBefore(d);c.collapsed&&a.splice(b--,1);if(!(d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS)){e.setStartAfter(d);e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var p,n,l=CKEDITOR.dom.walker.invisible(1),q=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return false}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!(e=
d.moveToClosestEditablePosition(b.selected,a)))e=d.moveToClosestEditablePosition(b.selected,!a);e&&c.getSelection().selectRanges([d]);c.fire("saveSnapshot");b.selected.remove();if(!e){d.moveToElementEditablePosition(c.editable());c.getSelection().selectRanges([d])}c.fire("saveSnapshot");return false}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a=d.getSelection();a&&a.removeAllRanges()}var d=b.editor;d.on("contentDom",function(){function b(){l=
new CKEDITOR.dom.selection(d.getSelection());l.lock()}function c(){g.removeListener("mouseup",c);k.removeListener("mouseup",c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==e.$&&b.select()}var e=d.document,g=CKEDITOR.document,h=d.editable(),j=e.getBody(),k=e.getDocumentElement(),n=h.isInline(),q,l;CKEDITOR.env.gecko&&h.attachListener(h,"focus",function(a){a.removeListener();if(q!==0)if((a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==
h.$){a=d.createRange();a.moveToElementEditStart(h);a.select()}},null,null,-2);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){q&&CKEDITOR.env.webkit&&(q=d._.previousActive&&d._.previousActive.equals(e.getActive()));d.unlockSelection(q);q=0},null,null,-1);h.attachListener(h,"mousedown",function(){q=0});if(CKEDITOR.env.ie||n){r?h.attachListener(h,"beforedeactivate",b,null,null,-1):h.attachListener(d,"selectionCheck",b,null,null,-1);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusOut":
"blur",function(){d.lockSelection(l);q=1},null,null,-1);h.attachListener(h,"mousedown",function(){q=0})}if(CKEDITOR.env.ie&&!n){var u;h.attachListener(h,"mousedown",function(a){if(a.data.$.button==2){a=d.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)u=d.window.getScrollPosition()}});h.attachListener(h,"mouseup",function(a){if(a.data.$.button==2&&u){d.document.$.documentElement.scrollLeft=u.x;d.document.$.documentElement.scrollTop=u.y}u=null});if(e.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||
CKEDITOR.env.ie6Compat)k.on("mousedown",function(a){function b(a){a=a.data.$;if(d){var c=j.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}d.setEndPoint(f.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);d.select()}}function c(){k.removeListener("mousemove",b);g.removeListener("mouseup",c);k.removeListener("mouseup",c);d.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<k.$.clientHeight&&a.$.x<k.$.clientWidth){var d=j.$.createTextRange();try{d.moveToPoint(a.$.clientX,
a.$.clientY)}catch(e){}var f=d.duplicate();k.on("mousemove",b);g.on("mouseup",c);k.on("mouseup",c)}});if(CKEDITOR.env.version>7&&CKEDITOR.env.version<11)k.on("mousedown",function(a){if(a.data.getTarget().is("html")){g.on("mouseup",c);k.on("mouseup",c)}})}}h.attachListener(h,"selectionchange",a,d);h.attachListener(h,"keyup",f,d);h.attachListener(h,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(n&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var p;
h.attachListener(h,"mousedown",function(){p=1});h.attachListener(e.getDocumentElement(),"mouseup",function(){p&&f.call(d);p=0})}else h.attachListener(CKEDITOR.env.ie?h:e.getDocumentElement(),"mouseup",f,d);CKEDITOR.env.webkit&&h.attachListener(e,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:i(h)}},null,null,-1);h.attachListener(h,"keydown",m(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&
c()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",c,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);if(b&&b.hasAttribute("data-cke-hidden-sel")){b.remove();if(CKEDITOR.env.gecko)(a=d.editable().getFirst(a))&&(a.is("br")&&a.getAttribute("_moz_editor_bogus_node"))&&
a.remove()}},null,null,100);d.on("key",function(a){if(d.mode=="wysiwyg"){var b=d.getSelection();if(b.isFake){var c=q[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){function b(){var a=e.editable();if(a)if(a=g(a)){var c=e.document.$.getSelection();if(c.type!="None"&&(c.anchorNode==a.$||c.focusNode==a.$))k=h(c);f=a.getText();a.setText(d(f))}}function c(){var a=e.editable();if(a)if(a=g(a)){a.setText(f);if(k){j(e.document.$,
k);k=null}}}var e=a.editor,f,k;if(CKEDITOR.env.webkit){e.on("selectionChange",function(){var a=e.editable(),b=g(a);b&&(b.getCustomData("ready")?i(a):b.setCustomData("ready",1))},null,null,-1);e.on("beforeSetMode",function(){i(e.editable())},null,null,-1);e.on("beforeUndoImage",b);e.on("afterUndoImage",c);e.on("beforeGetData",b,null,null,0);e.on("getData",c)}});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:f).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if((this._.savedSelection||
this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;return(a=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(a):null};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);if(a.getType()!=CKEDITOR.SELECTION_NONE){!a.isLocked&&a.lock();this._.savedSelection=a;return true}return false};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;if(b){b.unlock(a);delete this._.savedSelection;return true}return false};
CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;var r=typeof window.getSelection!=
"function",u=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:u++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b){CKEDITOR.tools.extend(this._.cache,b._.cache);this.isFake=b.isFake;this.isLocked=b.isLocked;return this}var a=this.getNative(),d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&&
new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||!(d.type==CKEDITOR.NODE_ELEMENT||d.type==CKEDITOR.NODE_TEXT)||!this.root.equals(d)&&!this.root.contains(d)){this._.cache.type=CKEDITOR.SELECTION_NONE;this._.cache.startElement=null;this._.cache.selectedElement=null;this._.cache.selectedText="";this._.cache.ranges=new CKEDITOR.dom.rangeList}return this};var t={img:1,hr:1,li:1,table:1,tr:1,
td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=r?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:r?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;if(d=="Text")b=CKEDITOR.SELECTION_TEXT;if(d=="Control")b=
CKEDITOR.SELECTION_ELEMENT;if(c.createRange().parentElement())b=CKEDITOR.SELECTION_TEXT}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(c.rangeCount==1){var c=c.getRangeAt(0),d=c.startContainer;if(d==c.endContainer&&d.nodeType==1&&c.endOffset-c.startOffset==1&&t[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=
r?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,f,g,h=b.duplicate(),j=0,i=e.length-1,k=-1,n,m;j<=i;){k=Math.floor((j+i)/2);f=e[k];h.moveToElementText(f);n=h.compareEndPoints("StartToStart",b);if(n>0)i=k-1;else if(n<0)j=k+1;else return{container:d,offset:a(f)}}if(k==-1||k==e.length-1&&n<0){h.moveToElementText(d);h.setEndPoint("StartToStart",
b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){f=e[e.length-1];return f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length}}for(d=e.length;h>0&&d>0;){g=e[--d];if(g.nodeType==CKEDITOR.NODE_TEXT){m=g;h=h-g.nodeValue.length}}return{container:m,offset:-h}}h.collapse(n>0?true:false);h.setEndPoint(n>0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(f)+(n>0?0:1)};for(;h>0;)try{g=
f[n>0?"previousSibling":"nextSibling"];if(g.nodeType==CKEDITOR.NODE_TEXT){h=h-g.nodeValue.length;m=g}f=g}catch(r){return{container:d,offset:a(f)}}return{container:m,offset:n>0?-h:m.nodeValue.length+h}};return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT){a=new CKEDITOR.dom.range(this.root);d=b(c,true);a.setStart(new CKEDITOR.dom.node(d.container),d.offset);d=b(c);a.setEnd(new CKEDITOR.dom.node(d.container),d.offset);a.endContainer.getPosition(a.startContainer)&
CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse();return[a]}if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var f=c.item(e),g=f.parentNode,h=0,a=new CKEDITOR.dom.range(this.root);h<g.childNodes.length&&g.childNodes[h]!=f;h++);a.setStart(new CKEDITOR.dom.node(g),h);a.setEnd(new CKEDITOR.dom.node(g),h+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);
b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};return function(b){var c=this._.cache,d=c.ranges;if(!d)c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this));return!b?d:o(new CKEDITOR.dom.rangeList(d.slice()))}}(),getStartElement:function(){var a=this._.cache;if(a.startElement!==void 0)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();
case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed){b=c.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent())}else{for(c.optimize();;){b=c.startContainer;if(c.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary())c.setStartAfter(b);else break}b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();b=b.getChild(c.startOffset);if(!b||b.type!=CKEDITOR.NODE_ELEMENT)b=c.startContainer;else for(c=b.getFirst();c&&c.type==
CKEDITOR.NODE_ELEMENT;){b=c;c=c.getFirst()}}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(a.selectedElement!==void 0)return a.selectedElement;var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&(!(c=a.getEnclosedNode())||!(c.type==CKEDITOR.NODE_ELEMENT&&t[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=
c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=r?b.type=="Control"?"":b.createRange().text:b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=!b&&this.getRanges(),d=this.isFake;this.isLocked=
0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection&&this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}this.rev=u++},selectElement:function(a){var b=
new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var c=this.root.editor,c=c&&c._.hiddenSelectionContainer;this.reset();if(c)for(var c=this.root,d,e=0;e<a.length;++e){d=a[e];if(d.endContainer.equals(c))d.endOffset=Math.min(d.endOffset,c.getChildCount())}if(a.length)if(this.isLocked){var f=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();f&&!f.equals(this.root)&&f.focus()}else{var g;a:{var h,j;if(a.length==
1&&!(j=a[0]).collapsed&&(g=j.getEnclosedNode())&&g.type==CKEDITOR.NODE_ELEMENT){j=j.clone();j.shrink(CKEDITOR.SHRINK_ELEMENT,true);if((h=j.getEnclosedNode())&&h.type==CKEDITOR.NODE_ELEMENT)g=h;if(g.getAttribute("contenteditable")=="false")break a}g=void 0}if(g)this.fake(g);else{if(r){j=CKEDITOR.dom.walker.whitespaces(true);h=/\ufeff|\u00a0/;c={table:1,tbody:1,tr:1};if(a.length>1){g=a[a.length-1];a[0].setEnd(g.endContainer,g.endOffset)}g=a[0];var a=g.collapsed,k,n,m;if((d=g.getEnclosedNode())&&d.type==
CKEDITOR.NODE_ELEMENT&&d.getName()in t&&(!d.is("a")||!d.getText()))try{m=d.$.createControlRange();m.addElement(d.$);m.select();return}catch(q){}if(g.startContainer.type==CKEDITOR.NODE_ELEMENT&&g.startContainer.getName()in c||g.endContainer.type==CKEDITOR.NODE_ELEMENT&&g.endContainer.getName()in c){g.shrink(CKEDITOR.NODE_ELEMENT,true);a=g.collapsed}m=g.createBookmark();c=m.startNode;if(!a)f=m.endNode;m=g.document.$.body.createTextRange();m.moveToElementText(c.$);m.moveStart("character",1);if(f){h=
g.document.$.body.createTextRange();h.moveToElementText(f.$);m.setEndPoint("EndToEnd",h);m.moveEnd("character",-1)}else{k=c.getNext(j);n=c.hasAscendant("pre");k=!(k&&k.getText&&k.getText().match(h))&&(n||!c.hasPrevious()||c.getPrevious().is&&c.getPrevious().is("br"));n=g.document.createElement("span");n.setHtml("&#65279;");n.insertBefore(c);k&&g.document.createText("﻿").insertBefore(c)}g.setStartBefore(c);c.remove();if(a){if(k){m.moveStart("character",-1);m.select();g.document.$.selection.clear()}else m.select();
g.moveToPosition(n,CKEDITOR.POSITION_BEFORE_START);n.remove()}else{g.setEndBefore(f);f.remove();m.select()}}else{f=this.getNative();if(!f)return;this.removeAllRanges();for(m=0;m<a.length;m++){if(m<a.length-1){k=a[m];n=a[m+1];h=k.clone();h.setStart(k.endContainer,k.endOffset);h.setEnd(n.startContainer,n.startOffset);if(!h.collapsed){h.shrink(CKEDITOR.NODE_ELEMENT,true);g=h.getCommonAncestor();h=h.getEnclosedNode();if(g.isReadOnly()||h&&h.isReadOnly()){n.setStart(k.startContainer,k.startOffset);a.splice(m--,
1);continue}}}g=a[m];n=this.document.$.createRange();if(g.collapsed&&CKEDITOR.env.webkit&&b(g)){k=this.root;i(k,false);h=k.getDocument().createText("​");k.setCustomData("cke-fillingChar",h);g.insertNode(h);if((k=h.getNext())&&!h.getPrevious()&&k.type==CKEDITOR.NODE_ELEMENT&&k.getName()=="br"){i(this.root);g.moveToPosition(k,CKEDITOR.POSITION_BEFORE_START)}else g.moveToPosition(h,CKEDITOR.POSITION_AFTER_END)}n.setStart(g.startContainer.$,g.startOffset);try{n.setEnd(g.endContainer.$,g.endOffset)}catch(l){if(l.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=
0){g.collapse(1);n.setEnd(g.endContainer.$,g.endOffset)}else throw l;}f.addRange(n)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a){var b=this.root.editor;this.reset();k(b);var c=this._.cache,d=new CKEDITOR.dom.range(this.root);d.setStartBefore(a);d.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(d);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=u++;b._.fakeSelection=this;this.root.fire("selectionchange")},
isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],c=0;c<a.length;c++){var d=new CKEDITOR.dom.range(this.root);d.moveToBookmark(a[c]);b.push(d)}a.isFake?this.fake(b[0].getEnclosedNode()):
this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return!a.length?null:a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer)},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[r?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}}(),"use strict",CKEDITOR.STYLE_BLOCK=1,CKEDITOR.STYLE_INLINE=2,CKEDITOR.STYLE_OBJECT=
3,function(){function a(a,b){for(var c,d;a=a.getParent();){if(a.equals(b))break;if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");e=="false"?c=a:e=="true"&&(d=1)}}return c}function f(b){var c=b.document;if(b.collapsed){c=q(this,c);b.insertNode(c);b.moveToPosition(c,CKEDITOR.POSITION_BEFORE_END)}else{var d=this.element,g=this._.definition,h,j=g.ignoreReadonly,i=j||g.includeReadonly;i==null&&(i=b.root.getCustomData("cke_includeReadonly"));var k=CKEDITOR.dtd[d];
if(!k){h=true;k=CKEDITOR.dtd.span}b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var n=b.createBookmark(),m=n.startNode,r=n.endNode,l=m,u;if(!j){var o=b.getCommonAncestor(),j=a(m,o),o=a(r,o);j&&(l=j.getNextSourceNode(true));o&&(r=o)}for(l.getPosition(r)==CKEDITOR.POSITION_FOLLOWING&&(l=0);l;){j=false;if(l.equals(r)){l=null;j=true}else{var t=l.type==CKEDITOR.NODE_ELEMENT?l.getName():null,o=t&&l.getAttribute("contentEditable")=="false",v=t&&l.getAttribute("data-nostyle");if(t&&l.data("cke-bookmark")){l=
l.getNextSourceNode(true);continue}if(o&&i&&CKEDITOR.dtd.$block[t])for(var x=l,w=e(x),s=void 0,z=w.length,y=0,x=z&&new CKEDITOR.dom.range(x.getDocument());y<z;++y){var s=w[y],A=CKEDITOR.filter.instances[s.data("cke-filter")];if(A?A.check(this):1){x.selectNodeContents(s);f.call(this,x)}}w=t?!k[t]||v?0:o&&!i?0:(l.getPosition(r)|F)==F&&(!g.childRule||g.childRule(l)):1;if(w)if((w=l.getParent())&&((w.getDtd()||CKEDITOR.dtd.span)[d]||h)&&(!g.parentRule||g.parentRule(w))){if(!u&&(!t||!CKEDITOR.dtd.$removeEmpty[t]||
(l.getPosition(r)|F)==F)){u=b.clone();u.setStartBefore(l)}t=l.type;if(t==CKEDITOR.NODE_TEXT||o||t==CKEDITOR.NODE_ELEMENT&&!l.getChildCount()){for(var t=l,aa;(j=!t.getNext(B))&&(aa=t.getParent(),k[aa.getName()])&&(aa.getPosition(m)|C)==C&&(!g.childRule||g.childRule(aa));)t=aa;u.setEndAfter(t)}}else j=true;else j=true;l=l.getNextSourceNode(v||o)}if(j&&u&&!u.collapsed){for(var j=q(this,c),o=j.hasAttributes(),v=u.getCommonAncestor(),t={},w={},s={},z={},U,$,ca;j&&v;){if(v.getName()==d){for(U in g.attributes)if(!z[U]&&
(ca=v.getAttribute($)))j.getAttribute(U)==ca?w[U]=1:z[U]=1;for($ in g.styles)if(!s[$]&&(ca=v.getStyle($)))j.getStyle($)==ca?t[$]=1:s[$]=1}v=v.getParent()}for(U in w)j.removeAttribute(U);for($ in t)j.removeStyle($);o&&!j.hasAttributes()&&(j=null);if(j){u.extractContents().appendTo(j);u.insertNode(j);p.call(this,j);j.mergeSiblings();CKEDITOR.env.ie||j.$.normalize()}else{j=new CKEDITOR.dom.element("span");u.extractContents().appendTo(j);u.insertNode(j);p.call(this,j);j.remove(true)}u=null}}b.moveToBookmark(n);
b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,true)}}function c(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(i.getParent()),e=null,f=null,g=0;g<a.elements.length;g++){var h=a.elements[g];if(h==a.block||h==a.blockLimit)break;k.checkElementRemovable(h,true)&&(e=h)}for(g=0;g<c.elements.length;g++){h=c.elements[g];if(h==c.block||h==c.blockLimit)break;k.checkElementRemovable(h,true)&&(f=h)}f&&i.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,
1);var c=a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),f,g=0,h;g<e.elements.length&&(h=e.elements[g]);g++){if(h==e.block||h==e.blockLimit)break;if(this.checkElementRemovable(h)){var j;if(a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(j=a.checkBoundaryOfElement(h,CKEDITOR.START)))){f=h;f.match=j?"start":"end"}else{h.mergeSiblings();h.is(this.element)?o.call(this,h):n(h,t(this)[h.getName()])}}}if(f){h=d;for(g=0;;g++){j=e.elements[g];
if(j.equals(f))break;else if(j.match)continue;else j=j.clone();j.append(h);h=j}h[f.match=="start"?"insertBefore":"insertAfter"](f)}}else{var i=c.endNode,k=this;b();for(e=d;!e.equals(i);){f=e.getNextSourceNode();if(e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)){e.getName()==this.element?o.call(this,e):n(e,t(this)[e.getName()]);if(f.type==CKEDITOR.NODE_ELEMENT&&f.contains(d)){b();f=d.getNext()}}e=f}}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,true)}function e(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")==
"true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function b(a){var b=a.getEnclosedNode()||a.getCommonAncestor(false,true);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&r(a,this)}function g(a){var b=a.getCommonAncestor(true,true);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
a.removeStyle(e)}}function i(a){var b=a.createBookmark(true),c=a.createIterator();c.enforceRealBlocks=true;if(this._.enterMode)c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e=a.document,f;d=c.getNextParagraph();)if(!d.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)){f=q(this,e,d);h(d,f)}a.moveToBookmark(b)}function d(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=true;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e;d=c.getNextParagraph();)if(this.checkElementRemovable(d))if(d.is("pre")){(e=
this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e);h(d,e)}else o.call(this,d);a.moveToBookmark(b)}function h(a,b){var c=!b;if(c){b=a.getDocument().createElement("div");a.copyAttributes(b)}var d=b&&b.is("pre"),e=a.is("pre"),f=!d&&e;if(d&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=k(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+|&nbsp;)/g,
" ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var g=a.getDocument().createElement("div");g.append(e);e.$.outerHTML="<pre>"+f+"</pre>";e.copyAttributes(g.getFirst());e=g.getFirst().remove()}else e.setHtml(f);b=e}else f?b=m(c?[a.getHtml()]:j(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,h;if((h=c.getPrevious(A))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")){d=k(h.getHtml(),/\n$/,"")+"\n\n"+k(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="<pre>"+d+"</pre>":c.setHtml(d);h.remove()}}else c&&
l(b)}function j(a){var b=[];k(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"</pre>"+c+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function k(a,b,c){var d="",e="",a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function m(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=k(e,/^[ \t]*\n/,""),e=k(e,/\n$/,""),e=k(e,/^[ \t]+|[ \t]+$/g,function(a,b){return a.length==1?"&nbsp;":b?" "+CKEDITOR.tools.repeat("&nbsp;",a.length-1):CKEDITOR.tools.repeat("&nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"<br>"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("&nbsp;",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function o(a,b){var c=this._.definition,
d=c.attributes,c=c.styles,e=t(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),g;for(g in d)if(!((g=="class"||this._.definition.fullMatch)&&a.getAttribute(g)!=v(g,d[g]))&&!(b&&g.slice(0,5)=="data-")){f=a.hasAttribute(g);a.removeAttribute(g)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=v(h,c[h],true))){f=f||!!a.getStyle(h);a.removeStyle(h)}n(a,e,w[a.getName()]);f&&(this._.definition.alwaysRemoveElement?l(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
CKEDITOR.ENTER_BR&&!a.hasAttributes()?l(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function p(a){for(var b=t(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||o.call(this,d,true)}for(var f in b)if(f!=this.element){c=a.getElementsByTag(f);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||n(d,b[f])}}}function n(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],f;if(f=a.getAttribute(e)){var g=b[d][1];(g===null||
g.test&&g.test(f)||typeof g=="string"&&f==g)&&a.removeAttribute(e)}}c||l(a)}function l(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(A),d=a.getNext(A);c&&(c.type==CKEDITOR.NODE_TEXT||!c.isBlockBoundary({br:1}))&&a.append("br",1);d&&(d.type==CKEDITOR.NODE_TEXT||!d.isBlockBoundary({br:1}))&&a.append("br");a.remove(true)}else{c=a.getFirst();d=a.getLast();a.remove(true);if(c){c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings();d&&(!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT)&&
d.mergeSiblings()}}}function q(a,b,c){var d;d=a.element;d=="*"&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=r(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function r(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function u(a,b){for(var c in a)a[c]=a[c].replace(z,function(a,
c){return b[c]})}function t(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,g;if(typeof e=="string")f=e.toLowerCase();else{f=e.element?e.element.toLowerCase():a.element;g=e.attributes}e=b[f]||(b[f]={});if(g){var e=e.attributes=e.attributes||[],h;for(h in g)e.push([h.toLowerCase(),g[h]])}}}return b}function v(a,b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,
b);return d[c?"getStyle":"getAttribute"](a)}function x(a,b,c){for(var d=a.document,e=a.getRanges(),b=b?this.removeFromRange:this.applyToRange,f,g=e.createIterator();f=g.getNextRange();)b.call(this,f,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var w={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},s=
{a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},y=/\s*(?:;\s*|$)/,z=/#\((.+?)\)/g,B=CKEDITOR.dom.walker.bookmark(0,1),A=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if(typeof a.type=="string")return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);u(a.attributes,
b);u(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():a.element:"*";this.type=a.type||(w[c]?CKEDITOR.STYLE_BLOCK:s[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return x.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;
x.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return x.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;x.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?f:this.type==CKEDITOR.STYLE_BLOCK?i:this.type==CKEDITOR.STYLE_OBJECT?b:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=
this.type==CKEDITOR.STYLE_INLINE?c:this.type==CKEDITOR.STYLE_BLOCK?d:this.type==CKEDITOR.STYLE_OBJECT?g:null;return this.removeFromRange(a)},applyToObject:function(a){r(a,this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,true,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++){e=c[d];if(!(this.type==CKEDITOR.STYLE_INLINE&&(e==a.block||e==a.blockLimit))){if(this.type==
CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!(typeof this.element=="string"?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,true,b))return true}}}return false},checkApplicable:function(a,b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return false;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return true},checkElementMatch:function(a,b){var c=this._.definition;
if(!a||!c.ignoreReadonly&&a.isReadOnly())return false;var d=a.getName();if(typeof this.element=="string"?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return true;if(d=c._AC)c=d;else{var d={},e=0,f=c.attributes;if(f)for(var g in f){e++;d[g]=f[g]}if(g=CKEDITOR.style.getStyleText(c)){d.style||e++;d.style=g}d._length=e;c=c._AC=d}if(c._length){for(var h in c)if(h!="_length"){e=a.getAttribute(h)||"";if(h=="style")a:{d=c[h];typeof d=="string"&&(d=CKEDITOR.tools.parseCssText(d));typeof e==
"string"&&(e=CKEDITOR.tools.parseCssText(e,true));g=void 0;for(g in d)if(!(g in e&&(e[g]==d[g]||d[g]=="inherit"||e[g]=="inherit"))){d=false;break a}d=true}else d=c[h]==e;if(d){if(!b)return true}else if(b)return false}if(b)return true}else return true}return false},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return true;if(b=t(this)[a.getName()]){var d;if(!(b=b.attributes))return true;for(c=0;c<b.length;c++){d=b[c][0];if(d=a.getAttribute(d)){var e=b[c][1];if(e===null)return true;
if(typeof e=="string"){if(d==e)return true}else if(e.test(d))return true}}}return false},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;d=="bdo"&&(d="span");var c=["<",d],e=b.attributes;if(e)for(var f in e)c.push(" ",f,'="',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style="',e,'"');c.push(">",a||b.name,"</",d,">");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;var b=a.styles,c=
a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(y,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(y,";");f=="inherit"?d=d+g:c=c+g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},a,true);
return this.customHandlers[a.type]=b};var F=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,C=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(a,f){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,f,true)},CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&
a.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(a,f,c){CKEDITOR.stylesSet.addExternal(a,f,"");CKEDITOR.stylesSet.load(a,c)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,f){var c=this._.styleStateChangeCallbacks;if(!c){c=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var b=
0;b<c.length;b++){var f=c[b],i=f.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;f.fn.call(this,i)}})}c.push({style:a,fn:f})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);else{var f=this,c=f.config.stylesCombo_stylesSet||f.config.stylesSet;if(c===false)a(null);else if(c instanceof Array){f._.stylesDefinitions=c;a(c)}else{c||(c="default");var c=c.split(":"),
e=c[0];CKEDITOR.stylesSet.addExternal(e,c[1]?c.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(e,function(b){f._.stylesDefinitions=b[e];a(f._.stylesDefinitions)})}}}}),CKEDITOR.dom.comment=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<\!--"+this.$.nodeValue+
"--\>"}}),"use strict",function(){var a={},f={},c;for(c in CKEDITOR.dtd.$blockLimit)c in CKEDITOR.dtd.$list||(a[c]=1);for(c in CKEDITOR.dtd.$block)c in CKEDITOR.dtd.$blockLimit||c in CKEDITOR.dtd.$empty||(f[c]=1);CKEDITOR.dom.elementPath=function(c,b){var g=null,i=null,d=[],h=c,j,b=b||c.getDocument().getBody();do if(h.type==CKEDITOR.NODE_ELEMENT){d.push(h);if(!this.lastElement){this.lastElement=h;if(h.is(CKEDITOR.dtd.$object)||h.getAttribute("contenteditable")=="false")continue}if(h.equals(b))break;
if(!i){j=h.getName();h.getAttribute("contenteditable")=="true"?i=h:!g&&f[j]&&(g=h);if(a[j]){var k;if(k=!g){if(j=j=="div"){a:{j=h.getChildren();k=0;for(var m=j.count();k<m;k++){var o=j.getItem(k);if(o.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[o.getName()]){j=true;break a}}j=false}j=!j}k=j}k?g=h:i=h}}}while(h=h.getParent());i||(i=b);this.block=g;this.blockLimit=i;this.root=b;this.elements=d}}(),CKEDITOR.dom.elementPath.prototype={compare:function(a){var f=this.elements,a=a&&a.elements;if(!a||
f.length!=a.length)return false;for(var c=0;c<f.length;c++)if(!f[c].equals(a[c]))return false;return true},contains:function(a,f,c){var e;typeof a=="string"&&(e=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?e=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?e=function(b){return CKEDITOR.tools.indexOf(a,b.getName())>-1}:typeof a=="function"?e=a:typeof a=="object"&&(e=function(b){return b.getName()in a});var b=this.elements,g=b.length;f&&g--;if(c){b=Array.prototype.slice.call(b,
0);b.reverse()}for(f=0;f<g;f++)if(e(b[f]))return b[f];return null},isContextFor:function(a){var f;if(a in CKEDITOR.dtd.$block){f=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit;return!!f.getDtd()[a]}return true},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}},CKEDITOR.dom.text=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createTextNode(a));this.$=a},CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node,
CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},split:function(a){var f=this.$.parentNode,c=f.childNodes.length,e=this.getLength(),b=this.getDocument(),g=new CKEDITOR.dom.text(this.$.splitText(a),b);if(f.childNodes.length==c)if(a>=e){g=b.createText("");g.insertAfter(this)}else{a=b.createText("");a.insertAfter(g);a.remove()}return g},substring:function(a,
f){return typeof f!="number"?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}}),function(){function a(a,e,b){var f=a.serializable,i=e[b?"endContainer":"startContainer"],d=b?"endOffset":"startOffset",h=f?e.document.getById(a.startNode):a.startNode,a=f?e.document.getById(a.endNode):a.endNode;if(i.equals(h.getPrevious())){e.startOffset=e.startOffset-i.getLength()-a.getPrevious().getLength();i=a.getNext()}else if(i.equals(a.getPrevious())){e.startOffset=e.startOffset-i.getLength();i=a.getNext()}i.equals(h.getParent())&&
e[d]++;i.equals(a.getParent())&&e[d]++;e[b?"endContainer":"startContainer"]=i;return e}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,f)};var f={createIterator:function(){var a=this,e=CKEDITOR.dom.walker.bookmark(),b=[],f;return{getNextRange:function(i){f=f===void 0?0:f+1;var d=a[f];if(d&&a.length>1){if(!f)for(var h=a.length-1;h>=0;h--)b.unshift(a[h].createBookmark(true));if(i)for(var j=
0;a[f+j+1];){for(var k=d.document,i=0,h=k.getById(b[j].endNode),k=k.getById(b[j+1].startNode);;){h=h.getNextSourceNode(false);if(k.equals(h))i=1;else if(e(h)||h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary())continue;break}if(!i)break;j++}for(d.moveToBookmark(b.shift());j--;){h=a[++f];h.moveToBookmark(b.shift());d.setEnd(h.endContainer,h.endOffset)}}return d}}},createBookmarks:function(c){for(var e=[],b,f=0;f<this.length;f++){e.push(b=this[f].createBookmark(c,true));for(var i=f+1;i<this.length;i++){this[i]=
a(b,this[i]);this[i]=a(b,this[i],true)}}return e},createBookmarks2:function(a){for(var e=[],b=0;b<this.length;b++)e.push(this[b].createBookmark2(a));return e},moveToBookmarks:function(a){for(var e=0;e<this.length;e++)this[e].moveToBookmark(a[e])}}}(),function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function f(b){var c=CKEDITOR.skin["ua_"+b],d=CKEDITOR.env;if(c)for(var c=c.split(",").sort(function(a,b){return a>b?-1:1}),e=
0,f;e<c.length;e++){f=c[e];if(d.ie&&(f.replace(/^ie/,"")==d.version||d.quirks&&f=="iequirks"))f="ie";if(d[f]){b=b+("_"+c[e]);break}}return CKEDITOR.getUrl(a()+b+".css")}function c(a,b){if(!g[a]){CKEDITOR.document.appendStyleSheet(f(a));g[a]=1}b&&b()}function e(a){var b=a.getById(i);if(!b){b=a.getHead().append("style");b.setAttribute("id",i);b.setAttribute("type","text/css")}return b}function b(a,b,c){var d,e,f;if(CKEDITOR.env.webkit){b=b.split("}").slice(0,-1);for(e=0;e<b.length;e++)b[e]=b[e].split("{")}for(var g=
0;g<a.length;g++)if(CKEDITOR.env.webkit)for(e=0;e<b.length;e++){f=b[e][1];for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);a[g].$.sheet.addRule(b[e][0],f)}else{f=b;for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);CKEDITOR.env.ie&&CKEDITOR.env.version<11?a[g].$.styleSheet.cssText=a[g].$.styleSheet.cssText+f:a[g].$.innerHTML=a[g].$.innerHTML+f}}var g={};CKEDITOR.skin={path:a,loadPart:function(b,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+
"skin.js"),function(){c(b,d)}):c(b,d)},getPath:function(a){return CKEDITOR.getUrl(f(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,b,c,d,e){var f;if(a){a=a.toLowerCase();b&&(f=this.icons[a+"-rtl"]);f||(f=this.icons[a])}a=c||f&&f.path||"";d=d||f&&f.offset;e=e||f&&f.bgsize||"16px";return a&&"background-image:url("+CKEDITOR.getUrl(a)+");background-position:0 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,
{getUiColor:function(){return this.uiColor},setUiColor:function(a){var c=e(CKEDITOR.document);return(this.setUiColor=function(a){var e=CKEDITOR.skin.chameleon,f=[[h,a]];this.uiColor=a;b([c],e(this,"editor"),f);b(d,e(this,"panel"),f)}).call(this,a)}});var i="cke_ui_color",d=[],h=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var c=a.editor,a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){a=
e(a);d.push(a);var f=c.getUiColor();f&&b([a],CKEDITOR.skin.chameleon(c,"panel"),[[h,f]])}};c.on("panelShow",a);c.on("menuShow",a);c.config.uiColor&&c.setUiColor(c.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=false;else{var a=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),
c=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!(f&&f==c)}catch(e){CKEDITOR.env.hc=false}a.remove()}if(CKEDITOR.env.hc)CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc";CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending){delete CKEDITOR._.pending;for(f=0;f<a.length;f++){CKEDITOR.editor.prototype.constructor.apply(a[f][0],a[f][1]);CKEDITOR.add(a[f][0])}}}(),CKEDITOR.skin.name="moono",CKEDITOR.skin.ua_editor=
"ie,iequirks,ie7,ie8,gecko",CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8",CKEDITOR.skin.chameleon=function(){var a=function(){return function(a,b){for(var c=a.match(/[^#]./g),f=0;f<3;f++){var d=c,h=f,j;j=parseInt(c[f],16);j=("0"+(b<0?0|j*(1+b):0|j+(255-j)*b).toString(16)).slice(-2);d[h]=j}return"#"+c.join("")}}(),f=function(){var a=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");
return function(b,c){return a.output({from:b,to:c})}}(),c={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
return function(e,b){var g=e.uiColor,g={id:"."+e.id,defaultBorder:a(g,-0.1),defaultGradient:f(a(g,0.9),g),lightGradient:f(a(g,1),a(g,0.7)),mediumGradient:f(a(g,0.8),a(g,0.5)),ckeButtonOn:f(a(g,0.6),a(g,0.7)),ckeResizer:a(g,-0.4),ckeToolbarSeparator:a(g,0.5),ckeColorauto:a(g,0.8),dialogBody:a(g,0.7),dialogTabSelected:f("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:a(g,-0.6),elementsPathBg:g,menubuttonIcon:a(g,0.5),menubuttonIconHover:a(g,0.3)};return c[b].output(g).replace(/\[/g,
"{").replace(/\]/g,"}")}}(),CKEDITOR.plugins.add("aspell",{lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",icons:"spellcheck",init:function(a){a.addCommand("aspell",new CKEDITOR.dialogCommand("aspell"));a.ui.addButton&&a.ui.addButton("SpellCheck",{label:a.lang.aspell.toolbar,command:"aspell",toolbar:"document,50"});CKEDITOR.dialog.add("aspell",
this.path+"dialogs/aspell.js")},requires:["toolbar"]}),CKEDITOR.plugins.add("insertdatetime",{init:function(a){CKEDITOR.scriptLoader.load(CKEDITOR.basePath+"../../datefield.js");a.addCommand("insertDateTimeCmd",new CKEDITOR.dialogCommand("insertDateTimeDialog"));a.ui.addButton("InsertDateTime",{label:"Insert Date/Time",command:"insertDateTimeCmd",icon:CKEDITOR.basePath+"../../../img/ckeditor/icon_insertdatetime.png"});CKEDITOR.dialog.add("insertDateTimeDialog",function(a){return{title:"Insert Date/Time",
minWidth:150,minHeight:80,contents:[{id:"general",label:"Content",elements:[{type:"select",id:"dateformat",label:"Date/Time Format",items:[["<none>",""]],onShow:function(){var a=new Date;this.clear();this.add(XPLAN.DateTimeUtil.strftime("%d/%m/%Y %I:%M%p",a));this.add(XPLAN.DateTimeUtil.strftime("%d/%m/%Y",a));this.add(XPLAN.DateTimeUtil.strftime("%I:%M%p",a));this.add(XPLAN.DateTimeUtil.strftime("%d %B %Y",a));this.add(XPLAN.DateTimeUtil.strftime("%a, %b %d, %Y",a))},commit:function(a){a.datetime=
this.getValue()}}]}],onOk:function(){var c={};this.commitContent(c);a.insertText(c.datetime)}}})}}),CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||false;for(var b=[this._],c=1;c<arguments.length;c++)b.push(arguments[c]);b.push(true);CKEDITOR.tools.extend.apply(CKEDITOR.tools,b);return this._},f={build:function(a,b,c){return new CKEDITOR.ui.dialog.textInput(a,b,c)}},c={build:function(a,
b,c){return new CKEDITOR.ui.dialog[b.type](a,b,c)}},e={isChanged:function(){return this.getValue()!=this.getInitValue()},reset:function(a){this.setValue(this.getInitValue(),a)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},b=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(a,b){if(!this._.domOnChangeRegistered){a.on("load",function(){this.getInputElement().on("change",
function(){a.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},this)},this);this._.domOnChangeRegistered=true}this.on("change",b)}},true),g=/^on([A-Z]\w+)/,i=function(a){for(var b in a)(g.test(b)||b=="title"||b=="type")&&delete a[b];return a};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,c,e,f){if(!(arguments.length<4)){var g=a.call(this,c);g.labelId=CKEDITOR.tools.getNextId()+"_label";this._.children=[];var i={role:c.role||"presentation"};if(c.includeLabel)i["aria-labelledby"]=
g.labelId;CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"div",null,i,function(){var a=[],e=c.required?" cke_required":"";if(c.labelLayout!="horizontal")a.push('<label class="cke_dialog_ui_labeled_label'+e+'" ',' id="'+g.labelId+'"',g.inputId?' for="'+g.inputId+'"':"",(c.labelStyle?' style="'+c.labelStyle+'"':"")+">",c.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',c.controlStyle?' style="'+c.controlStyle+'"':"",' role="presentation">',f.call(this,b,c),"</div>");else{e={type:"hbox",widths:c.widths,
padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+e+'" id="'+g.labelId+'" for="'+g.inputId+'"'+(c.labelStyle?' style="'+c.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(c.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(c.controlStyle?' style="'+c.controlStyle+'"':"")+">"+f.call(this,b,c)+"</span>"}]};CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,e,a)}return a.join("")})}},textInput:function(b,c,e){if(!(arguments.length<3)){a.call(this,
c);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",g={"class":"cke_dialog_ui_input_"+c.type,id:f,type:c.type};if(c.validate)this.validate=c.validate;if(c.maxLength)g.maxlength=c.maxLength;if(c.size)g.size=c.size;if(c.inputStyle)g.style=c.inputStyle;var i=this,p=false;b.on("load",function(){i.getInputElement().on("keydown",function(a){a.data.getKeystroke()==13&&(p=true)});i.getInputElement().on("keyup",function(a){if(a.data.getKeystroke()==13&&p){b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},
0);p=false}},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){var a=['<div class="cke_dialog_ui_input_',c.type,'" role="presentation"'];c.width&&a.push('style="width:'+c.width+'" ');a.push("><input ");g["aria-labelledby"]=this._.labelId;this._.required&&(g["aria-required"]=this._.required);for(var b in g)a.push(b+'="'+g[b]+'" ');a.push(" /></div>");return a.join("")})}},textarea:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);var f=this,g=this._.inputId=CKEDITOR.tools.getNextId()+
"_textarea",i={};if(c.validate)this.validate=c.validate;i.rows=c.rows||5;i.cols=c.cols||20;i["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");if(typeof c.inputStyle!="undefined")i.style=c.inputStyle;if(c.dir)i.dir=c.dir;CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){i["aria-labelledby"]=this._.labelId;this._.required&&(i["aria-required"]=this._.required);var a=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',g,'" '],b;for(b in i)a.push(b+'="'+
CKEDITOR.tools.htmlEncode(i[b])+'" ');a.push(">",CKEDITOR.tools.htmlEncode(f._["default"]),"</textarea></div>");return a.join("")})}},checkbox:function(b,c,e){if(!(arguments.length<3)){var f=a.call(this,c,{"default":!!c["default"]});if(c.validate)this.validate=c.validate;CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},true),e=[],g=CKEDITOR.tools.getNextId()+"_label",j={"class":"cke_dialog_ui_checkbox_input",
type:"checkbox","aria-labelledby":g};i(a);if(c["default"])j.checked="checked";if(typeof a.inputStyle!="undefined")a.style=a.inputStyle;f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,e,"input",null,j);e.push(' <label id="',g,'" for="',j.id,'"'+(c.labelStyle?' style="'+c.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(c.label),"</label>");return e.join("")})}},radio:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);if(!this._["default"])this._["default"]=this._.initValue=c.items[0][1];if(c.validate)this.validate=
c.valdiate;var f=[],g=this;c.role="radiogroup";c.includeLabel=true;CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){for(var a=[],e=[],j=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",l=0;l<c.items.length;l++){var q=c.items[l],r=q[2]!==void 0?q[2]:q[0],u=q[1]!==void 0?q[1]:q[0],t=CKEDITOR.tools.getNextId()+"_radio_input",v=t+"_label",t=CKEDITOR.tools.extend({},c,{id:t,title:null,type:null},true),r=CKEDITOR.tools.extend({},t,{title:r},true),x={type:"radio","class":"cke_dialog_ui_radio_input",
name:j,value:u,"aria-labelledby":v},w=[];if(g._["default"]==u)x.checked="checked";i(t);i(r);if(typeof t.inputStyle!="undefined")t.style=t.inputStyle;t.keyboardFocusable=true;f.push(new CKEDITOR.ui.dialog.uiElement(b,t,w,"input",null,x));w.push(" ");new CKEDITOR.ui.dialog.uiElement(b,r,w,"label",null,{id:v,"for":x.id},q[0]);a.push(w.join(""))}new CKEDITOR.ui.dialog.hbox(b,f,a,e);return e.join("")});this._.children=f}},button:function(b,c,e){if(arguments.length){typeof c=="function"&&(c=c(b.getParentEditor()));
a.call(this,c,{disabled:c.disabled||false});CKEDITOR.event.implementOn(this);var f=this;b.on("load",function(){var a=this.getElement();(function(){a.on("click",function(a){f.click();a.data.preventDefault()});a.on("keydown",function(a){if(a.data.getKeystroke()in{32:1}){f.click();a.data.preventDefault()}})})();a.unselectable()},this);var g=CKEDITOR.tools.extend({},c);delete g.style;var i=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,g,e,"a",null,{style:c.style,href:"javascript:void(0)",
title:c.label,hidefocus:"true","class":c["class"],role:"button","aria-labelledby":i},'<span id="'+i+'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(c.label)+"</span>")}},select:function(b,c,e){if(!(arguments.length<3)){var f=a.call(this,c);if(c.validate)this.validate=c.validate;f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},true),e=
[],g=[],j={id:f.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('<div class="cke_dialog_ui_input_',c.type,'" role="presentation"');c.width&&e.push('style="width:'+c.width+'" ');e.push(">");if(c.size!=void 0)j.size=c.size;if(c.multiple!=void 0)j.multiple=c.multiple;i(a);for(var l=0,q;l<c.items.length&&(q=c.items[l]);l++)g.push('<option value="',CKEDITOR.tools.htmlEncode(q[1]!==void 0?q[1]:q[0]).replace(/"/g,"&quot;"),'" /> ',CKEDITOR.tools.htmlEncode(q[0]));if(typeof a.inputStyle!=
"undefined")a.style=a.inputStyle;f.select=new CKEDITOR.ui.dialog.uiElement(b,a,e,"select",null,j,g.join(""));e.push("</div>");return e.join("")})}},file:function(b,c,e){if(!(arguments.length<3)){c["default"]===void 0&&(c["default"]="");var f=CKEDITOR.tools.extend(a.call(this,c),{definition:c,buttons:[]});if(c.validate)this.validate=c.validate;b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,
c,e,function(){f.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',f.frameId,'" title="',c.label,'" src="javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"></iframe>');return a.join("")})}},fileButton:function(b,c,e){if(!(arguments.length<3)){a.call(this,c);var f=this;if(c.validate)this.validate=
c.validate;var g=CKEDITOR.tools.extend({},c),i=g.onClick;g.className=(g.className?g.className+" ":"")+"cke_dialog_ui_button";g.onClick=function(a){var e=c["for"];if(!i||i.call(this,a)!==false){b.getContentElement(e[0],e[1]).submit();this.disable()}};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,g,e)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,b=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(e,
f,g){if(!(arguments.length<3)){var i=[],n=f.html;n.charAt(0)!="<"&&(n="<span>"+n+"</span>");var l=f.focus;if(l){var q=this.focus;this.focus=function(){(typeof l=="function"?l:q).call(this);this.fire("focus")};if(f.isFocusable)this.isFocusable=this.isFocusable;this.keyboardFocusable=true}CKEDITOR.ui.dialog.uiElement.call(this,e,f,i,"span",null,null,"");i=i.join("").match(a);n=n.match(b)||["","",""];if(c.test(n[1])){n[1]=n[1].slice(0,-1);n[2]="/"+n[2]}g.push([n[1]," ",i[1]||"",n[2]].join(""))}}}(),
fieldset:function(a,b,c,e,f){var g=f.label;this._={children:b};CKEDITOR.ui.dialog.uiElement.call(this,a,f,e,"fieldset",null,null,function(){var a=[];g&&a.push("<legend"+(f.labelStyle?' style="'+f.labelStyle+'"':"")+">"+g+"</legend>");for(var b=0;b<c.length;b++)a.push(c[b]);return a.join("")})}},true);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(a){var b=CKEDITOR.document.getById(this._.labelId);
b.getChildCount()<1?(new CKEDITOR.dom.text(a,CKEDITOR.document)).appendTo(b):b.getChild(0).$.nodeValue=a;return this},getLabel:function(){var a=CKEDITOR.document.getById(this._.labelId);return!a||a.getChildCount()<1?"":a.getChild(0).getText()},eventProcessors:b},true);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return!this._.disabled?this.fire("click",{dialog:this._.dialog}):false},enable:function(){this._.disabled=false;var a=this.getElement();
a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=true;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(a,b){this.on("click",function(){b.apply(this,arguments)})}},true),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:true},
true);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&b.$.focus()},0)},select:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();if(b){b.$.focus();b.$.select()}},0)},accessKeyUp:function(){this.select()},setValue:function(a){!a&&(a="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,
arguments)},keyboardFocusable:true},e,true);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(a,b,c){var e=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),f=this.getInputElement().$;e.$.text=a;e.$.value=b===void 0||b===null?a:b;c===void 0||c===null?CKEDITOR.env.ie?f.add(e.$):f.add(e.$,
null):f.add(e.$,c);return this},remove:function(a){this.getInputElement().$.remove(a);return this},clear:function(){for(var a=this.getInputElement().$;a.length>0;)a.remove(0);return this},keyboardFocusable:true},e,true);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(a,b){this.getInputElement().$.checked=a;!b&&this.fire("change",{value:a})},getValue:function(){return this.getInputElement().$.checked},
accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(a,c){if(!CKEDITOR.env.ie||CKEDITOR.env.version>8)return b.onChange.apply(this,arguments);a.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;b.propertyName=="checked"&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",c);return null}},keyboardFocusable:true},e,true);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,
{setValue:function(a,b){for(var c=this._.children,e,f=0;f<c.length&&(e=c[f]);f++)e.getElement().$.checked=e.getValue()==a;!b&&this.fire("change",{value:a})},getValue:function(){for(var a=this._.children,b=0;b<a.length;b++)if(a[b].getElement().$.checked)return a[b].getValue();return null},accessKeyUp:function(){var a=this._.children,b;for(b=0;b<a.length;b++)if(a[b].getElement().$.checked){a[b].getElement().focus();return}a[0].getElement().focus()},eventProcessors:{onChange:function(a,c){if(CKEDITOR.env.ie){a.on("load",
function(){for(var a=this._.children,b=this,c=0;c<a.length;c++)a[c].getElement().on("propertychange",function(a){a=a.data.$;a.propertyName=="checked"&&this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this);this.on("change",c)}else return b.onChange.apply(this,arguments);return null}}},e,true);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,e,{getInputElement:function(){var a=CKEDITOR.document.getById(this._.frameId).getFrameDocument();
return a.$.forms.length>0?new CKEDITOR.dom.element(a.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,e=function(a,b,c,d){a.on("formLoaded",function(){a.getInputElement().on(c,d,a)})},f;for(f in a)if(c=f.match(b))this.eventProcessors[f]?this.eventProcessors[f].call(this,this._.dialog,a[f]):e(this,this._.dialog,
c[1].toLowerCase(),a[f]);return this},reset:function(){function a(){c.$.open();var d="";e.size&&(d=e.size-(CKEDITOR.env.ie?7:0));var r=b.frameId+"_input";c.$.write(['<html dir="'+n+'" lang="'+l+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+n+'" lang="'+l+'" action="',CKEDITOR.tools.htmlEncode(e.action),'"><label id="',b.labelId,'" for="',r,'" style="display:none">',CKEDITOR.tools.htmlEncode(e.label),
'</label><input style="width:100%" id="',r,'" aria-labelledby="',b.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(e.id||"cke_upload"),'" size="',CKEDITOR.tools.htmlEncode(d>0?d:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+g+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+i+")}","<\/script>"].join(""));c.$.close();for(d=0;d<f.length;d++)f[d].enable()}var b=
this._,c=CKEDITOR.document.getById(b.frameId).getFrameDocument(),e=b.definition,f=b.buttons,g=this.formLoadedNumber,i=this.formUnloadNumber,n=b.dialog._.editor.lang.dir,l=b.dialog._.editor.langCode;if(!g){g=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this);i=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this);this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(g);CKEDITOR.tools.removeFunction(i)})}CKEDITOR.env.gecko?
setTimeout(a,500):a()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(a,b){if(!this._.domOnChangeRegistered){this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this);this._.domOnChangeRegistered=true}this.on("change",b)}},keyboardFocusable:true},true);CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=
CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",f);CKEDITOR.dialog.addUIElement("password",f);CKEDITOR.dialog.addUIElement("textarea",c);CKEDITOR.dialog.addUIElement("checkbox",c);CKEDITOR.dialog.addUIElement("radio",c);CKEDITOR.dialog.addUIElement("button",c);CKEDITOR.dialog.addUIElement("select",c);CKEDITOR.dialog.addUIElement("file",c);CKEDITOR.dialog.addUIElement("fileButton",c);CKEDITOR.dialog.addUIElement("html",c);CKEDITOR.dialog.addUIElement("fieldset",
{build:function(a,b,c){for(var e=b.children,f,g=[],i=[],n=0;n<e.length&&(f=e[n]);n++){var l=[];g.push(l);i.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a,f,l))}return new CKEDITOR.ui.dialog[b.type](a,i,g,c,b)}})}}),CKEDITOR.DIALOG_RESIZE_NONE=0,CKEDITOR.DIALOG_RESIZE_WIDTH=1,CKEDITOR.DIALOG_RESIZE_HEIGHT=2,CKEDITOR.DIALOG_RESIZE_BOTH=3,function(){function a(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,c=b-1;c>b-a;c--)if(this._.tabs[this._.tabIdList[c%
a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function f(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;c<b+a;c++)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function c(a,b){for(var c=a.$.getElementsByTagName("input"),d=0,e=c.length;d<e;d++){var f=new CKEDITOR.dom.element(c[d]);if(f.getAttribute("type").toLowerCase()=="text")if(b){f.setAttribute("value",f.getCustomData("fake_value")||
"");f.removeCustomData("fake_value")}else{f.setCustomData("fake_value",f.getAttribute("value"));f.setAttribute("value","")}}}function e(a,b){var c=this.getInputElement();c&&(a?c.removeAttribute("aria-invalid"):c.setAttribute("aria-invalid",true));a||(this.select?this.select():this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}function b(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function g(a){var a=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",
l).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),b=a.getChild([0,0,0,0,0]),c=b.getChild(0),d=b.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var e="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())";CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+
e+'" tabIndex="-1"></iframe>').appendTo(b.getParent())}c.unselectable();d.unselectable();return{element:a,parts:{dialog:a.getChild(0),title:c,close:d,tabs:b.getChild(2),contents:b.getChild([3,0,0,0]),footer:b.getChild([3,0,1,0])}}}function i(a,b,c){this.element=b;this.focusIndex=c;this.tabIndex=0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in
{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}function d(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function h(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function j(a){function b(c){var i=a.getSize(),j=CKEDITOR.document.getWindow().getViewPaneSize(),k=c.data.$.screenX,n=c.data.$.screenY,r=k-d.x,q=n-d.y;d={x:k,y:n};
e.x=e.x+r;e.y=e.y+q;a.move(e.x+h[3]<g?-h[3]:e.x-h[1]>j.width-i.width-g?j.width-i.width+(f.lang.dir=="rtl"?0:h[1]):e.x,e.y+h[0]<g?-h[0]:e.y-h[2]>j.height-i.height-g?j.height-i.height+h[2]:e.y,1);c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=s.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var d=null,e=null;a.getElement().getFirst();var f=
a.getParentEditor(),g=f.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];typeof g=="undefined"&&(g=20);a.parts.title.on("mousedown",function(f){d={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);e=a.getPosition();if(CKEDITOR.env.ie6Compat){var g=s.getChild(0).getFrameDocument();g.on("mousemove",b);g.on("mouseup",c)}f.data.preventDefault()},a)}function k(a){var b,c;function d(e){var r=h.lang.dir=="rtl",q=n.width,l=n.height,
m=q+(e.data.$.screenX-b)*(r?-1:1)*(a._.moved?1:2),u=l+(e.data.$.screenY-c)*(a._.moved?1:2),p=a._.element.getFirst(),p=r&&p.getComputedStyle("right"),t=a.getPosition();t.y+u>k.height&&(u=k.height-t.y);if((r?p:t.x)+m>k.width)m=k.width-(r?p:t.x);if(g==CKEDITOR.DIALOG_RESIZE_WIDTH||g==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(f.minWidth||0,m-i);if(g==CKEDITOR.DIALOG_RESIZE_HEIGHT||g==CKEDITOR.DIALOG_RESIZE_BOTH)l=Math.max(f.minHeight||0,u-j);a.resize(q,l);a._.moved||a.layout();e.data.preventDefault()}function e(){CKEDITOR.document.removeListener("mouseup",
e);CKEDITOR.document.removeListener("mousemove",d);if(r){r.remove();r=null}if(CKEDITOR.env.ie6Compat){var a=s.getChild(0).getFrameDocument();a.removeListener("mouseup",e);a.removeListener("mousemove",d)}}var f=a.definition,g=f.resizable;if(g!=CKEDITOR.DIALOG_RESIZE_NONE){var h=a.getParentEditor(),i,j,k,n,r,q=CKEDITOR.tools.addFunction(function(f){n=a.getSize();var g=a.parts.contents;if(g.$.getElementsByTagName("iframe").length){r=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>');
g.append(r)}j=n.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));i=n.width-a.parts.contents.getSize("width",1);b=f.screenX;c=f.screenY;k=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",d);CKEDITOR.document.on("mouseup",e);if(CKEDITOR.env.ie6Compat){g=s.getChild(0).getFrameDocument();g.on("mousemove",d);g.on("mouseup",e)}f.preventDefault&&f.preventDefault()});a.on("load",function(){var b="";g==CKEDITOR.DIALOG_RESIZE_WIDTH?
b=" cke_resizer_horizontal":g==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+b+" cke_resizer_"+h.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(h.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+q+', event )">'+(h.lang.dir=="ltr"?"◢":"◣")+"</div>");a.parts.footer.append(b,1)});h.on("destroy",function(){CKEDITOR.tools.removeFunction(q)})}}function m(a){a.data.preventDefault(1)}function o(a){var b=CKEDITOR.document.getWindow(),
c=a.config,d=c.dialog_backgroundCoverColor||"white",e=c.dialog_backgroundCoverOpacity,f=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(d,e,f),g=w[c];if(g)g.show();else{f=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",f,"; top: 0px; left: 0px; ",!CKEDITOR.env.ie6Compat?"background-color: "+d:"",'" class="cke_dialog_background_cover">'];if(CKEDITOR.env.ie6Compat){d="<html><body style=\\'background-color:"+d+";\\'></body></html>";f.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');
f.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+d+"' );document.close();")+"})())");f.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')}f.push("</div>");g=CKEDITOR.dom.element.createFromHtml(f.join(""));g.setOpacity(e!=void 0?e:0.5);g.on("keydown",m);g.on("keypress",m);g.on("keyup",m);g.appendTo(CKEDITOR.document.getBody());w[c]=g}a.focusManager.add(g);
s=g;var a=function(){var a=b.getViewPaneSize();g.setStyles({width:a.width+"px",height:a.height+"px"})},h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;g.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do{a=c.getPosition();c.move(a.x,a.y)}while(c=c._.parentDialog)}};x=a;b.on("resize",a);a();(!CKEDITOR.env.mac||!CKEDITOR.env.webkit)&&g.focus();if(CKEDITOR.env.ie6Compat){var i=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){i.prevScrollHandler=
window.onscroll||function(){};window.onscroll=i},0);h()}}function p(a){if(s){a.focusManager.remove(s);a=CKEDITOR.document.getWindow();s.hide();a.removeListener("resize",x);CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0);x=null}}var n=CKEDITOR.tools.cssLength,l='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+
CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
CKEDITOR.dialog=function(c,d){function h(){var a=s._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function i(a){var b=s._.focusList,a=a||0;if(!(b.length<1)){var c=s._.currentFocusIndex;try{b[c].getInputElement().$.blur()}catch(d){}for(var e=c=(c+a+b.length)%b.length;a&&!b[e].isFocusable();){e=(e+a+b.length)%b.length;if(e==c)break}b[e].focus();b[e].type=="text"&&b[e].select()}}function n(b){if(s==
CKEDITOR.dialog._.currentTop){var d=b.data.getKeystroke(),e=c.lang.dir=="rtl";o=x=0;if(d==9||d==CKEDITOR.SHIFT+9){d=d==CKEDITOR.SHIFT+9;if(s._.tabBarMode){d=d?a.call(s):f.call(s);s.selectPage(d);s._.tabs[d][0].focus()}else i(d?-1:1);o=1}else if(d==CKEDITOR.ALT+121&&!s._.tabBarMode&&s.getPageCount()>1){s._.tabBarMode=true;s._.tabs[s._.currentTabId][0].focus();o=1}else if((d==37||d==39)&&s._.tabBarMode){d=d==(e?39:37)?a.call(s):f.call(s);s.selectPage(d);s._.tabs[d][0].focus();o=1}else if((d==13||d==
32)&&s._.tabBarMode){this.selectPage(this._.currentTabId);this._.tabBarMode=false;this._.currentFocusIndex=-1;i(1);o=1}else if(d==13){d=b.data.getTarget();if(!d.is("a","button","select","textarea")&&(!d.is("input")||d.$.type!="button")){(d=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(d.click,0,d);o=1}x=1}else if(d==27){(d=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(d.click,0,d):this.fire("cancel",{hide:true}).hide!==false&&this.hide();x=1}else return;r(b)}}function r(a){o?a.data.preventDefault(1):
x&&a.data.stopPropagation()}var l=CKEDITOR.dialog._.dialogDefinitions[d],m=CKEDITOR.tools.clone(q),u=c.config.dialog_buttonsOrder||"OS",p=c.lang.dir,t={},o,x;(u=="OS"&&CKEDITOR.env.mac||u=="rtl"&&p=="ltr"||u=="ltr"&&p=="rtl")&&m.buttons.reverse();l=CKEDITOR.tools.extend(l(c),m);l=CKEDITOR.tools.clone(l);l=new v(this,l);m=g(c);this._={editor:c,element:m.element,name:d,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,
currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=m.parts;CKEDITOR.tools.setTimeout(function(){c.fire("ariaWidget",this.parts.contents)},0,this);m={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"};m[p=="rtl"?"right":"left"]=0;this.parts.dialog.setStyles(m);CKEDITOR.event.call(this);this.definition=l=CKEDITOR.fire("dialogDefinition",{name:d,definition:l},c).definition;if(!("removeDialogTabs"in c._)&&
c.config.removeDialogTabs){m=c.config.removeDialogTabs.split(";");for(p=0;p<m.length;p++){u=m[p].split(":");if(u.length==2){var w=u[0];t[w]||(t[w]=[]);t[w].push(u[1])}}c._.removeDialogTabs=t}if(c._.removeDialogTabs&&(t=c._.removeDialogTabs[d]))for(p=0;p<t.length;p++)l.removeContents(t[p]);if(l.onLoad)this.on("load",l.onLoad);if(l.onShow)this.on("show",l.onShow);if(l.onHide)this.on("hide",l.onHide);if(l.onOk)this.on("ok",function(a){c.fire("saveSnapshot");setTimeout(function(){c.fire("saveSnapshot")},
0);if(l.onOk.call(this,a)===false)a.data.hide=false});if(l.onCancel)this.on("cancel",function(a){if(l.onCancel.call(this,a)===false)a.data.hide=false});var s=this,z=function(a){var b=s._.contents,c=false,d;for(d in b)for(var e in b[d])if(c=a.call(this,b[d][e]))return};this.on("ok",function(a){z(function(b){if(b.validate){var c=b.validate(this),d=typeof c=="string"||c===false;if(d){a.data.hide=false;a.stop()}e.call(b,!d,typeof c=="string"?c:void 0);return d}})},this,null,0);this.on("cancel",function(a){z(function(b){if(b.isChanged()){if(!c.config.dialog_noConfirmCancel&&
!confirm(c.lang.common.confirmCancel))a.data.hide=false;return true}})},this,null,0);this.parts.close.on("click",function(a){this.fire("cancel",{hide:true}).hide!==false&&this.hide();a.data.preventDefault()},this);this.changeFocus=i;var y=this._.element;c.focusManager.add(y,1);this.on("show",function(){y.on("keydown",n,this);if(CKEDITOR.env.gecko)y.on("keypress",r,this)});this.on("hide",function(){y.removeListener("keydown",n);CKEDITOR.env.gecko&&y.removeListener("keypress",r);z(function(a){b.apply(a)})});
this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",n,this,null,0)});this.on("show",function(){h();if(c.config.dialog_startupFocusTab&&s._.pageCount>1){s._.tabBarMode=true;s._.tabs[s._.currentTabId][0].focus()}else if(!this._.hasFocus){this._.currentFocusIndex=-1;if(l.onFocus){var a=l.onFocus.call(this);a&&a.focus()}else i(1)}},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();
b.remove();b.appendTo(a)},this);j(this);k(this);(new CKEDITOR.dom.text(l.title,CKEDITOR.document)).appendTo(this.parts.title);for(p=0;p<l.contents.length;p++)(t=l.contents[p])&&this.addPage(t);this.parts.tabs.on("click",function(a){var b=a.data.getTarget();if(b.hasClass("cke_dialog_tab")){b=b.$.id;this.selectPage(b.substring(4,b.lastIndexOf("_")));if(this._.tabBarMode){this._.tabBarMode=false;this._.currentFocusIndex=-1;i(1)}a.data.preventDefault()}},this);p=[];t=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,
{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:l.buttons},p).getChild();this.parts.footer.setHtml(p.join(""));for(p=0;p<t.length;p++)this._.buttons[t[p].id]=t[p]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(){return function(a,b){if(!this._.contentSize||!(this._.contentSize.width==a&&this._.contentSize.height==b)){CKEDITOR.dialog.fire("resize",{dialog:this,width:a,height:b},this._.editor);this.fire("resize",{width:a,height:b},
this._.editor);this.parts.contents.setStyles({width:a+"px",height:b+"px"});if(this._.editor.lang.dir=="rtl"&&this._.position)this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10);this._.contentSize={width:a,height:b}}}}(),getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||0}},move:function(a,b,c){var d=this._.element.getFirst(),e=this._.editor.lang.dir==
"rtl",f=d.getComputedStyle("position")=="fixed";CKEDITOR.env.ie&&d.setStyle("zoom","100%");if(!f||!this._.position||!(this._.position.x==a&&this._.position.y==b)){this._.position={x:a,y:b};if(!f){f=CKEDITOR.document.getWindow().getScrollPosition();a=a+f.x;b=b+f.y}if(e){f=this.getSize();a=CKEDITOR.document.getWindow().getViewPaneSize().width-f.width-a}b={top:(b>0?b:0)+"px"};b[e?"right":"left"]=(a>0?a:0)+"px";d.setStyles(b);c&&(this._.moved=1)}},getPosition:function(){return CKEDITOR.tools.extend({},
this._.position)},show:function(){var a=this._.element,b=this.definition;!a.getParent()||!a.getParent().equals(CKEDITOR.document.getBody())?a.appendTo(CKEDITOR.document.getBody()):a.setStyle("display","block");this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(CKEDITOR.dialog._.currentZIndex===null)CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;
this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex+10);if(CKEDITOR.dialog._.currentTop===null){CKEDITOR.dialog._.currentTop=this;this._.parentDialog=null;o(this._.editor)}else{this._.parentDialog=CKEDITOR.dialog._.currentTop;this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);CKEDITOR.dialog._.currentTop=this}a.on("keydown",z);a.on("keyup",B);this._.hasFocus=false;for(var c in b.contents)if(b.contents[c]){var a=
b.contents[c],e=this._.tabs[a.id],f=a.requiredContent,g=0;if(e){for(var h in this._.contents[a.id]){var i=this._.contents[a.id][h];if(!(i.type=="hbox"||i.type=="vbox"||!i.getInputElement()))if(i.requiredContent&&!this._.editor.activeFilter.check(i.requiredContent))i.disable();else{i.enable();g++}}!g||f&&!this._.editor.activeFilter.check(f)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();d(this);this.parts.dialog.setStyle("visibility",
"");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),d=(c.width-b.width)/2,e=(c.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(e>0?e:0)>c.height||b.width+(d>0?d:0)>c.width?a.setStyle("position",
"absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:d,this._.moved?this._.position.y:e)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&
this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(F(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();
b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else p(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex-10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",z);a.removeListener("keyup",B);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&
a.resetInitValue()})}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title="'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},f=d.getChild(),g=0;d=f.shift();){!d.notAllowed&&(d.type!="hbox"&&d.type!="vbox")&&g++;e[d.id]=
d;typeof d.getChild=="function"&&f.push.apply(f,d.getChild())}if(!g)a.hidden=true;b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");d=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',this._.pageCount>0?" cke_last":"cke_first",c,a.hidden?' style="display:none"':"",' id="',e,'"',d.gecko&&!d.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',a.label,"</a>"].join(""));
b.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[c,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);if(a.accessKey){A(this,this,"CTRL+"+a.accessKey,I,C);this._.accessKeyMap["CTRL+"+a.accessKey]=a.id}}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&this.fire("selectPage",{page:a,currentPage:this._.currentTabId})!==
false){for(var b in this._.tabs){var d=this._.tabs[b][0],e=this._.tabs[b][1];if(b!=a){d.removeClass("cke_dialog_tab_selected");e.hide()}e.setAttribute("aria-hidden",b!=a)}var f=this._.tabs[a];f[0].addClass("cke_dialog_tab_selected");if(CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat){c(f[1]);f[1].show();setTimeout(function(){c(f[1],1)},0)}else f[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(this._.pageCount===
1?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(b){var c=this._.tabs[b]&&this._.tabs[b][0];if(c&&this._.pageCount!=1&&c.isVisible()){b==this._.currentTabId&&this.selectPage(a.call(this));c.hide();this._.pageCount--;this.updateStyle()}},showPage:function(a){if(a=this._.tabs[a]&&this._.tabs[a][0]){a.show();this._.pageCount++;this.updateStyle()}},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var c=this._.contents[a];
return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},
addFocusable:function(a,b){if(typeof b=="undefined"){b=this._.focusList.length;this._.focusList.push(new i(this,a,b))}else{this._.focusList.splice(b,0,new i(this,a,b));for(var c=b+1;c<this._.focusList.length;c++)this._.focusList[c].focusIndex++}}};CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(a,b){if(!this._.dialogDefinitions[a]||typeof b=="function")this._.dialogDefinitions[a]=b},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},
isTabEnabled:function(a,b,c){a=a.config.removeDialogTabs;return!(a&&a.match(RegExp("(?:^|;)"+b+":"+c+"(?:$|;)","i")))},okButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;a.fire("ok",{hide:true}).hide!==false&&a.hide()}},b,true)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},true)};return a}(),
cancelButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;a.fire("cancel",{hide:true}).hide!==false&&a.hide()}},b,true)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},true)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},
dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var q={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},r=function(a,b,c){for(var d=0,e;e=a[d];d++){if(e.id==b)return e;if(c&&e[c])if(e=r(e[c],b,c))return e}return null},u=function(a,b,c,d,e){if(c){for(var f=0,g;g=a[f];f++){if(g.id==c){a.splice(f,0,b);return b}if(d&&
g[d])if(g=u(g[d],b,c,d,true))return g}if(e)return null}a.push(b);return b},t=function(a,b,c){for(var d=0,e;e=a[d];d++){if(e.id==b)return a.splice(d,1);if(c&&e[c])if(e=t(e[c],b,c))return e}return null},v=function(a,b){this.dialog=a;for(var c=b.contents,d=0,e;e=c[d];d++)c[d]=e&&new h(a,e);CKEDITOR.tools.extend(this,b)};v.prototype={getContents:function(a){return r(this.contents,a)},getButton:function(a){return r(this.buttons,a)},addContents:function(a,b){return u(this.contents,a,b)},addButton:function(a,
b){return u(this.buttons,a,b)},removeContents:function(a){t(this.contents,a)},removeButton:function(a){t(this.buttons,a)}};h.prototype={get:function(a){return r(this.elements,a,"children")},add:function(a,b){return u(this.elements,a,b,"children")},remove:function(a){t(this.elements,a,"children")}};var x,w={},s,y={},z=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);if((b=y[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+
e])&&b.length){b=b[b.length-1];b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key);a.data.preventDefault()}},B=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);if((b=y[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+e])&&b.length){b=b[b.length-1];if(b.keyup){b.keyup.call(b.uiElement,b.dialog,b.key);a.data.preventDefault()}}},A=function(a,b,c,d,e){(y[c]||(y[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:e||a.accessKeyUp,
keydown:d||a.accessKeyDown})},F=function(a){for(var b in y){for(var c=y[b],d=c.length-1;d>=0;d--)(c[d].dialog==a||c[d].uiElement==a)&&c.splice(d,1);c.length===0&&delete y[b]}},C=function(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])},I=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,d,e,f,g){if(!(arguments.length<4)){var h=(d.call?d(b):d)||"div",i=["<",h," "],j=(e&&e.call?e(b):e)||{},k=(f&&f.call?f(b):f)||{},n=(g&&g.call?g.call(this,a,b):g)||"",r=this.domId=k.id||
CKEDITOR.tools.getNextId()+"_uiElement";this.id=b.id;if(b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)){j.display="none";this.notAllowed=true}k.id=r;var q={};b.type&&(q["cke_dialog_ui_"+b.type]=1);b.className&&(q[b.className]=1);b.disabled&&(q.cke_disabled=1);for(var l=k["class"]&&k["class"].split?k["class"].split(" "):[],r=0;r<l.length;r++)l[r]&&(q[l[r]]=1);l=[];for(r in q)l.push(r);k["class"]=l.join(" ");if(b.title)k.title=b.title;q=(b.style||"").split(";");if(b.align){l=
b.align;j["margin-left"]=l=="left"?0:"auto";j["margin-right"]=l=="right"?0:"auto"}for(r in j)q.push(r+":"+j[r]);b.hidden&&q.push("display:none");for(r=q.length-1;r>=0;r--)q[r]===""&&q.splice(r,1);if(q.length>0)k.style=(k.style?k.style+"; ":"")+q.join("; ");for(r in k)i.push(r+'="'+CKEDITOR.tools.htmlEncode(k[r])+'" ');i.push(">",n,"</",h,">");c.push(i.join(""));(this._||(this._={})).dialog=a;if(typeof b.isChanged=="boolean")this.isChanged=function(){return b.isChanged};if(typeof b.isChanged=="function")this.isChanged=
b.isChanged;if(typeof b.setValue=="function")this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}});if(typeof b.getValue=="function")this.getValue=CKEDITOR.tools.override(this.getValue,function(a){return function(){return b.getValue.call(this,a.call(this))}});CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&(this.accessKeyDown&&b.accessKey)&&A(this,a,"CTRL+"+b.accessKey);var m=this;a.on("load",function(){var b=
m.getInputElement();if(b){var c=m.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=false;a._.hasFocus=true;m.fire("focus");c&&this.addClass(c)});b.on("blur",function(){m.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);if(this.keyboardFocusable){this.tabIndex=b.tabIndex||0;this.focusIndex=a._.focusList.push(this)-1;this.on("focus",function(){a._.currentFocusIndex=m.focusIndex})}}},hbox:function(a,
b,c,d,e){if(!(arguments.length<4)){this._||(this._={});var f=this._.children=b,g=e&&e.widths||null,h=e&&e.height||null,i,j={role:"presentation"};e&&e.align&&(j.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},j,function(){var a=['<tbody><tr class="cke_dialog_ui_hbox">'];for(i=0;i<c.length;i++){var b="cke_dialog_ui_hbox_child",d=[];i===0&&(b="cke_dialog_ui_hbox_first");i==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('<td class="',b,'" role="presentation" ');
g?g[i]&&d.push("width:"+n(g[i])):d.push("width:"+Math.floor(100/c.length)+"%");h&&d.push("height:"+n(h));e&&e.padding!=void 0&&d.push("padding:"+n(e.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&f[i].align)&&d.push("text-align:"+f[i].align);d.length>0&&a.push('style="'+d.join("; ")+'" ');a.push(">",c[i],"</td>")}a.push("</tr></tbody>");return a.join("")})}},vbox:function(a,b,c,d,e){if(!(arguments.length<3)){this._||(this._={});var f=this._.children=b,g=e&&e.width||null,h=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,
a,e||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var b=['<table role="presentation" cellspacing="0" border="0" '];b.push('style="');e&&e.expand&&b.push("height:100%;");b.push("width:"+n(g||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align="',CKEDITOR.tools.htmlEncode(e&&e.align||(a.getParentEditor().lang.dir=="ltr"?"left":"right")),'" ');b.push("><tbody>");for(var d=0;d<c.length;d++){var i=[];b.push('<tr><td role="presentation" ');g&&i.push("width:"+
n(g||"100%"));h?i.push("height:"+n(h[d])):e&&e.expand&&i.push("height:"+Math.floor(100/c.length)+"%");e&&e.padding!=void 0&&i.push("padding:"+n(e.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&f[d].align)&&i.push("text-align:"+f[d].align);i.length>0&&b.push('style="',i.join("; "),'" ');b.push(' class="cke_dialog_ui_vbox_child">',c[d],"</td></tr>")}b.push("</tbody></table>");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},
getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return false},selectParentTab:function(){for(var a=this.getInputElement();(a=a.getParent())&&a.$.className.search("cke_dialog_page_contents")==-1;);if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=
a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,d=function(a,b,c,d){b.on("load",function(){a.getInputElement().on(c,d,a)})},e;for(e in a)if(c=e.match(b))this.eventProcessors[e]?this.eventProcessors[e].call(this,this._.dialog,a[e]):d(this,this._.dialog,c[1].toLowerCase(),a[e]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",
b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled");a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},
isFocusable:function(){return!this.isEnabled()||!this.isVisible()?false:true}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(a){if(arguments.length<1)return this._.children.concat();a.splice||(a=[a]);return a.length<2?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},true);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a=
{build:function(a,b,c){for(var d=b.children,e,f=[],g=[],h=0;h<d.length&&(e=d[h]);h++){var i=[];f.push(i);g.push(CKEDITOR.dialog._.uiElementBuilders[e.type].build(a,e,i))}return new CKEDITOR.ui.dialog[b.type](a,g,f,c,b)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;CKEDITOR.tools.extend(this,b,true)};CKEDITOR.dialogCommand.prototype={exec:function(a){a.openDialog(this.dialogName)},canUndo:false,editorFocus:1};
(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,c=/^\d*(?:\.\d+)?$/,d=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,f=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():a[0],c=void 0,d=CKEDITOR.VALIDATE_AND,e=[],f;for(f=0;f<a.length;f++)if(typeof a[f]=="function")e.push(a[f]);else break;if(f<a.length&&
typeof a[f]=="string"){c=a[f];f++}f<a.length&&typeof a[f]=="number"&&(d=a[f]);var g=d==CKEDITOR.VALIDATE_AND?true:false;for(f=0;f<e.length;f++)g=d==CKEDITOR.VALIDATE_AND?g&&e[f](b):g||e[f](b);return!g?c:true}},regex:function(a,b){return function(c){c=this&&this.getValue?this.getValue():c;return!a.test(c)?b:true}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,a)},number:function(a){return this.regex(c,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},
a)},htmlLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return f.test(CKEDITOR.tools.trim(a))},a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var c in w)w[c].remove();
w={}}var a=a.editor._.storedDialogs,d;for(d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b){var c=null,d=CKEDITOR.dialog._.dialogDefinitions[a];CKEDITOR.dialog._.currentTop===null&&o(this);if(typeof d=="function"){c=this._.storedDialogs||(this._.storedDialogs={});c=c[a]||(c[a]=new CKEDITOR.dialog(this,a));b&&b.call(c,c);c.show()}else{if(d=="failed"){p(this);throw Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');
}typeof d=="string"&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d),function(){typeof CKEDITOR.dialog._.dialogDefinitions[a]!="function"&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");this.openDialog(a,b)},this,0,1)}CKEDITOR.skin.loadPart("dialog");return c}})}(),CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(a){a.on("doubleclick",function(f){f.data.dialog&&a.openDialog(f.data.dialog)},null,null,999)}}),CKEDITOR.plugins.add("iframedialog",{requires:"dialog",onLoad:function(){CKEDITOR.dialog.addIframe=
function(a,f,c,e,b,g,i){c={type:"iframe",src:c,width:"100%",height:"100%"};c.onContentLoad=typeof g=="function"?g:function(){var a=this.getElement().$.contentWindow;if(a.onDialogEvent){var b=this.getDialog(),c=function(b){return a.onDialogEvent(b)};b.on("ok",c);b.on("cancel",c);b.on("resize",c);b.on("hide",function(a){b.removeListener("ok",c);b.removeListener("cancel",c);b.removeListener("resize",c);a.removeListener()});a.onDialogEvent({name:"load",sender:this,editor:b._.editor})}};var d={title:f,
minWidth:e,minHeight:b,contents:[{id:"iframe",label:f,expand:true,elements:[c],style:"width:"+c.width+";height:"+c.height}]},h;for(h in i)d[h]=i[h];this.add(a,function(){return d})};(function(){var a=function(a,c,e){if(!(arguments.length<3)){var b=this._||(this._={}),g=c.onContentLoad&&CKEDITOR.tools.bind(c.onContentLoad,this),i=CKEDITOR.tools.cssLength(c.width),d=CKEDITOR.tools.cssLength(c.height);b.frameId=CKEDITOR.tools.getNextId()+"_iframe";a.on("load",function(){CKEDITOR.document.getById(b.frameId).getParent().setStyles({width:i,
height:d})});var h={src:"%2",id:b.frameId,frameborder:0,allowtransparency:true},j=[];if(typeof c.onContentLoad=="function")h.onload="CKEDITOR.tools.callFunction(%1);";CKEDITOR.ui.dialog.uiElement.call(this,a,c,j,"iframe",{width:i,height:d},h,"");e.push('<div style="width:'+i+";height:"+d+';" id="'+this.domId+'"></div>');j=j.join("");a.on("show",function(){var a=CKEDITOR.document.getById(b.frameId).getParent(),d=CKEDITOR.tools.addFunction(g),d=j.replace("%1",d).replace("%2",CKEDITOR.tools.htmlEncode(c.src));
a.setHtml(d)})}};a.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.dialog.addUIElement("iframe",{build:function(f,c,e){return new a(f,c,e)}})})()}}),CKEDITOR.plugins.add("xplanemailsyntax",{requires:["iframedialog"],init:function(a){a.addCommand("xplanEmailSyntaxCmd",new CKEDITOR.dialogCommand("xplanEmailSyntaxDialog"));a.ui.addButton("XplanEmailSyntax",{label:"Xplan Email Syntax",command:"xplanEmailSyntaxCmd",icon:CKEDITOR.basePath+"../../../img/ckeditor/icon_xplanemailsyntax.png"});CKEDITOR.dialog.addIframe("xplanEmailSyntaxDialog",
"Insert Xplan Template Syntax",CKEDITOR.basePath+"../../../email/syntax_popup?syntaxtype=email",400,200)}}),CKEDITOR.plugins.add("xplansyntax",{requires:["iframedialog"],init:function(a){a.addCommand("xplanSyntaxCmd",new CKEDITOR.dialogCommand("xplanEmailSyntaxDialog"));a.ui.addButton("XplanSyntax",{label:"Xplan Syntax",command:"xplanSyntaxCmd",icon:CKEDITOR.basePath+"../../../img/ckeditor/icon_xplansyntax.png"});CKEDITOR.dialog.addIframe("xplanSyntaxDialog","Insert Xplan Template Syntax",CKEDITOR.basePath+
"../../../email/syntax_popup",400,200)}}),function(){CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(a){var f=this;a.addCommand("a11yHelp",{exec:function(){var c=
a.langCode,c=f.availableLangs[c]?c:f.availableLangs[c.replace(/-.*/,"")]?c.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path+"dialogs/lang/"+c+".js"),function(){a.lang.a11yhelp=f.langEntries[c];a.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:false});a.setKeystroke(CKEDITOR.ALT+48,"a11yHelp");CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js");a.on("ariaEditorHelpLabel",function(c){c.data.label=a.lang.common.editorHelp})}})}(),CKEDITOR.plugins.add("about",
{requires:"dialog",init:function(a){var f=a.addCommand("about",new CKEDITOR.dialogCommand("about"));f.modes={wysiwyg:1,source:1};f.canUndo=false;f.readOnly=1;a.ui.addButton&&a.ui.addButton("About",{label:a.lang.about.title,command:"about",toolbar:"about"});CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}}),CKEDITOR.plugins.add("basicstyles",{init:function(a){var f=0,c=function(b,c,g,j){if(j){var j=new CKEDITOR.style(j),k=e[g];k.unshift(j);a.attachStyleStateChange(j,function(b){!a.readOnly&&
a.getCommand(g).setState(b)});a.addCommand(g,new CKEDITOR.styleCommand(j,{contentForms:k}));a.ui.addButton&&a.ui.addButton(b,{label:c,command:g,toolbar:"basicstyles,"+(f=f+10)})}},e={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return a=="bold"||+a>=700}]],italic:["em","i",["span",function(a){return a.styles["font-style"]=="italic"}]],underline:["u",["span",function(a){return a.styles["text-decoration"]=="underline"}]],strike:["s","strike",["span",function(a){return a.styles["text-decoration"]==
"line-through"}]],subscript:["sub"],superscript:["sup"]},b=a.config,g=a.lang.basicstyles;c("Bold",g.bold,"bold",b.coreStyles_bold);c("Italic",g.italic,"italic",b.coreStyles_italic);c("Underline",g.underline,"underline",b.coreStyles_underline);c("Strike",g.strike,"strike",b.coreStyles_strike);c("Subscript",g.subscript,"subscript",b.coreStyles_subscript);c("Superscript",g.superscript,"superscript",b.coreStyles_superscript);a.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+
85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"},function(){function a(a,b,c,d){if(!a.isReadOnly()&&!a.equals(c.editable())){CKEDITOR.dom.element.setMarker(d,a,"bidi_processed",
1);for(var d=a,e=c.editable();(d=d.getParent())&&!d.equals(e);)if(d.getCustomData("bidi_processed")){a.removeStyle("direction");a.removeAttribute("dir");return}d="useComputedState"in c.config?c.config.useComputedState:1;if((d?a.getComputedStyle("direction"):a.getStyle("direction")||a.hasAttribute("dir"))!=b){a.removeStyle("direction");if(d){a.removeAttribute("dir");b!=a.getComputedStyle("direction")&&a.setAttribute("dir",b)}else a.setAttribute("dir",b);c.forceNextSelectionCheck()}}}function f(a,b,
c){var d=a.getCommonAncestor(false,true),a=a.clone();a.enlarge(c==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(a.checkBoundaryOfElement(d,CKEDITOR.START)&&a.checkBoundaryOfElement(d,CKEDITOR.END)){for(var e;d&&d.type==CKEDITOR.NODE_ELEMENT&&(e=d.getParent())&&e.getChildCount()==1&&!(d.getName()in b);)d=e;return d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in b&&d}}function c(c){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:true,
attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var c=a.config.useComputedState,d,c=c===void 0||c;if(!c){d=b.lastElement;for(var e=a.editable();d&&!(d.getName()in i||d.equals(e));){var f=d.getParent();if(!f)break;d=f}}d=d||b.block||b.blockLimit;if(d.equals(a.editable()))(e=a.getSelection().getRanges()[0].getEnclosedNode())&&e.type==CKEDITOR.NODE_ELEMENT&&(d=e);if(d){c=c?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir");a.getCommand("bidirtl").setState(c==
"rtl"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);a.getCommand("bidiltr").setState(c=="ltr"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}c=(b.block||b.blockLimit||a.editable()).getDirection(1);if(c!=(a._.selDir||a.lang.dir)){a._.selDir=c;a.fire("contentDirChanged",c)}},exec:function(d){var e=d.getSelection(),h=d.config.enterMode,i=e.getRanges();if(i&&i.length){for(var j={},q=e.createBookmarks(),i=i.createIterator(),r,u=0;r=i.getNextRange(1);){var t=r.getEnclosedNode();if(!t||t&&!(t.type==CKEDITOR.NODE_ELEMENT&&
t.getName()in g))t=f(r,b,h);t&&a(t,c,d,j);var v=new CKEDITOR.dom.walker(r),x=q[u].startNode,w=q[u++].endNode;v.evaluator=function(a){return!!(a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in b&&!(a.getName()==(h==CKEDITOR.ENTER_P?"p":"div")&&a.getParent().type==CKEDITOR.NODE_ELEMENT&&a.getParent().getName()=="blockquote")&&a.getPosition(x)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(w)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;t=v.next();)a(t,c,d,j);r=
r.createIterator();for(r.enlargeBr=h!=CKEDITOR.ENTER_BR;t=r.getNextParagraph(h==CKEDITOR.ENTER_P?"p":"div");)a(t,c,d,j)}CKEDITOR.dom.element.clearAllMarkers(j);d.forceNextSelectionCheck();e.selectBookmarks(q);d.focus()}}}}function e(a){var b=a==d.setAttribute,c=a==d.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;return function(d,f){if(!this.isReadOnly()){var g;if(g=d==(b||c?"dir":"direction")||d=="style"&&(c||e.test(f))){a:{g=this;for(var h=g.getDocument().getBody().getParent();g;){if(g.equals(h)){g=
false;break a}g=g.getParent()}g=true}g=!g}if(g){g=this.getDirection(1);h=a.apply(this,arguments);if(g!=this.getDirection(1)){this.getDocument().fire("dirChanged",this);return h}}}return a.apply(this,arguments)}}var b={table:1,ul:1,ol:1,blockquote:1,div:1},g={},i={};CKEDITOR.tools.extend(g,b,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(i,g,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function b(c,d,e,f,g){a.addCommand(e,new CKEDITOR.command(a,f));a.ui.addButton&&a.ui.addButton(c,{label:d,
command:e,toolbar:"bidi,"+g})}if(!a.blockless){var d=a.lang.bidi;b("BidiLtr",d.ltr,"bidiltr",c("ltr"),10);b("BidiRtl",d.rtl,"bidirtl",c("rtl"),20);a.on("contentDom",function(){a.document.on("dirChanged",function(b){a.fire("dirChanged",{node:b.data,dir:b.data.getDirection(1)})})});a.on("contentDirChanged",function(b){var b=(a.lang.dir!=b.data?"add":"remove")+"Class",c=a.ui.space(a.config.toolbarLocation);if(c)c[b]("cke_mixed_dir_content")})}}});for(var d=CKEDITOR.dom.element.prototype,h=["setStyle",
"removeStyle","setAttribute","removeAttribute"],j=0;j<h.length;j++)d[h[j]]=CKEDITOR.tools.override(d[h[j]],e)}(),function(){var a={exec:function(a){var c=a.getCommand("blockquote").state,e=a.getSelection(),b=e&&e.getRanges()[0];if(b){var g=e.createBookmarks();if(CKEDITOR.env.ie){var i=g[0].startNode,d=g[0].endNode,h;if(i&&i.getParent().getName()=="blockquote")for(h=i;h=h.getNext();)if(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary()){i.move(h,true);break}if(d&&d.getParent().getName()=="blockquote")for(h=
d;h=h.getPrevious();)if(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary()){d.move(h);break}}var j=b.createIterator();j.enlargeBr=a.config.enterMode!=CKEDITOR.ENTER_BR;if(c==CKEDITOR.TRISTATE_OFF){for(i=[];c=j.getNextParagraph();)i.push(c);if(i.length<1){c=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div");d=g.shift();b.insertNode(c);c.append(new CKEDITOR.dom.text("﻿",a.document));b.moveToBookmark(d);b.selectNodeContents(c);b.collapse(true);d=b.createBookmark();i.push(c);g.unshift(d)}h=
i[0].getParent();b=[];for(d=0;d<i.length;d++){c=i[d];h=h.getCommonAncestor(c.getParent())}for(c={table:1,tbody:1,tr:1,ol:1,ul:1};c[h.getName()];)h=h.getParent();for(d=null;i.length>0;){for(c=i.shift();!c.getParent().equals(h);)c=c.getParent();c.equals(d)||b.push(c);d=c}for(;b.length>0;){c=b.shift();if(c.getName()=="blockquote"){for(d=new CKEDITOR.dom.documentFragment(a.document);c.getFirst();){d.append(c.getFirst().remove());i.push(d.getLast())}d.replace(c)}else i.push(c)}b=a.document.createElement("blockquote");
for(b.insertBefore(i[0]);i.length>0;){c=i.shift();b.append(c)}}else if(c==CKEDITOR.TRISTATE_ON){d=[];for(h={};c=j.getNextParagraph();){for(i=b=null;c.getParent();){if(c.getParent().getName()=="blockquote"){b=c.getParent();i=c;break}c=c.getParent()}if(b&&i&&!i.getCustomData("blockquote_moveout")){d.push(i);CKEDITOR.dom.element.setMarker(h,i,"blockquote_moveout",true)}}CKEDITOR.dom.element.clearAllMarkers(h);c=[];i=[];for(h={};d.length>0;){j=d.shift();b=j.getParent();if(j.getPrevious())if(j.getNext()){j.breakParent(j.getParent());
i.push(j.getNext())}else j.remove().insertAfter(b);else j.remove().insertBefore(b);if(!b.getCustomData("blockquote_processed")){i.push(b);CKEDITOR.dom.element.setMarker(h,b,"blockquote_processed",true)}c.push(j)}CKEDITOR.dom.element.clearAllMarkers(h);for(d=i.length-1;d>=0;d--){b=i[d];a:{h=b;for(var j=0,k=h.getChildCount(),m=void 0;j<k&&(m=h.getChild(j));j++)if(m.type==CKEDITOR.NODE_ELEMENT&&m.isBlockBoundary()){h=false;break a}h=true}h&&b.remove()}if(a.config.enterMode==CKEDITOR.ENTER_BR)for(b=true;c.length;){j=
c.shift();if(j.getName()=="div"){d=new CKEDITOR.dom.documentFragment(a.document);b&&(j.getPrevious()&&!(j.getPrevious().type==CKEDITOR.NODE_ELEMENT&&j.getPrevious().isBlockBoundary()))&&d.append(a.document.createElement("br"));for(b=j.getNext()&&!(j.getNext().type==CKEDITOR.NODE_ELEMENT&&j.getNext().isBlockBoundary());j.getFirst();)j.getFirst().remove().appendTo(d);b&&d.append(a.document.createElement("br"));d.replace(j);b=false}}}e.selectBookmarks(g);a.focus()}},refresh:function(a,c){this.setState(a.elementPath(c.block||
c.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(f){if(!f.blockless){f.addCommand("blockquote",a);f.ui.addButton&&f.ui.addButton("Blockquote",{label:f.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"})}}})}(),"use strict",function(){function a(a){function b(){var c=a.editable();c.on(y,function(a){(!CKEDITOR.env.ie||!x)&&
u(a)});CKEDITOR.env.ie&&c.on("paste",function(b){if(!w){f();b.data.preventDefault();u(b);o("paste")||a.openDialog("paste")}});if(CKEDITOR.env.ie){c.on("contextmenu",g,null,null,0);c.on("beforepaste",function(a){a.data&&(!a.data.$.ctrlKey&&!a.data.$.shiftKey)&&g()},null,null,0)}c.on("beforecut",function(){!x&&n(a)});var d;c.attachListener(CKEDITOR.env.ie?c:a.document.getDocumentElement(),"mouseup",function(){d=setTimeout(function(){t()},0)});a.on("destroy",function(){clearTimeout(d)});c.on("keyup",
t)}function c(b){return{type:b,canUndo:b=="cut",startDisabled:true,exec:function(){this.type=="cut"&&n();var b;var c=this.type;if(CKEDITOR.env.ie)b=o(c);else try{b=a.document.$.execCommand(c,false,null)}catch(d){b=false}b||alert(a.lang.clipboard[this.type+"Error"]);return b}}}function e(){return{canUndo:false,async:true,exec:function(a,b){var c=function(b,c){b&&p(b.type,b.dataValue,!!c);a.fire("afterCommandExec",{name:"paste",command:d,returnValue:!!b})},d=this;typeof b=="string"?c({type:"auto",dataValue:b},
1):a.getClipboardData(c)}}}function f(){w=1;setTimeout(function(){w=0},100)}function g(){x=1;setTimeout(function(){x=0},10)}function o(b){var c=a.document,d=c.getBody(),e=false,f=function(){e=true};d.on(b,f);(CKEDITOR.env.version>7?c.$:c.$.selection.createRange()).execCommand(b);d.removeListener(b,f);return e}function p(b,c,d){b={type:b};if(d&&a.fire("beforePaste",b)===false||!c)return false;b.dataValue=c;return a.fire("paste",b)}function n(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var b=a.getSelection(),
c,d,e;if(b.getType()==CKEDITOR.SELECTION_ELEMENT&&(c=b.getSelectedElement())){d=b.getRanges()[0];e=a.document.createText("");e.insertBefore(c);d.setStartBefore(e);d.setEndAfter(c);b.selectRanges([d]);setTimeout(function(){if(c.getParent()){e.remove();b.selectElement(c)}},0)}}}function l(b,c){var d=a.document,e=a.editable(),f=function(a){a.cancel()},g;if(!d.getById("cke_pastebin")){var h=a.getSelection(),j=h.createBookmarks();CKEDITOR.env.ie&&h.root.fire("selectionchange");var k=new CKEDITOR.dom.element((CKEDITOR.env.webkit||
e.is("body"))&&!CKEDITOR.env.ie?"body":"div",d);k.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var r=0,d=d.getWindow();if(CKEDITOR.env.webkit){e.append(k);k.addClass("cke_editable");if(!e.is("body")){r=e.getComputedStyle("position")!="static"?e:CKEDITOR.dom.element.get(e.$.offsetParent);r=r.getDocumentPosition().y}}else e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(k);k.setStyles({position:"absolute",top:d.getScrollPosition().y-r+10+"px",width:"1px",height:Math.max(1,d.getViewPaneSize().height-
20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));if(r=k.getParent().isReadOnly()){k.setOpacity(0);k.setAttribute("contenteditable",true)}else k.setStyle(a.config.contentsLangDirection=="ltr"?"left":"right","-1000px");a.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)g=e.once("blur",f,null,null,-100);r&&k.focus();r=new CKEDITOR.dom.range(k);r.selectNodeContents(k);var n=r.select();CKEDITOR.env.ie&&
(g=e.once("blur",function(){a.lockSelection(n)}));var q=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=q;g&&g.removeListener();CKEDITOR.env.ie&&e.focus();h.selectBookmarks(j);k.remove();var b;if(CKEDITOR.env.webkit&&(b=k.getFirst())&&b.is&&b.hasClass("Apple-style-span"))k=b;a.removeListener("selectionChange",f);c(k.getHtml())},0)}}function q(){if(CKEDITOR.env.ie){a.focus();f();var b=a.focusManager;b.lock();if(a.editable().fire(y)&&
!o("paste")){b.unlock();return false}b.unlock()}else try{if(a.editable().fire(y)&&!a.document.$.execCommand("Paste",false,null))throw 0;}catch(c){return false}return true}function r(b){if(a.mode=="wysiwyg")switch(b.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:b=a.editable();f();!CKEDITOR.env.ie&&b.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:a.fire("saveSnapshot");setTimeout(function(){a.fire("saveSnapshot")},50)}}function u(b){var c={type:"auto"},d=a.fire("beforePaste",
c);l(b,function(a){a=a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");d&&p(c.type,a,0,1)})}function t(){if(a.mode=="wysiwyg"){var b=v("paste");a.getCommand("cut").setState(v("cut"));a.getCommand("copy").setState(v("copy"));a.getCommand("paste").setState(b);a.fire("pasteState",b)}}function v(b){if(s&&b in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if(b=="paste")return CKEDITOR.TRISTATE_OFF;var b=a.getSelection(),c=b.getRanges();return b.getType()==CKEDITOR.SELECTION_NONE||c.length==
1&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var x=0,w=0,s=0,y=CKEDITOR.env.ie?"beforepaste":"paste";(function(){a.on("key",r);a.on("contentDom",b);a.on("selectionChange",function(a){s=a.data.selection.getRanges()[0].checkReadOnly();t()});a.contextMenu&&a.contextMenu.addListener(function(a,b){s=b.getRanges()[0].checkReadOnly();return{cut:v("cut"),copy:v("copy"),paste:v("paste")}})})();(function(){function b(c,d,e,f,g){var h=a.lang.clipboard[d];a.addCommand(d,e);a.ui.addButton&&
a.ui.addButton(c,{label:h,command:d,toolbar:"clipboard,"+f});a.addMenuItems&&a.addMenuItem(d,{label:h,command:d,group:"clipboard",order:g})}b("Cut","cut",c("cut"),10,1);b("Copy","copy",c("copy"),20,4);b("Paste","paste",e(),30,8)})();a.getClipboardData=function(b,c){function d(a){a.removeListener();a.cancel();c(a.data)}function e(a){a.removeListener();a.cancel();j=true;c({type:h,dataValue:a.data})}function f(){this.customTitle=b&&b.title}var g=false,h="auto",j=false;if(!c){c=b;b=null}a.on("paste",
d,null,null,0);a.on("beforePaste",function(a){a.removeListener();g=true;h=a.data.type},null,null,1E3);if(q()===false){a.removeListener("paste",d);if(g&&a.fire("pasteDialog",f)){a.on("pasteDialogCommit",e);a.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",e);setTimeout(function(){j||c(null)},10)})}else c(null)}}}function f(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi)&&
!a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function c(a,b){function c(a){return CKEDITOR.tools.repeat("</p><p>",~~(a/2))+(a%2==1?"<br>":"")}b=b.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;if(CKEDITOR.env.webkit&&b.indexOf("<div>")>-1){b=
b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>");b.match(/<div>(<br>|)<\/div>/)&&(b="<p>"+b.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("</div><div>").length+1)})+"</p>");b=b.replace(/<\/div><div>/g,"<br>");b=b.replace(/<\/?div>/g,"")}if(CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR){CKEDITOR.env.gecko&&(b=b.replace(/^<br><br>$/,"<br>"));b.indexOf("<br><br>")>-1&&(b="<p>"+b.replace(/(<br>){2,}/g,
function(a){return c(a.length/4)})+"</p>")}return g(a,b)}function e(){var a=new CKEDITOR.htmlParser.filter,b={blockquote:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ol:1,p:1,table:1,ul:1},c=CKEDITOR.tools.extend({br:0},CKEDITOR.dtd.$inline),e={p:1,br:1,"cke:br":1},f=CKEDITOR.dtd,g=CKEDITOR.tools.extend({area:1,basefont:1,embed:1,iframe:1,map:1,object:1,param:1},CKEDITOR.dtd.$nonBodyContent,CKEDITOR.dtd.$cdata),o=function(a){delete a.name;a.add(new CKEDITOR.htmlParser.text(" "))},p=function(a){for(var b=
a,c;(b=b.next)&&b.name&&b.name.match(/^h\d$/);){c=new CKEDITOR.htmlParser.element("cke:br");c.isEmpty=true;for(a.add(c);c=b.children.shift();)a.add(c)}};a.addRules({elements:{h1:p,h2:p,h3:p,h4:p,h5:p,h6:p,img:function(a){var a=CKEDITOR.tools.trim(a.attributes.alt||""),b=" ";a&&!a.match(/(^http|\.(jpe?g|gif|png))/i)&&(b=" ["+a+"] ");return new CKEDITOR.htmlParser.text(b)},td:o,th:o,$:function(a){var i=a.name,q;if(g[i])return false;a.attributes={};if(i=="br")return a;if(b[i])a.name="p";else if(c[i])delete a.name;
else if(f[i]){q=new CKEDITOR.htmlParser.element("cke:br");q.isEmpty=true;if(CKEDITOR.dtd.$empty[i])return q;a.add(q,0);q=q.clone();q.isEmpty=true;a.add(q);delete a.name}e[a.name]||delete a.name;return a}}},{applyToAll:true});return a}function b(a,b,c){var b=new CKEDITOR.htmlParser.fragment.fromHtml(b),e=new CKEDITOR.htmlParser.basicWriter;b.writeHtml(e,c);var b=e.getHtml(),b=b.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g,"$1").replace(/(<cke:br \/>){2,}/g,"<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,
"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g,"$1").replace(/<(cke:)?br( \/)?>/g,"<br>").replace(/<p><\/p>/g,""),f=0,b=b.replace(/<\/?p>/g,function(a){if(a=="<p>"){if(++f>1)return"</p><p>"}else if(--f>0)return"</p><p>";return a}).replace(/<p><\/p>/g,"");return g(a,b)}function g(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("<br>",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"<$1div>"));return b}
CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(g){var d;a(g);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));g.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;if(b.indexOf("Apple-")>-1){b=b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," ");a.data.type!="html"&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")}));if(b.indexOf('<br class="Apple-interchange-newline">')>
-1){a.data.startsWithEOL=1;a.data.preSniffing="html";b=b.replace(/<br class="Apple-interchange-newline">/,"")}b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1")}if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);f.getChildCount()==1&&(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(b,
d){if(d.toLowerCase()in c){a.data.preSniffing="html";return"<"+d}return b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,d){if(d in c){a.data.endsWithEOL=1;return"</"+d+">"}return b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,null,3);g.on("paste",function(a){var a=a.data,j=a.type,k=a.dataValue,m,o=g.config.clipboard_defaultContentType||"html";m=j=="html"||a.preSniffing=="html"?"html":f(k);m=="htmlifiedtext"?k=c(g.config,k):j=="text"&&m==
"html"&&(k=b(g.config,k,d||(d=e(g))));a.startsWithEOL&&(k='<br data-cke-eol="1">'+k);a.endsWithEOL&&(k=k+'<br data-cke-eol="1">');j=="auto"&&(j=m=="html"||o=="html"?"html":"text");a.type=j;a.dataValue=k;delete a.preSniffing;delete a.startsWithEOL;delete a.endsWithEOL},null,null,6);g.on("paste",function(a){a=a.data;g.insertHtml(a.dataValue,a.type);setTimeout(function(){g.fire("afterPaste")},0)},null,null,1E3);g.on("pasteDialog",function(a){setTimeout(function(){g.openDialog("paste",a.data)},0)})}})}(),
function(){var a='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a=a+' onkeypress="return false;"');CKEDITOR.env.gecko&&(a=a+' onblur="this.style.cssText = this.style.cssText;"');var a=a+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+
(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),a=a+'>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',f=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"&#9660;":"")+"</span>"),c=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",
{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,b){var g=CKEDITOR.env,i=this._.id=CKEDITOR.tools.getNextId(),d="",h=this.command,j;this._.editor=a;var k={id:i,button:this,
editor:a,focus:function(){CKEDITOR.document.getById(i).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},m=CKEDITOR.tools.addFunction(function(a){if(k.onkey){a=new CKEDITOR.dom.event(a);return k.onkey(k,a.getKeystroke())!==false}}),o=CKEDITOR.tools.addFunction(function(a){var b;k.onfocus&&(b=k.onfocus(k,new CKEDITOR.dom.event(a))!==false);return b}),p=0;k.clickFn=j=CKEDITOR.tools.addFunction(function(){if(p){a.unlockSelection(1);p=0}k.execute();g.iOS&&a.focus()});
if(this.modes){var n={},l=function(){var b=a.mode;if(b){b=this.modes[b]?n[b]!=void 0?n[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:b;this.setState(b);this.refresh&&this.refresh()}};a.on("beforeModeUnload",function(){if(a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED)n[a.mode]=this._.state},this);a.on("activeFilterChange",l,this);a.on("mode",l,this);!this.readOnly&&a.on("readOnly",l,this)}else if(h)if(h=a.getCommand(h)){h.on("state",
function(){this.setState(h.state)},this);d=d+(h.state==CKEDITOR.TRISTATE_ON?"on":h.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off")}if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst(),b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(q,b=="rtl",this.icon,this.iconOffset))},this);h||(d=d+"off");var q=l=this.name||this.command;if(this.icon&&!/\./.test(this.icon)){q=
this.icon;this.icon=null}d={id:i,name:l,iconName:q,label:this.label,cls:this.className||"",state:d,ariaDisabled:d=="disabled"?"true":"false",title:this.title,titleJs:g.gecko&&!g.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:m,focusFn:o,clickFn:j,style:CKEDITOR.skin.getIconStyle(q,a.lang.dir=="rtl",this.icon,this.iconOffset),arrowHtml:this.hasArrow?f.output():""};c.output(d,b);if(this.onRender)this.onRender();return k},setState:function(a){if(this._.state==
a)return false;this._.state=a;var b=CKEDITOR.document.getById(this._.id);if(b){b.setState(a,"cke_button");a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",true):b.removeAttribute("aria-disabled");if(this.hasArrow){a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label;CKEDITOR.document.getById(this._.id+"_label").setText(a)}else a==CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",true):b.removeAttribute("aria-pressed");return true}return false},
getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;!this.allowedContent&&(!this.requiredContent&&this.command)&&(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}}(),CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function a(a){var c=this._;if(c.state!=CKEDITOR.TRISTATE_DISABLED){this.createPanel(a);c.on?c.panel.hide():c.panel.showBlock(this._.id,
this.document.getById(this._.id),4)}}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(f){var c=f.panel||{};delete f.panel;this.base(f);this.document=c.parent&&c.parent.getDocument()||CKEDITOR.document;c.block={attributes:c.attributes};this.hasArrow=c.toolbarRelated=true;this.click=a;this._={panelDefinition:c}},statics:{handler:{create:function(a){return new CKEDITOR.ui.panelButton(a)}}},proto:{createPanel:function(a){var c=this._;if(!c.panel){var e=this._.panelDefinition,
b=this._.panelDefinition.block,g=e.parent||CKEDITOR.document.getBody(),i=this._.panel=new CKEDITOR.ui.floatPanel(a,g,e),e=i.addBlock(c.id,b),d=this;i.onShow=function(){d.className&&this.element.addClass(d.className+"_panel");d.setState(CKEDITOR.TRISTATE_ON);c.on=1;d.editorFocus&&a.focus();if(d.onOpen)d.onOpen()};i.onHide=function(b){d.className&&this.element.getFirst().removeClass(d.className+"_panel");d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);c.on=0;if(!b&&
d.onClose)d.onClose()};i.onEscape=function(){i.hide(1);d.document.getById(c.id).focus()};if(this.onBlock)this.onBlock(i,e);e.onHide=function(){c.on=0;d.setState(CKEDITOR.TRISTATE_OFF)}}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}}),CKEDITOR.UI_PANELBUTTON="panelbutton",function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,
b){b&&CKEDITOR.tools.extend(this,b);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var a=CKEDITOR.addTemplate("panel",'<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),f=
CKEDITOR.addTemplate("panel-frame",'<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),c=CKEDITOR.addTemplate("panel-frame-inner",'<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');CKEDITOR.ui.panel.prototype={render:function(e,b){this.getHolderElement=function(){var a=this._.holder;if(!a){if(this.isFramed){var a=
this.document.getById(this.id+"_frame"),b=a.getParent(),a=a.getFrameDocument();CKEDITOR.env.iOS&&b.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"});b=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=true;if(this.onLoad)this.onLoad()},this));a.write(c.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+b+");"},g)));a.getWindow().$.CKEDITOR=CKEDITOR;a.on("keydown",function(a){var b=a.data.getKeystroke(),
c=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&this._.onKeyDown(b)===false?a.data.preventDefault():(b==27||b==(c=="rtl"?39:37))&&this.onEscape&&this.onEscape(b)===false&&a.data.preventDefault()},this);a=a.getBody();a.unselectable();CKEDITOR.env.air&&CKEDITOR.tools.callFunction(b)}else a=this.document.getById(this.id);this._.holder=a}return a};var g={editorId:e.id,id:this.id,langCode:e.langCode,dir:e.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":e.config.baseFloatZIndex+
1};if(this.isFramed){var i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";g.frame=f.output({id:this.id+"_frame",src:i})}i=a.output(g);b&&b.push(i);return i},addBlock:function(a,b){b=this._.blocks[a]=b instanceof CKEDITOR.ui.panel.block?b:new CKEDITOR.ui.panel.block(this.getHolderElement(),b);this._.currentBlock||this.showBlock(a);return b},getBlock:function(a){return this._.blocks[a]},
showBlock:function(a){var a=this._.blocks[a],b=this._.currentBlock,c=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");b&&b.hide();this._.currentBlock=a;CKEDITOR.fire("ariaWidget",c);a._.focusIndex=-1;this._.onKeyDown=a.onKeyDown&&CKEDITOR.tools.bind(a.onKeyDown,a);a.show();return a},destroy:function(){this.element&&this.element.remove()}};CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a,b){this.element=a.append(a.getDocument().createElement("div",
{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}}));b&&CKEDITOR.tools.extend(this,b);this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]});this.keys={};this._.focusIndex=-1;this.element.disableContextMenu()},_:{markItem:function(a){if(a!=-1){a=this.element.getElementsByTag("a").getItem(this._.focusIndex=a);CKEDITOR.env.webkit&&a.getDocument().getWindow().focus();
a.focus();this.onMark&&this.onMark(a)}}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){(!this.onHide||this.onHide.call(this)!==true)&&this.element.setStyle("display","none")},onKeyDown:function(a,b){var c=this.keys[a];switch(c){case "next":for(var f=this._.focusIndex,c=this.element.getElementsByTag("a"),d;d=c.getItem(++f);)if(d.getAttribute("_cke_focus")&&d.$.offsetWidth){this._.focusIndex=f;d.focus();break}if(!d&&!b){this._.focusIndex=-1;return this.onKeyDown(a,1)}return false;
case "prev":f=this._.focusIndex;for(c=this.element.getElementsByTag("a");f>0&&(d=c.getItem(--f));){if(d.getAttribute("_cke_focus")&&d.$.offsetWidth){this._.focusIndex=f;d.focus();break}d=null}if(!d&&!b){this._.focusIndex=c.count();return this.onKeyDown(a,1)}return false;case "click":case "mouseup":f=this._.focusIndex;(d=f>=0&&this.element.getElementsByTag("a").getItem(f))&&(d.$[c]?d.$[c]():d.$["on"+c]());return false}return true}}})}(),CKEDITOR.plugins.add("floatpanel",{requires:"panel"}),function(){function a(a,
e,b,g,i){var i=CKEDITOR.tools.genKey(e.getUniqueId(),b.getUniqueId(),a.lang.dir,a.uiColor||"",g.css||"",i||""),d=f[i];if(!d){d=f[i]=new CKEDITOR.ui.panel(e,g);d.element=b.append(CKEDITOR.dom.element.createFromHtml(d.render(a),e));d.element.setStyles({display:"none",position:"absolute"})}return d}var f={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(c,e,b,f){function i(){k.hide()}b.forceIFrame=1;b.toolbarRelated&&c.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(e=CKEDITOR.document.getById("cke_"+
c.name));var d=e.getDocument(),f=a(c,d,e,b,f||0),h=f.element,j=h.getFirst(),k=this;h.disableContextMenu();this.element=h;this._={editor:c,panel:f,parentElement:e,definition:b,document:d,iframe:j,children:[],dir:c.lang.dir};c.on("mode",i);c.on("resize",i);if(!CKEDITOR.env.iOS)d.getWindow().on("resize",i)},proto:{addBlock:function(a,e){return this._.panel.addBlock(a,e)},addListBlock:function(a,e){return this._.panel.addListBlock(a,e)},getBlock:function(a){return this._.panel.getBlock(a)},showBlock:function(a,
e,b,f,i,d){var h=this._.panel,j=h.showBlock(a);this.allowBlur(false);a=this._.editor.editable();this._.returnFocus=a.hasFocus?a:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var k=this.element,a=this._.iframe,a=CKEDITOR.env.ie?a:new CKEDITOR.dom.window(a.$.contentWindow),m=k.getDocument(),o=this._.parentElement.getPositionedAncestor(),p=e.getDocumentPosition(m),m=o?o.getDocumentPosition(m):{x:0,y:0},n=this._.dir=="rtl",l=p.x+(f||0)-m.x,q=p.y+(i||0)-m.y;if(n&&(b==
1||b==4))l=l+e.$.offsetWidth;else if(!n&&(b==2||b==3))l=l+(e.$.offsetWidth-1);if(b==3||b==4)q=q+(e.$.offsetHeight-1);this._.panel._.offsetParentId=e.getId();k.setStyles({top:q+"px",left:0,display:""});k.setOpacity(0);k.getFirst().removeStyle("width");this._.editor.focusManager.add(a);if(!this._.blurSet){CKEDITOR.event.useCapture=true;a.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}if(this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild)if(CKEDITOR.env.iOS){if(!this._.hideTimeout)this._.hideTimeout=
CKEDITOR.tools.setTimeout(b,0,this)}else b.call(this)},this);a.on("focus",function(){this._.focused=true;this.hideChild();this.allowBlur(true)},this);if(CKEDITOR.env.iOS){a.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this);a.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)}CKEDITOR.event.useCapture=false;this._.blurSet=1}h.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&this.onEscape(a)===false)return false},this);CKEDITOR.tools.setTimeout(function(){var a=
CKEDITOR.tools.bind(function(){k.removeStyle("width");if(j.autoSize){var a=j.element.getDocument(),a=(CKEDITOR.env.webkit?j.element:a.getBody()).$.scrollWidth;CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&a>0)&&(a=a+((k.$.offsetWidth||0)-(k.$.clientWidth||0)+3));k.setStyle("width",a+10+"px");a=j.element.$.scrollHeight;CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&a>0)&&(a=a+((k.$.offsetHeight||0)-(k.$.clientHeight||0)+3));k.setStyle("height",a+"px");h._.currentBlock.element.setStyle("display","none").removeStyle("display")}else k.removeStyle("height");
n&&(l=l-k.$.offsetWidth);k.setStyle("left",l+"px");var b=h.element.getWindow(),a=k.$.getBoundingClientRect(),b=b.getViewPaneSize(),c=a.width||a.right-a.left,e=a.height||a.bottom-a.top,f=n?a.right:b.width-a.left,g=n?b.width-a.right:a.left;n?f<c&&(l=g>c?l+c:b.width>c?l-a.left:l-a.right+b.width):f<c&&(l=g>c?l-c:b.width>c?l-a.right+b.width:l-a.left);c=a.top;b.height-a.top<e&&(q=c>e?q-e:b.height>e?q-a.bottom+b.height:q-a.top);if(CKEDITOR.env.ie){b=a=new CKEDITOR.dom.element(k.$.offsetParent);b.getName()==
"html"&&(b=b.getDocument().getBody());b.getComputedStyle("direction")=="rtl"&&(l=CKEDITOR.env.ie8Compat?l-k.getDocument().getDocumentElement().$.scrollLeft*2:l-(a.$.scrollWidth-a.$.clientWidth))}var a=k.getFirst(),i;(i=a.getCustomData("activePanel"))&&i.onHide&&i.onHide.call(this,1);a.setCustomData("activePanel",this);k.setStyles({top:q+"px",left:l+"px"});k.setOpacity(1);d&&d()},this);h.isLoaded?a():h.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;
this.focus();j.element.focus();if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=a;this.allowBlur(true);this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=this._.iframe.getFrameDocument().getActive();
a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||this.onHide.call(this)!==true)){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus){CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus();a.focus()}delete this._.lastFocused;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var e=
this._.panel;if(a!=void 0)e.allowBlur=a;return e.allowBlur},showAsChild:function(a,e,b,f,i,d){if(!(this._.activeChild==a&&a._.panel._.offsetParentId==b.getId())){this.hideChild();a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this);this._.activeChild=a;this._.focused=false;a.showBlock(e,b,f,i,d);this.blur();(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=""},100)}},hideChild:function(a){var e=
this._.activeChild;if(e){delete e.onHide;delete this._.activeChild;e.hide();a&&this.focus()}}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),e;for(e in f){var b=f[e];a?b.destroy():b.element.hide()}a&&(f={})})}(),CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function f(e,d,f,j){var k=new CKEDITOR.style(b["colorButton_"+d+"Style"]),m=CKEDITOR.tools.getNextId()+"_colorBox";a.ui.add(e,CKEDITOR.UI_PANELBUTTON,{label:f,
title:f,modes:{wysiwyg:1},editorFocus:0,toolbar:"colors,"+j,allowedContent:k,requiredContent:k,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":g.panelTitle}},onBlock:function(b,e){e.autoSize=true;e.element.addClass("cke_colorblock");e.element.setHtml(c(b,d,m));e.element.getDocument().getBody().setStyle("overflow","hidden");CKEDITOR.ui.fire("ready",this);var f=e.keys,g=a.lang.dir=="rtl";f[g?37:39]="next";f[40]="next";f[9]="next";f[g?39:37]="prev";f[38]="prev";f[CKEDITOR.SHIFT+
9]="prev";f[32]="click"},refresh:function(){a.activeFilter.check(k)||this.setState(CKEDITOR.TRISTATE_DISABLED)},onOpen:function(){var b=a.getSelection(),b=b&&b.getStartElement(),b=a.elementPath(b),c;if(b){b=b.block||b.blockLimit||a.document.getBody();do c=b&&b.getComputedStyle(d=="back"?"background-color":"color")||"transparent";while(d=="back"&&c=="transparent"&&b&&(b=b.getParent()));if(!c||c=="transparent")c="#ffffff";this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color",
c);return c}}})}function c(c,d,f){var j=[],k=b.colorButton_colors.split(","),m=a.plugins.colordialog&&b.colorButton_enableMore!==false,o=k.length+(m?2:1),p=CKEDITOR.tools.addFunction(function(d,f){if(d=="?"){var g=arguments.callee,h=function(a){this.removeListener("ok",h);this.removeListener("cancel",h);a.name=="ok"&&g(this.getContentElement("picker","selectedColor").getValue(),f)};a.openDialog("colordialog",function(){this.on("ok",h);this.on("cancel",h)})}else{a.focus();c.hide();a.fire("saveSnapshot");
a.removeStyle(new CKEDITOR.style(b["colorButton_"+f+"Style"],{color:"inherit"}));if(d){var j=b["colorButton_"+f+"Style"];j.childRule=f=="back"?function(a){return e(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||e(a)};a.applyStyle(new CKEDITOR.style(j,{color:d}))}a.fire("saveSnapshot")}});j.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',g.auto,'" onclick="CKEDITOR.tools.callFunction(',p,",null,'",d,"');return false;\" href=\"javascript:void('",g.auto,'\')" role="option" aria-posinset="1" aria-setsize="',
o,'"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" id="',f,'"></span></td><td colspan=7 align=center>',g.auto,'</td></tr></table></a><table role="presentation" cellspacing=0 cellpadding=0 width="100%">');for(f=0;f<k.length;f++){f%8===0&&j.push("</tr><tr>");var n=k[f].split("/"),l=n[0],q=n[1]||l;n[1]||(l="#"+l.replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3"));n=a.lang.colorbutton.colors[q]||q;j.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',
n,'" onclick="CKEDITOR.tools.callFunction(',p,",'",l,"','",d,"'); return false;\" href=\"javascript:void('",n,'\')" role="option" aria-posinset="',f+2,'" aria-setsize="',o,'"><span class="cke_colorbox" style="background-color:#',q,'"></span></a></td>')}m&&j.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',g.more,'" onclick="CKEDITOR.tools.callFunction(',p,",'?','",d,"');return false;\" href=\"javascript:void('",g.more,"')\"",' role="option" aria-posinset="',
o,'" aria-setsize="',o,'">',g.more,"</a></td>");j.push("</tr></table>");return j.join("")}function e(a){return a.getAttribute("contentEditable")=="false"||a.getAttribute("data-nostyle")}var b=a.config,g=a.lang.colorbutton;if(!CKEDITOR.env.hc){f("TextColor","fore",g.textColorTitle,10);f("BGColor","back",g.bgColorTitle,20)}}}),CKEDITOR.config.colorButton_colors="000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF",
CKEDITOR.config.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]},CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}},CKEDITOR.plugins.colordialog={requires:"dialog",init:function(a){var f=new CKEDITOR.dialogCommand("colordialog");f.editorFocus=false;a.addCommand("colordialog",f);CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js");a.getColorFromDialog=function(c,e){var b=
function(a){this.removeListener("ok",b);this.removeListener("cancel",b);a=a.name=="ok"?this.getValueOf("picker","selectedColor"):null;c.call(e,a)},f=function(a){a.on("ok",b);a.on("cancel",b)};a.execCommand("colordialog");if(a._.storedDialogs&&a._.storedDialogs.colordialog)f(a._.storedDialogs.colordialog);else CKEDITOR.on("dialogDefinition",function(a){if(a.data.name=="colordialog"){var b=a.data.definition;a.removeListener();b.onLoad=CKEDITOR.tools.override(b.onLoad,function(a){return function(){f(this);
b.onLoad=a;typeof a=="function"&&a.call(this)}})}})}}},CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog),CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(a){for(var f=a.config.menu_groups.split(","),c=a._.menuGroups={},e=a._.menuItems={},b=0;b<f.length;b++)c[f[b]]=b+1;a.addMenuGroup=function(a,b){c[a]=b||100};a.addMenuItem=function(a,b){c[b.group]&&(e[a]=new CKEDITOR.menuItem(this,a,b))};a.addMenuItems=function(a){for(var b in a)this.addMenuItem(b,a[b])};a.getMenuItem=
function(a){return e[a]};a.removeMenuItem=function(a){delete e[a]}}}),function(){function a(a){a.sort(function(a,b){return a.group<b.group?-1:a.group>b.group?1:a.order<b.order?-1:a.order>b.order?1:0})}var f='<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&
(f=f+' onkeypress="return false;"');CKEDITOR.env.gecko&&(f=f+' onblur="this.style.cssText = this.style.cssText;"');var f=f+(' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),c=CKEDITOR.addTemplate("menuItem",f+'<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),
e=CKEDITOR.addTemplate("menuArrow",'<span class="cke_menuarrow"><span>{label}</span></span>');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,c){c=this._.definition=c||{};this.id=CKEDITOR.tools.getNextId();this.editor=a;this.items=[];this._.listeners=[];this._.level=c.level||1;var e=CKEDITOR.tools.extend({},c.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),d=e.block.attributes=e.attributes||{};!d.role&&(d.role="menu");this._.panelDefinition=e},_:{onShow:function(){var a=
this.editor.getSelection(),c=a&&a.getStartElement(),e=this.editor.elementPath(),d=this._.listeners;this.removeAll();for(var f=0;f<d.length;f++){var j=d[f](c,a,e);if(j)for(var k in j){var m=this.editor.getMenuItem(k);if(m&&(!m.command||this.editor.getCommand(m.command).state)){m.state=j[k];this.add(m)}}}},onClick:function(a){this.hide();if(a.onClick)a.onClick();else a.command&&this.editor.execCommand(a.command)},onEscape:function(a){var c=this.parent;c?c._.panel.hideChild(1):a==27&&this.hide(1);return false},
onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(a){var c=this._.subMenu,e=this.items[a];if(e=e.getItems&&e.getItems()){if(c)c.removeAll();else{c=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},true));c.parent=this;c._.onClick=CKEDITOR.tools.bind(this._.onClick,this)}for(var d in e){var f=this.editor.getMenuItem(d);if(f){f.state=e[d];c.add(f)}}var j=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+
(""+a));setTimeout(function(){c.show(j,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(a){if(!a.order)a.order=this.items.length;this.items.push(a)},removeAll:function(){this.items=[]},show:function(b,c,e,d){if(!this.parent){this._.onShow();if(!this.items.length)return}var c=c||(this.editor.lang.dir=="rtl"?2:1),f=this.items,j=this.editor,k=this._.panel,m=this._.element;if(!k){k=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);
k.onEscape=CKEDITOR.tools.bind(function(a){if(this._.onEscape(a)===false)return false},this);k.onShow=function(){k._.panel.getHolderElement().getParent().addClass("cke cke_reset_all")};k.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);m=k.addBlock(this.id,this._.panelDefinition.block);m.autoSize=true;var o=m.keys;o[40]="next";o[9]="next";o[38]="prev";o[CKEDITOR.SHIFT+9]="prev";o[j.lang.dir=="rtl"?37:39]=CKEDITOR.env.ie?"mouseup":"click";o[32]=CKEDITOR.env.ie?"mouseup":
"click";CKEDITOR.env.ie&&(o[13]="mouseup");m=this._.element=m.element;o=m.getDocument();o.getBody().setStyle("overflow","hidden");o.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,j.config.menu_subMenuDelay||400,this,[a])},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);
this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}a(f);for(var o=j.elementPath(),o=['<div class="cke_menu'+(o&&o.direction()!=j.lang.dir?" cke_mixed_dir_content":"")+'" role="presentation">'],p=f.length,n=p&&f[0].group,l=0;l<p;l++){var q=f[l];if(n!=q.group){o.push('<div class="cke_menuseparator" role="separator"></div>');n=q.group}q.render(this,l,o)}o.push("</div>");
m.setHtml(o.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(k,this.id,b,c,e,d):k.showBlock(this.id,b,c,e,d);j.fire("menuShow",[k])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,c,e){CKEDITOR.tools.extend(this,e,{order:0,className:"cke_menubutton__"+c});this.group=a._.menuGroups[this.group];this.editor=a;this.name=
c},proto:{render:function(a,f,i){var d=a.id+(""+f),h=typeof this.state=="undefined"?CKEDITOR.TRISTATE_OFF:this.state,j="",k=h==CKEDITOR.TRISTATE_ON?"on":h==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(j=' aria-checked="'+(h==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var m=this.getItems,o="&#"+(this.editor.lang.dir=="rtl"?"9668":"9658")+";",p=this.name;if(this.icon&&!/\./.test(this.icon))p=this.icon;a={id:d,name:this.name,iconName:p,label:this.label,
cls:this.className||"",state:k,hasPopup:m?"true":"false",disabled:h==CKEDITOR.TRISTATE_DISABLED,title:this.label,href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:f,iconStyle:CKEDITOR.skin.getIconStyle(p,this.editor.lang.dir=="rtl",p==this.icon?null:this.icon,this.iconOffset),arrowHtml:m?e.output({label:o}):"",role:this.role?this.role:"menuitem",ariaChecked:j};c.output(a,i)}}})}(),CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",
CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,$:function(a){this.base.call(this,a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,f){a.on("contextmenu",function(a){var a=a.data,e=CKEDITOR.env.webkit?c:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!f||!e){a.preventDefault();if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var e=this.editor,
i=(new CKEDITOR.dom.elementPath(a.getTarget(),e.editable())).contains(function(a){return a.hasAttribute("contenteditable")},true);i&&i.getAttribute("contenteditable")=="false"&&e.getSelection().fake(i)}var i=a.getTarget().getDocument(),d=a.getTarget().getDocument().getDocumentElement(),e=!i.equals(CKEDITOR.document),i=i.getWindow().getScrollPosition(),h=e?a.$.clientX:a.$.pageX||i.x+a.$.clientX,j=e?a.$.clientY:a.$.pageY||i.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(d,null,h,j)},CKEDITOR.env.ie?
200:0,this)}},this);if(CKEDITOR.env.webkit){var c,e=function(){c=0};a.on("keydown",function(a){c=CKEDITOR.env.mac?a.data.$.metaKey:a.data.$.ctrlKey});a.on("keyup",e);a.on("contextmenu",e)}},open:function(a,f,c,e){this.editor.focus();a=a||CKEDITOR.document.getDocumentElement();this.editor.selectionChange(1);this.show(a,f,c,e)}}})},beforeInit:function(a){var f=a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.on("contentDom",function(){f.addTarget(a.editable(),a.config.browserContextMenuOnCtrl!==
false)});a.addCommand("contextMenu",{exec:function(){a.contextMenu.open(a.document.getBody())}});a.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu");a.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}}),function(){function a(a){var b=this.att,a=a&&a.hasAttribute(b)&&a.getAttribute(b)||"";a!==void 0&&this.setValue(a)}function f(){for(var a,b=0;b<arguments.length;b++)if(arguments[b]instanceof CKEDITOR.dom.element){a=arguments[b];break}if(a){var b=this.att,c=this.getValue();c?a.setAttribute(b,
c):a.removeAttribute(b,c)}}var c={id:1,dir:1,classes:1,styles:1};CKEDITOR.plugins.add("dialogadvtab",{requires:"dialog",allowedContent:function(a){a||(a=c);var b=[];a.id&&b.push("id");a.dir&&b.push("dir");var f="";b.length&&(f=f+("["+b.join(",")+"]"));a.classes&&(f=f+"(*)");a.styles&&(f=f+"{*}");return f},createAdvancedTab:function(e,b,g){b||(b=c);var i=e.lang.common,d={id:"advanced",label:i.advancedTab,title:i.advancedTab,elements:[{type:"vbox",padding:1,children:[]}]},h=[];if(b.id||b.dir){b.id&&
h.push({id:"advId",att:"id",type:"text",requiredContent:g?g+"[id]":null,label:i.id,setup:a,commit:f});b.dir&&h.push({id:"advLangDir",att:"dir",type:"select",requiredContent:g?g+"[dir]":null,label:i.langDir,"default":"",style:"width:100%",items:[[i.notSet,""],[i.langDirLTR,"ltr"],[i.langDirRTL,"rtl"]],setup:a,commit:f});d.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(h)})}if(b.styles||b.classes){h=[];b.styles&&h.push({id:"advStyles",att:"style",type:"text",requiredContent:g?
g+"{cke-xyz}":null,label:i.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(i.invalidInlineStyle),onChange:function(){},getStyle:function(a,b){var c=this.getValue().match(RegExp("(?:^|;)\\s*"+a+"\\s*:\\s*([^;]*)","i"));return c?c[1]:b},updateStyle:function(a,b){var c=this.getValue(),d=e.document.createElement("span");d.setAttribute("style",c);d.setStyle(a,b);c=CKEDITOR.tools.normalizeCssText(d.getAttribute("style"));this.setValue(c,1)},setup:a,commit:f});b.classes&&h.push({type:"hbox",
widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:g?g+"(cke-xyz)":null,label:i.cssClasses,"default":"",setup:a,commit:f}]});d.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(h)})}return d}})}(),function(){CKEDITOR.plugins.add("div",{requires:"dialog",init:function(a){if(!a.blockless){var f=a.lang.div,c="div(*)";CKEDITOR.dialog.isTabEnabled(a,"editdiv","advanced")&&(c=c+";div[dir,id,lang,title]{*}");a.addCommand("creatediv",new CKEDITOR.dialogCommand("creatediv",
{allowedContent:c,requiredContent:"div",contextSensitive:true,refresh:function(a,b){this.setState("div"in(a.config.div_wrapTable?b.root:b.blockLimit).getDtd()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}}));a.addCommand("editdiv",new CKEDITOR.dialogCommand("editdiv",{requiredContent:"div"}));a.addCommand("removediv",{requiredContent:"div",exec:function(a){function b(b){if((b=CKEDITOR.plugins.div.getSurroundDiv(a,b))&&!b.data("cke-div-added")){j.push(b);b.data("cke-div-added")}}for(var c=a.getSelection(),
f=c&&c.getRanges(),d,h=c.createBookmarks(),j=[],k=0;k<f.length;k++){d=f[k];if(d.collapsed)b(c.getStartElement());else{d=new CKEDITOR.dom.walker(d);d.evaluator=b;d.lastForward()}}for(k=0;k<j.length;k++)j[k].remove(true);c.selectBookmarks(h)}});a.ui.addButton&&a.ui.addButton("CreateDiv",{label:f.toolbar,command:"creatediv",toolbar:"blocks,50"});if(a.addMenuItems){a.addMenuItems({editdiv:{label:f.edit,command:"editdiv",group:"div",order:1},removediv:{label:f.remove,command:"removediv",group:"div",order:5}});
a.contextMenu&&a.contextMenu.addListener(function(c){return!c||c.isReadOnly()?null:CKEDITOR.plugins.div.getSurroundDiv(a)?{editdiv:CKEDITOR.TRISTATE_OFF,removediv:CKEDITOR.TRISTATE_OFF}:null})}CKEDITOR.dialog.add("creatediv",this.path+"dialogs/div.js");CKEDITOR.dialog.add("editdiv",this.path+"dialogs/div.js")}}});CKEDITOR.plugins.div={getSurroundDiv:function(a,f){var c=a.elementPath(f);return a.elementPath(c.blockLimit).contains(function(a){return a.is("div")&&!a.isReadOnly()},1)}}}(),function(){var a;
function f(e,f){function d(a){a=m.list[a];if(a.equals(e.editable())||a.getAttribute("contenteditable")=="true"){var b=e.createRange();b.selectNodeContents(a);b.select()}else e.getSelection().selectElement(a);e.focus()}function h(){k&&k.setHtml(c);delete m.list}var j=e.ui.spaceId("path"),k,m=e._.elementsPath,o=m.idBase;f.html=f.html+('<span id="'+j+'_label" class="cke_voice_label">'+e.lang.elementspath.eleLabel+'</span><span id="'+j+'" class="cke_path" role="group" aria-labelledby="'+j+'_label">'+
c+"</span>");e.on("uiReady",function(){var a=e.ui.space("path");a&&e.focusManager.add(a,1)});m.onClick=d;var p=CKEDITOR.tools.addFunction(d),n=CKEDITOR.tools.addFunction(function(a,b){var c=m.idBase,f,b=new CKEDITOR.dom.event(b);f=e.lang.dir=="rtl";switch(b.getKeystroke()){case f?39:37:case 9:(f=CKEDITOR.document.getById(c+(a+1)))||(f=CKEDITOR.document.getById(c+"0"));f.focus();return false;case f?37:39:case CKEDITOR.SHIFT+9:(f=CKEDITOR.document.getById(c+(a-1)))||(f=CKEDITOR.document.getById(c+(m.list.length-
1)));f.focus();return false;case 27:e.focus();return false;case 13:case 32:d(a);return false}return true});e.on("selectionChange",function(){e.editable();for(var a=[],d=m.list=[],f=[],h=m.filters,i=true,v=e.elementPath().elements,x,w=v.length;w--;){var s=v[w],y=0;x=s.data("cke-display-name")?s.data("cke-display-name"):s.data("cke-real-element-type")?s.data("cke-real-element-type"):s.getName();i=s.hasAttribute("contenteditable")?s.getAttribute("contenteditable")=="true":i;!i&&!s.hasAttribute("contenteditable")&&
(y=1);for(var z=0;z<h.length;z++){var B=h[z](s,x);if(B===false){y=1;break}x=B||x}if(!y){d.unshift(s);f.unshift(x)}}d=d.length;for(h=0;h<d;h++){x=f[h];i=e.lang.elementspath.eleTitle.replace(/%1/,x);x=b.output({id:o+h,label:i,text:x,jsTitle:"javascript:void('"+x+"')",index:h,keyDownFn:n,clickFn:p});a.unshift(x)}k||(k=CKEDITOR.document.getById(j));f=k;f.setHtml(a.join("")+c);e.fire("elementsPathUpdate",{space:f})});e.on("readOnly",h);e.on("contentDomUnload",h);e.addCommand("elementsPathFocus",a);e.setKeystroke(CKEDITOR.ALT+
122,"elementsPathFocus")}a={editorFocus:false,readOnly:1,exec:function(a){(a=CKEDITOR.document.getById(a._.elementsPath.idBase+"0"))&&a.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}};var c='<span class="cke_path_empty">&nbsp;</span>',e="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e=e+' onkeypress="return false;"');CKEDITOR.env.gecko&&(e=e+' onblur="this.style.cssText = this.style.cssText;"');var b=CKEDITOR.addTemplate("pathItem",'<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"'+
e+' hidefocus="true"  onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');CKEDITOR.plugins.add("elementspath",{init:function(a){a._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]};a.on("uiSpace",function(b){b.data.space=="bottom"&&f(a,b.data)})}})}(),function(){function a(a,b,c){c=a.config.forceEnterMode||c;if(a.mode==
"wysiwyg"){if(!b)b=a.activeEnterMode;if(!a.elementPath().isContextFor("p")){b=CKEDITOR.ENTER_BR;c=1}a.fire("saveSnapshot");b==CKEDITOR.ENTER_BR?i(a,b,null,c):d(a,b,null,c);a.fire("saveSnapshot")}}function f(a){for(var a=a.getSelection().getRanges(true),b=a.length-1;b>0;b--)a[b].deleteContents();return a[0]}function c(a){var b=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="true"},true);if(a.root.equals(b))return a;b=new CKEDITOR.dom.range(b);
b.moveToRange(a);return b}CKEDITOR.plugins.add("enterkey",{init:function(b){b.addCommand("enter",{modes:{wysiwyg:1},editorFocus:false,exec:function(b){a(b)}});b.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:false,exec:function(b){a(b,b.activeShiftEnterMode,1)}});b.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var e=CKEDITOR.dom.walker.whitespaces(),b=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(a,d,g,o){if(g=g||f(a)){var g=c(g),p=g.document,
n=g.checkStartOfBlock(),l=g.checkEndOfBlock(),q=a.elementPath(g.startContainer),r=q.block,u=d==CKEDITOR.ENTER_DIV?"div":"p",t;if(n&&l){if(r&&(r.is("li")||r.getParent().is("li"))){r.is("li")||(r=r.getParent());g=r.getParent();t=g.getParent();var o=!r.hasPrevious(),v=!r.hasNext(),u=a.getSelection(),x=u.createBookmarks(),n=r.getDirection(1),l=r.getAttribute("class"),w=r.getAttribute("style"),s=t.getDirection(1)!=n,a=a.enterMode!=CKEDITOR.ENTER_BR||s||w||l;if(t.is("li"))if(o||v)r[o?"insertBefore":"insertAfter"](t);
else r.breakParent(t);else{if(a){if(q.block.is("li")){t=p.createElement(d==CKEDITOR.ENTER_P?"p":"div");s&&t.setAttribute("dir",n);w&&t.setAttribute("style",w);l&&t.setAttribute("class",l);r.moveChildren(t)}else t=q.block;if(o||v)t[o?"insertBefore":"insertAfter"](g);else{r.breakParent(g);t.insertAfter(g)}}else{r.appendBogus(true);if(o||v)for(;p=r[o?"getFirst":"getLast"]();)p[o?"insertBefore":"insertAfter"](g);else for(r.breakParent(g);p=r.getLast();)p.insertAfter(g)}r.remove()}u.selectBookmarks(x);
return}if(r&&r.getParent().is("blockquote")){r.breakParent(r.getParent());r.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||r.getPrevious().remove();r.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||r.getNext().remove();g.moveToElementEditStart(r);g.select();return}}else if(r&&r.is("pre")&&!l){i(a,d,g,o);return}if(n=g.splitBlock(u)){d=n.previousBlock;r=n.nextBlock;q=n.wasStartOfBlock;a=n.wasEndOfBlock;if(r){x=r.getParent();if(x.is("li")){r.breakParent(x);r.move(r.getNext(),1)}}else if(d&&
(x=d.getParent())&&x.is("li")){d.breakParent(x);x=d.getNext();g.moveToElementEditStart(x);d.move(d.getPrevious())}if(!q&&!a){if(r.is("li")){t=g.clone();t.selectNodeContents(r);t=new CKEDITOR.dom.walker(t);t.evaluator=function(a){return!(b(a)||e(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))};(x=t.next())&&(x.type==CKEDITOR.NODE_ELEMENT&&x.is("ul","ol"))&&(CKEDITOR.env.needsBrFiller?p.createElement("br"):p.createText(" ")).insertBefore(x)}r&&
g.moveToElementEditStart(r)}else{if(d){if(d.is("li")||!h.test(d.getName())&&!d.is("pre"))t=d.clone()}else r&&(t=r.clone());if(t)o&&!t.is("li")&&t.renameNode(u);else if(x&&x.is("li"))t=x;else{t=p.createElement(u);d&&(v=d.getDirection())&&t.setAttribute("dir",v)}if(p=n.elementPath){o=0;for(u=p.elements.length;o<u;o++){x=p.elements[o];if(x.equals(p.block)||x.equals(p.blockLimit))break;if(CKEDITOR.dtd.$removeEmpty[x.getName()]){x=x.clone();t.moveChildren(x);t.append(x)}}}t.appendBogus();t.getParent()||
g.insertNode(t);t.is("li")&&t.removeAttribute("value");if(CKEDITOR.env.ie&&q&&(!a||!d.getChildCount())){g.moveToElementEditStart(a?d:t);g.select()}g.moveToElementEditStart(q&&!a?r:t)}g.select();g.scrollIntoView()}}},enterBr:function(a,b,c,e){if(c=c||f(a)){var g=c.document,i=c.checkEndOfBlock(),l=new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),q=l.block,r=q&&l.block.getName();if(!e&&r=="li")d(a,b,c,e);else{if(!e&&i&&h.test(r))if(i=q.getDirection()){g=g.createElement("div");g.setAttribute("dir",
i);g.insertAfter(q);c.setStart(g,0)}else{g.createElement("br").insertAfter(q);CKEDITOR.env.gecko&&g.createText("").insertAfter(q);c.setStartAt(q.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)}else{a=r=="pre"&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?g.createText("\r"):g.createElement("br");c.deleteContents();c.insertNode(a);if(CKEDITOR.env.needsBrFiller){g.createText("﻿").insertAfter(a);i&&(q||l.blockLimit).appendBogus();a.getNext().$.nodeValue="";c.setStartAt(a.getNext(),
CKEDITOR.POSITION_AFTER_START)}else c.setStartAt(a,CKEDITOR.POSITION_AFTER_END)}c.collapse(true);c.select();c.scrollIntoView()}}}};var g=CKEDITOR.plugins.enterkey,i=g.enterBr,d=g.enterBlock,h=/^h[1-6]$/}(),function(){function a(a,c){var e={},b=[],g={nbsp:" ",shy:"­",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,d){var f=c?"&"+d+";":g[d];e[f]=c?g[d]:"&"+d+";";b.push(f);return""});if(!c&&a){var a=a.split(","),i=document.createElement("div"),
d;i.innerHTML="&"+a.join(";&")+";";d=i.innerHTML;i=null;for(i=0;i<d.length;i++){var h=d.charAt(i);e[h]="&"+a[i]+";";b.push(h)}}e.regex=b.join(c?"|":"");return e}CKEDITOR.plugins.add("entities",{afterInit:function(f){var c=f.config;if(f=(f=f.dataProcessor)&&f.htmlFilter){var e=[];c.basicEntities!==false&&e.push("nbsp,gt,lt,amp");if(c.entities){e.length&&e.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro");
c.entities_latin&&e.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml");c.entities_greek&&e.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv");
c.entities_additional&&e.push(c.entities_additional)}var b=a(e.join(",")),g=b.regex?"["+b.regex+"]":"a^";delete b.regex;c.entities&&c.entities_processNumerical&&(g="[^ -~]|"+g);var g=RegExp(g,"g"),i=function(a){return c.entities_processNumerical=="force"||!b[a]?"&#"+a.charCodeAt(0)+";":b[a]},d=a("nbsp,gt,lt,amp,shy",true),h=RegExp(d.regex,"g"),j=function(a){return d[a]};f.addRules({text:function(a){return a.replace(h,j).replace(g,i)}},{applyToAll:true,excludeNestedEditable:true})}}})}(),CKEDITOR.config.basicEntities=
!0,CKEDITOR.config.entities=!0,CKEDITOR.config.entities_latin=!0,CKEDITOR.config.entities_greek=!0,CKEDITOR.config.entities_additional="#39",CKEDITOR.plugins.add("popup"),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(a,f,c,e){f=f||"80%";c=c||"70%";typeof f=="string"&&(f.length>1&&f.substr(f.length-1,1)=="%")&&(f=parseInt(window.screen.width*parseInt(f,10)/100,10));typeof c=="string"&&(c.length>1&&c.substr(c.length-1,1)=="%")&&(c=parseInt(window.screen.height*parseInt(c,10)/100,10));
f<640&&(f=640);c<420&&(c=420);var b=parseInt((window.screen.height-c)/2,10),g=parseInt((window.screen.width-f)/2,10),e=(e||"location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes")+",width="+f+",height="+c+",top="+b+",left="+g,i=window.open("",null,e,true);if(!i)return false;try{if(navigator.userAgent.toLowerCase().indexOf(" chrome/")==-1){i.moveTo(g,b);i.resizeTo(f,c)}i.focus();i.location.href=a}catch(d){window.open(a,null,e,true)}return true}}),
function(){function a(a,b){var c=[];if(b)for(var d in b)c.push(d+"="+encodeURIComponent(b[d]));else return a;return a+(a.indexOf("?")!=-1?"&":"?")+c.join("&")}function f(a){a=a+"";return a.charAt(0).toUpperCase()+a.substr(1)}function c(){var b=this.getDialog(),c=b.getParentEditor();c._.filebrowserSe=this;var d=c.config["filebrowser"+f(b.getName())+"WindowWidth"]||c.config.filebrowserWindowWidth||"80%",b=c.config["filebrowser"+f(b.getName())+"WindowHeight"]||c.config.filebrowserWindowHeight||"70%",
e=this.filebrowser.params||{};e.CKEditor=c.name;e.CKEditorFuncNum=c._.filebrowserFn;if(!e.langCode)e.langCode=c.langCode;e=a(this.filebrowser.url,e);c.popup(e,d,b,c.config.filebrowserWindowFeatures||c.config.fileBrowserWindowFeatures)}function e(){var a=this.getDialog();a.getParentEditor()._.filebrowserSe=this;return!a.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value||!a.getContentElement(this["for"][0],this["for"][1]).getAction()?false:true}function b(b,c,d){var e=d.params||
{};e.CKEditor=b.name;e.CKEditorFuncNum=b._.filebrowserFn;if(!e.langCode)e.langCode=b.langCode;c.action=a(d.url,e);c.filebrowser=d}function g(a,d,i,m){if(m&&m.length)for(var o,p=m.length;p--;){o=m[p];(o.type=="hbox"||o.type=="vbox"||o.type=="fieldset")&&g(a,d,i,o.children);if(o.filebrowser){if(typeof o.filebrowser=="string")o.filebrowser={action:o.type=="fileButton"?"QuickUpload":"Browse",target:o.filebrowser};if(o.filebrowser.action=="Browse"){var n=o.filebrowser.url;if(n===void 0){n=a.config["filebrowser"+
f(d)+"BrowseUrl"];if(n===void 0)n=a.config.filebrowserBrowseUrl}if(n){o.onClick=c;o.filebrowser.url=n;o.hidden=false}}else if(o.filebrowser.action=="QuickUpload"&&o["for"]){n=o.filebrowser.url;if(n===void 0){n=a.config["filebrowser"+f(d)+"UploadUrl"];if(n===void 0)n=a.config.filebrowserUploadUrl}if(n){var l=o.onClick;o.onClick=function(a){var b=a.sender;return l&&l.call(b,a)===false?false:e.call(b,a)};o.filebrowser.url=n;o.hidden=false;b(a,i.getContents(o["for"][0]).get(o["for"][1]),o.filebrowser)}}}}}
function i(a,b,c){if(c.indexOf(";")!==-1){for(var c=c.split(";"),d=0;d<c.length;d++)if(i(a,b,c[d]))return true;return false}return(a=a.getContents(b).get(c).filebrowser)&&a.url}function d(a,b){var c=this._.filebrowserSe.getDialog(),d=this._.filebrowserSe["for"],e=this._.filebrowserSe.filebrowser.onSelect;d&&c.getContentElement(d[0],d[1]).reset();if(!(typeof b=="function"&&b.call(this._.filebrowserSe)===false)&&!(e&&e.call(this._.filebrowserSe,a,b)===false)){typeof b=="string"&&b&&alert(b);if(a){d=
this._.filebrowserSe;c=d.getDialog();if(d=d.filebrowser.target||null){d=d.split(":");if(e=c.getContentElement(d[0],d[1])){e.setValue(a);c.selectPage(d[0])}}}}}CKEDITOR.plugins.add("filebrowser",{requires:"popup",init:function(a){a._.filebrowserFn=CKEDITOR.tools.addFunction(d,a);a.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}});CKEDITOR.on("dialogDefinition",function(a){if(a.editor.plugins.filebrowser)for(var b=a.data.definition,c,d=0;d<b.contents.length;++d)if(c=b.contents[d]){g(a.editor,
a.data.name,b,c.elements);if(c.hidden&&c.filebrowser)c.hidden=!i(b,c.id,c.filebrowser)}})}(),CKEDITOR.plugins.add("find",{requires:"dialog",init:function(a){var f=a.addCommand("find",new CKEDITOR.dialogCommand("find"));f.canUndo=false;f.readOnly=1;a.addCommand("replace",new CKEDITOR.dialogCommand("replace")).canUndo=false;if(a.ui.addButton){a.ui.addButton("Find",{label:a.lang.find.find,command:"find",toolbar:"find,10"});a.ui.addButton("Replace",{label:a.lang.find.replace,command:"replace",toolbar:"find,20"})}CKEDITOR.dialog.add("find",
this.path+"dialogs/find.js");CKEDITOR.dialog.add("replace",this.path+"dialogs/find.js")}}),CKEDITOR.config.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}},function(){function a(a,b){var c=e.exec(a),f=e.exec(b);if(c){if(!c[2]&&f[2]=="px")return f[1];if(c[2]=="px"&&!f[2])return f[1]+"px"}return b}var f=CKEDITOR.htmlParser.cssStyle,c=CKEDITOR.tools.cssLength,e=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,b={elements:{$:function(b){var c=b.attributes;if((c=(c=(c=c&&c["data-cke-realelement"])&&
new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(c)))&&c.children[0])&&b.attributes["data-cke-resizable"]){var d=(new f(b)).rules,b=c.attributes,e=d.width,d=d.height;e&&(b.width=a(b.width,e));d&&(b.height=a(b.height,d))}return c}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(b,{applyToAll:true})}});CKEDITOR.editor.prototype.createFakeElement=
function(a,b,d,e){var j=this.lang.fakeobjects,j=j[d]||j.unknown,b={"class":b,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),"data-cke-real-node-type":a.type,alt:j,title:j,align:a.getAttribute("align")||""};if(!CKEDITOR.env.hc)b.src=CKEDITOR.tools.transparentImageData;d&&(b["data-cke-real-element-type"]=d);if(e){b["data-cke-resizable"]=e;d=new f;e=a.getAttribute("width");a=a.getAttribute("height");e&&(d.rules.width=c(e));a&&(d.rules.height=c(a));d.populate(b)}return this.document.createElement("img",
{attributes:b})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,b,d,e){var j=this.lang.fakeobjects,j=j[d]||j.unknown,k;k=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(k);k=k.getHtml();b={"class":b,"data-cke-realelement":encodeURIComponent(k),"data-cke-real-node-type":a.type,alt:j,title:j,align:a.attributes.align||""};if(!CKEDITOR.env.hc)b.src=CKEDITOR.tools.transparentImageData;d&&(b["data-cke-real-element-type"]=d);if(e){b["data-cke-resizable"]=e;e=a.attributes;a=new f;d=e.width;
e=e.height;d!=void 0&&(a.rules.width=c(d));e!=void 0&&(a.rules.height=c(e));a.populate(b)}return new CKEDITOR.htmlParser.element("img",b)};CKEDITOR.editor.prototype.restoreRealElement=function(b){if(b.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var c=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(b.data("cke-realelement")),this.document);if(b.data("cke-resizable")){var d=b.getStyle("width"),b=b.getStyle("height");d&&c.setAttribute("width",a(c.getAttribute("width"),d));b&&
c.setAttribute("height",a(c.getAttribute("height"),b))}return c}}(),function(){function a(a){a=a.attributes;return a.type=="application/x-shockwave-flash"||c.test(a.src||"")}function f(a,b){return a.createFakeParserElement(b,"cke_flash","flash",true)}var c=/\.swf(?:$|\?)/i;CKEDITOR.plugins.add("flash",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_flash{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},
init:function(a){var b="object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";CKEDITOR.dialog.isTabEnabled(a,"flash","properties")&&(b=b+";object[align]; embed[allowscriptaccess,quality,scale,wmode]");CKEDITOR.dialog.isTabEnabled(a,"flash","advanced")&&(b=b+";object[id]{*}; embed[bgcolor]{*}(*)");a.addCommand("flash",new CKEDITOR.dialogCommand("flash",{allowedContent:b,requiredContent:"embed"}));a.ui.addButton&&a.ui.addButton("Flash",
{label:a.lang.common.flash,command:"flash",toolbar:"insert,20"});CKEDITOR.dialog.add("flash",this.path+"dialogs/flash.js");a.addMenuItems&&a.addMenuItems({flash:{label:a.lang.flash.properties,command:"flash",group:"flash"}});a.on("doubleclick",function(a){var b=a.data.element;if(b.is("img")&&b.data("cke-real-element-type")=="flash")a.data.dialog="flash"});a.contextMenu&&a.contextMenu.addListener(function(a){if(a&&a.is("img")&&!a.isReadOnly()&&a.data("cke-real-element-type")=="flash")return{flash:CKEDITOR.TRISTATE_OFF}})},
afterInit:function(c){var b=c.dataProcessor;(b=b&&b.dataFilter)&&b.addRules({elements:{"cke:object":function(b){var i=b.attributes;if((!i.classid||!(""+i.classid).toLowerCase())&&!a(b)){for(i=0;i<b.children.length;i++)if(b.children[i].name=="cke:embed"){if(!a(b.children[i]))break;return f(c,b)}return null}return f(c,b)},"cke:embed":function(b){return!a(b)?null:f(c,b)}}},5)}})}(),CKEDITOR.tools.extend(CKEDITOR.config,{flashEmbedTagOnly:!1,flashAddEmbedTag:!0,flashConvertOnEdit:!1}),function(){function a(a){var b=
a.config,g=a.fire("uiSpace",{space:"top",html:""}).html,i=function(){function d(a,b,e){h.setStyle(b,c(e));h.setStyle("position",a)}function g(a){var b=k.getDocumentPosition();switch(a){case "top":d("absolute","top",b.y-u-x);break;case "pin":d("fixed","top",s);break;case "bottom":d("absolute","top",b.y+(q.height||q.bottom-q.top)+x)}j=a}var j,k,l,q,r,u,t,v=b.floatSpaceDockedOffsetX||0,x=b.floatSpaceDockedOffsetY||0,w=b.floatSpacePinnedOffsetX||0,s=b.floatSpacePinnedOffsetY||0;return function(b){if(k=
a.editable()){b&&b.name=="focus"&&h.show();h.removeStyle("left");h.removeStyle("right");l=h.getClientRect();q=k.getClientRect();r=f.getViewPaneSize();u=l.height;t="pageXOffset"in f.$?f.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;if(j){u+x<=q.top?g("top"):u+x>r.height-q.bottom?g("pin"):g("bottom");var b=r.width/2,b=q.left>0&&q.right<r.width&&q.width>l.width?a.config.contentsLangDirection=="rtl"?"right":"left":b-q.left>q.right-b?"left":"right",d;if(l.width>r.width){b="left";d=0}else{d=
b=="left"?q.left>0?q.left:0:q.right<r.width?r.width-q.right:0;if(d+l.width>r.width){b=b=="left"?"right":"left";d=0}}h.setStyle(b,c((j=="pin"?w:v)+d+(j=="pin"?0:b=="left"?t:-t)))}else{j="pin";g("pin");i(b)}}}}();if(g){var d=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+(a.title?' aria-labelledby="cke_{name}_arialbl"':
" ")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),h=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(d.output({content:g,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(b.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),j=CKEDITOR.tools.eventsBuffer(500,i),k=CKEDITOR.tools.eventsBuffer(100,
i);h.unselectable();h.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){i(b);a.on("change",j.input);f.on("scroll",k.input);f.on("resize",k.input)});a.on("blur",function(){h.hide();a.removeListener("change",j.input);f.removeListener("scroll",k.input);f.removeListener("resize",k.input)});a.on("destroy",function(){f.removeListener("scroll",k.input);f.removeListener("resize",k.input);h.clearCustomData();h.remove()});a.focusManager.hasFocus&&
h.show();a.focusManager.add(h,1)}}var f=CKEDITOR.document.getWindow(),c=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(c){c.on("loaded",function(){a(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),f=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')"  {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),
c=CKEDITOR.addTemplate("panel-list-group",'<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),e=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,c){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),c))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,c){var c=c||{},e=c.attributes||(c.attributes={});(this.multiSelect=!!c.multiSelect)&&(e["aria-multiselectable"]=true);!e.role&&(e.role="listbox");
this.base.apply(this,arguments);this.element.setAttribute("role",e.role);e=this.keys;e[40]="next";e[9]="next";e[38]="prev";e[CKEDITOR.SHIFT+9]="prev";e[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(e[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var b=a.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(b);delete this._.started}},getClick:function(){if(!this._.click)this._.click=
CKEDITOR.tools.addFunction(function(a){var c=this.toggle(a);if(this.onClick)this.onClick(a,c)},this);return this._.click}},proto:{add:function(a,c,i){var d=CKEDITOR.tools.getNextId();if(!this._.started){this._.started=1;this._.size=this._.size||0}this._.items[a]=d;var h;h=CKEDITOR.tools.htmlEncodeAttr(a).replace(e,"\\'");a={id:d,val:h,onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(i||a),text:c||a};this._.pendingList.push(f.output(a))},
startGroup:function(a){this._.close();var e=CKEDITOR.tools.getNextId();this._.groups[a]=e;this._.pendingHtml.push(c.output({id:e,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var c=this.isMarked(a);c?this.unmark(a):this.mark(a);return!c},hideGroup:function(a){var c=(a=this.element.getDocument().getById(this._.groups[a]))&&a.getNext();if(a){a.setStyle("display","none");c&&c.getName()=="ul"&&
c.setStyle("display","none")}},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,c=this._.groups,e=this.element.getDocument(),d;for(d in a)e.getById(a[d]).setStyle("display","");for(var f in c){a=e.getById(c[f]);d=a.getNext();a.setStyle("display","");d&&d.getName()=="ul"&&d.setStyle("display","")}},mark:function(a){this.multiSelect||this.unmarkAll();var a=this._.items[a],c=this.element.getDocument().getById(a);
c.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",true);this.onMark&&this.onMark(c)},unmark:function(a){var c=this.element.getDocument(),a=this._.items[a],e=c.getById(a);e.removeClass("cke_selected");c.getById(a+"_option").removeAttribute("aria-selected");this.onUnmark&&this.onUnmark(e)},unmarkAll:function(){var a=this._.items,c=this.element.getDocument(),e;for(e in a){var d=a[e];c.getById(d).removeClass("cke_selected");c.getById(d+"_option").removeAttribute("aria-selected")}this.onUnmark&&
this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var c=this.element.getElementsByTag("a"),e,d=-1;if(a)for(e=this.element.getDocument().getById(this._.items[a]).getFirst();a=c.getItem(++d);){if(a.equals(e)){this._.focusIndex=d;break}}else this.element.focus();e&&setTimeout(function(){e.focus()},0)}}})}}),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,
CKEDITOR.ui.richCombo.handler)}}),function(){var a='<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a=a+' onkeypress="return false;"');CKEDITOR.env.gecko&&
(a=a+' onblur="this.style.cssText = this.style.cssText;"');var a=a+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">'+(CKEDITOR.env.hc?"&#9660;":
CKEDITOR.env.air?"&nbsp;":"")+"</span></span></a></span>"),f=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,a,{canGroup:false,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};
a.toolbarRelated=true;this._={panelDefinition:a,items:{}}},proto:{renderHtml:function(a){var e=[];this.render(a,e);return e.join("")},render:function(a,e){function b(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var b=this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;if(a.readOnly&&!this.readOnly)b=CKEDITOR.TRISTATE_DISABLED;this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var g=CKEDITOR.env,i="cke_"+this.id,d=CKEDITOR.tools.addFunction(function(b){if(o){a.unlockSelection(1);
o=0}j.execute(b)},this),h=this,j={id:i,combo:this,focus:function(){CKEDITOR.document.getById(i).getChild(1).focus()},execute:function(b){var d=h._;if(d.state!=CKEDITOR.TRISTATE_DISABLED){h.createPanel(a);if(d.on)d.panel.hide();else{h.commit();var e=h.getValue();e?d.list.mark(e):d.list.unmarkAll();d.panel.showBlock(h.id,new CKEDITOR.dom.element(b),4)}}},clickFn:d};a.on("activeFilterChange",b,this);a.on("mode",b,this);a.on("selectionChange",b,this);!this.readOnly&&a.on("readOnly",b,this);var k=CKEDITOR.tools.addFunction(function(b,
e){var b=new CKEDITOR.dom.event(b),f=b.getKeystroke();if(f==40)a.once("panelShow",function(a){a.data._.panel._.currentBlock.onKeyDown(40)});switch(f){case 13:case 32:case 40:CKEDITOR.tools.callFunction(d,e);break;default:j.onkey(j,f)}b.preventDefault()}),m=CKEDITOR.tools.addFunction(function(){j.onfocus&&j.onfocus()}),o=0;j.keyDownFn=k;g={id:i,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:g.gecko&&!g.hc?"":(this.title||"").replace("'",""),keydownFn:k,
focusFn:m,clickFn:d};f.output(g,e);if(this.onRender)this.onRender();return j},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,b=this._.panelDefinition.block,f=e.parent||CKEDITOR.document.getBody(),i="cke_combopanel__"+this.name,d=new CKEDITOR.ui.floatPanel(a,f,e),h=d.addListBlock(this.id,b),j=this;d.onShow=function(){this.element.addClass(i);j.setState(CKEDITOR.TRISTATE_ON);j._.on=1;j.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(j.onOpen)j.onOpen();a.once("panelShow",
function(){h.focus(!h.multiSelect&&j.getValue())})};d.onHide=function(b){this.element.removeClass(i);j.setState(j.modes&&j.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);j._.on=0;if(!b&&j.onClose)j.onClose()};d.onEscape=function(){d.hide(1)};h.onClick=function(a,b){j.onClick&&j.onClick.call(j,a,b);d.hide()};this._.panel=d;this._.list=h;d.getBlock(this.id).onHide=function(){j._.on=0;j.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,e){this._.value=a;var b=
this.document.getById("cke_"+this.id+"_text");if(b){if(!a&&!e){e=this.label;b.addClass("cke_combo_inlinelabel")}else b.removeClass("cke_combo_inlinelabel");b.setText(typeof e!="undefined"?e:a)}},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,e,b){this._.items[a]=b||a;
this._.list.add(a,e,b)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){if(!this._.committed){this._.list.commit();this._.committed=1;CKEDITOR.ui.fire("ready",this)}this._.committed=1},setState:function(a){if(this._.state!=a){var e=this.document.getById("cke_"+this.id);e.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?e.setAttribute("aria-disabled",true):e.removeAttribute("aria-disabled");this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==
CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){if(this._.state!=CKEDITOR.TRISTATE_DISABLED){this._.lastState=this._.state;this.setState(CKEDITOR.TRISTATE_DISABLED)}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,e){this.add(a,CKEDITOR.UI_RICHCOMBO,e)}}(),function(){function a(a,e,b,g,i,d,h,j){for(var k=a.config,m=new CKEDITOR.style(h),o=i.split(";"),i=[],p={},n=0;n<o.length;n++){var l=o[n];
if(l){var l=l.split("/"),q={},r=o[n]=l[0];q[b]=i[n]=l[1]||r;p[r]=new CKEDITOR.style(h,q);p[r]._.definition.name=r}else o.splice(n--,1)}a.ui.addRichCombo(e,{label:g.label,title:g.panelTitle,toolbar:"styles,"+j,allowedContent:m,requiredContent:m,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(k.contentsCss),multiSelect:false,attributes:{"aria-label":g.panelTitle}},init:function(){this.startGroup(g.panelTitle);for(var a=0;a<o.length;a++){var b=o[a];this.add(b,p[b].buildPreview(),b)}},onClick:function(b){a.focus();
a.fire("saveSnapshot");var d=this.getValue(),e=p[b];if(d&&b!=d){var g=p[d],h=a.getSelection().getRanges()[0];if(h.collapsed){var j=a.elementPath(),i=j.contains(function(a){return g.checkElementRemovable(a)});if(i){var k=h.checkBoundaryOfElement(i,CKEDITOR.START),r=h.checkBoundaryOfElement(i,CKEDITOR.END);if(k&&r){for(k=h.createBookmark();j=i.getFirst();)j.insertBefore(i);i.remove();h.moveToBookmark(k)}else if(k)h.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START);else if(r)h.moveToPosition(i,CKEDITOR.POSITION_AFTER_END);
else{h.splitElement(i);h.moveToPosition(i,CKEDITOR.POSITION_AFTER_END);f(h,j.elements.slice(),i)}a.getSelection().selectRanges([h])}}else a.removeStyle(g)}a[d==b?"removeStyle":"applyStyle"](e);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){for(var e=this.getValue(),b=b.data.path.elements,f=0,g;f<b.length;f++){g=b[f];for(var h in p)if(p[h].checkElementMatch(g,true,a)){h!=e&&this.setValue(h);return}}this.setValue("",d)},this)},refresh:function(){a.activeFilter.check(m)||
this.setState(CKEDITOR.TRISTATE_DISABLED)}})}function f(a,e,b){var g=e.pop();if(g){if(b)return f(a,e,g.equals(b)?null:b);b=g.clone();a.insertNode(b);a.moveToPosition(b,CKEDITOR.POSITION_AFTER_START);f(a,e)}}CKEDITOR.plugins.add("font",{requires:"richcombo",init:function(c){var e=c.config;a(c,"Font","family",c.lang.font,e.font_names,e.font_defaultLabel,e.font_style,30);a(c,"FontSize","size",c.lang.font.fontSize,e.fontSize_sizes,e.fontSize_defaultLabel,e.fontSize_style,40)}})}(),CKEDITOR.config.font_names=
"Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif",CKEDITOR.config.font_defaultLabel="",CKEDITOR.config.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",
attributes:{face:null}}]},CKEDITOR.config.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px",CKEDITOR.config.fontSize_defaultLabel="",CKEDITOR.config.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]},CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(a){if(!a.blockless){for(var f=a.config,c=a.lang.format,e=f.format_tags.split(";"),
b={},g=0,i=[],d=0;d<e.length;d++){var h=e[d],j=new CKEDITOR.style(f["format_"+h]);if(!a.filter.customConfig||a.filter.check(j)){g++;b[h]=j;b[h]._.enterMode=a.config.enterMode;i.push(j)}}g!==0&&a.ui.addRichCombo("Format",{label:c.label,title:c.panelTitle,toolbar:"styles,20",allowedContent:i,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),multiSelect:false,attributes:{"aria-label":c.panelTitle}},init:function(){this.startGroup(c.panelTitle);for(var a in b){var d=c["tag_"+a];this.add(a,
b[a].buildPreview(d),d)}},onClick:function(c){a.focus();a.fire("saveSnapshot");var c=b[c],d=a.elementPath();a[c.checkActive(d,a)?"removeStyle":"applyStyle"](c);setTimeout(function(){a.fire("saveSnapshot")},0)},onRender:function(){a.on("selectionChange",function(c){var d=this.getValue(),c=c.data.path;this.refresh();for(var e in b)if(b[e].checkActive(c,a)){e!=d&&this.setValue(e,a.lang.format["tag_"+e]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var c in b)a.activeFilter.check(b[c])||
this.hideItem(c)},refresh:function(){var c=a.elementPath();if(c){if(c.isContextFor("p"))for(var d in b)if(a.activeFilter.check(b[d]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}}),CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div",CKEDITOR.config.format_p={element:"p"},CKEDITOR.config.format_div={element:"div"},CKEDITOR.config.format_pre={element:"pre"},CKEDITOR.config.format_address={element:"address"},CKEDITOR.config.format_h1={element:"h1"},CKEDITOR.config.format_h2={element:"h2"},
CKEDITOR.config.format_h3={element:"h3"},CKEDITOR.config.format_h4={element:"h4"},CKEDITOR.config.format_h5={element:"h5"},CKEDITOR.config.format_h6={element:"h6"},CKEDITOR.plugins.add("forms",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");CKEDITOR.addCss("img.cke_hidden{background-image: url("+CKEDITOR.getUrl(this.path+"images/hiddenfield.gif")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}")},
init:function(a){var f=a.lang,c=0,e={email:1,password:1,search:1,tel:1,text:1,url:1},b={checkbox:"input[type,name,checked]",radio:"input[type,name,checked]",textfield:"input[type,name,value,size,maxlength]",textarea:"textarea[cols,rows,name]",select:"select[name,size,multiple]; option[value,selected]",button:"input[type,name,value]",form:"form[action,name,id,enctype,target,method]",hiddenfield:"input[type,name,value]",imagebutton:"input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"},
g={checkbox:"input",radio:"input",textfield:"input",textarea:"textarea",select:"select",button:"input",form:"form",hiddenfield:"input",imagebutton:"input"},i=function(d,e,h){var i={allowedContent:b[e],requiredContent:g[e]};e=="form"&&(i.context="form");a.addCommand(e,new CKEDITOR.dialogCommand(e,i));a.ui.addButton&&a.ui.addButton(d,{label:f.common[d.charAt(0).toLowerCase()+d.slice(1)],command:e,toolbar:"forms,"+(c=c+10)});CKEDITOR.dialog.add(e,h)},d=this.path+"dialogs/";!a.blockless&&i("Form","form",
d+"form.js");i("Checkbox","checkbox",d+"checkbox.js");i("Radio","radio",d+"radio.js");i("TextField","textfield",d+"textfield.js");i("Textarea","textarea",d+"textarea.js");i("Select","select",d+"select.js");i("Button","button",d+"button.js");var h=a.plugins.image;h&&!a.plugins.image2&&i("ImageButton","imagebutton",CKEDITOR.plugins.getPath("image")+"dialogs/image.js");i("HiddenField","hiddenfield",d+"hiddenfield.js");if(a.addMenuItems){i={checkbox:{label:f.forms.checkboxAndRadio.checkboxTitle,command:"checkbox",
group:"checkbox"},radio:{label:f.forms.checkboxAndRadio.radioTitle,command:"radio",group:"radio"},textfield:{label:f.forms.textfield.title,command:"textfield",group:"textfield"},hiddenfield:{label:f.forms.hidden.title,command:"hiddenfield",group:"hiddenfield"},button:{label:f.forms.button.title,command:"button",group:"button"},select:{label:f.forms.select.title,command:"select",group:"select"},textarea:{label:f.forms.textarea.title,command:"textarea",group:"textarea"}};if(h)i.imagebutton={label:f.image.titleButton,
command:"imagebutton",group:"imagebutton"};!a.blockless&&(i.form={label:f.forms.form.menu,command:"form",group:"form"});a.addMenuItems(i)}if(a.contextMenu){!a.blockless&&a.contextMenu.addListener(function(a,b,c){if((a=c.contains("form",1))&&!a.isReadOnly())return{form:CKEDITOR.TRISTATE_OFF}});a.contextMenu.addListener(function(a){if(a&&!a.isReadOnly()){var b=a.getName();if(b=="select")return{select:CKEDITOR.TRISTATE_OFF};if(b=="textarea")return{textarea:CKEDITOR.TRISTATE_OFF};if(b=="input"){var c=
a.getAttribute("type")||"text";switch(c){case "button":case "submit":case "reset":return{button:CKEDITOR.TRISTATE_OFF};case "checkbox":return{checkbox:CKEDITOR.TRISTATE_OFF};case "radio":return{radio:CKEDITOR.TRISTATE_OFF};case "image":return h?{imagebutton:CKEDITOR.TRISTATE_OFF}:null}if(e[c])return{textfield:CKEDITOR.TRISTATE_OFF}}if(b=="img"&&a.data("cke-real-element-type")=="hiddenfield")return{hiddenfield:CKEDITOR.TRISTATE_OFF}}})}a.on("doubleclick",function(b){var c=b.data.element;if(!a.blockless&&
c.is("form"))b.data.dialog="form";else if(c.is("select"))b.data.dialog="select";else if(c.is("textarea"))b.data.dialog="textarea";else if(c.is("img")&&c.data("cke-real-element-type")=="hiddenfield")b.data.dialog="hiddenfield";else if(c.is("input")){c=c.getAttribute("type")||"text";switch(c){case "button":case "submit":case "reset":b.data.dialog="button";break;case "checkbox":b.data.dialog="checkbox";break;case "radio":b.data.dialog="radio";break;case "image":b.data.dialog="imagebutton"}if(e[c])b.data.dialog=
"textfield"}})},afterInit:function(a){var f=a.dataProcessor,c=f&&f.htmlFilter,f=f&&f.dataFilter;CKEDITOR.env.ie&&c&&c.addRules({elements:{input:function(a){var a=a.attributes,b=a.type;if(!b)a.type="text";(b=="checkbox"||b=="radio")&&a.value=="on"&&delete a.value}}},{applyToAll:true});f&&f.addRules({elements:{input:function(c){if(c.attributes.type=="hidden")return a.createFakeParserElement(c,"cke_hidden","hiddenfield")}}},{applyToAll:true})}}),function(){var a={canUndo:false,exec:function(a){var c=
a.document.createElement("hr");a.insertElement(c)},allowedContent:"hr",requiredContent:"hr"};CKEDITOR.plugins.add("horizontalrule",{init:function(f){if(!f.blockless){f.addCommand("horizontalrule",a);f.ui.addButton&&f.ui.addButton("HorizontalRule",{label:f.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"})}}})}(),CKEDITOR.plugins.add("htmlwriter",{init:function(a){var f=new CKEDITOR.htmlWriter;f.forceSimpleAmpersand=a.config.forceSimpleAmpersand;f.indentationChars=a.config.dataIndentationChars||
"\t";a.dataProcessor.writer=f}}),CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base();this.indentationChars="\t";this.selfClosingEnd=" />";this.lineBreakChars="\n";this.sortAttributes=1;this._.indent=0;this._.indentation="";this._.inPre=0;this._.rules={};var a=CKEDITOR.dtd,f;for(f in CKEDITOR.tools.extend({},a.$nonBodyContent,a.$block,a.$listItem,a.$tableContent))this.setRules(f,{indent:!a[f]["#"],breakBeforeOpen:1,breakBeforeClose:!a[f]["#"],
breakAfterClose:1,needsSpace:f in a.$block&&!(f in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1});this.setRules("title",{indent:0,breakAfterOpen:0});this.setRules("style",{indent:0,breakBeforeClose:1});this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(a){var f=this._.rules[a];this._.afterCloser&&(f&&f.needsSpace&&this._.needsSpace)&&this._.output.push("\n");if(this._.indent)this.indentation();else if(f&&f.breakBeforeOpen){this.lineBreak();this.indentation()}this._.output.push("<",
a);this._.afterCloser=0},openTagClose:function(a,f){var c=this._.rules[a];if(f){this._.output.push(this.selfClosingEnd);if(c&&c.breakAfterClose)this._.needsSpace=c.needsSpace}else{this._.output.push(">");if(c&&c.indent)this._.indentation=this._.indentation+this.indentationChars}c&&c.breakAfterOpen&&this.lineBreak();a=="pre"&&(this._.inPre=1)},attribute:function(a,f){if(typeof f=="string"){this.forceSimpleAmpersand&&(f=f.replace(/&amp;/g,"&"));f=CKEDITOR.tools.htmlEncodeAttr(f)}this._.output.push(" ",
a,'="',f,'"')},closeTag:function(a){var f=this._.rules[a];if(f&&f.indent)this._.indentation=this._.indentation.substr(this.indentationChars.length);if(this._.indent)this.indentation();else if(f&&f.breakBeforeClose){this.lineBreak();this.indentation()}this._.output.push("</",a,">");a=="pre"&&(this._.inPre=0);if(f&&f.breakAfterClose){this.lineBreak();this._.needsSpace=f.needsSpace}this._.afterCloser=1},text:function(a){if(this._.indent){this.indentation();!this._.inPre&&(a=CKEDITOR.tools.ltrim(a))}this._.output.push(a)},
comment:function(a){this._.indent&&this.indentation();this._.output.push("<\!--",a,"--\>")},lineBreak:function(){!this._.inPre&&this._.output.length>0&&this._.output.push(this.lineBreakChars);this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation);this._.indent=0},reset:function(){this._.output=[];this._.indent=0;this._.indentation="";this._.afterCloser=0;this._.inPre=0},setRules:function(a,f){var c=this._.rules[a];c?CKEDITOR.tools.extend(c,
f,true):this._.rules[a]=f}}}),function(){CKEDITOR.plugins.add("iframe",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_iframe{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},init:function(a){var f=a.lang.iframe,c="iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";a.plugins.dialogadvtab&&(c=c+(";iframe"+
a.plugins.dialogadvtab.allowedContent({id:1,classes:1,styles:1})));CKEDITOR.dialog.add("iframe",this.path+"dialogs/iframe.js");a.addCommand("iframe",new CKEDITOR.dialogCommand("iframe",{allowedContent:c,requiredContent:"iframe"}));a.ui.addButton&&a.ui.addButton("Iframe",{label:f.toolbar,command:"iframe",toolbar:"insert,80"});a.on("doubleclick",function(a){var b=a.data.element;if(b.is("img")&&b.data("cke-real-element-type")=="iframe")a.data.dialog="iframe"});a.addMenuItems&&a.addMenuItems({iframe:{label:f.title,
command:"iframe",group:"image"}});a.contextMenu&&a.contextMenu.addListener(function(a){if(a&&a.is("img")&&a.data("cke-real-element-type")=="iframe")return{iframe:CKEDITOR.TRISTATE_OFF}})},afterInit:function(a){var f=a.dataProcessor;(f=f&&f.dataFilter)&&f.addRules({elements:{iframe:function(c){return a.createFakeParserElement(c,"cke_iframe","iframe",true)}}})}})}(),function(){function a(a,e){e||(e=a.getSelection().getSelectedElement());if(e&&e.is("img")&&!e.data("cke-realelement")&&!e.isReadOnly())return e}
function f(a){var e=a.getStyle("float");if(e=="inherit"||e=="none")e=0;e||(e=a.getAttribute("align"));return e}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(c){if(!c.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var e="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";CKEDITOR.dialog.isTabEnabled(c,"image","advanced")&&(e="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");c.addCommand("image",
new CKEDITOR.dialogCommand("image",{allowedContent:e,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]}));c.ui.addButton&&c.ui.addButton("Image",{label:c.lang.common.image,command:"image",toolbar:"insert,10"});c.on("doubleclick",function(a){var c=a.data.element;if(c.is("img")&&!c.data("cke-realelement")&&!c.isReadOnly())a.data.dialog="image"});c.addMenuItems&&c.addMenuItems({image:{label:c.lang.image.menu,
command:"image",group:"image"}});c.contextMenu&&c.contextMenu.addListener(function(b){if(a(c,b))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(c){function e(b){var e=c.getCommand("justify"+b);if(e){if(b=="left"||b=="right")e.on("exec",function(e){var d=a(c),g;if(d){g=f(d);if(g==b){d.removeStyle("float");b==f(d)&&d.removeAttribute("align")}else d.setStyle("float",b);e.cancel()}});e.on("refresh",function(e){var d=a(c);if(d){d=f(d);this.setState(d==b?CKEDITOR.TRISTATE_ON:b=="right"||b=="left"?
CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);e.cancel()}})}}if(!c.plugins.image2){e("left");e("right");e("center");e("block")}}})}(),CKEDITOR.config.image_removeLinkByEmptyURL=!0,function(){function a(a,b){var g,i;b.on("refresh",function(a){var b=[f],e;for(e in a.data.states)b.push(a.data.states[e]);this.setState(CKEDITOR.tools.search(b,c)?c:f)},b,null,100);b.on("exec",function(b){g=a.getSelection();i=g.createBookmarks(1);if(!b.data)b.data={};b.data.done=false},b,null,0);b.on("exec",function(){a.forceNextSelectionCheck();
g.selectBookmarks(i)},b,null,100)}var f=CKEDITOR.TRISTATE_DISABLED,c=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(c){var b=CKEDITOR.plugins.indent.genericDefinition;a(c,c.addCommand("indent",new b(true)));a(c,c.addCommand("outdent",new b));if(c.ui.addButton){c.ui.addButton("Indent",{label:c.lang.indent.indent,command:"indent",directional:true,toolbar:"indent,20"});c.ui.addButton("Outdent",{label:c.lang.indent.outdent,command:"outdent",directional:true,toolbar:"indent,10"})}c.on("dirChanged",
function(a){var b=c.createRange(),d=a.data.node;b.setStartBefore(d);b.setEndAfter(d);for(var f=new CKEDITOR.dom.walker(b),j;j=f.next();)if(j.type==CKEDITOR.NODE_ELEMENT)if(!j.equals(d)&&j.getDirection()){b.setStartAfter(j);f=new CKEDITOR.dom.walker(b)}else{var k=c.config.indentClasses;if(k)for(var m=a.data.dir=="ltr"?["_rtl",""]:["","_rtl"],o=0;o<k.length;o++)if(j.hasClass(k[o]+m[0])){j.removeClass(k[o]+m[0]);j.addClass(k[o]+m[1])}k=j.getStyle("margin-right");m=j.getStyle("margin-left");k?j.setStyle("margin-left",
k):j.removeStyle("margin-left");m?j.setStyle("margin-right",m):j.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,b,c){this.name=b;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!c;this.relatedGlobal=c?"indent":"outdent";this.indentKey=c?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,b){a.on("pluginsLoaded",function(){for(var a in b)(function(a,
b){var c=a.getCommand(b.relatedGlobal),e;for(e in b.jobs){c.on("exec",function(c){if(!c.data.done){a.fire("lockSnapshot");if(b.execJob(a,e))c.data.done=true;a.fire("unlockSnapshot");CKEDITOR.dom.element.clearAllMarkers(b.database)}},this,null,e);c.on("refresh",function(c){if(!c.data.states)c.data.states={};c.data.states[b.name+"@"+e]=b.refreshJob(a,e,c.data.path)},this,null,e)}a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype=
{execJob:function(a,b){var c=this.jobs[b];if(c.state!=f)return c.exec.call(this,a)},refreshJob:function(a,b,c){b=this.jobs[b];b.state=a.activeFilter.checkFeature(this)?b.refresh.call(this,a,c):f;return b.state},getContext:function(a){return a.contains(this.context)}}}(),function(){function a(a){function b(f){for(var h=p.startContainer,n=p.endContainer;h&&!h.getParent().equals(f);)h=h.getParent();for(;n&&!n.getParent().equals(f);)n=n.getParent();if(!h||!n)return false;for(var l=h,h=[],o=false;!o;){l.equals(n)&&
(o=true);h.push(l);l=l.getNext()}if(h.length<1)return false;l=f.getParents(true);for(n=0;n<l.length;n++)if(l[n].getName&&i[l[n].getName()]){f=l[n];break}for(var l=e.isIndent?1:-1,n=h[0],h=h[h.length-1],o=CKEDITOR.plugins.list.listToArray(f,g),x=o[h.getCustomData("listarray_index")].indent,n=n.getCustomData("listarray_index");n<=h.getCustomData("listarray_index");n++){o[n].indent=o[n].indent+l;if(l>0){var w=o[n].parent;o[n].parent=new CKEDITOR.dom.element(w.getName(),w.getDocument())}}for(n=h.getCustomData("listarray_index")+
1;n<o.length&&o[n].indent>x;n++)o[n].indent=o[n].indent+l;h=CKEDITOR.plugins.list.arrayToList(o,g,null,a.config.enterMode,f.getDirection());if(!e.isIndent){var s;if((s=f.getParent())&&s.is("li"))for(var l=h.listNode.getChildren(),y=[],z,n=l.count()-1;n>=0;n--)(z=l.getItem(n))&&(z.is&&z.is("li"))&&y.push(z)}h&&h.listNode.replace(f);if(y&&y.length)for(n=0;n<y.length;n++){for(z=f=y[n];(z=z.getNext())&&z.is&&z.getName()in i;){CKEDITOR.env.needsNbspFiller&&!f.getFirst(c)&&f.append(p.document.createText(" "));
f.append(z)}f.insertAfter(s)}h&&a.fire("contentDomInvalidated");return true}for(var e=this,g=this.database,i=this.context,o=a.getSelection(),o=(o&&o.getRanges()).createIterator(),p;p=o.getNextRange();){for(var n=p.getCommonAncestor();n&&!(n.type==CKEDITOR.NODE_ELEMENT&&i[n.getName()]);)n=n.getParent();n||(n=p.startPath().contains(i))&&p.setEndAt(n,CKEDITOR.POSITION_BEFORE_END);if(!n){var l=p.getEnclosedNode();if(l&&l.type==CKEDITOR.NODE_ELEMENT&&l.getName()in i){p.setStartAt(l,CKEDITOR.POSITION_AFTER_START);
p.setEndAt(l,CKEDITOR.POSITION_BEFORE_END);n=l}}if(n&&p.startContainer.type==CKEDITOR.NODE_ELEMENT&&p.startContainer.getName()in i){l=new CKEDITOR.dom.walker(p);l.evaluator=f;p.startContainer=l.next()}if(n&&p.endContainer.type==CKEDITOR.NODE_ELEMENT&&p.endContainer.getName()in i){l=new CKEDITOR.dom.walker(p);l.evaluator=f;p.endContainer=l.previous()}if(n)return b(n)}return 0}function f(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function c(a){return e(a)&&b(a)}var e=CKEDITOR.dom.walker.whitespaces(true),
b=CKEDITOR.dom.walker.bookmark(false,true),g=CKEDITOR.TRISTATE_DISABLED,i=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(b){function c(b){e.specificDefinition.apply(this,arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){if(b.mode=="wysiwyg"&&a.data.keyCode==this.indentKey){var c=this.getContext(b.elementPath());if(c&&(!this.isIndent||!CKEDITOR.plugins.indentList.firstItemInPath(this.context,b.elementPath(),c))){b.execCommand(this.relatedGlobal);
a.cancel()}}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var c=this.getContext(b),d=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,c);return!c||!this.isIndent||d?g:i}:function(a,b){return!this.getContext(b)||this.isIndent?g:i},exec:CKEDITOR.tools.bind(a,this)}}var e=CKEDITOR.plugins.indent;e.registerCommands(b,{indentlist:new c(b,"indentlist",true),outdentlist:new c(b,"outdentlist")});CKEDITOR.tools.extend(c.prototype,e.specificDefinition.prototype,{context:{ol:1,
ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,b,c){var e=b.contains(f);c||(c=b.contains(a));return c&&e&&e.equals(c.getFirst(f))}}(),function(){function a(a,b,c){if(!a.getCustomData("indent_processed")){var e=this.editor,g=this.isIndent;if(b){e=a.$.className.match(this.classNameRegex);c=0;if(e){e=e[1];c=CKEDITOR.tools.indexOf(b,e)+1}if((c=c+(g?1:-1))<0)return;c=Math.min(c,b.length);c=Math.max(c,0);a.$.className=CKEDITOR.tools.ltrim(a.$.className.replace(this.classNameRegex,
""));c>0&&a.addClass(b[c-1])}else{var b=f(a,c),c=parseInt(a.getStyle(b),10),m=e.config.indentOffset||40;isNaN(c)&&(c=0);c=c+(g?1:-1)*m;if(c<0)return;c=Math.max(c,0);c=Math.ceil(c/m)*m;a.setStyle(b,c?c+(e.config.indentUnit||"px"):"");a.getAttribute("style")===""&&a.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,a,"indent_processed",1)}}function f(a,b){return(b||a.getComputedStyle("direction"))=="ltr"?"margin-left":"margin-right"}var c=CKEDITOR.dtd.$listItem,e=CKEDITOR.dtd.$list,
b=CKEDITOR.TRISTATE_DISABLED,g=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(i){function d(){h.specificDefinition.apply(this,arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:true,styles:!j?"margin-left,margin-right":null,classes:j||null}};if(this.enterBr)this.allowedContent.div=true;this.requiredContent=(this.enterBr?"div":"p")+(j?"("+j.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,d){var e=d.block||
d.blockLimit;e.is(c)||(e=e.getAscendant(c)||e);e.is(c)&&(e=e.getParent());if(!this.enterBr&&!this.getContext(d))return b;if(j){var h;h=j;var e=e.$.className.match(this.classNameRegex),i=this.isIndent;h=e?i?e[1]!=h.slice(-1):true:i;return h?g:b}return this.isIndent?g:e?CKEDITOR[(parseInt(e.getStyle(f(e)),10)||0)<=0?"TRISTATE_DISABLED":"TRISTATE_OFF"]:b},exec:function(b){var c=b.getSelection(),c=c&&c.getRanges()[0],d;if(d=b.elementPath().contains(e))a.call(this,d,j);else{c=c.createIterator();b=b.config.enterMode;
c.enforceRealBlocks=true;for(c.enlargeBr=b!=CKEDITOR.ENTER_BR;d=c.getNextParagraph(b==CKEDITOR.ENTER_P?"p":"div");)d.isReadOnly()||a.call(this,d,j)}return true}}}}var h=CKEDITOR.plugins.indent,j=i.config.indentClasses;h.registerCommands(i,{indentblock:new d(i,"indentblock",true),outdentblock:new d(i,"outdentblock")});CKEDITOR.tools.extend(d.prototype,h.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:j?RegExp("(?:^|\\s+)("+
j.join("|")+")(?=$|\\s)"):null})}})}(),function(){function a(a,b){var b=b===void 0||b,c;if(b)c=a.getComputedStyle("text-align");else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){c=a.getParent();if(!c)break;a=c}c=a.getStyle("text-align")||a.getAttribute("align")||""}c&&(c=c.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!c&&b&&(c=a.getComputedStyle("direction")=="rtl"?"right":"left");return c}function f(a,b,c){this.editor=a;this.name=b;this.value=c;this.context=
"p";var b=a.config.justifyClasses,f=a.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(b){switch(c){case "left":this.cssClassName=b[0];break;case "center":this.cssClassName=b[1];break;case "right":this.cssClassName=b[2];break;case "justify":this.cssClassName=b[3]}this.cssClassRegex=RegExp("(?:^|\\s+)(?:"+b.join("|")+")(?=$|\\s)");this.requiredContent=f+"("+this.cssClassName+")"}else this.requiredContent=f+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:true,
styles:this.cssClassName?null:"text-align",classes:this.cssClassName||null}};if(a.config.enterMode==CKEDITOR.ENTER_BR)this.allowedContent.div=true}function c(a){var b=a.editor,c=b.createRange();c.setStartBefore(a.data.node);c.setEndAfter(a.data.node);for(var f=new CKEDITOR.dom.walker(c),d;d=f.next();)if(d.type==CKEDITOR.NODE_ELEMENT)if(!d.equals(a.data.node)&&d.getDirection()){c.setStartAfter(d);f=new CKEDITOR.dom.walker(c)}else{var h=b.config.justifyClasses;if(h)if(d.hasClass(h[0])){d.removeClass(h[0]);
d.addClass(h[2])}else if(d.hasClass(h[2])){d.removeClass(h[2]);d.addClass(h[0])}h=d.getStyle("text-align");h=="left"?d.setStyle("text-align","right"):h=="right"&&d.setStyle("text-align","left")}}f.prototype={exec:function(c){var b=c.getSelection(),f=c.config.enterMode;if(b){for(var i=b.createBookmarks(),d=b.getRanges(),h=this.cssClassName,j,k,m=c.config.useComputedState,m=m===void 0||m,o=d.length-1;o>=0;o--){j=d[o].createIterator();for(j.enlargeBr=f!=CKEDITOR.ENTER_BR;k=j.getNextParagraph(f==CKEDITOR.ENTER_P?
"p":"div");)if(!k.isReadOnly()){k.removeAttribute("align");k.removeStyle("text-align");var p=h&&(k.$.className=CKEDITOR.tools.ltrim(k.$.className.replace(this.cssClassRegex,""))),n=this.state==CKEDITOR.TRISTATE_OFF&&(!m||a(k,true)!=this.value);h?n?k.addClass(h):p||k.removeAttribute("class"):n&&k.setStyle("text-align",this.value)}}c.focus();c.forceNextSelectionCheck();b.selectBookmarks(i)}},refresh:function(c,b){var f=b.block||b.blockLimit;this.setState(f.getName()!="body"&&a(f,this.editor.config.useComputedState)==
this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var b=new f(a,"justifyleft","left"),g=new f(a,"justifycenter","center"),i=new f(a,"justifyright","right"),d=new f(a,"justifyblock","justify");a.addCommand("justifyleft",b);a.addCommand("justifycenter",g);a.addCommand("justifyright",i);a.addCommand("justifyblock",d);if(a.ui.addButton){a.ui.addButton("JustifyLeft",{label:a.lang.justify.left,command:"justifyleft",toolbar:"align,10"});
a.ui.addButton("JustifyCenter",{label:a.lang.justify.center,command:"justifycenter",toolbar:"align,20"});a.ui.addButton("JustifyRight",{label:a.lang.justify.right,command:"justifyright",toolbar:"align,30"});a.ui.addButton("JustifyBlock",{label:a.lang.justify.block,command:"justifyblock",toolbar:"align,40"})}a.on("dirChanged",c)}}})}(),"use strict",function(){function a(a){return a.replace(/'/g,"\\$&")}function f(a){for(var b,c=a.length,d=[],e=0;e<c;e++){b=a.charCodeAt(e);d.push(b)}return"String.fromCharCode("+
d.join(",")+")"}function c(b,c){var d=b.plugins.link,e=d.compiledProtectionFunction.params,f,g;g=[d.compiledProtectionFunction.name,"("];for(var h=0;h<e.length;h++){d=e[h].toLowerCase();f=c[d];h>0&&g.push(",");g.push("'",f?a(encodeURIComponent(c[d])):"","'")}g.push(")");return g.join("")}function e(a){var a=a.config.emailProtection||"",b;if(a&&a!="encode"){b={};a.replace(/^([^(]+)\(([^)]+)\)$/,function(a,c,d){b.name=c;b.params=[];d.replace(/[^,\s]+/g,function(a){b.params.push(a)})})}return b}CKEDITOR.plugins.add("link",
{requires:"dialog,fakeobjects",onLoad:function(){function a(b){return c.replace(/%1/g,b=="rtl"?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",c=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
CKEDITOR.addCss(a("ltr")+a("rtl"))},init:function(a){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(a,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));CKEDITOR.dialog.isTabEnabled(a,"link","target")&&(b=b.replace("]",",target,onclick]"));a.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,requiredContent:"a[href]"}));a.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));
a.addCommand("unlink",new CKEDITOR.unlinkCommand);a.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);a.setKeystroke(CKEDITOR.CTRL+76,"link");if(a.ui.addButton){a.ui.addButton("Link",{label:a.lang.link.toolbar,command:"link",toolbar:"links,10"});a.ui.addButton("Unlink",{label:a.lang.link.unlink,command:"unlink",toolbar:"links,20"});a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})}CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",
this.path+"dialogs/anchor.js");a.on("doubleclick",function(b){var c=CKEDITOR.plugins.link.getSelectedLink(a)||b.data.element;if(!c.isReadOnly())if(c.is("a")){b.data.dialog=c.getAttribute("name")&&(!c.getAttribute("href")||!c.getChildCount())?"anchor":"link";b.data.link=c}else if(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,c))b.data.dialog="anchor"},null,null,0);a.on("doubleclick",function(b){b.data.dialog in{link:1,anchor:1}&&b.data.link&&a.getSelection().selectElement(b.data.link)},null,null,20);
a.addMenuItems&&a.addMenuItems({anchor:{label:a.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:a.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:a.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:a.lang.link.unlink,command:"unlink",group:"link",order:5}});a.contextMenu&&a.contextMenu.addListener(function(b){if(!b||b.isReadOnly())return null;b=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b);if(!b&&!(b=CKEDITOR.plugins.link.getSelectedLink(a)))return null;
var c={};b.getAttribute("href")&&b.getChildCount()&&(c={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});if(b&&b.hasAttribute("name"))c.anchor=c.removeAnchor=CKEDITOR.TRISTATE_OFF;return c});this.compiledProtectionFunction=e(a)},afterInit:function(a){a.dataProcessor.dataFilter.addRules({elements:{a:function(b){return!b.attributes.name?null:!b.children.length?a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if(c==
"a"&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var b=/^javascript:/,g=/^mailto:([^?]+)(?:\?(.+))?$/,i=/subject=([^;?:@&=$,\/]*)/,d=/body=([^;?:@&=$,\/]*)/,h=/^#(.*)$/,j=/^((?:http|https|ftp|news):\/\/)?(.*)$/,k=/^(_(?:self|top|parent|blank))$/,m=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,o=/^javascript:([^(]+)\(([^)]+)\)$/,p=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
n=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,l={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a){var b=a.getSelection(),c=b.getSelectedElement();if(c&&c.is("a"))return c;if(b=b.getRanges()[0]){b.shrink(CKEDITOR.SHRINK_TEXT);return a.elementPath(b.getCommonAncestor()).contains("a",1)}return null},
getEditorAnchors:function(a){for(var b=a.editable(),c=b.isInline()&&!a.plugins.divarea?a.document:b,b=c.getElementsByTag("a"),c=c.getElementsByTag("img"),d=[],e=0,f;f=b.getItem(e++);)if(f.data("cke-saved-name")||f.hasAttribute("name"))d.push({name:f.data("cke-saved-name")||f.getAttribute("name"),id:f.getAttribute("id")});for(e=0;f=c.getItem(e++);)(f=this.tryRestoreFakeAnchor(a,f))&&d.push({name:f.getAttribute("name"),id:f.getAttribute("id")});return d},fakeAnchor:true,tryRestoreFakeAnchor:function(a,
b){if(b&&b.data("cke-real-element-type")&&b.data("cke-real-element-type")=="anchor"){var c=a.restoreRealElement(b);if(c.data("cke-saved-name"))return c}},parseLinkAttributes:function(a,c){var e=c&&(c.data("cke-saved-href")||c.getAttribute("href"))||"",f=a.plugins.link.compiledProtectionFunction,v=a.config.emailProtection,x,w={};e.match(b)&&(v=="encode"?e=e.replace(m,function(a,b,c){return"mailto:"+String.fromCharCode.apply(String,b.split(","))+(c&&c.replace(/\\'/g,"'"))}):v&&e.replace(o,function(a,
b,c){if(b==f.name){w.type="email";for(var a=w.email={},b=/(^')|('$)/g,c=c.match(/[^,\s]+/g),d=c.length,e,g,h=0;h<d;h++){e=decodeURIComponent;g=c[h].replace(b,"").replace(/\\'/g,"'");g=e(g);e=f.params[h].toLowerCase();a[e]=g}a.address=[a.name,a.domain].join("@")}}));if(!w.type)if(v=e.match(h)){w.type="anchor";w.anchor={};w.anchor.name=w.anchor.id=v[1]}else if(v=e.match(g)){x=e.match(i);e=e.match(d);w.type="email";var s=w.email={};s.address=v[1];x&&(s.subject=decodeURIComponent(x[1]));e&&(s.body=decodeURIComponent(e[1]))}else if(e&&
(x=e.match(j))){w.type="url";w.url={};w.url.protocol=x[1];w.url.url=x[2]}if(c){if(e=c.getAttribute("target"))w.target={type:e.match(k)?e:"frame",name:e};else if(e=(e=c.data("cke-pa-onclick")||c.getAttribute("onclick"))&&e.match(p))for(w.target={type:"popup",name:e[1]};v=n.exec(e[2]);)(v[2]=="yes"||v[2]=="1")&&!(v[1]in{height:1,width:1,top:1,left:1})?w.target[v[1]]=true:isFinite(v[2])&&(w.target[v[1]]=v[2]);var e={},y;for(y in l)(v=c.getAttribute(y))&&(e[l[y]]=v);if(y=c.data("cke-saved-name")||e.advName)e.advName=
y;if(!CKEDITOR.tools.isEmpty(e))w.advanced=e}return w},getLinkAttributes:function(b,d){var e=b.config.emailProtection||"",g={};switch(d.type){case "url":var e=d.url&&d.url.protocol!=void 0?d.url.protocol:"http://",h=d.url&&CKEDITOR.tools.trim(d.url.url)||"";g["data-cke-saved-href"]=h.indexOf("/")===0?h:e+h;break;case "anchor":e=d.anchor&&d.anchor.id;g["data-cke-saved-href"]="#"+(d.anchor&&d.anchor.name||e||"");break;case "email":var i=d.email,h=i.address;switch(e){case "":case "encode":var j=encodeURIComponent(i.subject||
""),k=encodeURIComponent(i.body||""),i=[];j&&i.push("subject="+j);k&&i.push("body="+k);i=i.length?"?"+i.join("&"):"";if(e=="encode"){e=["javascript:void(location.href='mailto:'+",f(h)];i&&e.push("+'",a(i),"'");e.push(")")}else e=["mailto:",h,i];break;default:e=h.split("@",2);i.name=e[0];i.domain=e[1];e=["javascript:",c(b,i)]}g["data-cke-saved-href"]=e.join("")}if(d.target)if(d.target.type=="popup"){for(var e=["window.open(this.href, '",d.target.name||"","', '"],n=["resizable","status","location",
"toolbar","menubar","fullscreen","scrollbars","dependent"],h=n.length,j=function(a){d.target[a]&&n.push(a+"="+d.target[a])},i=0;i<h;i++)n[i]=n[i]+(d.target[n[i]]?"=yes":"=no");j("width");j("left");j("height");j("top");e.push(n.join(","),"'); return false;");g["data-cke-pa-onclick"]=e.join("")}else if(d.target.type!="notSet"&&d.target.name)g.target=d.target.name;if(d.advanced){for(var p in l)(e=d.advanced[l[p]])&&(g[p]=e);if(g.name)g["data-cke-saved-name"]=g.name}if(g["data-cke-saved-href"])g.href=
g["data-cke-saved-href"];p=CKEDITOR.tools.extend({target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},l);for(var m in g)delete p[m];return{set:g,removed:CKEDITOR.tools.objectKeys(p)}}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){var b=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});a.removeStyle(b)},refresh:function(a,b){var c=b.lastElement&&b.lastElement.getAscendant("a",true);c&&c.getName()=="a"&&c.getAttribute("href")&&
c.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"};CKEDITOR.removeAnchorCommand=function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(a){var b=a.getSelection(),c=b.createBookmarks(),d;if(b&&(d=b.getSelectedElement())&&(!d.getChildCount()?CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,d):d.is("a")))d.remove(1);else if(d=CKEDITOR.plugins.link.getSelectedLink(a))if(d.hasAttribute("href")){d.removeAttributes({name:1,
"data-cke-saved-name":1});d.removeClass("cke_anchor")}else d.remove(1);b.selectBookmarks(c)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:true,linkShowTargetTab:true})}(),function(){function a(a,b,c){function d(c){if((j=i[c?"getFirst":"getLast"]())&&(!j.is||!j.isBlockBoundary())&&(k=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(true)))&&(!k.is||!k.isBlockBoundary({br:1})))a.document.createElement("br")[c?"insertBefore":"insertAfter"](j)}for(var e=
CKEDITOR.plugins.list.listToArray(b.root,c),f=[],g=0;g<b.contents.length;g++){var h=b.contents[g];if((h=h.getAscendant("li",true))&&!h.getCustomData("list_item_processed")){f.push(h);CKEDITOR.dom.element.setMarker(c,h,"list_item_processed",true)}}h=null;for(g=0;g<f.length;g++){h=f[g].getCustomData("listarray_index");e[h].indent=-1}for(g=h+1;g<e.length;g++)if(e[g].indent>e[g-1].indent+1){f=e[g-1].indent+1-e[g].indent;for(h=e[g].indent;e[g]&&e[g].indent>=h;){e[g].indent=e[g].indent+f;g++}g--}var i=
CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,j,k;d(true);d();i.replace(b.root);a.fire("contentDomInvalidated")}function f(a,b){this.name=a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function c(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](p);){(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f);e.remove();c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d)}}function e(a){var b;(b=function(b){var d=
a[b?"getPrevious":"getNext"](k);if(d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())){c(a,d,null,!b);a.remove();a=d}})();b(1)}function b(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function g(a,b,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();b.trim(false,true);var g=b.createBookmark(),h=new CKEDITOR.dom.elementPath(b.startContainer),j=h.block,
h=h.lastElement.getAscendant("li",1)||j,p=new CKEDITOR.dom.elementPath(d.startContainer),o=p.contains(CKEDITOR.dtd.$listItem),p=p.contains(CKEDITOR.dtd.$list);if(j)(j=j.getBogus())&&j.remove();else if(p)(j=p.getPrevious(k))&&m(j)&&j.remove();(j=f.getLast())&&(j.type==CKEDITOR.NODE_ELEMENT&&j.is("br"))&&j.remove();(j=b.startContainer.getChild(b.startOffset))?f.insertBefore(j):b.startContainer.append(f);if(o)if(f=i(o))if(h.contains(o)){c(f,o.getParent(),o);f.remove()}else h.append(f);for(;d.checkStartOfBlock()&&
d.checkEndOfBlock();){p=d.startPath();f=p.block;if(!f)break;if(f.is("li")){h=f.getParent();f.equals(h.getLast(k))&&f.equals(h.getFirst(k))&&(f=h)}d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return k(a)&&!m(a)};(d=d.next())&&(d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list)&&e(d);b.moveToBookmark(g);b.select();a.fire("saveSnapshot")}function i(a){return(a=
a.getLast(k))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in d?a:null}var d={ol:1,ul:1},h=CKEDITOR.dom.walker.whitespaces(),j=CKEDITOR.dom.walker.bookmark(),k=function(a){return!(h(a)||j(a))},m=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,b,c,e,f){if(!d[a.getName()])return[];e||(e=0);c||(c=[]);for(var g=0,h=a.getChildCount();g<h;g++){var i=a.getChild(g);i.type==CKEDITOR.NODE_ELEMENT&&i.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(i,b,c,e+1);if(i.$.nodeName.toLowerCase()==
"li"){var j={parent:a,indent:e,element:i,contents:[]};if(f)j.grandparent=f;else{j.grandparent=a.getParent();if(j.grandparent&&j.grandparent.$.nodeName.toLowerCase()=="li")j.grandparent=j.grandparent.getParent()}b&&CKEDITOR.dom.element.setMarker(b,i,"listarray_index",c.length);c.push(j);for(var k=0,p=i.getChildCount(),m;k<p;k++){m=i.getChild(k);m.type==CKEDITOR.NODE_ELEMENT&&d[m.getName()]?CKEDITOR.plugins.list.listToArray(m,b,c,e+1,j.grandparent):j.contents.push(m)}}}return c},arrayToList:function(a,
b,c,e,f){c||(c=0);if(!a||a.length<c+1)return null;for(var g,h=a[c].parent.getDocument(),i=new CKEDITOR.dom.documentFragment(h),p=null,m=c,o=Math.max(a[c].indent,0),z=null,B,A,F=e==CKEDITOR.ENTER_P?"p":"div";;){var C=a[m];g=C.grandparent;B=C.element.getDirection(1);if(C.indent==o){if(!p||a[m].parent.getName()!=p.getName()){p=a[m].parent.clone(false,1);f&&p.setAttribute("dir",f);i.append(p)}z=p.append(C.element.clone(0,1));B!=p.getDirection(1)&&z.setAttribute("dir",B);for(g=0;g<C.contents.length;g++)z.append(C.contents[g].clone(1,
1));m++}else if(C.indent==Math.max(o,0)+1){C=a[m-1].element.getDirection(1);m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,C!=B?B:null);!z.getChildCount()&&(CKEDITOR.env.needsNbspFiller&&!(h.$.documentMode>7))&&z.append(h.createText(" "));z.append(m.listNode);m=m.nextIndex}else if(C.indent==-1&&!c&&g){if(d[g.getName()]){z=C.element.clone(false,true);B!=g.getDirection(1)&&z.setAttribute("dir",B)}else z=new CKEDITOR.dom.documentFragment(h);var p=g.getDirection(1)!=B,I=C.element,G=I.getAttribute("class"),
E=I.getAttribute("style"),D=z.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||p||E||G),J,L=C.contents.length,H;for(g=0;g<L;g++){J=C.contents[g];if(j(J)&&L>1)D?H=J.clone(1,1):z.append(J.clone(1,1));else if(J.type==CKEDITOR.NODE_ELEMENT&&J.isBlockBoundary()){p&&!J.getDirection()&&J.setAttribute("dir",B);A=J;var Q=I.getAttribute("style");Q&&A.setAttribute("style",Q.replace(/([^;])$/,"$1;")+(A.getAttribute("style")||""));G&&J.addClass(G);A=null;if(H){z.append(H);H=null}z.append(J.clone(1,
1))}else if(D){if(!A){A=h.createElement(F);z.append(A);p&&A.setAttribute("dir",B)}E&&A.setAttribute("style",E);G&&A.setAttribute("class",G);if(H){A.append(H);H=null}A.append(J.clone(1,1))}else z.append(J.clone(1,1))}if(H){(A||z).append(H);H=null}if(z.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1){if(CKEDITOR.env.needsBrFiller)(B=z.getLast())&&(B.type==CKEDITOR.NODE_ELEMENT&&B.is("br"))&&B.remove();B=z.getLast(k);(!B||!(B.type==CKEDITOR.NODE_ELEMENT&&B.is(CKEDITOR.dtd.$block)))&&z.append(h.createElement("br"))}B=
z.$.nodeName.toLowerCase();(B=="div"||B=="p")&&z.appendBogus();i.append(z);p=null;m++}else return null;A=null;if(a.length<=m||Math.max(a[m].indent,0)<o)break}if(b)for(a=i.getFirst();a;){if(a.type==CKEDITOR.NODE_ELEMENT){CKEDITOR.dom.element.clearMarkers(b,a);if(a.getName()in CKEDITOR.dtd.$listItem){c=a;h=f=e=void 0;if(e=c.getDirection()){for(f=c.getParent();f&&!(h=f.getDirection());)f=f.getParent();e==h&&c.removeAttribute("dir")}}}a=a.getNextSourceNode()}return{listNode:i,nextIndex:m}}};var o=/^h[1-6]$/,
p=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);f.prototype={exec:function(b){this.refresh(b,b.elementPath());var c=b.config,f=b.getSelection(),g=f&&f.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var h=b.editable();if(h.getFirst(k)){var i=g.length==1&&g[0];(c=i&&i.getEnclosedNode())&&(c.is&&this.type==c.getName())&&this.setState(CKEDITOR.TRISTATE_ON)}else{c.enterMode==CKEDITOR.ENTER_BR?h.appendBogus():g[0].fixBlock(1,c.enterMode==CKEDITOR.ENTER_P?"p":"div");f.selectRanges(g)}}for(var c=
f.createBookmarks(true),h=[],j={},g=g.createIterator(),p=0;(i=g.getNextRange())&&++p;){var m=i.getBoundaryNodes(),s=m.startNode,y=m.endNode;s.type==CKEDITOR.NODE_ELEMENT&&s.getName()=="td"&&i.setStartAt(m.startNode,CKEDITOR.POSITION_AFTER_START);y.type==CKEDITOR.NODE_ELEMENT&&y.getName()=="td"&&i.setEndAt(m.endNode,CKEDITOR.POSITION_BEFORE_END);i=i.createIterator();for(i.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;m=i.getNextParagraph();)if(!m.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(j,
m,"list_block",1);for(var z=b.elementPath(m),s=z.elements,y=0,z=z.blockLimit,B,A=s.length-1;A>=0&&(B=s[A]);A--)if(d[B.getName()]&&z.contains(B)){z.removeCustomData("list_group_object_"+p);if(s=B.getCustomData("list_group_object"))s.contents.push(m);else{s={root:B,contents:[m]};h.push(s);CKEDITOR.dom.element.setMarker(j,B,"list_group_object",s)}y=1;break}if(!y){y=z;if(y.getCustomData("list_group_object_"+p))y.getCustomData("list_group_object_"+p).contents.push(m);else{s={root:y,contents:[m]};CKEDITOR.dom.element.setMarker(j,
y,"list_group_object_"+p,s);h.push(s)}}}}for(B=[];h.length>0;){s=h.shift();if(this.state==CKEDITOR.TRISTATE_OFF)if(d[s.root.getName()]){g=b;p=s;s=j;i=B;y=CKEDITOR.plugins.list.listToArray(p.root,s);z=[];for(m=0;m<p.contents.length;m++){A=p.contents[m];if((A=A.getAscendant("li",true))&&!A.getCustomData("list_item_processed")){z.push(A);CKEDITOR.dom.element.setMarker(s,A,"list_item_processed",true)}}for(var A=p.root.getDocument(),F=void 0,C=void 0,m=0;m<z.length;m++){var I=z[m].getCustomData("listarray_index"),
F=y[I].parent;if(!F.is(this.type)){C=A.createElement(this.type);F.copyAttributes(C,{start:1,type:1});C.removeStyle("list-style-type");y[I].parent=C}}s=CKEDITOR.plugins.list.arrayToList(y,s,null,g.config.enterMode);y=void 0;z=s.listNode.getChildCount();for(m=0;m<z&&(y=s.listNode.getChild(m));m++)y.getName()==this.type&&i.push(y);s.listNode.replace(p.root);g.fire("contentDomInvalidated")}else{m=b;i=s;y=B;z=i.contents;g=i.root.getDocument();p=[];if(z.length==1&&z[0].equals(i.root)){s=g.createElement("div");
z[0].moveChildren&&z[0].moveChildren(s);z[0].append(s);z[0]=s}i=i.contents[0].getParent();for(A=0;A<z.length;A++)i=i.getCommonAncestor(z[A].getParent());F=m.config.useComputedState;s=m=void 0;F=F===void 0||F;for(A=0;A<z.length;A++)for(C=z[A];I=C.getParent();){if(I.equals(i)){p.push(C);!s&&C.getDirection()&&(s=1);C=C.getDirection(F);m!==null&&(m=m&&m!=C?null:C);break}C=I}if(!(p.length<1)){z=p[p.length-1].getNext();A=g.createElement(this.type);y.push(A);for(I=C=F=y=void 0;p.length;){y=p.shift();F=g.createElement("li");
if(CKEDITOR.UnorderedListColor){C=true;I=F.getStyle("color");F.setStyle("color",CKEDITOR.UnorderedListColor)}if(y.is("pre")||(o.test(y.getName())||y.getAttribute("contenteditable")=="false")||C){y.appendTo(F);C&&y.setStyle("color",I||"#000000")}else{y.copyAttributes(F);if(m&&y.getDirection()){F.removeStyle("direction");F.removeAttribute("dir")}y.moveChildren(F);y.remove()}F.appendTo(A)}m&&s&&A.setAttribute("dir",m);z?A.insertBefore(z):A.appendTo(i)}}else this.state==CKEDITOR.TRISTATE_ON&&d[s.root.getName()]&&
a.call(this,b,s,j)}for(A=0;A<B.length;A++)e(B[A]);CKEDITOR.dom.element.clearAllMarkers(j);f.selectBookmarks(c);b.focus()},refresh:function(a,b){var c=b.contains(d,1),e=b.blockLimit||b.root;c&&e.contains(c)?this.setState(c.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(a){if(!a.blockless){a.addCommand("numberedlist",new f("numberedlist","ol"));a.addCommand("bulletedlist",new f("bulletedlist",
"ul"));if(a.ui.addButton){a.ui.addButton("NumberedList",{label:a.lang.list.numberedlist,command:"numberedlist",directional:true,toolbar:"list,10"});a.ui.addButton("BulletedList",{label:a.lang.list.bulletedlist,command:"bulletedlist",directional:true,toolbar:"list,20"})}a.on("key",function(c){var e=c.data.domEvent.getKey();if(a.mode=="wysiwyg"&&e in{8:1,46:1}){var f=a.getSelection().getRanges()[0],h=f&&f.startPath();if(f&&f.collapsed){var j=e==8,p=a.editable(),o=new CKEDITOR.dom.walker(f.clone());
o.evaluator=function(a){return k(a)&&!m(a)};o.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=f.clone();if(j){var w,s;if((w=h.contains(d))&&f.checkBoundaryOfElement(w,CKEDITOR.START)&&(w=w.getParent())&&w.is("li")&&(w=i(w))){s=w;w=w.getPrevious(k);e.moveToPosition(w&&m(w)?w:s,CKEDITOR.POSITION_BEFORE_START)}else{o.range.setStartAt(p,CKEDITOR.POSITION_AFTER_START);o.range.setEnd(f.startContainer,f.startOffset);if((w=o.previous())&&w.type==CKEDITOR.NODE_ELEMENT&&(w.getName()in
d||w.is("li"))){if(!w.is("li")){o.range.selectNodeContents(w);o.reset();o.evaluator=b;w=o.previous()}s=w;e.moveToElementEditEnd(s)}}if(s){g(a,e,f);c.cancel()}else if((e=h.contains(d))&&f.checkBoundaryOfElement(e,CKEDITOR.START)){s=e.getFirst(k);if(f.checkBoundaryOfElement(s,CKEDITOR.START)){w=e.getPrevious(k);if(i(s)){if(w){f.moveToElementEditEnd(w);f.select()}}else a.execCommand("outdent");c.cancel()}}}else if(s=h.contains("li")){o.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END);p=(h=s.getLast(k))&&
b(h)?h:s;s=0;if((w=o.next())&&w.type==CKEDITOR.NODE_ELEMENT&&w.getName()in d&&w.equals(h)){s=1;w=o.next()}else f.checkBoundaryOfElement(p,CKEDITOR.END)&&(s=1);if(s&&w){f=f.clone();f.moveToElementEditStart(w);g(a,e,f);c.cancel()}}else{o.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END);if((w=o.next())&&w.type==CKEDITOR.NODE_ELEMENT&&w.is(d)){w=w.getFirst(k);if(h.block&&f.checkStartOfBlock()&&f.checkEndOfBlock()){h.block.remove();f.moveToElementEditStart(w);f.select()}else if(i(w)){f.moveToElementEditStart(w);
f.select()}else{f=f.clone();f.moveToElementEditStart(w);g(a,e,f)}c.cancel()}}setTimeout(function(){a.selectionChange(1)})}}})}}})}(),function(){CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(a){if(!a.blockless){var f;f=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]"});f=a.addCommand("numberedListStyle",f);a.addFeature(f);CKEDITOR.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js");f=new CKEDITOR.dialogCommand("bulletedListStyle",
{requiredContent:"ul",allowedContent:"ul{list-style-type}"});f=a.addCommand("bulletedListStyle",f);a.addFeature(f);CKEDITOR.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js");a.addMenuGroup("list",108);a.addMenuItems({numberedlist:{label:a.lang.liststyle.numberedTitle,group:"list",command:"numberedListStyle"},bulletedlist:{label:a.lang.liststyle.bulletedTitle,group:"list",command:"bulletedListStyle"}});a.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;for(;a;){var e=
a.getName();if(e=="ol")return{numberedlist:CKEDITOR.TRISTATE_OFF};if(e=="ul")return{bulletedlist:CKEDITOR.TRISTATE_OFF};a=a.getParent()}return null})}}};CKEDITOR.plugins.add("liststyle",CKEDITOR.plugins.liststyle)}(),"use strict",function(){function a(a,b,c){return k(b)&&k(c)&&c.equals(b.getNext(function(a){return!(Y(a)||Z(a)||m(a))}))}function f(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function c(a){var b=a.element;if(b&&k(b))if((b=b.getAscendant(a.triggers,true))&&a.editable.contains(b)){var c=
g(b);if(c.getAttribute("contenteditable")=="true")return b;if(c.is(a.triggers))return c}return null}function e(a,b,c){t(a,b);t(a,c);a=b.size.bottom;c=c.size.top;return a&&c?0|(a+c)/2:a||c}function b(a,b,c){return b=b[c?"getPrevious":"getNext"](function(b){return b&&b.type==CKEDITOR.NODE_TEXT&&!Y(b)||k(b)&&!m(b)&&!j(a,b)})}function g(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a;){if(a.data("cke-editable"))break;if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}
function i(a){var b=a.doc,c=z('<span contenteditable="false" style="'+P+"position:absolute;border-top:1px dashed "+a.boxColor+'"></span>',b),e=CKEDITOR.getUrl(this.path+"images/"+(B.hidpi?"hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");s(c,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,true);return this},lineChildren:[s(z('<span title="'+a.editor.lang.magicline.title+'" contenteditable="false">&#8629;</span>',b),{base:P+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+
e+") center no-repeat "+a.boxColor+";cursor:pointer;"+(B.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(B.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px",1),"top:-17px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px 2px 0px 0px",1),"top:-1px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","0px 0px 2px 2px",1)]}),s(z(W,b),{base:V+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px",
"border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),s(z(W,b),{base:V+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){t(a,this);var b=a.holdDistance,c=this.size;return c&&a.mouse.y>c.top-b&&a.mouse.y<c.bottom+b&&a.mouse.x>c.left-b&&a.mouse.x<c.right+b?true:false},place:function(){var b=
a.view,c=a.editable,d=a.trigger,e=d.upper,f=d.lower,g=e||f,h=g.getParent(),i={};this.trigger=d;e&&t(a,e,true);f&&t(a,f,true);t(a,h,true);a.inInlineMode&&v(a,true);if(h.equals(c)){i.left=b.scroll.x;i.right=-b.scroll.x;i.width=""}else{i.left=g.size.left-g.size.margin.left+b.scroll.x-(a.inInlineMode?b.editable.left+b.editable.border.left:0);i.width=g.size.outerWidth+g.size.margin.left+g.size.margin.right+b.scroll.x;i.right=""}if(e&&f)i.top=e.size.margin.bottom===f.size.margin.top?0|e.size.bottom+e.size.margin.bottom/
2:e.size.margin.bottom<f.size.margin.top?e.size.bottom+e.size.margin.bottom:e.size.bottom+e.size.margin.bottom-f.size.margin.top;else if(e){if(!f)i.top=e.size.bottom+e.size.margin.bottom}else i.top=f.size.top-f.size.margin.top;if(d.is(L)||i.top>b.scroll.y-15&&i.top<b.scroll.y+5){i.top=a.inInlineMode?0:b.scroll.y;this.look(L)}else if(d.is(H)||i.top>b.pane.bottom-5&&i.top<b.pane.bottom+15){i.top=a.inInlineMode?b.editable.height+b.editable.padding.top+b.editable.padding.bottom:b.pane.bottom-1;this.look(H)}else{if(a.inInlineMode)i.top=
i.top-(b.editable.top+b.editable.border.top);this.look(Q)}if(a.inInlineMode){i.top--;i.top=i.top+b.editable.scroll.top;i.left=i.left+b.editable.scroll.left}for(var j in i)i[j]=CKEDITOR.tools.cssLength(i[j]);this.setStyles(i)},look:function(a){if(this.oldLook!=a){for(var b=this.lineChildren.length,c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new y("span",a.doc)});for(b=c.lineChildren.length;b--;)c.lineChildren[b].appendTo(c);c.look(Q);c.appendTo(c.wrap);
c.unselectable();c.lineChildren[0].on("mouseup",function(b){c.detach();d(a,function(b){var c=a.line.trigger;b[c.is(I)?"insertBefore":"insertAfter"](c.is(I)?c.lower:c.upper)},true);a.editor.focus();!B.ie&&a.enterMode!=CKEDITOR.ENTER_BR&&a.hotNode.scrollIntoView();b.data.preventDefault(true)});c.on("mousedown",function(a){a.data.preventDefault(true)});a.line=c}function d(a,b,c){var d=new CKEDITOR.dom.range(a.doc),e=a.editor,f;if(B.ie&&a.enterMode==CKEDITOR.ENTER_BR)f=a.doc.createText(O);else{f=(f=g(a.element,
true))&&f.data("cke-enter-mode")||a.enterMode;f=new y(C[f],a.doc);f.is("br")||a.doc.createText(O).appendTo(f)}c&&e.fire("saveSnapshot");b(f);d.moveToPosition(f,CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([d]);a.hotNode=f;c&&e.fire("saveSnapshot")}function h(a,e){return{canUndo:true,modes:{wysiwyg:1},exec:function(){function f(b){var c=B.ie&&B.version<9?" ":O,g=a.hotNode&&a.hotNode.getText()==c&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!e;d(a,function(c){g&&a.hotNode&&a.hotNode.remove();
c[e?"insertAfter":"insertBefore"](b);c.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!e});a.lastCmdDirection=!!e});!B.ie&&a.enterMode!=CKEDITOR.ENTER_BR&&a.hotNode.scrollIntoView();a.line.detach()}return function(d){var d=d.getSelection().getStartElement(),h,d=d.getAscendant(N,1);if(!n(a,d)&&d&&!d.equals(a.editable)&&!d.contains(a.editable)){if((h=g(d))&&h.getAttribute("contenteditable")=="false")d=h;a.element=d;h=b(a,d,!e);var i;if(k(h)&&h.is(a.triggers)&&h.is(R)&&(!b(a,h,!e)||
(i=b(a,h,!e))&&k(i)&&i.is(a.triggers)))f(h);else{i=c(a,d);if(k(i))if(b(a,i,!e))(d=b(a,i,!e))&&(k(d)&&d.is(a.triggers))&&f(i);else f(i)}}}}()}}function j(a,b){if(!b||!(b.type==CKEDITOR.NODE_ELEMENT&&b.$))return false;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function k(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.$}function m(a){if(!k(a))return false;var b;if(!(b=o(a)))if(k(a)){b={left:1,right:1,center:1};b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])}else b=false;
return b}function o(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function p(a,b){return k(b)?b.is(a.triggers):null}function n(a,b){if(!b)return false;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return true;return false}function l(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(K)});if(!b)return false;t(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function q(a){var b=a.editable,
c=a.mouse,d=a.view,e=a.triggerOffset;v(a);var g=c.y>(a.inInlineMode?d.editable.top+d.editable.height/2:Math.min(d.editable.height,d.pane.height)/2),b=b[g?"getLast":"getFirst"](function(a){return!(Y(a)||Z(a))});if(!b)return null;j(a,b)&&(b=a.line.wrap[g?"getPrevious":"getNext"](function(a){return!(Y(a)||Z(a))}));if(!k(b)||m(b)||!p(a,b))return null;t(a,b);if(!g&&b.size.top>=0&&c.y>0&&c.y<b.size.top+e){a=a.inInlineMode||d.scroll.y===0?L:Q;return new f([null,b,I,D,a])}if(g&&b.size.bottom<=d.pane.height&&
c.y>b.size.bottom-e&&c.y<d.pane.height){a=a.inInlineMode||b.size.bottom>d.pane.height-e&&b.size.bottom<d.pane.height?H:Q;return new f([b,null,G,D,a])}return null}function r(a){var d=a.mouse,e=a.view,g=a.triggerOffset,h=c(a);if(!h)return null;t(a,h);var g=Math.min(g,0|h.size.outerHeight/2),i=[],j,n;if(d.y>h.size.top-1&&d.y<h.size.top+g)n=false;else if(d.y>h.size.bottom-g&&d.y<h.size.bottom+1)n=true;else return null;if(m(h)||l(a,h,n)||h.getParent().is(M))return null;var r=b(a,h,!n);if(r){if(r&&r.type==
CKEDITOR.NODE_TEXT)return null;if(k(r)){if(m(r)||!p(a,r)||r.getParent().is(M))return null;i=[r,h][n?"reverse":"concat"]().concat([E,D])}}else{if(h.equals(a.editable[n?"getLast":"getFirst"](a.isRelevant))){v(a);n&&d.y>h.size.bottom-g&&d.y<e.pane.height&&h.size.bottom>e.pane.height-g&&h.size.bottom<e.pane.height?j=H:d.y>0&&d.y<h.size.top+g&&(j=L)}else j=Q;i=[null,h][n?"reverse":"concat"]().concat([n?G:I,D,j,h.equals(a.editable[n?"getLast":"getFirst"](a.isRelevant))?n?H:L:Q])}return 0 in i?new f(i):
null}function u(a,b,c,d){for(var e=function(){var c=B.ie?b.$.currentStyle:a.win.$.getComputedStyle(b.$,"");return B.ie?function(a){return c[CKEDITOR.tools.cssStyleToDomStyle(a)]}:function(a){return c.getPropertyValue(a)}}(),f=b.getDocumentPosition(),g={},h={},i={},j={},k=X.length;k--;){g[X[k]]=parseInt(e("border-"+X[k]+"-width"),10)||0;i[X[k]]=parseInt(e("padding-"+X[k]),10)||0;h[X[k]]=parseInt(e("margin-"+X[k]),10)||0}(!c||d)&&x(a,d);j.top=f.y-(c?0:a.view.scroll.y);j.left=f.x-(c?0:a.view.scroll.x);
j.outerWidth=b.$.offsetWidth;j.outerHeight=b.$.offsetHeight;j.height=j.outerHeight-(i.top+i.bottom+g.top+g.bottom);j.width=j.outerWidth-(i.left+i.right+g.left+g.right);j.bottom=j.top+j.outerHeight;j.right=j.left+j.outerWidth;if(a.inInlineMode)j.scroll={top:b.$.scrollTop,left:b.$.scrollLeft};return s({border:g,padding:i,margin:h,ignoreScroll:c},j,true)}function t(a,b,c){if(!k(b))return b.size=null;if(b.size){if(b.size.ignoreScroll==c&&b.size.date>new Date-T)return null}else b.size={};return s(b.size,
u(a,b,c),{date:+new Date},true)}function v(a,b){a.view.editable=u(a,a.editable,b,true)}function x(a,b){if(!a.view)a.view={};var c=a.view;if(b||!(c&&c.date>new Date-T)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();s(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},true)}}function w(a,b,c,d){for(var e=d,g=d,h=0,i=false,j=false,k=a.view.pane.height,
n=a.mouse;n.y+h<k&&n.y-h>0;){i||(i=b(e,d));j||(j=b(g,d));!i&&n.y-h>0&&(e=c(a,{x:n.x,y:n.y-h}));!j&&n.y+h<k&&(g=c(a,{x:n.x,y:n.y+h}));if(i&&j)break;h=h+2}return new f([e,g,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var e=a.config,g=e.magicline_triggerOffset||30,l={editor:a,enterMode:e.enterMode,triggerOffset:g,holdDistance:0|g*(e.magicline_holdDistance||0.5),boxColor:e.magicline_color||"#ff0000",rtl:e.contentsLangDirection=="rtl",tabuList:["data-cke-hidden-sel"].concat(e.magicline_tabuList||
[]),triggers:e.magicline_everywhere?N:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},p,t,w;l.isRelevant=function(a){return k(a)&&!j(l,a)&&!m(a)};a.on("contentDom",function(){var g=a.editable(),k=a.document,m=a.window;s(l,{editable:g,inInlineMode:g.isInline(),doc:k,win:m,hotNode:null},true);l.boundary=l.inInlineMode?l.editable:l.doc.getDocumentElement();if(!g.is(F.$inline)){l.inInlineMode&&!o(g)&&g.setStyles({position:"relative",top:null,left:null});i.call(this,l);x(l);g.attachListener(a,
"beforeUndoImage",function(){l.line.detach()});g.attachListener(a,"beforeGetData",function(){if(l.line.wrap.getParent()){l.line.detach();a.once("getData",function(){l.line.attach()},null,null,1E3)}},null,null,0);g.attachListener(l.inInlineMode?k:k.getWindow().getFrame(),"mouseout",function(b){if(a.mode=="wysiwyg")if(l.inInlineMode){var c=b.data.$.clientX,b=b.data.$.clientY;x(l);v(l,true);var d=l.view.editable,e=l.view.scroll;if(!(c>d.left-e.x&&c<d.right-e.x)||!(b>d.top-e.y&&b<d.bottom-e.y)){clearTimeout(w);
w=null;l.line.detach()}}else{clearTimeout(w);w=null;l.line.detach()}});g.attachListener(g,"keyup",function(){l.hiddenMode=0});g.attachListener(g,"keydown",function(b){if(a.mode=="wysiwyg"){b=b.data.getKeystroke();a.getSelection().getStartElement();switch(b){case 2228240:case 16:l.hiddenMode=1;l.line.detach()}}});g.attachListener(l.inInlineMode?g:k,"mousemove",function(b){t=true;if(!(a.mode!="wysiwyg"||a.readOnly||w)){var c={x:b.data.$.clientX,y:b.data.$.clientY};w=setTimeout(function(){l.mouse=c;
w=l.trigger=null;x(l);if(t&&!l.hiddenMode&&a.focusManager.hasFocus&&!l.line.mouseNear()&&(l.element=S(l,true))){if((l.trigger=q(l)||r(l)||ba(l))&&!n(l,l.trigger.upper||l.trigger.lower))l.line.attach().place();else{l.trigger=null;l.line.detach()}t=false}},30)}});g.attachListener(m,"scroll",function(){if(a.mode=="wysiwyg"){l.line.detach();if(B.webkit){l.hiddenMode=1;clearTimeout(p);p=setTimeout(function(){if(!l.mouseDown)l.hiddenMode=0},50)}}});g.attachListener(A?k:m,"mousedown",function(){if(a.mode==
"wysiwyg"){l.line.detach();l.hiddenMode=1;l.mouseDown=1}});g.attachListener(A?k:m,"mouseup",function(){l.hiddenMode=0;l.mouseDown=0});a.addCommand("accessPreviousSpace",h(l));a.addCommand("accessNextSpace",h(l,true));a.setKeystroke([[e.magicline_keystrokePrevious,"accessPreviousSpace"],[e.magicline_keystrokeNext,"accessNextSpace"]]);a.on("loadSnapshot",function(){var b,c,d,e;for(e in{p:1,br:1,div:1}){b=a.document.getElementsByTag(e);for(d=b.count();d--;)if((c=b.getItem(d)).data("cke-magicline-hot")){l.hotNode=
c;l.lastCmdDirection=c.data("cke-magicline-dir")==="true"?true:false;return}}});this.backdoor={accessFocusSpace:d,boxTrigger:f,isLine:j,getAscendantTrigger:c,getNonEmptyNeighbour:b,getSize:u,that:l,triggerEdge:r,triggerEditable:q,triggerExpand:ba}}},this)}});var s=CKEDITOR.tools.extend,y=CKEDITOR.dom.element,z=y.createFromHtml,B=CKEDITOR.env,A=CKEDITOR.env.ie&&CKEDITOR.env.version<9,F=CKEDITOR.dtd,C={},I=128,G=64,E=32,D=16,J=8,L=4,H=2,Q=1,O=" ",M=F.$listItem,K=F.$tableContent,R=s({},F.$nonEditable,
F.$empty),N=F.$block,T=100,P="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=P+"border-color:transparent;display:block;border-style:solid;",W="<span>"+O+"</span>";C[CKEDITOR.ENTER_BR]="br";C[CKEDITOR.ENTER_P]="p";C[CKEDITOR.ENTER_DIV]="div";f.prototype={set:function(a,b,c){this.properties=a+b+(c||Q);return this},is:function(a){return(this.properties&a)==a}};var S=function(){function a(b,c){var d=b.$.elementFromPoint(c.x,
c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(b,c,d){if(!b.mouse)return null;var e=b.doc,f=b.line.wrap,d=d||b.mouse,g=a(e,d);if(c&&j(b,g)){f.hide();g=a(e,d);f.show()}return!g||!(g.type==CKEDITOR.NODE_ELEMENT&&g.$)||B.ie&&B.version<9&&!b.boundary.equals(g)&&!b.boundary.contains(g)?null:g}}(),Y=CKEDITOR.dom.walker.whitespaces(),Z=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),ba=function(){function b(d){var f=d.element,g,h,i;if(!k(f)||f.contains(d.editable)||f.isReadOnly())return null;
i=w(d,function(a,b){return!b.equals(a)},function(a,b){return S(a,true,b)},f);g=i.upper;h=i.lower;if(a(d,g,h))return i.set(E,J);if(g&&f.contains(g))for(;!g.getParent().equals(f);)g=g.getParent();else g=f.getFirst(function(a){return c(d,a)});if(h&&f.contains(h))for(;!h.getParent().equals(f);)h=h.getParent();else h=f.getLast(function(a){return c(d,a)});if(!g||!h)return null;t(d,g);t(d,h);if(!(d.mouse.y>g.size.top&&d.mouse.y<h.size.bottom))return null;for(var f=Number.MAX_VALUE,j,l,n,p;h&&!h.equals(g);){if(!(l=
g.getNext(d.isRelevant)))break;j=Math.abs(e(d,g,l)-d.mouse.y);if(j<f){f=j;n=g;p=l}g=l;t(d,g)}if(!n||!p||!(d.mouse.y>n.size.top&&d.mouse.y<p.size.bottom))return null;i.upper=n;i.lower=p;return i.set(E,J)}function c(a,b){return!(b&&b.type==CKEDITOR.NODE_TEXT||Z(b)||m(b)||j(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var d=b(c),e;if(e=d){e=d.upper;var f=d.lower;e=!e||!f||m(f)||m(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?false:p(c,e)&&p(c,f)&&a(c,e,f)?true:
false}return e?d:null}}(),X=["top","left","right","bottom"]}(),CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51,CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52,function(){function a(a){if(!a||a.type!=CKEDITOR.NODE_ELEMENT||a.getName()!="form")return[];for(var b=[],c=["style","className"],e=0;e<c.length;e++){var f=a.$.elements.namedItem(c[e]);if(f){f=new CKEDITOR.dom.element(f);b.push([f,f.nextSibling]);f.remove()}}return b}function f(a,b){if(a&&!(a.type!=
CKEDITOR.NODE_ELEMENT||a.getName()!="form")&&b.length>0)for(var c=b.length-1;c>=0;c--){var e=b[c][0],f=b[c][1];f?e.insertBefore(f):e.appendTo(a)}}function c(b,c){var d=a(b),e={},j=b.$;if(!c){e["class"]=j.className||"";j.className=""}e.inline=j.style.cssText||"";if(!c)j.style.cssText="position: static; overflow: visible";f(d);return e}function e(b,c){var d=a(b),e=b.$;if("class"in c)e.className=c["class"];if("inline"in c)e.style.cssText=c.inline;f(d)}function b(a){if(!a.editable().isInline()){var b=
CKEDITOR.instances,c;for(c in b){var e=b[c];if(e.mode=="wysiwyg"&&!e.readOnly){e=e.document.getBody();e.setAttribute("contentEditable",false);e.setAttribute("contentEditable",true)}}if(a.editable().hasFocus){a.toolbox.focus();a.focus()}}}CKEDITOR.plugins.add("maximize",{init:function(a){function f(){var b=j.getViewPaneSize();a.resize(b.width,b.height,null,true)}if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var d=a.lang,h=CKEDITOR.document,j=h.getWindow(),k,m,o,p=CKEDITOR.TRISTATE_OFF;a.addCommand("maximize",
{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:false,exec:function(){var n=a.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}),l=a.ui.space("contents");if(a.mode=="wysiwyg"){var q=a.getSelection();k=q&&q.getRanges();m=j.getScrollPosition()}else{var r=a.editable().$;k=!CKEDITOR.env.ie&&[r.selectionStart,r.selectionEnd];m=[r.scrollLeft,r.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){j.on("resize",f);o=j.getScrollPosition();
for(q=a.container;q=q.getParent();){q.setCustomData("maximize_saved_styles",c(q));q.setStyle("z-index",a.config.baseFloatZIndex-5)}l.setCustomData("maximize_saved_styles",c(l,true));n.setCustomData("maximize_saved_styles",c(n,true));l={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0};h.getDocumentElement().setStyles(l);!CKEDITOR.env.gecko&&h.getDocumentElement().setStyle("position","fixed");(!CKEDITOR.env.gecko||!CKEDITOR.env.quirks)&&h.getBody().setStyles(l);CKEDITOR.env.ie?setTimeout(function(){j.$.scrollTo(0,
0)},0):j.$.scrollTo(0,0);n.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute");n.$.offsetLeft;n.setStyles({"z-index":a.config.baseFloatZIndex-5,left:"0px",top:"0px"});n.addClass("cke_maximized");f();l=n.getDocumentPosition();n.setStyles({left:-1*l.x+"px",top:-1*l.y+"px"});CKEDITOR.env.gecko&&b(a)}else if(this.state==CKEDITOR.TRISTATE_ON){j.removeListener("resize",f);l=[l,n];for(q=0;q<l.length;q++){e(l[q],l[q].getCustomData("maximize_saved_styles"));l[q].removeCustomData("maximize_saved_styles")}for(q=
a.container;q=q.getParent();){e(q,q.getCustomData("maximize_saved_styles"));q.removeCustomData("maximize_saved_styles")}CKEDITOR.env.ie?setTimeout(function(){j.$.scrollTo(o.x,o.y)},0):j.$.scrollTo(o.x,o.y);n.removeClass("cke_maximized");if(CKEDITOR.env.webkit){n.setStyle("display","inline");setTimeout(function(){n.setStyle("display","block")},0)}a.fire("resize")}this.toggleState();if(q=this.uiItems[0]){l=this.state==CKEDITOR.TRISTATE_OFF?d.maximize.maximize:d.maximize.minimize;q=CKEDITOR.document.getById(q._.id);
q.getChild(1).setHtml(l);q.setAttribute("title",l);q.setAttribute("href",'javascript:void("'+l+'");')}if(a.mode=="wysiwyg")if(k){CKEDITOR.env.gecko&&b(a);a.getSelection().selectRanges(k);(r=a.getSelection().getStartElement())&&r.scrollIntoView(true)}else j.$.scrollTo(m.x,m.y);else{if(k){r.selectionStart=k[0];r.selectionEnd=k[1]}r.scrollLeft=m[0];r.scrollTop=m[1]}k=m=null;p=this.state;a.fire("maximize",this.state)},canUndo:false});a.ui.addButton&&a.ui.addButton("Maximize",{label:d.maximize.maximize,
command:"maximize",toolbar:"tools,10"});a.on("mode",function(){var b=a.getCommand("maximize");b.setState(b.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:p)},null,null,100)}}})}(),CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(a){var c=this;a.setData(a.config.newpage_html||"",function(){a.focus();setTimeout(function(){a.fire("afterCommandExec",{name:"newpage",command:c});a.selectionChange()},200)})},async:true});a.ui.addButton&&
a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}}),"use strict",function(){function a(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:5px;cursor:default;").replace(/;/g,
" !important;");CKEDITOR.addCss("div.cke_pagebreak{"+a+"}")},init:function(a){if(!a.blockless){a.addCommand("pagebreak",CKEDITOR.plugins.pagebreakCmd);a.ui.addButton&&a.ui.addButton("PageBreak",{label:a.lang.pagebreak.toolbar,command:"pagebreak",toolbar:"insert,70"});CKEDITOR.env.webkit&&a.on("contentDom",function(){a.document.on("click",function(c){c=c.data.getTarget();c.is("div")&&c.hasClass("cke_pagebreak")&&a.getSelection().selectElement(c)})})}},afterInit:function(f){function c(b){CKEDITOR.tools.extend(b.attributes,
a(f.lang.pagebreak.alt),true);b.children.length=0}var e=f.dataProcessor,b=e&&e.dataFilter,e=e&&e.htmlFilter,g=/page-break-after\s*:\s*always/i,i=/display\s*:\s*none/i;e&&e.addRules({attributes:{"class":function(a,b){var c=a.replace("cke_pagebreak","");if(c!=a){var e=CKEDITOR.htmlParser.fragment.fromHtml('<span style="display: none;">&nbsp;</span>').children[0];b.children.length=0;b.add(e);e=b.attributes;delete e["aria-label"];delete e.contenteditable;delete e.title}return c}}},{applyToAll:true,priority:5});
b&&b.addRules({elements:{div:function(a){if(a.attributes["data-cke-pagebreak"])c(a);else if(g.test(a.attributes.style)){var b=a.children[0];b&&(b.name=="span"&&i.test(b.attributes.style))&&c(a)}}}})}});CKEDITOR.plugins.pagebreakCmd={exec:function(f){var c=f.document.createElement("div",{attributes:a(f.lang.pagebreak.alt)});f.insertElement(c)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(a){return(a=a.parent)&&a.name=="div"&&a.styles&&a.styles["page-break-after"]},
styles:"display"}},requiredContent:"div{page-break-after}"}}(),function(){function a(a,e,b){var f=CKEDITOR.cleanWord;if(f)b();else{a=CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile||e+"filter/default.js");CKEDITOR.scriptLoader.load(a,b,null,true)}return!f}function f(a){a.data.type="html"}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(c){var e=0,b=this.path;c.addCommand("pastefromword",{canUndo:false,async:true,exec:function(a){var b=this;e=1;a.once("beforePaste",f);a.getClipboardData({title:a.lang.pastefromword.title},
function(c){c&&a.fire("paste",{type:"html",dataValue:c.dataValue});a.fire("afterCommandExec",{name:"pastefromword",command:b,returnValue:!!c})})}});c.ui.addButton&&c.ui.addButton("PasteFromWord",{label:c.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"});c.on("pasteState",function(a){c.getCommand("pastefromword").setState(a.data)});c.on("paste",function(f){var i=f.data,d=i.dataValue;if(d&&(e||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(d))){var h=a(c,b,function(){if(h)c.fire("paste",
i);else if(!c.config.pasteFromWordPromptCleanup||e||confirm(c.lang.pastefromword.confirmCleanup))i.dataValue=CKEDITOR.cleanWord(d,c)});h&&f.cancel()}},null,null,3)}})}(),function(){var a={canUndo:false,async:true,exec:function(f){f.getClipboardData({title:f.lang.pastetext.title},function(c){c&&f.fire("paste",{type:"text",dataValue:c.dataValue});f.fire("afterCommandExec",{name:"pastetext",command:a,returnValue:!!c})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(f){f.addCommand("pastetext",
a);f.ui.addButton&&f.ui.addButton("PasteText",{label:f.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(f.config.forcePasteAsPlainText)f.on("beforePaste",function(a){if(a.data.type!="html")a.data.type="text"});f.on("pasteState",function(a){f.getCommand("pastetext").setState(a.data)})}})}(),function(){var a,f={modes:{wysiwyg:1,source:1},canUndo:false,readOnly:1,exec:function(c){var e,b=c.config,f=b.baseHref?'<base href="'+b.baseHref+'"/>':"";if(b.fullPage)e=c.getData().replace(/<head>/,
"$&"+f).replace(/[^>]*(?=<\/title>)/,"$& &mdash; "+c.lang.preview.preview);else{var b="<body ",i=c.document&&c.document.getBody();if(i){i.getAttribute("id")&&(b=b+('id="'+i.getAttribute("id")+'" '));i.getAttribute("class")&&(b=b+('class="'+i.getAttribute("class")+'" '))}e=c.config.docType+'<html dir="'+c.config.contentsLangDirection+'"><head>'+f+"<title>"+c.lang.preview.preview+"</title>"+CKEDITOR.tools.buildStyleHtml(c.config.contentsCss)+"</head>"+(b+">")+c.getData()+"</body></html>"}f=640;b=420;
i=80;try{var d=window.screen,f=Math.round(d.width*0.8),b=Math.round(d.height*0.7),i=Math.round(d.width*0.1)}catch(h){}if(c.fire("contentPreview",c={dataValue:e})===false)return false;var d="",j;if(CKEDITOR.env.ie){window._cke_htmlToLoad=c.dataValue;j="javascript:void( (function(){document.open();"+("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )";
d=""}if(CKEDITOR.env.gecko){window._cke_htmlToLoad=c.dataValue;d=CKEDITOR.getUrl(a+"preview.html")}d=window.open(d,null,"toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+f+",height="+b+",left="+i);if(CKEDITOR.env.ie&&d)d.location=j;if(!CKEDITOR.env.ie&&!CKEDITOR.env.gecko){j=d.document;j.open();j.write(c.dataValue);j.close()}return true}};CKEDITOR.plugins.add("preview",{init:function(c){if(c.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){a=this.path;c.addCommand("preview",
f);c.ui.addButton&&c.ui.addButton("Preview",{label:c.lang.preview.preview,command:"preview",toolbar:"document,40"})}}})}(),CKEDITOR.plugins.add("print",{init:function(a){if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){a.addCommand("print",CKEDITOR.plugins.print);a.ui.addButton&&a.ui.addButton("Print",{label:a.lang.print.toolbar,command:"print",toolbar:"document,50"})}}}),CKEDITOR.plugins.print={exec:function(a){CKEDITOR.env.gecko?a.window.$.print():a.document.$.execCommand("Print")},canUndo:!1,readOnly:1,
modes:{wysiwyg:1}},CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}),CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var f=a._.removeFormatRegex||(a._.removeFormatRegex=RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),c=a._.removeAttributes||
(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),e=CKEDITOR.plugins.removeformat.filter,b=a.getSelection().getRanges(),g=b.createIterator(),i=function(a){return a.type==CKEDITOR.NODE_ELEMENT},d;d=g.getNextRange();){d.collapsed||d.enlarge(CKEDITOR.ENLARGE_ELEMENT);var h=d.createBookmark(),j=h.startNode,k=h.endNode,m=function(b){for(var c=a.elementPath(b),d=c.elements,g=1,h;h=d[g];g++){if(h.equals(c.block)||h.equals(c.blockLimit))break;f.test(h.getName())&&e(a,h)&&b.breakParent(h)}};
m(j);if(k){m(k);for(j=j.getNextSourceNode(true,CKEDITOR.NODE_ELEMENT);j;){if(j.equals(k))break;if(j.isReadOnly()){if(j.getPosition(k)&CKEDITOR.POSITION_CONTAINS)break;j=j.getNext(i)}else{m=j.getNextSourceNode(false,CKEDITOR.NODE_ELEMENT);if(!(j.getName()=="img"&&j.data("cke-realelement"))&&e(a,j))if(f.test(j.getName()))j.remove(1);else{j.removeAttributes(c);a.fire("removeFormatCleanup",j)}j=m}}}d.moveToBookmark(h)}a.forceNextSelectionCheck();a.getSelection().selectRanges(b)}}},filter:function(a,f){for(var c=
a._.removeFormatFilters||[],e=0;e<c.length;e++)if(c[e](f)===false)return false;return true}},CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){if(!this._.removeFormatFilters)this._.removeFormatFilters=[];this._.removeFormatFilters.push(a)},CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var",CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign",CKEDITOR.plugins.add("resize",{init:function(a){var f,
c,e,b,g=a.config,i=a.ui.spaceId("resizer"),d=a.element?a.element.getDirection(1):"ltr";!g.resize_dir&&(g.resize_dir="vertical");g.resize_maxWidth==void 0&&(g.resize_maxWidth=3E3);g.resize_maxHeight==void 0&&(g.resize_maxHeight=3E3);g.resize_minWidth==void 0&&(g.resize_minWidth=750);g.resize_minHeight==void 0&&(g.resize_minHeight=250);if(g.resize_enabled!==false){var h=null,j=(g.resize_dir=="both"||g.resize_dir=="horizontal")&&g.resize_minWidth!=g.resize_maxWidth,k=(g.resize_dir=="both"||g.resize_dir==
"vertical")&&g.resize_minHeight!=g.resize_maxHeight,m=function(h){var i=f,p=c,m=i+(h.data.$.screenX-e)*(d=="rtl"?-1:1),h=p+(h.data.$.screenY-b);j&&(i=Math.max(g.resize_minWidth,Math.min(m,g.resize_maxWidth)));k&&(p=Math.max(g.resize_minHeight,Math.min(h,g.resize_maxHeight)));a.resize(j?i:null,p)},o=function(){CKEDITOR.document.removeListener("mousemove",m);CKEDITOR.document.removeListener("mouseup",o);if(a.document){a.document.removeListener("mousemove",m);a.document.removeListener("mouseup",o)}},
p=CKEDITOR.tools.addFunction(function(d){h||(h=a.getResizable());f=h.$.offsetWidth||0;c=h.$.offsetHeight||0;e=d.screenX;b=d.screenY;g.resize_minWidth>f&&(g.resize_minWidth=f);g.resize_minHeight>c&&(g.resize_minHeight=c);CKEDITOR.document.on("mousemove",m);CKEDITOR.document.on("mouseup",o);if(a.document){a.document.on("mousemove",m);a.document.on("mouseup",o)}d.preventDefault&&d.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(p)});a.on("uiSpace",function(b){if(b.data.space==
"bottom"){var c="";j&&!k&&(c=" cke_resizer_horizontal");!j&&k&&(c=" cke_resizer_vertical");var e='<span id="'+i+'" class="cke_resizer'+c+" cke_resizer_"+d+'" title="'+CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+p+', event)">'+(d=="ltr"?"◢":"◣")+"</span>";d=="ltr"&&c=="ltr"?b.data.html=b.data.html+e:b.data.html=e+b.data.html}},a,null,100);a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),function(){var a=
{readOnly:1,exec:function(a){if(a.fire("save"))if(a=a.element.$.form)try{a.submit()}catch(c){a.submit.click&&a.submit.click()}}};CKEDITOR.plugins.add("save",{init:function(f){if(f.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE){f.addCommand("save",a).modes={wysiwyg:!!f.element.$.form};f.ui.addButton&&f.ui.addButton("Save",{label:f.lang.save.toolbar,command:"save",toolbar:"document,10"})}}})}(),function(){CKEDITOR.plugins.add("selectall",{init:function(a){a.addCommand("selectAll",{modes:{wysiwyg:1,source:1},
exec:function(a){var c=a.editable();if(c.is("textarea")){a=c.$;if(CKEDITOR.env.ie)a.createTextRange().execCommand("SelectAll");else{a.selectionStart=0;a.selectionEnd=a.value.length}a.focus()}else{if(c.is("body"))a.document.$.execCommand("SelectAll",false,null);else{var e=a.createRange();e.selectNodeContents(c);e.select()}a.forceNextSelectionCheck();a.selectionChange()}},canUndo:false});a.ui.addButton&&a.ui.addButton("SelectAll",{label:a.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}})}(),
function(){var a={readOnly:1,preserveState:true,editorFocus:false,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var c=this.state==CKEDITOR.TRISTATE_ON&&(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE||a.focusManager.hasFocus)?"attachClass":"removeClass";a.editable()[c]("cke_show_blocks")}}};CKEDITOR.plugins.add("showblocks",{onLoad:function(){var a=["p","div","pre","address","blockquote","h1","h2","h3","h4","h5","h6"],c,e,b,g,i=CKEDITOR.getUrl(this.path),d=!(CKEDITOR.env.ie&&
CKEDITOR.env.version<9),h=d?":not([contenteditable=false]):not(.cke_show_blocks_off)":"",j,k;for(c=e=b=g="";j=a.pop();){k=a.length?",":"";c=c+(".cke_show_blocks "+j+h+k);b=b+(".cke_show_blocks.cke_contents_ltr "+j+h+k);g=g+(".cke_show_blocks.cke_contents_rtl "+j+h+k);e=e+(".cke_show_blocks "+j+h+"{background-image:url("+CKEDITOR.getUrl(i+"images/block_"+j+".png")+")}")}CKEDITOR.addCss((c+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(e,b+"{background-position:top left;padding-left:8px}",
g+"{background-position:top right;padding-right:8px}"));d||CKEDITOR.addCss(".cke_show_blocks [contenteditable=false],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable=false],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable=false],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")},init:function(f){function c(){e.refresh(f)}
if(!f.blockless){var e=f.addCommand("showblocks",a);e.canUndo=false;f.config.startupOutlineBlocks&&e.setState(CKEDITOR.TRISTATE_ON);f.ui.addButton&&f.ui.addButton("ShowBlocks",{label:f.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"});f.on("mode",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(f)});if(f.elementMode==CKEDITOR.ELEMENT_MODE_INLINE){f.on("focus",c);f.on("blur",c)}f.on("contentDom",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(f)})}}})}(),function(){var a=
{preserveState:true,editorFocus:false,readOnly:1,exec:function(a){this.toggleState();this.refresh(a)},refresh:function(a){if(a.document){var c=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";a.editable()[c]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var a;a=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:[".%1 table.%2,",".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,",
".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,",".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,",".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th","{","border : #d3d3d3 1px dotted","}"]).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,"cke_show_borders ");CKEDITOR.addCss(a)},init:function(f){var c=f.addCommand("showborders",a);c.canUndo=false;f.config.startupShowBorders!==false&&c.setState(CKEDITOR.TRISTATE_ON);f.on("mode",function(){c.state!=
CKEDITOR.TRISTATE_DISABLED&&c.refresh(f)},null,null,100);f.on("contentDom",function(){c.state!=CKEDITOR.TRISTATE_DISABLED&&c.refresh(f)});f.on("removeFormatCleanup",function(a){a=a.data;f.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&(a.is("table")&&(!a.hasAttribute("border")||parseInt(a.getAttribute("border"),10)<=0))&&a.addClass("cke_show_border")})},afterInit:function(a){var c=a.dataProcessor,a=c&&c.dataFilter,c=c&&c.htmlFilter;a&&a.addRules({elements:{table:function(a){var a=a.attributes,
b=a["class"],c=parseInt(a.border,10);if((!c||c<=0)&&(!b||b.indexOf("cke_show_border")==-1))a["class"]=(b||"")+" cke_show_border"}}});c&&c.addRules({elements:{table:function(a){var a=a.attributes,b=a["class"];b&&(a["class"]=b.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}});CKEDITOR.on("dialogDefinition",function(a){var c=a.data.name;if(c=="table"||c=="tableProperties"){a=a.data.definition;c=a.getContents("info").get("txtBorder");c.commit=CKEDITOR.tools.override(c.commit,
function(a){return function(b,c){a.apply(this,arguments);var f=parseInt(this.getValue(),10);c[!f||f<=0?"addClass":"removeClass"]("cke_show_border")}});if(a=(a=a.getContents("advanced"))&&a.get("advCSSClasses")){a.setup=CKEDITOR.tools.override(a.setup,function(a){return function(){a.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,""))}});a.commit=CKEDITOR.tools.override(a.commit,function(a){return function(b,c){a.apply(this,arguments);parseInt(c.getAttribute("border"),
10)||c.addClass("cke_show_border")}})}}})}(),CKEDITOR.plugins.add("smiley",{requires:"dialog",init:function(a){a.config.smiley_path=a.config.smiley_path||this.path+"images/";a.addCommand("smiley",new CKEDITOR.dialogCommand("smiley",{allowedContent:"img[alt,height,!src,title,width]",requiredContent:"img"}));a.ui.addButton&&a.ui.addButton("Smiley",{label:a.lang.smiley.toolbar,command:"smiley",toolbar:"insert,50"});CKEDITOR.dialog.add("smiley",this.path+"dialogs/smiley.js")}}),CKEDITOR.config.smiley_images=
"regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" "),CKEDITOR.config.smiley_descriptions="smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";"),
function(){CKEDITOR.plugins.add("sourcearea",{init:function(f){function c(){var a=b&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+"px");this.show();a&&this.focus()}if(f.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var e=CKEDITOR.plugins.sourcearea;f.addMode("source",function(b){var e=f.ui.space("contents").getDocument().createElement("textarea");e.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?
"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",f.config.sourceAreaTabSize||4)));e.setAttribute("dir","ltr");e.addClass("cke_source cke_reset cke_enable_context_menu");f.ui.space("contents").append(e);e=f.editable(new a(f,e));e.setData(f.getData(1));if(CKEDITOR.env.ie){e.attachListener(f,"resize",c,e);e.attachListener(CKEDITOR.document.getWindow(),"resize",c,e);CKEDITOR.tools.setTimeout(c,0,e)}f.fire("ariaWidget",this);b()});f.addCommand("source",
e.commands.source);f.ui.addButton&&f.ui.addButton("Source",{label:f.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});f.on("mode",function(){f.getCommand("source").setState(f.mode=="source"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var b=CKEDITOR.env.ie&&CKEDITOR.env.version==9}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},
insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(a){a.mode=="wysiwyg"&&a.fire("saveSnapshot");a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);a.setMode(a.mode=="source"?"wysiwyg":"source")},canUndo:!1}}},
CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var f=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var c=a.langCode,c=f.availableLangs[c]?
c:f.availableLangs[c.replace(/-.*/,"")]?c.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path+"dialogs/lang/"+c+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,f.langEntries[c]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:false});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &Oslash; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &ocirc; &otilde; &ouml; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),
function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var f=a.config,c=a.lang.stylescombo,e={},b=[],g=[];a.on("stylesSet",function(c){if(c=c.data.styles){for(var d,h,j,k=0,m=c.length;k<m;k++){d=c[k];if(!(a.blockless&&d.element in CKEDITOR.dtd.$block)){h=d.name;d=new CKEDITOR.style(d);if(!a.filter.customConfig||a.filter.check(d)){d._name=h;d._.enterMode=f.enterMode;d._.type=j=d.assignedTo||d.type;d._.weight=k+(j==CKEDITOR.STYLE_OBJECT?1:j==CKEDITOR.STYLE_BLOCK?2:3)*1E3;
e[h]=d;b.push(d);g.push(d)}}}b.sort(function(a,b){return a._.weight-b._.weight})}});a.ui.addRichCombo("Styles",{label:c.label,title:c.panelTitle,toolbar:"styles,10",allowedContent:g,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),multiSelect:true,attributes:{"aria-label":c.panelTitle}},init:function(){var a,d,e,f,g,m;g=0;for(m=b.length;g<m;g++){a=b[g];d=a._name;f=a._.type;if(f!=e){this.startGroup(c["panelTitle"+f]);e=f}this.add(d,a.type==CKEDITOR.STYLE_OBJECT?d:a.buildPreview(),
d)}this.commit()},onClick:function(b){a.focus();a.fire("saveSnapshot");var b=e[b],c=a.elementPath();a[b.checkActive(c,a)?"removeStyle":"applyStyle"](b);a.fire("saveSnapshot")},onRender:function(){a.on("selectionChange",function(b){for(var c=this.getValue(),b=b.data.path.elements,f=0,g=b.length,k;f<g;f++){k=b[f];for(var m in e)if(e[m].checkElementRemovable(k,true,a)){m!=c&&this.setValue(m);return}}this.setValue("")},this)},onOpen:function(){var b=a.getSelection().getSelectedElement(),b=a.elementPath(b),
d=[0,0,0,0];this.showAll();this.unmarkAll();for(var f in e){var g=e[f],k=g._.type;g.checkApplicable(b,a,a.activeFilter)?d[k]++:this.hideItem(f);g.checkActive(b,a)&&this.mark(f)}d[CKEDITOR.STYLE_BLOCK]||this.hideGroup(c["panelTitle"+CKEDITOR.STYLE_BLOCK]);d[CKEDITOR.STYLE_INLINE]||this.hideGroup(c["panelTitle"+CKEDITOR.STYLE_INLINE]);d[CKEDITOR.STYLE_OBJECT]||this.hideGroup(c["panelTitle"+CKEDITOR.STYLE_OBJECT])},refresh:function(){var b=a.elementPath();if(b){for(var c in e)if(e[c].checkApplicable(b,
a,a.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){e={};b=[]}})}})}(),function(){function a(a){return{editorFocus:false,canUndo:false,modes:{wysiwyg:1},exec:function(c){if(c.editable().hasFocus){var e=c.getSelection(),d;if(d=(new CKEDITOR.dom.elementPath(e.getCommonAncestor(),e.root)).contains({td:1,th:1},1)){var e=c.createRange(),f=CKEDITOR.tools.tryThese(function(){var c=d.getParent().$.cells[d.$.cellIndex+(a?-1:1)];c.parentNode.parentNode;return c},function(){var c=
d.getParent(),c=c.getAscendant("table").$.rows[c.$.rowIndex+(a?-1:1)];return c.cells[a?c.cells.length-1:0]});if(!f&&!a){for(var j=d.getAscendant("table").$,f=d.getParent().$.cells,j=new CKEDITOR.dom.element(j.insertRow(-1),c.document),k=0,m=f.length;k<m;k++)j.append((new CKEDITOR.dom.element(f[k],c.document)).clone(false,false)).appendBogus();e.moveToElementEditStart(j)}else if(f){f=new CKEDITOR.dom.element(f);e.moveToElementEditStart(f);(!e.checkStartOfBlock()||!e.checkEndOfBlock())&&e.selectNodeContents(f)}else return true;
e.select(true);return true}}return false}}}var f={editorFocus:false,modes:{wysiwyg:1,source:1}},c={exec:function(a){a.container.focusNext(true,a.tabIndex)}},e={exec:function(a){a.container.focusPrevious(true,a.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(b){for(var g=b.config.enableTabKeyTools!==false,i=b.config.tabSpaces||0,d="";i--;)d=d+" ";if(d)b.on("key",function(a){if(a.data.keyCode==9){b.insertHtml(d);a.cancel()}});if(g)b.on("key",function(a){(a.data.keyCode==9&&b.execCommand("selectNextCell")||
a.data.keyCode==CKEDITOR.SHIFT+9&&b.execCommand("selectPreviousCell"))&&a.cancel()});b.addCommand("blur",CKEDITOR.tools.extend(c,f));b.addCommand("blurBack",CKEDITOR.tools.extend(e,f));b.addCommand("selectNextCell",a());b.addCommand("selectPreviousCell",a(true))}})}(),CKEDITOR.dom.element.prototype.focusNext=function(a,f){var c=f===void 0?this.getTabIndex():f,e,b,g,i,d,h;if(c<=0)for(d=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);d;){if(d.isVisible()&&d.getTabIndex()===0){g=d;break}d=d.getNextSourceNode(false,
CKEDITOR.NODE_ELEMENT)}else for(d=this.getDocument().getBody().getFirst();d=d.getNextSourceNode(false,CKEDITOR.NODE_ELEMENT);){if(!e)if(!b&&d.equals(this)){b=true;if(a){if(!(d=d.getNextSourceNode(true,CKEDITOR.NODE_ELEMENT)))break;e=1}}else b&&!this.contains(d)&&(e=1);if(d.isVisible()&&!((h=d.getTabIndex())<0)){if(e&&h==c){g=d;break}if(h>c&&(!g||!i||h<i)){g=d;i=h}else if(!g&&h===0){g=d;i=h}}}g&&g.focus()},CKEDITOR.dom.element.prototype.focusPrevious=function(a,f){for(var c=f===void 0?this.getTabIndex():
f,e,b,g,i=0,d,h=this.getDocument().getBody().getLast();h=h.getPreviousSourceNode(false,CKEDITOR.NODE_ELEMENT);){if(!e)if(!b&&h.equals(this)){b=true;if(a){if(!(h=h.getPreviousSourceNode(true,CKEDITOR.NODE_ELEMENT)))break;e=1}}else b&&!this.contains(h)&&(e=1);if(h.isVisible()&&!((d=h.getTabIndex())<0))if(c<=0){if(e&&d===0){g=h;break}if(d>i){g=h;i=d}}else{if(e&&d==c){g=h;break}if(d<c&&(!g||d>i)){g=h;i=d}}}g&&g.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function f(a){return CKEDITOR.tools.extend(a||
{},{contextSensitive:1,refresh:function(a,c){this.setState(c.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var c=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle",
"table[width]: sizeToAttribute"]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",f()));a.addCommand("tableDelete",f({exec:function(a){var b=a.elementPath().contains("table",1);if(b){var c=b.getParent(),f=a.editable();c.getChildCount()==1&&(!c.is("td","th")&&!c.equals(f))&&(b=c);a=a.createRange();a.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START);b.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:c.toolbar,command:"table",toolbar:"insert,30"});
CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:c.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:c.deleteTable,command:"tableDelete",group:"table",order:1}});a.on("doubleclick",function(a){if(a.data.element.is("table"))a.data.dialog="tableProperties"});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),
function(){function a(a){function b(a){if(!(c.length>0)&&a.type==CKEDITOR.NODE_ELEMENT&&o.test(a.getName())&&!a.getCustomData("selected_cell")){CKEDITOR.dom.element.setMarker(d,a,"selected_cell",true);c.push(a)}}for(var a=a.getRanges(),c=[],d={},e=0;e<a.length;e++){var f=a[e];if(f.collapsed){f=f.getCommonAncestor();(f=f.getAscendant("td",true)||f.getAscendant("th",true))&&c.push(f)}else{var f=new CKEDITOR.dom.walker(f),g;for(f.guard=b;g=f.next();)if(g.type!=CKEDITOR.NODE_ELEMENT||!g.is(CKEDITOR.dtd.table))if((g=
g.getAscendant("td",true)||g.getAscendant("th",true))&&!g.getCustomData("selected_cell")){CKEDITOR.dom.element.setMarker(d,g,"selected_cell",true);c.push(g)}}}CKEDITOR.dom.element.clearAllMarkers(d);return c}function f(b,c){for(var d=a(b),e=d[0],f=e.getAscendant("table"),e=e.getDocument(),g=d[0].getParent(),h=g.$.rowIndex,d=d[d.length-1],i=d.getParent().$.rowIndex+d.$.rowSpan-1,d=new CKEDITOR.dom.element(f.$.rows[i]),h=c?h:i,g=c?g:d,d=CKEDITOR.tools.buildTableMap(f),f=d[h],h=c?d[h-1]:d[h+1],d=d[0].length,
e=e.createElement("tr"),i=0;f[i]&&i<d;i++){var j;if(f[i].rowSpan>1&&h&&f[i]==h[i]){j=f[i];j.rowSpan=j.rowSpan+1}else{j=(new CKEDITOR.dom.element(f[i])).clone();j.removeAttribute("rowSpan");j.appendBogus();e.append(j);j=j.$}i=i+(j.colSpan-1)}c?e.insertBefore(g):e.insertAfter(g)}function c(b){if(b instanceof CKEDITOR.dom.selection){for(var d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),b=d[0].getParent().$.rowIndex,d=d[d.length-1],g=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[],
h=b;h<=g;h++){for(var i=f[h],j=new CKEDITOR.dom.element(e.$.rows[h]),k=0;k<i.length;k++){var m=new CKEDITOR.dom.element(i[k]),o=m.getParent().$.rowIndex;if(m.$.rowSpan==1)m.remove();else{m.$.rowSpan=m.$.rowSpan-1;if(o==h){o=f[h+1];o[k-1]?m.insertAfter(new CKEDITOR.dom.element(o[k-1])):(new CKEDITOR.dom.element(e.$.rows[h+1])).append(m,1)}}k=k+(m.$.colSpan-1)}d.push(j)}f=e.$.rows;e=new CKEDITOR.dom.element(f[g+1]||(b>0?f[b-1]:null)||e.$.parentNode);for(h=d.length;h>=0;h--)c(d[h]);return e}if(b instanceof
CKEDITOR.dom.element){e=b.getAscendant("table");e.$.rows.length==1?e.remove():b.remove()}return null}function e(a,b){for(var c=b?Infinity:0,d=0;d<a.length;d++){var e;e=a[d];for(var f=b,g=e.getParent().$.cells,h=0,i=0;i<g.length;i++){var j=g[i],h=h+(f?1:j.colSpan);if(j==e.$)break}e=h-1;if(b?e<c:e>c)c=e}return c}function b(b,c){for(var d=a(b),f=d[0].getAscendant("table"),g=e(d,1),d=e(d),g=c?g:d,h=CKEDITOR.tools.buildTableMap(f),f=[],d=[],i=h.length,j=0;j<i;j++){f.push(h[j][g]);d.push(c?h[j][g-1]:h[j][g+
1])}for(j=0;j<i;j++)if(f[j]){if(f[j].colSpan>1&&d[j]==f[j]){g=f[j];g.colSpan=g.colSpan+1}else{g=(new CKEDITOR.dom.element(f[j])).clone();g.removeAttribute("colSpan");g.appendBogus();g[c?"insertBefore":"insertAfter"].call(g,new CKEDITOR.dom.element(f[j]));g=g.$}j=j+(g.rowSpan-1)}}function g(a,b){var c=a.getStartElement();if(c=c.getAscendant("td",1)||c.getAscendant("th",1)){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function i(b){if(b instanceof CKEDITOR.dom.selection){var b=
a(b),c=b[0]&&b[0].getAscendant("table"),e;a:{var f=0;e=b.length-1;for(var g={},h,j;h=b[f++];)CKEDITOR.dom.element.setMarker(g,h,"delete_cell",true);for(f=0;h=b[f++];)if((j=h.getPrevious())&&!j.getCustomData("delete_cell")||(j=h.getNext())&&!j.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(g);e=j;break a}CKEDITOR.dom.element.clearAllMarkers(g);j=b[0].getParent();if(j=j.getPrevious())e=j.getLast();else{j=b[e].getParent();e=(j=j.getNext())?j.getChild(0):null}}for(j=b.length-1;j>=
0;j--)i(b[j]);e?d(e,true):c&&c.remove()}else if(b instanceof CKEDITOR.dom.element){c=b.getParent();c.getChildCount()==1?c.remove():b.remove()}}function d(a,b){var c=a.getDocument(),d=CKEDITOR.document;if(CKEDITOR.env.ie&&CKEDITOR.env.version==10){d.focus();c.focus()}c=new CKEDITOR.dom.range(c);if(!c["moveToElementEdit"+(b?"End":"Start")](a)){c.selectNodeContents(a);c.collapse(b?false:true)}c.select(true)}function h(a,b,c){a=a[b];if(typeof c=="undefined")return a;for(b=0;a&&b<a.length;b++){if(c.is&&
a[b]==c.$)return b;if(b==c)return new CKEDITOR.dom.element(a[b])}return c.is?-1:null}function j(b,c,d){var e=a(b),f;if((c?e.length!=1:e.length<2)||(f=b.getCommonAncestor())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("table"))return false;var g,b=e[0];f=b.getAscendant("table");var j=CKEDITOR.tools.buildTableMap(f),i=j.length,k=j[0].length,m=b.getParent().$.rowIndex,o=h(j,m,b);if(c){var y;try{var z=parseInt(b.getAttribute("rowspan"),10)||1;g=parseInt(b.getAttribute("colspan"),10)||1;y=j[c=="up"?m-z:c=="down"?
m+z:m][c=="left"?o-g:c=="right"?o+g:o]}catch(B){return false}if(!y||b.$==y)return false;e[c=="up"||c=="left"?"unshift":"push"](new CKEDITOR.dom.element(y))}for(var c=b.getDocument(),A=m,z=y=0,F=!d&&new CKEDITOR.dom.documentFragment(c),C=0,c=0;c<e.length;c++){g=e[c];var I=g.getParent(),G=g.getFirst(),E=g.$.colSpan,D=g.$.rowSpan,I=I.$.rowIndex,J=h(j,I,g),C=C+E*D,z=Math.max(z,J-o+E);y=Math.max(y,I-m+D);if(!d){E=g;(D=E.getBogus())&&D.remove();E.trim();if(g.getChildren().count()){if(I!=A&&G&&(!G.isBlockBoundary||
!G.isBlockBoundary({br:1})))(A=F.getLast(CKEDITOR.dom.walker.whitespaces(true)))&&(!A.is||!A.is("br"))&&F.append("br");g.moveChildren(F)}c?g.remove():g.setHtml("")}A=I}if(d)return y*z==C;F.moveChildren(b);b.appendBogus();z>=k?b.removeAttribute("rowSpan"):b.$.rowSpan=y;y>=i?b.removeAttribute("colSpan"):b.$.colSpan=z;d=new CKEDITOR.dom.nodeList(f.$.rows);e=d.count();for(c=e-1;c>=0;c--){f=d.getItem(c);if(!f.$.cells.length){f.remove();e++}}return b}function k(b,c){var d=a(b);if(d.length>1)return false;
if(c)return true;var d=d[0],e=d.getParent(),f=e.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(f),j=e.$.rowIndex,i=h(g,j,d),k=d.$.rowSpan,m;if(k>1){m=Math.ceil(k/2);for(var k=Math.floor(k/2),e=j+m,f=new CKEDITOR.dom.element(f.$.rows[e]),g=h(g,e),o,e=d.clone(),j=0;j<g.length;j++){o=g[j];if(o.parentNode==f.$&&j>i){e.insertBefore(new CKEDITOR.dom.element(o));break}else o=null}o||f.append(e)}else{k=m=1;f=e.clone();f.insertAfter(e);f.append(e=d.clone());o=h(g,j);for(i=0;i<o.length;i++)o[i].rowSpan++}e.appendBogus();
d.$.rowSpan=m;e.$.rowSpan=k;m==1&&d.removeAttribute("rowSpan");k==1&&e.removeAttribute("rowSpan");return e}function m(b,c){var d=a(b);if(d.length>1)return false;if(c)return true;var d=d[0],e=d.getParent(),f=e.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(f),g=h(f,e.$.rowIndex,d),j=d.$.colSpan;if(j>1){e=Math.ceil(j/2);j=Math.floor(j/2)}else{for(var j=e=1,i=[],k=0;k<f.length;k++){var m=f[k];i.push(m[g]);m[g].rowSpan>1&&(k=k+(m[g].rowSpan-1))}for(f=0;f<i.length;f++)i[f].colSpan++}f=d.clone();
f.insertAfter(d);f.appendBogus();d.$.colSpan=e;f.$.colSpan=j;e==1&&d.removeAttribute("colSpan");j==1&&f.removeAttribute("colSpan");return f}var o=/^(?:td|th)$/;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(e){function h(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function l(a,b){var c=e.addCommand(a,b);e.addFeature(c)}var o=e.lang.table;
l("cellProperties",new CKEDITOR.dialogCommand("cellProperties",h({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:"table"})));CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");l("rowDelete",h({requiredContent:"table",exec:function(a){a=a.getSelection();d(c(a))}}));l("rowInsertBefore",h({requiredContent:"table",exec:function(a){a=a.getSelection();f(a,true)}}));l("rowInsertAfter",h({requiredContent:"table",
exec:function(a){a=a.getSelection();f(a)}}));l("columnDelete",h({requiredContent:"table",exec:function(b){for(var b=b.getSelection(),b=a(b),c=b[0],e=b[b.length-1],b=c.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(b),g,h,j=[],i=0,k=f.length;i<k;i++)for(var l=0,m=f[i].length;l<m;l++){f[i][l]==c.$&&(g=l);f[i][l]==e.$&&(h=l)}for(i=g;i<=h;i++)for(l=0;l<f.length;l++){e=f[l];c=new CKEDITOR.dom.element(b.$.rows[l]);e=new CKEDITOR.dom.element(e[i]);if(e.$){e.$.colSpan==1?e.remove():e.$.colSpan=e.$.colSpan-
1;l=l+(e.$.rowSpan-1);c.$.cells.length||j.push(c)}}h=b.$.rows[0]&&b.$.rows[0].cells;g=new CKEDITOR.dom.element(h[g]||(g?h[g-1]:b.$.parentNode));j.length==k&&b.remove();g&&d(g,true)}}));l("columnInsertBefore",h({requiredContent:"table",exec:function(a){a=a.getSelection();b(a,true)}}));l("columnInsertAfter",h({requiredContent:"table",exec:function(a){a=a.getSelection();b(a)}}));l("cellDelete",h({requiredContent:"table",exec:function(a){a=a.getSelection();i(a)}}));l("cellMerge",h({allowedContent:"td[colspan,rowspan]",
requiredContent:"td[colspan,rowspan]",exec:function(a){d(j(a.getSelection()),true)}}));l("cellMergeRight",h({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){d(j(a.getSelection(),"right"),true)}}));l("cellMergeDown",h({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a){d(j(a.getSelection(),"down"),true)}}));l("cellVerticalSplit",h({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a){d(k(a.getSelection()))}}));l("cellHorizontalSplit",
h({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){d(m(a.getSelection()))}}));l("cellInsertBefore",h({requiredContent:"table",exec:function(a){a=a.getSelection();g(a,true)}}));l("cellInsertAfter",h({requiredContent:"table",exec:function(a){a=a.getSelection();g(a)}}));e.addMenuItems&&e.addMenuItems({tablecell:{label:o.cell.menu,group:"tablecell",order:1,getItems:function(){var b=e.getSelection(),c=a(b);return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,
tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:j(b,null,true)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:j(b,"right",true)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:j(b,"down",true)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:k(b,true)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:m(b,true)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_properties:c.length>0?CKEDITOR.TRISTATE_OFF:
CKEDITOR.TRISTATE_DISABLED}}},tablecell_insertBefore:{label:o.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:o.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:o.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:o.cell.merge,group:"tablecell",command:"cellMerge",order:16},tablecell_merge_right:{label:o.cell.mergeRight,group:"tablecell",command:"cellMergeRight",
order:17},tablecell_merge_down:{label:o.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:o.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:o.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:o.cell.title,group:"tablecellproperties",command:"cellProperties",order:21},tablerow:{label:o.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,
tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:o.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:o.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:o.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:o.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,
tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:o.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:o.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:o.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}});e.contextMenu&&e.contextMenu.addListener(function(a,b,c){return(a=c.contains({td:1,th:1},
1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getSelectedCells:a};CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)}(),CKEDITOR.tools.buildTableMap=function(a){for(var a=a.$.rows,f=-1,c=[],e=0;e<a.length;e++){f++;!c[f]&&(c[f]=[]);for(var b=-1,g=0;g<a[e].cells.length;g++){var i=a[e].cells[g];for(b++;c[f][b];)b++;for(var d=isNaN(i.colSpan)?1:i.colSpan,i=isNaN(i.rowSpan)?1:i.rowSpan,h=0;h<i;h++){c[f+h]||(c[f+
h]=[]);for(var j=0;j<d;j++)c[f+h][b+j]=a[e].cells[g]}b=b+(d-1)}}return c},function(){CKEDITOR.plugins.add("templates",{requires:"dialog",init:function(a){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js"));a.addCommand("templates",new CKEDITOR.dialogCommand("templates"));a.ui.addButton&&a.ui.addButton("Templates",{label:a.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var a={},f={};CKEDITOR.addTemplates=function(c,e){a[c]=e};CKEDITOR.getTemplates=
function(c){return a[c]};CKEDITOR.loadTemplates=function(a,e){for(var b=[],g=0,i=a.length;g<i;g++)if(!f[a[g]]){b.push(a[g]);f[a[g]]=1}b.length?CKEDITOR.scriptLoader.load(b,e):setTimeout(e,0)}}(),CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")],CKEDITOR.config.templates_replaceContent=!0,function(){function a(a){function c(){for(var g=e(),h=CKEDITOR.tools.clone(a.config.toolbarGroups)||f(a),j=0;j<h.length;j++){var k=h[j];if(k!="/"){typeof k=="string"&&(k=
h[j]={name:k});var l,q=k.groups;if(q)for(var r=0;r<q.length;r++){l=q[r];(l=g[l])&&d(k,l)}(l=g[k.name])&&d(k,l)}}return h}function e(){var c={},d,f,g;for(d in a.ui.items){f=a.ui.items[d];g=f.toolbar||"others";g=g.split(",");f=g[0];g=parseInt(g[1]||-1,10);c[f]||(c[f]=[]);c[f].push({name:d,order:g})}for(f in c)c[f]=c[f].sort(function(a,b){return a.order==b.order?0:b.order<0?-1:a.order<0?1:a.order<b.order?-1:1});return c}function d(c,d){if(d.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var e;e=
d.shift();){e=typeof e=="string"?e:e.name;if(!j||CKEDITOR.tools.indexOf(j,e)==-1)(e=a.ui.create(e))&&a.addFeature(e)&&c.items.push(e)}}}function h(a){var b=[],c,e,f;for(c=0;c<a.length;++c){e=a[c];f={};if(e=="/")b.push(e);else if(CKEDITOR.tools.isArray(e)){d(f,CKEDITOR.tools.clone(e));b.push(f)}else if(e.items){d(f,CKEDITOR.tools.clone(e.items));f.name=e.name;b.push(f)}}return b}var j=a.config.removeButtons,j=j&&j.split(","),k=a.config.toolbar;typeof k=="string"&&(k=a.config["toolbar_"+k]);return a.toolbar=
k?h(k):c()}function f(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var c=function(){this.toolbars=
[];this.focusCommandExecuted=false};c.prototype.focus=function(){for(var a=0,c;c=this.toolbars[a++];)for(var e=0,d;d=c.items[e++];)if(d.focus){d.focus();return}};var e={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){if(a.toolbox){a.toolbox.focusCommandExecuted=true;CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},100):a.toolbox.focus()}}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(b){var f,i=function(a,c){var e,k=b.lang.dir=="rtl",m=b.config.toolbarGroupCycling,
o=k?37:39,k=k?39:37,m=m===void 0||m;switch(c){case 9:case CKEDITOR.SHIFT+9:for(;!e||!e.items.length;){e=c==9?(e?e.next:a.toolbar.next)||b.toolbox.toolbars[0]:(e?e.previous:a.toolbar.previous)||b.toolbox.toolbars[b.toolbox.toolbars.length-1];if(e.items.length)for(a=e.items[f?e.items.length-1:0];a&&!a.focus;)(a=f?a.previous:a.next)||(e=0)}a&&a.focus();return false;case o:e=a;do{e=e.next;!e&&m&&(e=a.toolbar.items[0])}while(e&&!e.focus);e?e.focus():i(a,9);return false;case 40:if(a.button&&a.button.hasArrow){b.once("panelShow",
function(a){a.data._.panel._.currentBlock.onKeyDown(40)});a.execute()}else i(a,c==40?o:k);return false;case k:case 38:e=a;do{e=e.previous;!e&&m&&(e=a.toolbar.items[a.toolbar.items.length-1])}while(e&&!e.focus);if(e)e.focus();else{f=1;i(a,CKEDITOR.SHIFT+9);f=0}return false;case 27:b.focus();return false;case 13:case 32:a.execute();return false}return true};b.on("uiSpace",function(d){if(d.data.space==b.config.toolbarLocation){d.removeListener();b.toolbox=new c;var e=CKEDITOR.tools.getNextId(),f=['<span id="',
e,'" class="cke_voice_label">',b.lang.toolbar.toolbars,"</span>",'<span id="'+b.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',e,'" onmousedown="return false;">'],e=b.config.toolbarStartupExpanded!==false,g,m;b.config.toolbarCanCollapse&&b.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&f.push('<span class="cke_toolbox_main"'+(e?">":' style="display:none">'));for(var o=b.toolbox.toolbars,p=a(b),n=0;n<p.length;n++){var l,q=0,r,u=p[n],t;if(u){if(g){f.push("</span>");m=g=0}if(u===
"/")f.push('<span class="cke_toolbar_break"></span>');else{t=u.items||u;for(var v=0;v<t.length;v++){var x=t[v],w;if(x)if(x.type==CKEDITOR.UI_SEPARATOR)m=g&&x;else{w=x.canGroup!==false;if(!q){l=CKEDITOR.tools.getNextId();q={id:l,items:[]};r=u.name&&(b.lang.toolbar.toolbarGroups[u.name]||u.name);f.push('<span id="',l,'" class="cke_toolbar"',r?' aria-labelledby="'+l+'_label"':"",' role="toolbar">');r&&f.push('<span id="',l,'_label" class="cke_voice_label">',r,"</span>");f.push('<span class="cke_toolbar_start"></span>');
var s=o.push(q)-1;if(s>0){q.previous=o[s-1];q.previous.next=q}}if(w){if(!g){f.push('<span class="cke_toolgroup" role="presentation">');g=1}}else if(g){f.push("</span>");g=0}l=function(a){a=a.render(b,f);s=q.items.push(a)-1;if(s>0){a.previous=q.items[s-1];a.previous.next=a}a.toolbar=q;a.onkey=i;a.onfocus=function(){b.toolbox.focusCommandExecuted||b.focus()}};if(m){l(m);m=0}l(x)}}if(g){f.push("</span>");m=g=0}q&&f.push('<span class="cke_toolbar_end"></span></span>')}}}b.config.toolbarCanCollapse&&f.push("</span>");
if(b.config.toolbarCanCollapse&&b.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var y=CKEDITOR.tools.addFunction(function(){b.execCommand("toolbarCollapse")});b.on("destroy",function(){CKEDITOR.tools.removeFunction(y)});b.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=a.ui.space("toolbar_collapser"),c=b.getPrevious(),d=a.ui.space("contents"),e=c.getParent(),f=parseInt(d.$.style.height,10),g=e.$.offsetHeight,h=b.hasClass("cke_toolbox_collapser_min");if(h){c.show();b.removeClass("cke_toolbox_collapser_min");
b.setAttribute("title",a.lang.toolbar.toolbarCollapse)}else{c.hide();b.addClass("cke_toolbox_collapser_min");b.setAttribute("title",a.lang.toolbar.toolbarExpand)}b.getFirst().setText(h?"▲":"◀");d.setStyle("height",f-(e.$.offsetHeight-g)+"px");a.fire("resize")},modes:{wysiwyg:1,source:1}});b.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");f.push('<a title="'+(e?b.lang.toolbar.toolbarCollapse:b.lang.toolbar.toolbarExpand)+'" id="'+b.ui.spaceId("toolbar_collapser")+
'" tabIndex="-1" class="cke_toolbox_collapser');e||f.push(" cke_toolbox_collapser_min");f.push('" onclick="CKEDITOR.tools.callFunction('+y+')">','<span class="cke_arrow">&#9650;</span>',"</a>")}f.push("</span>");d.data.html=d.data.html+f.join("")}});b.on("destroy",function(){if(this.toolbox){var a,b=0,c,e,f;for(a=this.toolbox.toolbars;b<a.length;b++){e=a[b].items;for(c=0;c<e.length;c++){f=e[c];f.clickFn&&CKEDITOR.tools.removeFunction(f.clickFn);f.keyDownFn&&CKEDITOR.tools.removeFunction(f.keyDownFn)}}}});
b.on("uiReady",function(){var a=b.ui.space("toolbox");a&&b.focusManager.add(a,1)});b.addCommand("toolbarFocus",e);b.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");b.ui.add("-",CKEDITOR.UI_SEPARATOR,{});b.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,b){b.push('<span class="cke_toolbar_separator" role="separator"></span>');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,c,e){var d=f(this.editor),h=c===0,j={name:a};if(e){if(e=CKEDITOR.tools.search(d,
function(a){return a.name==e})){!e.groups&&(e.groups=[]);if(c){c=CKEDITOR.tools.indexOf(e.groups,c);if(c>=0){e.groups.splice(c+1,0,a);return}}h?e.groups.splice(0,0,a):e.groups.push(a);return}c=null}c&&(c=CKEDITOR.tools.indexOf(d,function(a){return a.name==c}));h?d.splice(0,0,a):typeof c=="number"?d.splice(c+1,0,j):d.push(a)}}(),CKEDITOR.UI_SEPARATOR="separator",CKEDITOR.config.toolbarLocation="top","use strict",function(){var a=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],f=
{8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(b){function e(a){i.enabled&&a.data.command.canUndo!==false&&i.save()}function f(){i.enabled=b.readOnly?false:b.mode=="wysiwyg";i.onChange()}var i=b.undoManager=new c(b),m=i.editingHandler=new g(i),o=b.addCommand("undo",{exec:function(){if(i.undo()){b.selectionChange();this.fire("afterUndo")}},startDisabled:true,canUndo:false}),p=b.addCommand("redo",{exec:function(){if(i.redo()){b.selectionChange();this.fire("afterRedo")}},startDisabled:true,canUndo:false});
b.setKeystroke([[a[0],"undo"],[a[1],"redo"],[a[2],"redo"]]);i.onChange=function(){o.setState(i.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);p.setState(i.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};b.on("beforeCommandExec",e);b.on("afterCommandExec",e);b.on("saveSnapshot",function(a){i.save(a.data&&a.data.contentOnly)});b.on("contentDom",m.attachListeners,m);b.on("instanceReady",function(){b.fire("saveSnapshot")});b.on("beforeModeUnload",function(){b.mode=="wysiwyg"&&
i.save(true)});b.on("mode",f);b.on("readOnly",f);if(b.ui.addButton){b.ui.addButton("Undo",{label:b.lang.undo.undo,command:"undo",toolbar:"undo,10"});b.ui.addButton("Redo",{label:b.lang.undo.redo,command:"redo",toolbar:"undo,20"})}b.resetUndo=function(){i.reset();b.fire("saveSnapshot")};b.on("updateSnapshot",function(){i.currentImage&&i.update()});b.on("lockSnapshot",function(a){a=a.data;i.lock(a&&a.dontUpdate,a&&a.forceUpdate)});b.on("unlockSnapshot",i.unlock,i)}});CKEDITOR.plugins.undo={};var c=
CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this.editor=a;this.reset()};c.prototype={type:function(a,b){var e=c.getKeyGroup(a),f=this.strokesRecorded[e]+1,b=b||f>=this.strokesLimit;if(!this.typing){this.hasUndo=this.typing=true;this.hasRedo=false;this.onChange()}if(b){f=0;this.editor.fire("saveSnapshot")}else this.editor.fire("change");this.strokesRecorded[e]=f;this.previousKeyGroup=
e},keyGroupChanged:function(a){return c.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=false;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=false;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(true);this.hasRedo=!!this.getNextImage(false);this.resetType();this.onChange()},save:function(a,b,c){var f=this.editor;if(this.locked||
f.status!="ready"||f.mode!="wysiwyg")return false;var g=f.editable();if(!g||g.status!="ready")return false;g=this.snapshots;b||(b=new e(f));if(b.contents===false)return false;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return false}else c!==false&&f.fire("change");g.splice(this.index+1,g.length-this.index-1);g.length==this.limit&&g.shift();this.index=g.push(b)-1;this.currentImage=b;c!==false&&this.refreshState();return true},restoreImage:function(a){var b=
this.editor,c;if(a.bookmarks){b.focus();c=b.getSelection()}this.locked={level:999};this.editor.loadSnapshot(a.contents);if(a.bookmarks)c.selectBookmarks(a.bookmarks);else if(CKEDITOR.env.ie){c=this.editor.document.getBody().$.createTextRange();c.collapse(true);c.select()}this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();b.fire("change")},getNextImage:function(a){var b=this.snapshots,c=this.currentImage,e;if(c)if(a)for(e=this.index-1;e>=
0;e--){a=b[e];if(!c.equalsContent(a)){a.index=e;return a}}else for(e=this.index+1;e<b.length;e++){a=b[e];if(!c.equalsContent(a)){a.index=e;return a}}return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(true);var a=this.getNextImage(true);if(a)return this.restoreImage(a),true}return false},redo:function(){if(this.redoable()){this.save(true);if(this.redoable()){var a=this.getNextImage(false);
if(a)return this.restoreImage(a),true}}return false},update:function(a){if(!this.locked){a||(a=new e(this.editor));for(var b=this.index,c=this.snapshots;b>0&&this.currentImage.equalsContent(c[b-1]);)b=b-1;c.splice(b,this.index-b+1,a);this.index=b;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return false;var b=this.snapshots,c=b[b.length-1];if(c.equalsContent(a)&&!c.equalsSelection(a)){this.currentImage=b[b.length-1]=a;return true}return false},lock:function(a,b){if(this.locked)this.locked.level++;
else if(a)this.locked={level:1};else{var c=null;if(b)c=true;else{var f=new e(this.editor,true);this.currentImage&&this.currentImage.equalsContent(f)&&(c=f)}this.locked={update:c,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(a===true)this.update();else if(a){var b=new e(this.editor,true);a.equalsContent(b)||this.update()}}}};c.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};c.keyGroups={PRINTABLE:0,FUNCTIONAL:1};c.isNavigationKey=
function(a){return!!c.navigationKeyCodes[a]};c.getKeyGroup=function(a){var b=c.keyGroups;return f[a]?b.FUNCTIONAL:b.PRINTABLE};c.getOppositeKeyGroup=function(a){var b=c.keyGroups;return a==b.FUNCTIONAL?b.PRINTABLE:b.FUNCTIONAL};c.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&c.getKeyGroup(a)==c.keyGroups.FUNCTIONAL};var e=CKEDITOR.plugins.undo.Image=function(a,b){this.editor=a;a.fire("beforeUndoImage");var c=a.getSnapshot();CKEDITOR.env.ie&&c&&(c=c.replace(/\s+data-cke-expando=".*?"/g,""));
this.contents=c;if(!b)this.bookmarks=(c=c&&a.getSelection())&&c.createBookmarks2(true);a.fire("afterUndoImage")},b=/\b(?:href|src|name)="[^"]*?"/gi;e.prototype={equalsContent:function(a){var c=this.contents,a=a.contents;if(CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)){c=c.replace(b,"");a=a.replace(b,"")}return c!=a?false:true},equalsSelection:function(a){var b=this.bookmarks,a=a.bookmarks;if(b||a){if(!b||!a||b.length!=a.length)return false;for(var c=0;c<b.length;c++){var e=b[c],
f=a[c];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return false}}return true}};var g=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=false;this.keyEventsStack=new i;this.lastKeydownImage=null};g.prototype={onKeydown:function(b){if(CKEDITOR.tools.indexOf(a,b.data.getKeystroke())>-1)b.data.preventDefault();else{this.keyEventsStack.cleanUp(b);var b=b.data.getKey(),
f=this.undoManager;this.keyEventsStack.getLast(b)||this.keyEventsStack.push(b);this.lastKeydownImage=new e(f.editor);if(c.isNavigationKey(b)||this.undoManager.keyGroupChanged(b))if(f.strokesRecorded[0]||f.strokesRecorded[1]){f.save(false,this.lastKeydownImage,false);f.resetType()}}},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=false;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);if(this.keyEventsStack.getTotalInputs()>=
this.undoManager.strokesLimit){this.undoManager.type(a.keyCode,true);this.keyEventsStack.resetInputs()}}},onKeyup:function(a){var b=this.undoManager,a=a.data.getKey(),f=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!c.ieFunctionalKeysBug(a)||!this.lastKeydownImage||!this.lastKeydownImage.equalsContent(new e(b.editor,true)))if(f>0)b.type(a);else if(c.isNavigationKey(a))this.onNavigationKey(true)},onNavigationKey:function(a){var b=this.undoManager;(a||!b.save(true,null,false))&&
b.updateSelection(new e(b.editor));b.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=true},attachListeners:function(){var a=this.undoManager.editor,b=a.editable(),e=this;b.attachListener(b,"keydown",function(a){e.onKeydown(a);if(c.ieFunctionalKeysBug(a.data.getKey()))e.onInput()},null,null,999);b.attachListener(b,CKEDITOR.env.ie?"keypress":"input",e.onInput,e,null,999);b.attachListener(b,"keyup",e.onKeyup,e,null,999);b.attachListener(b,"paste",e.ignoreInputEventListener,e,null,
999);b.attachListener(b,"drop",e.ignoreInputEventListener,e,null,999);b.attachListener(b.isInline()?b:a.document.getDocumentElement(),"click",function(){e.onNavigationKey()},null,null,999);b.attachListener(this.undoManager.editor,"blur",function(){e.keyEventsStack.remove(9)},null,null,999)}};var i=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};i.prototype={push:function(a){return this.stack[this.stack.push({keyCode:a,inputs:0})-1]},getLastIndex:function(a){if(typeof a!="number")return this.stack.length-
1;for(var b=this.stack.length;b--;)if(this.stack[b].keyCode==a)return b;return-1},getLast:function(a){a=this.getLastIndex(a);return a!=-1?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);a!=-1&&this.stack.splice(a,1)},resetInputs:function(a){if(typeof a=="number")this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,b=0;a--;)b=b+this.stack[a].inputs;return b},
cleanUp:function(a){a=a.data.$;!a.ctrlKey&&!a.metaKey&&this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}}(),function(){function a(a){var c=this.editor,e=a.document,d=e.body,h=e.getElementById("cke_actscrpt");h&&h.parentNode.removeChild(h);(h=e.getElementById("cke_shimscrpt"))&&h.parentNode.removeChild(h);(h=e.getElementById("cke_basetagscrpt"))&&h.parentNode.removeChild(h);d.contentEditable=true;if(CKEDITOR.env.ie){d.hideFocus=true;d.disabled=true;d.removeAttribute("disabled")}delete this._.isLoadingData;
this.$=d;e=new CKEDITOR.dom.document(e);this.setup();this.fixInitialSelection();if(CKEDITOR.env.ie){e.getDocumentElement().addClass(e.$.compatMode);c.config.enterMode!=CKEDITOR.ENTER_P&&this.attachListener(e,"selectionchange",function(){var a=e.getBody(),b=c.getSelection(),d=b&&b.getRanges()[0];d&&(a.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i)&&d.startContainer.equals(a))&&setTimeout(function(){d=c.getSelection().getRanges()[0];if(!d.startContainer.equals("body")){a.getFirst().remove(1);d.moveToElementEditEnd(a);
d.select()}},0)})}if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&CKEDITOR.env.version>10)e.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){c.editable().focus()})});f(c);try{c.document.$.execCommand("2D-position",false,true)}catch(j){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&c.document.$.compatMode=="CSS1Compat")&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(b==33||b==34)if(CKEDITOR.env.ie)setTimeout(function(){c.getSelection().scrollIntoView()},
0);else if(c.window.$.innerHeight>this.$.offsetHeight){var d=c.createRange();d[b==33?"moveToElementEditStart":"moveToElementEditEnd"](this);d.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(e,"blur",function(){try{e.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(e,"touchend",function(){a.focus()});d=c.document.getElementsByTag("title").getItem(0);d.data("cke-title",d.getText());if(CKEDITOR.env.ie)c.document.$.title=this._.docTitle;CKEDITOR.tools.setTimeout(function(){if(this.status==
"unloaded")this.status="ready";c.fire("contentDom");if(this._.isPendingFocus){c.focus();this._.isPendingFocus=false}setTimeout(function(){c.fire("dataReady")},0);CKEDITOR.env.ie&&setTimeout(function(){if(c.document){var a=c.document.$.body;a.runtimeStyle.marginBottom="0px";a.runtimeStyle.marginBottom=""}},1E3)},0,this)}function f(a){function c(){var d;a.editable().attachListener(a,"selectionChange",function(){var c=a.getSelection().getSelectedElement();if(c){if(d){d.detachEvent("onresizestart",e);
d=null}c.$.attachEvent("onresizestart",e);d=c.$}})}function e(a){a.returnValue=false}if(CKEDITOR.env.gecko)try{var d=a.document.$;d.execCommand("enableObjectResizing",false,!a.config.disableObjectResizing);d.execCommand("enableInlineTableEditing",false,!a.config.disableNativeTableHandles)}catch(f){}else CKEDITOR.env.ie&&(CKEDITOR.env.version<11&&a.config.disableObjectResizing)&&c(a)}function c(){var a=[];if(CKEDITOR.document.$.documentMode>=8){a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");
var c=[],e;for(e in CKEDITOR.dtd.$removeEmpty)c.push("html.CSS1Compat "+e+"[contenteditable=false]");a.push(c.join(",")+"{display:inline-block}")}else if(CKEDITOR.env.gecko){a.push("html{height:100% !important}");a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
requiredContent:"body"});a.addMode("wysiwyg",function(c){function f(d){d&&d.removeListener();a.editable(new e(a,h.$.contentWindow.document.body));a.setData(a.getData(1),c)}var d="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",d=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent(d)+"}())":"",h=CKEDITOR.dom.element.createFromHtml('<iframe src="'+d+'" frameBorder="0"></iframe>');h.setStyles({width:"100%",
height:"100%"});h.addClass("cke_wysiwyg_frame cke_reset");var j=a.ui.space("contents");j.append(h);if(d=CKEDITOR.env.ie||CKEDITOR.env.gecko)h.on("load",f);var k=a.title,m=a.fire("ariaEditorHelpLabel",{}).label;if(k){CKEDITOR.env.ie&&m&&(k=k+(", "+m));h.setAttribute("title",k)}if(m){var k=CKEDITOR.tools.getNextId(),o=CKEDITOR.dom.element.createFromHtml('<span id="'+k+'" class="cke_voice_label">'+m+"</span>");j.append(o,1);h.setAttribute("aria-describedby",k)}a.on("beforeModeUnload",function(a){a.removeListener();
o&&o.remove()});h.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!d&&f();if(CKEDITOR.env.webkit){d=function(){j.setStyle("width","100%");h.hide();var a=j.getSize("width");if(a){h.setSize("width",a);j.removeStyle("width")}h.show()};h.setCustomData("onResize",d);CKEDITOR.document.getWindow().on("resize",d)}a.fire("ariaWidget",h)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var c=this.config,e=c.contentsCss;if(!CKEDITOR.tools.isArray(e))c.contentsCss=e?[e]:[];c.contentsCss.push(a)};
var e=CKEDITOR.tools.createClass({$:function(b){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(b){CKEDITOR.tools.setTimeout(a,0,this,b)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,e){var f=this.editor;if(e){this.setHtml(a);this.fixInitialSelection();f.fire("dataReady")}else{this._.isLoadingData=true;f._.dataStore={id:1};var d=f.config,h=d.fullPage,j=d.docType,k=CKEDITOR.tools.buildStyleHtml(c()).replace(/<style>/,
'<style data-cke-temp="1">');h||(k=k+CKEDITOR.tools.buildStyleHtml(f.config.contentsCss));var m=d.baseHref?'<base href="'+d.baseHref+'" data-cke-temp="1" />':"";h&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){f.docType=j=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){f.xmlDeclaration=a;return""}));a=f.dataProcessor.toHtml(a);if(h){/<body[\s|>]/.test(a)||(a="<body>"+a);/<html[\s|>]/.test(a)||(a="<html>"+a+"</html>");/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$&<title></title>")):
a=a.replace(/<html[^>]*>/,"$&<head><title></title></head>");m&&(a=a.replace(/<head[^>]*?>/,"$&"+m));a=a.replace(/<\/head\s*>/,k+"$&");a=j+a}else a=d.docType+'<html dir="'+d.contentsLangDirection+'" lang="'+(d.contentsLanguage||f.langCode)+'"><head><title>'+this._.docTitle+"</title>"+m+k+"</head><body"+(d.bodyId?' id="'+d.bodyId+'"':"")+(d.bodyClass?' class="'+d.bodyClass+'"':"")+">"+a+"</body></html>";if(CKEDITOR.env.gecko){a=a.replace(/<body/,'<body contenteditable="true" ');CKEDITOR.env.version<
2E4&&(a=a.replace(/<body[^>]*>/,"$&<\!-- cke-content-start --\>"))}d='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"<\/script>";CKEDITOR.env.ie&&CKEDITOR.env.version<9&&(d=d+'<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');
m&&(CKEDITOR.env.ie&&CKEDITOR.env.version<10)&&(d=d+'<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;<\/script>');a=a.replace(/(?=\s*<\/(:?head)>)/,d);this.clearCustomData();this.clearListeners();f.fire("contentDomUnload");var o=this.getDocument();try{o.write(a)}catch(p){setTimeout(function(){o.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();var a=this.editor,c=a.config,e=c.fullPage,d=e&&a.docType,f=e&&a.xmlDeclaration,j=this.getDocument(),
e=e?j.getDocumentElement().getOuterHtml():j.getBody().getHtml();CKEDITOR.env.gecko&&c.enterMode!=CKEDITOR.ENTER_BR&&(e=e.replace(/<br>(?=\s*(:?$|<\/body>))/,""));e=a.dataProcessor.toDataFormat(e);f&&(e=f+"\n"+e);d&&(e=d+"\n"+e);return e},focus:function(){this._.isLoadingData?this._.isPendingFocus=true:e.baseProto.focus.call(this)},detach:function(){var a=this.editor,c=a.document,a=a.window.getFrame();e.baseProto.detach.call(this);this.clearCustomData();c.getDocumentElement().clearCustomData();a&&
a.clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);if(a){(c=a.removeCustomData("onResize"))&&c.removeListener();a.remove()}}}})}(),CKEDITOR.config.disableObjectResizing=!1,CKEDITOR.config.disableNativeTableHandles=!0,CKEDITOR.config.disableNativeSpellChecker=!0,CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css"),CKEDITOR.config.plugins="aspell,insertdatetime,dialogui,dialog,iframedialog,xplanemailsyntax,xplansyntax,a11yhelp,about,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,format,forms,horizontalrule,htmlwriter,iframe,image,indent,indentlist,indentblock,justify,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,resize,save,selectall,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,tabletools,templates,toolbar,undo,wysiwygarea",
CKEDITOR.config.skin="moono",function(){var a=function(a,c){for(var e=CKEDITOR.getUrl("plugins/"+c),a=a.split(","),b=0;b<a.length;b++)CKEDITOR.skin.icons[a[b]]={path:e,offset:-a[++b],bgsize:a[++b]}};CKEDITOR.env.hidpi?a("about,0,,spellcheck,24,,bold,48,,italic,72,,strike,96,,subscript,120,,superscript,144,,underline,168,,bidiltr,192,,bidirtl,216,,blockquote,240,,copy-rtl,264,,copy,288,,cut-rtl,312,,cut,336,,paste-rtl,360,,paste,384,,codesnippet,408,,bgcolor,432,,textcolor,456,,creatediv,480,,docprops-rtl,504,,docprops,528,,find-rtl,552,,find,576,,replace,600,,flash,624,,button,648,,checkbox,672,,form,696,,hiddenfield,720,,imagebutton,744,,radio,768,,select-rtl,792,,select,816,,textarea-rtl,840,,textarea,864,,textfield-rtl,888,,textfield,912,,horizontalrule,936,,iframe,960,,image,984,,indent-rtl,1008,,indent,1032,,outdent-rtl,1056,,outdent,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,,language,1200,,anchor-rtl,1224,,anchor,1248,,link,1272,,unlink,1296,,bulletedlist-rtl,1320,,bulletedlist,1344,,numberedlist-rtl,1368,,numberedlist,1392,,mathjax,1416,,maximize,1440,,newpage-rtl,1464,,newpage,1488,,pagebreak-rtl,1512,,pagebreak,1536,,pastefromword-rtl,1560,,pastefromword,1584,,pastetext-rtl,1608,,pastetext,1632,,placeholder,1656,,preview-rtl,1680,,preview,1704,,print,1728,,removeformat,1752,,save,1776,,selectall,1800,,showblocks-rtl,1824,,showblocks,1848,,smiley,1872,,source-rtl,1896,,source,1920,,sourcedialog-rtl,1944,,sourcedialog,1968,,specialchar,1992,,table,2016,,templates-rtl,2040,,templates,2064,,uicolor,2088,,redo-rtl,2112,,redo,2136,,undo-rtl,2160,,undo,2184,,simplebox,4416,auto",
"icons_hidpi.png"):a("about,0,auto,spellcheck,24,auto,bold,48,auto,italic,72,auto,strike,96,auto,subscript,120,auto,superscript,144,auto,underline,168,auto,bidiltr,192,auto,bidirtl,216,auto,blockquote,240,auto,copy-rtl,264,auto,copy,288,auto,cut-rtl,312,auto,cut,336,auto,paste-rtl,360,auto,paste,384,auto,codesnippet,408,auto,bgcolor,432,auto,textcolor,456,auto,creatediv,480,auto,docprops-rtl,504,auto,docprops,528,auto,find-rtl,552,auto,find,576,auto,replace,600,auto,flash,624,auto,button,648,auto,checkbox,672,auto,form,696,auto,hiddenfield,720,auto,imagebutton,744,auto,radio,768,auto,select-rtl,792,auto,select,816,auto,textarea-rtl,840,auto,textarea,864,auto,textfield-rtl,888,auto,textfield,912,auto,horizontalrule,936,auto,iframe,960,auto,image,984,auto,indent-rtl,1008,auto,indent,1032,auto,outdent-rtl,1056,auto,outdent,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto,language,1200,auto,anchor-rtl,1224,auto,anchor,1248,auto,link,1272,auto,unlink,1296,auto,bulletedlist-rtl,1320,auto,bulletedlist,1344,auto,numberedlist-rtl,1368,auto,numberedlist,1392,auto,mathjax,1416,auto,maximize,1440,auto,newpage-rtl,1464,auto,newpage,1488,auto,pagebreak-rtl,1512,auto,pagebreak,1536,auto,pastefromword-rtl,1560,auto,pastefromword,1584,auto,pastetext-rtl,1608,auto,pastetext,1632,auto,placeholder,1656,auto,preview-rtl,1680,auto,preview,1704,auto,print,1728,auto,removeformat,1752,auto,save,1776,auto,selectall,1800,auto,showblocks-rtl,1824,auto,showblocks,1848,auto,smiley,1872,auto,source-rtl,1896,auto,source,1920,auto,sourcedialog-rtl,1944,auto,sourcedialog,1968,auto,specialchar,1992,auto,table,2016,auto,templates-rtl,2040,auto,templates,2064,auto,uicolor,2088,auto,redo-rtl,2112,auto,redo,2136,auto,undo-rtl,2160,auto,undo,2184,auto,simplebox,2208,auto",
"icons.png")}()})();
;Dependency._js['lib/ckeditor/ckeditor']=true;

;
﻿/*
 Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g))var k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b=
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",
!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();
return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);j.resolve()}else setTimeout(arguments.callee,
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}}),CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var k=this,i=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});i.push(f.promise());
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}})))})(window.jQuery);
;Dependency._js['lib/ckeditor/adapters/jquery']=true;

;
var qq;(qq=qq||{}).extend=function(e,t){for(var n in t)e[n]=t[n]},qq.indexOf=function(e,t,n){if(e.indexOf)return e.indexOf(t,n);n=n||0;var o=e.length;for(n<0&&(n+=o);n<o;n++)if(n in e&&e[n]===t)return n;return-1},qq.getUniqueId=function(){var e=0;return function(){return e++}}(),qq.ie=function(){return-1!=navigator.userAgent.indexOf("MSIE")},qq.safari=function(){return void 0!=navigator.vendor&&-1!=navigator.vendor.indexOf("Apple")},qq.chrome=function(){return void 0!=navigator.vendor&&-1!=navigator.vendor.indexOf("Google")},qq.firefox=function(){return-1!=navigator.userAgent.indexOf("Mozilla")&&void 0!=navigator.vendor&&""==navigator.vendor},qq.windows=function(){return"Win32"==navigator.platform},qq.attach=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n),function(){qq.detach(e,t,n)}},qq.detach=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.attachEvent&&e.detachEvent("on"+t,n)},qq.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},qq.insertBefore=function(e,t){t.parentNode.insertBefore(e,t)},qq.remove=function(e){e.parentNode.removeChild(e)},qq.contains=function(e,t){return e==t||(e.contains?e.contains(t):!!(8&t.compareDocumentPosition(e)))},qq.toElement=function(){var e=document.createElement("div");return function(t){e.innerHTML=t;var n=e.firstChild;return e.removeChild(n),n}}(),qq.css=function(e,t){null!=t.opacity&&"string"!=typeof e.style.opacity&&"undefined"!=typeof e.filters&&(t.filter="alpha(opacity="+Math.round(100*t.opacity)+")"),qq.extend(e.style,t)},qq.hasClass=function(e,t){return new RegExp("(^| )"+t+"( |$)").test(e.className)},qq.addClass=function(e,t){qq.hasClass(e,t)||(e.className+=" "+t)},qq.removeClass=function(e,t){var n=new RegExp("(^| )"+t+"( |$)");e.className=e.className.replace(n," ").replace(/^\s+|\s+$/g,"")},qq.setText=function(e,t){e.innerText=t,e.textContent=t},qq.copyDataAttributes=function(e,t){for(var n=e.attributes,o=n.length,i=0;i<o;i++){var s=n.item(i),a=s.nodeName;0==a.indexOf("data-")&&t.setAttribute(a,s.nodeValue)}},qq.children=function(e){for(var t=[],n=e.firstChild;n;)1==n.nodeType&&t.push(n),n=n.nextSibling;return t},qq.getByClass=function(e,t){if(e.querySelectorAll)return e.querySelectorAll("."+t);for(var n=[],o=e.getElementsByTagName("*"),i=o.length,s=0;s<i;s++)qq.hasClass(o[s],t)&&n.push(o[s]);return n},qq.obj2url=function(e,t,n){var o=[],i="&",s=function(e,n){var i=t?/\[\]$/.test(t)?t:t+"["+n+"]":n;"undefined"!=i&&"undefined"!=n&&o.push("object"==typeof e?qq.obj2url(e,i,!0):"[object Function]"===Object.prototype.toString.call(e)?encodeURIComponent(i)+"="+encodeURIComponent(e()):encodeURIComponent(i)+"="+encodeURIComponent(e))};if(!n&&t)i=/\?/.test(t)?/\?$/.test(t)?"":"&":"?",o.push(t),o.push(qq.obj2url(e));else if("[object Array]"===Object.prototype.toString.call(e)&&"undefined"!=typeof e)for(var a=0,r=e.length;a<r;++a)s(e[a],a);else if("undefined"!=typeof e&&null!==e&&"object"==typeof e)for(var a in e)s(e[a],a);else o.push(encodeURIComponent(t)+"="+encodeURIComponent(e));return o.join(i).replace(/^&/,"").replace(/%20/g,"+")},(qq=qq||{}).FileUploaderBasic=function(e){this._options={debug:!1,action:"/server/upload",params:{},customHeaders:{},button:null,multiple:!0,maxConnections:1,allowedExtensions:[],acceptFiles:null,sizeLimit:0,minSizeLimit:0,abortOnFailure:!0,onSubmit:function(e,t){},onProgress:function(e,t,n,o){},onComplete:function(e,t,n){},onCancel:function(e,t){},onUpload:function(e,t,n){},onError:function(e,t,n){},onSizeValidationFailure:function(e,t){},messages:{typeError:"Unfortunately the file(s) you selected weren't the type we were expecting. Only {extensions} files are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(e){alert(e)},inputName:"qqfile",extraDropzones:[]},qq.extend(this._options,e),qq.extend(this,qq.DisposeSupport),this._filesInProgress=0,this._handler=this._createUploadHandler(),this._options.button&&(this._button=this._createUploadButton(this._options.button)),this._preventLeaveInProgress()},qq.FileUploaderBasic.prototype={updateInputStyle:function(e){qq.css(this._button.getInput(),e)},setParams:function(e){this._options.params=e},getInProgress:function(){return this._filesInProgress},_createUploadButton:function(e){var t=this,n=new qq.UploadButton({element:e,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),acceptFiles:this._options.acceptFiles,onChange:function(e){t._onInputChange(e)}});return e.style.display="",this.addDisposer(function(){n.dispose()}),n},_createUploadHandler:function(){var e,t=this;return e=qq.UploadHandlerXhr.isSupported()?"UploadHandlerXhr":"UploadHandlerForm",new qq[e]({debug:this._options.debug,action:this._options.action,encoding:this._options.encoding,maxConnections:this._options.maxConnections,customHeaders:this._options.customHeaders,inputName:this._options.inputName,extraDropzones:this._options.extraDropzones,onProgress:function(e,n,o,i){t._onProgress(e,n,o,i),t._options.onProgress(e,n,o,i)},onComplete:function(e,n,o){t._onComplete(e,n,o),t._options.onComplete(e,n,o)},onCancel:function(e,n){t._onCancel(e,n),t._options.onCancel(e,n)},onError:t._options.onError,onUpload:function(e,n,o){t._onUpload(e,n,o),t._options.onUpload(e,n,o)}})},_preventLeaveInProgress:function(){var e=this;this._attach(window,"beforeunload",function(t){if(e._filesInProgress)return(t=t||window.event).returnValue=e._options.messages.onLeave,e._options.messages.onLeave})},_onSubmit:function(e,t){this._filesInProgress++},_onProgress:function(e,t,n,o){},_onComplete:function(e,t,n){this._filesInProgress--,n.error&&this._options.showMessage(n.error)},_onCancel:function(e,t){this._filesInProgress--},_onUpload:function(e,t,n){},_onInputChange:function(e){this._handler instanceof qq.UploadHandlerXhr?this._uploadFileList(e.files):this._validateFile(e)&&this._uploadFile(e),this._button.reset()},_uploadFileList:function(e){for(var t=[],n=0;n<e.length;n++)if(this._validateFile(e[n]))t.push(e[n]);else if(this._options.abortOnFailure)return;for(n=0;n<t.length;n++)this._uploadFile(t[n])},_uploadFile:function(e){var t=this._handler.add(e),n=this._handler.getName(t);!1!==this._options.onSubmit(t,n)&&(this._onSubmit(t,n),this._handler.upload(t,this._options.params))},_validateFile:function(e){var t,n;return e.value?t=e.value.replace(/.*(\/|\\)/,""):(t=null!==e.fileName&&void 0!==e.fileName?e.fileName:e.name,n=null!==e.fileSize&&void 0!==e.fileSize?e.fileSize:e.size),this._isAllowedExtension(t)?0===n?(this._error("emptyError",t),!1):n&&this._options.sizeLimit&&n>this._options.sizeLimit?(this._error("sizeError",t),this._options.onSizeValidationFailure(n,this._options.sizeLimit),!1):!(n&&n<this._options.minSizeLimit)||(this._error("minSizeError",t),!1):(this._error("typeError",t),!1)},_error:function(e,t){function n(e,t){o=o.replace(e,t)}var o=this._options.messages[e];n("{file}",this._formatFileName(t)),n("{extensions}",this._options.allowedExtensions.join(", ")),n("{sizeLimit}",this._formatSize(this._options.sizeLimit)),n("{minSizeLimit}",this._formatSize(this._options.minSizeLimit)),this._options.showMessage(o)},_formatFileName:function(e){return e.length>33&&(e=e.slice(0,19)+"..."+e.slice(-13)),e},_isAllowedExtension:function(e){var t=-1!==e.indexOf(".")?e.replace(/.*[.]/,"").toLowerCase():"",n=this._options.allowedExtensions;if(!n.length)return!0;for(var o=0;o<n.length;o++)if(n[o].toLowerCase()==t)return!0;return!1},_formatSize:function(e){var t=-1;do{e/=1024,t++}while(e>999);return Math.max(e,1).toFixed(1)+["kB","MB","GB","TB","PB","EB"][t]}},qq.FileUploader=function(e){qq.FileUploaderBasic.apply(this,arguments),qq.extend(this._options,{element:null,listElement:null,dragText:"Drop files here to upload",uploadButtonText:"Upload a file",cancelButtonText:"Cancel",failUploadText:"Upload failed",hideShowDropArea:!0,template:'<div class="qq-uploader"><div class="qq-upload-drop-area"><span>{dragText}</span></div><div class="qq-upload-button" style="display: none">{uploadButtonText}</div><ul class="qq-upload-list"></ul></div>',fileTemplate:'<li><span class="qq-progress-bar"></span><span class="qq-upload-file"></span><span class="qq-upload-spinner"></span><span class="qq-upload-size"></span><a class="qq-upload-cancel" href="#">{cancelButtonText}</a><span class="qq-upload-failed-text">{failUploadtext}</span></li>',classes:{button:"qq-upload-button",drop:"qq-upload-drop-area",dropActive:"qq-upload-drop-area-active",dropDisabled:"qq-upload-drop-area-disabled",list:"qq-upload-list",progressBar:"qq-progress-bar",file:"qq-upload-file",spinner:"qq-upload-spinner",size:"qq-upload-size",cancel:"qq-upload-cancel",success:"qq-upload-success",fail:"qq-upload-fail"}}),qq.extend(this._options,e),this._options.template=this._options.template.replace(/\{dragText\}/g,this._options.dragText),this._options.template=this._options.template.replace(/\{uploadButtonText\}/g,this._options.uploadButtonText),this._options.fileTemplate=this._options.fileTemplate.replace(/\{cancelButtonText\}/g,this._options.cancelButtonText),this._options.fileTemplate=this._options.fileTemplate.replace(/\{failUploadtext\}/g,this._options.failUploadText),this._element=this._options.element,this._element.innerHTML=this._options.template,this._listElement=this._options.listElement||this._find(this._element,"list"),this._classes=this._options.classes,this._button||(this._button=this._createUploadButton(this._find(this._element,"button"))),this._bindCancelEvent(),this._setupDragDrop()},qq.isValidFileDrag=function(e){if(qq.ie())return!1;var t=e.dataTransfer,n=qq.safari();return t&&"none"!=t.effectAllowed&&(t.files||!n&&t.types.contains&&t.types.contains("Files"))},qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype),qq.extend(qq.FileUploader.prototype,{addExtraDropzone:function(e){this._setupExtraDropzone(e)},removeExtraDropzone:function(e){var t=this._options.extraDropzones;for(var n in t)if(t[n]===e)return this._options.extraDropzones.splice(n,1)},_leaving_document_out:function(e){return(qq.chrome()||qq.safari()&&qq.windows())&&0==e.clientX&&0==e.clientY||qq.firefox()&&!e.relatedTarget},_find:function(e,t){var n=qq.getByClass(e,this._options.classes[t])[0];if(!n)throw new Error("element not found "+t);return n},_setupExtraDropzone:function(e){this._options.extraDropzones.push(e),this._setupDropzone(e)},_setupDropzone:function(e){var t=this,n=new qq.UploadDropZone({element:e,onEnter:function(n){qq.addClass(e,t._classes.dropActive),n.stopPropagation()},onLeave:function(e){},onLeaveNotDescendants:function(n){qq.removeClass(e,t._classes.dropActive)},onDrop:function(n){t._options.hideShowDropArea&&(e.style.display="none"),qq.removeClass(e,t._classes.dropActive),t._uploadFileList(n.dataTransfer.files)}});this.addDisposer(function(){n.dispose()}),this._options.hideShowDropArea&&(e.style.display="none")},_setupDragDrop:function(){var e=this._find(this._element,"drop"),t=this;this._options.extraDropzones.push(e);var n,o=this._options.extraDropzones;for(n=0;n<o.length;n++)this._setupDropzone(o[n]);qq.ie()||this._attach(document,"dragenter",function(i){if(qq.isValidFileDrag(i)&&!qq.hasClass(e,t._classes.dropDisabled))for(e.style.display="block",n=0;n<o.length;n++)o[n].style.display="block"}),this._attach(document,"dragleave",function(e){document.elementFromPoint(e.clientX,e.clientY);if(t._options.hideShowDropArea&&qq.FileUploader.prototype._leaving_document_out(e))for(n=0;n<o.length;n++)o[n].style.display="none"}),qq.attach(document,"drop",function(e){if(t._options.hideShowDropArea)for(n=0;n<o.length;n++)o[n].style.display="none";e.preventDefault()})},_onSubmit:function(e,t){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments),this._addToList(e,t)},_onProgress:function(e,t,n,o){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var i,s=this._getItemByFileId(e),a=this._find(s,"size");a.style.display="inline";var r=Math.round(n/o*100);i=n!=o?r+"% from "+this._formatSize(o):this._formatSize(o),this._find(s,"progressBar").style.width=r+"%",qq.setText(a,i)},_onComplete:function(e,t,n){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var o=this._getItemByFileId(e);qq.remove(this._find(o,"cancel")),qq.remove(this._find(o,"spinner")),n.success?qq.addClass(o,this._classes.success):qq.addClass(o,this._classes.fail)},_addToList:function(e,t){var n=qq.toElement(this._options.fileTemplate);n.qqFileId=e;var o=this._find(n,"file");qq.setText(o,this._formatFileName(t)),this._find(n,"size").style.display="none",this._options.multiple||this._clearList(),this._listElement.appendChild(n)},_clearList:function(){this._listElement.innerHTML=""},_getItemByFileId:function(e){for(var t=this._listElement.firstChild;t;){if(t.qqFileId==e)return t;t=t.nextSibling}},_bindCancelEvent:function(){var e=this,t=this._listElement;this._attach(t,"click",function(t){var n=(t=t||window.event).target||t.srcElement;if(qq.hasClass(n,e._classes.cancel)){qq.preventDefault(t);var o=n.parentNode;e._handler.cancel(o.qqFileId),qq.remove(o)}})}}),qq.UploadDropZone=function(e){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}},qq.extend(this._options,e),qq.extend(this,qq.DisposeSupport),this._element=this._options.element,this._disableDropOutside(),this._attachEvents()},qq.UploadDropZone.prototype={_dragover_should_be_canceled:function(){return qq.safari()||qq.firefox()&&qq.windows()},_disableDropOutside:function(e){qq.UploadDropZone.dropOutsideDisabled||(this._dragover_should_be_canceled?qq.attach(document,"dragover",function(e){e.preventDefault()}):qq.attach(document,"dragover",function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="none",e.preventDefault())}),qq.UploadDropZone.dropOutsideDisabled=!0)},_attachEvents:function(){var e=this;e._attach(e._element,"dragover",function(t){if(e._isValidFileDrag(t)){var n=qq.ie()?null:t.dataTransfer.effectAllowed;t.dataTransfer.dropEffect="move"==n||"linkMove"==n?"move":"copy",t.stopPropagation(),t.preventDefault()}}),e._attach(e._element,"dragenter",function(t){e._isValidFileDrag(t)&&e._options.onEnter(t)}),e._attach(e._element,"dragleave",function(t){if(e._isValidFileDrag(t)){e._options.onLeave(t);var n=document.elementFromPoint(t.clientX,t.clientY);qq.contains(this,n)||e._options.onLeaveNotDescendants(t)}}),e._attach(e._element,"drop",function(t){e._isValidFileDrag(t)&&(t.preventDefault(),e._options.onDrop(t))})},_isValidFileDrag:function(e){return qq.isValidFileDrag(e)}},qq.UploadButton=function(e){if(this._options={element:null,multiple:!1,acceptFiles:null,name:"file",onChange:function(e){},hoverClass:"qq-upload-button-hover",focusClass:"qq-upload-button-focus"},qq.extend(this._options,e),qq.extend(this,qq.DisposeSupport),this._element=this._options.element,"button"===this._element.tagName.toLowerCase()){var t=document.createElement("div");t.setAttribute("id",this._element.id),qq.copyDataAttributes(this._element,t);var n=document.createElement("div");"undefined"!=typeof n.textContent?n.textContent=this._element.textContent:n.innerText=this._element.innerText,t.appendChild(n),t.className="file-upload-button",this._element.parentNode.appendChild(t),this._element=t,this._element.parentNode.removeChild(this._options.element)}qq.css(this._element,{position:"relative",overflow:"hidden",direction:"ltr",opacity:1}),this._input=this._createInput()},qq.UploadButton.prototype={getInput:function(){return this._input},reset:function(){this._input.parentNode&&qq.remove(this._input),qq.removeClass(this._element,this._options.focusClass),this._input=this._createInput()},_createInput:function(){var e=document.createElement("input");this._options.multiple&&e.setAttribute("multiple","multiple"),this._options.acceptFiles&&e.setAttribute("accept",this._options.acceptFiles),e.setAttribute("type","file"),e.setAttribute("name",this._options.name),qq.css(e,{position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),this._element.appendChild(e);var t=this;return this._attach(e,"change",function(){t._options.onChange(e)}),this._attach(e,"mouseover",function(){qq.addClass(t._element,t._options.hoverClass)}),this._attach(e,"mouseout",function(){qq.removeClass(t._element,t._options.hoverClass)}),this._attach(e,"focus",function(){qq.addClass(t._element,t._options.focusClass)}),this._attach(e,"blur",function(){qq.removeClass(t._element,t._options.focusClass)}),window.attachEvent&&e.setAttribute("tabIndex","-1"),e}},qq.UploadHandlerAbstract=function(e){this._options={debug:!1,action:"/upload.php",maxConnections:999,onProgress:function(e,t,n,o){},onComplete:function(e,t,n){},onCancel:function(e,t){},onUpload:function(e,t,n){}},qq.extend(this._options,e),this._queue=[],this._params=[]},qq.UploadHandlerAbstract.prototype={log:function(e){this._options.debug&&window.console&&console.log("[uploader] "+e)},add:function(e){},upload:function(e,t){var n=this._queue.push(e),o={};qq.extend(o,t),this._params[e]=o,n<=this._options.maxConnections&&this._upload(e,this._params[e])},cancel:function(e){this._cancel(e),this._dequeue(e)},cancelAll:function(){for(var e=0;e<this._queue.length;e++)this._cancel(this._queue[e]);this._queue=[]},getName:function(e){},getSize:function(e){},getQueue:function(){return this._queue},_upload:function(e){},_cancel:function(e){},_dequeue:function(e){var t=qq.indexOf(this._queue,e);this._queue.splice(t,1);var n=this._options.maxConnections;if(this._queue.length>=n&&t<n){var o=this._queue[n-1];this._upload(o,this._params[o])}}},qq.UploadHandlerForm=function(e){qq.UploadHandlerAbstract.apply(this,arguments),this._inputs={}},qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype),qq.extend(qq.UploadHandlerForm.prototype,{add:function(e){e.setAttribute("name",this._options.inputName);var t="qq-upload-handler-iframe"+qq.getUniqueId();return this._inputs[t]=e,e.parentNode&&qq.remove(e),t},getName:function(e){return this._inputs[e].value.replace(/.*(\/|\\)/,"")},_cancel:function(e){this._options.onCancel(e,this.getName(e)),delete this._inputs[e];var t=document.getElementById(e);t&&(t.setAttribute("src","javascript:false;"),qq.remove(t))},_upload:function(e,t){this._options.onUpload(e,this.getName(e),!1);var n=this._inputs[e];if(!n)throw new Error("file with passed id was not added, or already uploaded or cancelled");var o=this.getName(e),i=this._createIframe(e),s=this._createForm(i,t);s.appendChild(n);var a=this;return this._attachLoadEvent(i,function(){a.log("iframe loaded");var t=a._getIframeContentJSON(i);a._options.onComplete(e,o,t),a._dequeue(e),delete a._inputs[e],setTimeout(function(){a._detach_event(),qq.remove(i)},1)}),s.submit(),qq.remove(s),e},_attachLoadEvent:function(e,t){this._detach_event=qq.attach(e,"load",function(){e.parentNode&&(e.contentDocument&&e.contentDocument.body&&"false"==e.contentDocument.body.innerHTML||t())})},_getIframeContentJSON:function(e){var t,n=e.contentDocument?e.contentDocument:e.contentWindow.document,o=n.body.innerHTML;this.log("converting iframe's innerHTML to JSON"),this.log("innerHTML = "+o),"<pre>"==o.slice(0,5).toLowerCase()&&"</pre>"==o.slice(-6).toLowerCase()&&(o=n.body.firstChild.firstChild.nodeValue);try{t=JSON.parse(o)}catch(e){t={}}return t},_createIframe:function(e){var t=qq.toElement('<iframe src="javascript:false;" name="'+e+'" />');return t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),t},_createForm:function(e,t){var n=qq.toElement('<form method="post" enctype="multipart/form-data"></form>'),o=qq.obj2url(t,this._options.action);return n.setAttribute("action",o),n.setAttribute("target",e.name),n.style.display="none",document.body.appendChild(n),n}}),qq.UploadHandlerXhr=function(e){qq.UploadHandlerAbstract.apply(this,arguments),this._files=[],this._xhrs=[],this._loaded=[]},qq.UploadHandlerXhr.isSupported=function(){var e=document.createElement("input");return e.type="file","multiple"in e&&"undefined"!=typeof File&&"undefined"!=typeof FormData&&"undefined"!=typeof(new XMLHttpRequest).upload},qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype),qq.extend(qq.UploadHandlerXhr.prototype,{add:function(e){if(!(e instanceof File))throw new Error("Passed obj in not a File (in qq.UploadHandlerXhr)");return this._files.push(e)-1},getName:function(e){var t=this._files[e];return null!==t.fileName&&void 0!==t.fileName?t.fileName:t.name},getSize:function(e){var t=this._files[e];return null!=t.fileSize?t.fileSize:t.size},getLoaded:function(e){return this._loaded[e]||0},_upload:function(e,t){this._options.onUpload(e,this.getName(e),!0);var n=this._files[e],o=this.getName(e);this.getSize(e);this._loaded[e]=0;var i=this._xhrs[e]=new XMLHttpRequest,s=this;i.upload.onprogress=function(t){t.lengthComputable&&(s._loaded[e]=t.loaded,s._options.onProgress(e,o,t.loaded,t.total))},i.onreadystatechange=function(){4==i.readyState&&s._onComplete(e,i)},(t=t||{})[this._options.inputName]=o;var a=qq.obj2url(t,this._options.action);if(i.open("POST",a,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("X-File-Name",encodeURIComponent(o)),"multipart"==this._options.encoding){var r=new FormData;r.append(o,n),n=r}else i.setRequestHeader("Content-Type","application/octet-stream"),i.setRequestHeader("X-Mime-Type",n.type);for(key in this._options.customHeaders)i.setRequestHeader(key,this._options.customHeaders[key]);i.send(n)},_onComplete:function(e,t){if(this._files[e]){var n=this.getName(e),o=this.getSize(e);if(this._options.onProgress(e,n,o,o),200==t.status){var i;this.log("xhr - server response received"),this.log("responseText = "+t.responseText);try{i=JSON.parse(t.responseText)}catch(e){i={}}this._options.onComplete(e,n,i)}else this._options.onError(e,n,t),this._options.onComplete(e,n,{});this._files[e]=null,this._xhrs[e]=null,this._dequeue(e)}},_cancel:function(e){this._options.onCancel(e,this.getName(e)),this._files[e]=null,this._xhrs[e]&&(this._xhrs[e].abort(),this._xhrs[e]=null)}}),qq.DisposeSupport={_disposers:[],dispose:function(){for(var e;e=this._disposers.shift();)e()},addDisposer:function(e){this._disposers.push(e)},_attach:function(){this.addDisposer(qq.attach.apply(this,arguments))}};
;Dependency._js['lib/fileuploader/fileuploader']=true;

;
EJS.Helpers.prototype.date_tag=function(t,e,r){e instanceof Date||(e=new Date);for(var n=["January","February","March","April","May","June","July","August","September","October","November","December"],o=[],i=[],a=[],s=e.getFullYear(),l=e.getMonth(),p=e.getDate(),u=s-15;u<s+15;u++)o.push({value:u,text:u});for(var f=0;f<12;f++)i.push({value:f,text:n[f]});for(var _=0;_<31;_++)a.push({value:_+1,text:_+1});return this.select_tag(t+"[year]",s,o,{id:t+"[year]"})+this.select_tag(t+"[month]",l,i,{id:t+"[month]"})+this.select_tag(t+"[day]",p,a,{id:t+"[day]"})},EJS.Helpers.prototype.form_tag=function(t,e){return(e=e||{}).action=t,1==e.multipart&&(e.method="post",e.enctype="multipart/form-data"),this.start_tag_for("form",e)},EJS.Helpers.prototype.form_tag_end=function(){return this.tag_end("form")},EJS.Helpers.prototype.hidden_field_tag=function(t,e,r){return this.input_field_tag(t,e,"hidden",r)},EJS.Helpers.prototype.input_field_tag=function(t,e,r,n){return(n=n||{}).id=n.id||t,n.value=e||"",n.type=r||"text",n.name=t,this.single_tag_for("input",n)},EJS.Helpers.prototype.is_current_page=function(t){return window.location.href==t||window.location.pathname==t},EJS.Helpers.prototype.link_to=function(t,e,r){if(!t)t="null";if(!r)r={};return r.confirm&&(r.onclick=' var ret_confirm = confirm("'+r.confirm+'"); if(!ret_confirm){ return false;} ',r.confirm=null),r.href=e,this.start_tag_for("a",r)+t+this.tag_end("a")},EJS.Helpers.prototype.submit_link_to=function(t,e,r){if(!t)t="null";if(!r)r={};return r.onclick=r.onclick||"",r.confirm&&(r.onclick=' var ret_confirm = confirm("'+r.confirm+'"); if(!ret_confirm){ return false;} ',r.confirm=null),r.value=t,r.type="submit",r.onclick=r.onclick+(e?this.url_for(e):"")+"return false;",this.start_tag_for("input",r)},EJS.Helpers.prototype.link_to_if=function(t,e,r,n,o,i){return this.link_to_unless(0==t,e,r,n,o,i)},EJS.Helpers.prototype.link_to_unless=function(t,e,r,n,o){return n=n||{},t?o&&"function"==typeof o?o(e,r,n,o):e:this.link_to(e,r,n)},EJS.Helpers.prototype.link_to_unless_current=function(t,e,r,n){return r=r||{},this.link_to_unless(this.is_current_page(e),t,e,r,n)},EJS.Helpers.prototype.password_field_tag=function(t,e,r){return this.input_field_tag(t,e,"password",r)},EJS.Helpers.prototype.select_tag=function(t,e,r,n){(n=n||{}).id=n.id||t,n.value=e,n.name=t;var o="";o+=this.start_tag_for("select",n);for(var i=0;i<r.length;i++){var a=r[i],s={value:a.value};a.value==e&&(s.selected="selected"),o+=this.start_tag_for("option",s)+a.text+this.tag_end("option")}return o+=this.tag_end("select")},EJS.Helpers.prototype.single_tag_for=function(t,e){return this.tag(t,e,"/>")},EJS.Helpers.prototype.start_tag_for=function(t,e){return this.tag(t,e)},EJS.Helpers.prototype.submit_tag=function(t,e){return(e=e||{}).type=e.type||"submit",e.value=t||"Submit",this.single_tag_for("input",e)},EJS.Helpers.prototype.tag=function(t,e,r){if(!r)r=">";var n=" ";for(var o in e){if(null!=e[o])var i=e[o].toString();else i="";"Class"==o&&(o="class"),-1!=i.indexOf("'")?n+=o+'="'+i+'" ':n+=o+"='"+i+"' "}return"<"+t+n+r},EJS.Helpers.prototype.tag_end=function(t){return"</"+t+">"},EJS.Helpers.prototype.text_area_tag=function(t,e,r){return(r=r||{}).id=r.id||t,r.name=r.name||t,e=e||"",r.size&&(r.cols=r.size.split("x")[0],r.rows=r.size.split("x")[1],delete r.size),r.cols=r.cols||50,r.rows=r.rows||4,this.start_tag_for("textarea",r)+e+this.tag_end("textarea")},EJS.Helpers.prototype.text_tag=EJS.Helpers.prototype.text_area_tag,EJS.Helpers.prototype.text_field_tag=function(t,e,r){return this.input_field_tag(t,e,"text",r)},EJS.Helpers.prototype.url_for=function(t){return'window.location="'+t+'";'},EJS.Helpers.prototype.img_tag=function(t,e,r){return(r=r||{}).src=t,r.alt=e,this.single_tag_for("img",r)};
;Dependency._js['lib/ejs/view']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("lib/ejs/ejs"),Dependency.addJS("lib/ejs/view")),XPLAN.namespace("Template"),XPLAN.Template.get=function(e){if(!XPLAN.debugmode){var t=XPLAN.Template._get(e);return t?new EJS({precompiled:t}):(jQuery.ajax(getBaseURL()+"/js/tpl_bank/ejs/"+e+".js",{async:!1,dataType:"text",success:function(e){jQuery.globalEval(e,{nonce:XPLAN.nonce})}}),new EJS({precompiled:XPLAN.Template._get(e)}))}return new EJS({url:getBaseURL()+"/ejs/"+e+".ejs"})},XPLAN.Template._get=function(e){for(var t=XPLAN.Template.path_to_namespace(e),n=XPLAN.TplBank,a=0;a<t.length&&n;a++)n=n[t[a]];return n},XPLAN.Template.path_to_namespace=function(e){var t,n,a,p,l=e.toLowerCase().split("/"),s=[];for(n=0;n<l.length;n++){if(t=l[n].split("_"),p="",n+1!=l.length)for(a=0;a<t.length;a++)p+=t[a].charAt(0).toUpperCase()+t[a].slice(1);else p=l[n];s.push(p)}return s};
;Dependency._js['template']=true;

;
XPLAN.namespace("TplBank.Portfolio.Search.portfolio_account_search"),XPLAN.TplBank.Portfolio.Search.portfolio_account_search=function(_CONTEXT,_VIEW){try{with(_VIEW)with(_CONTEXT){var ___ViewO=[];return ___ViewO.push('<div id="portfolio_search_control_'),___ViewO.push(EJS.Scanner.to_text(id_counter)),___ViewO.push('" >\n'),___ViewO.push('    <div id="portfolio_search_opener_'),___ViewO.push(EJS.Scanner.to_text(id_counter)),___ViewO.push('" class="portfolio_search_opener entitylookup-select" ></div>\n'),___ViewO.push('    <div id="portfolio_search_dialog_'),___ViewO.push(EJS.Scanner.to_text(id_counter)),___ViewO.push('" class="portfolio_search_dialog" style="display: none;" data-xplan-elem="portfolio_search_dialog">\n'),___ViewO.push('        <div class="content">\n'),___ViewO.push("            <table>\n"),___ViewO.push('                <tr data-xplan-elem="row_search">\n'),___ViewO.push("                    <td>\n"),___ViewO.push('                        <label class="key" for="portfolios_search_string">'),___ViewO.push(EJS.Scanner.to_text(_("Search"))),___ViewO.push(":</label>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                    <td>\n"),___ViewO.push("                        <div>\n"),___ViewO.push('                            <input id="portfolios_search_string" />\n'),___ViewO.push('                            <span class="icon icon-search" id="portfolios_search" title="Search Portfolio" />\n'),___ViewO.push("                        </div>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                </tr>\n"),___ViewO.push('                <tr data-xplan-elem="row_warning_message">\n'),___ViewO.push('                    <td colspan="2" class="truncation_warning" style="display: none;">\n'),___ViewO.push('                        <label class="warning">'),___ViewO.push(EJS.Scanner.to_text(_("Results limited to 100 entries. Please refine your search."))),___ViewO.push("</label>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                </tr>\n"),___ViewO.push('                <tr data-xplan-elem="row_portfolio_selection">\n'),___ViewO.push("                    <td>\n"),___ViewO.push('                        <label class="key" id="portfolios_label" for="portfolios">'),___ViewO.push(EJS.Scanner.to_text(account_group_mode?_("Group"):_("Portfolio"))),___ViewO.push(":</label>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                    <td>\n"),___ViewO.push('                        <select id="portfolio_selection">\n'),___ViewO.push("                            <option></option>\n"),___ViewO.push("                        </select>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                </tr>\n"),___ViewO.push("                "),portfolio_only||account_group_mode||(___ViewO.push("\n"),___ViewO.push('                <tr data-xplan-elem="row_account_selection">\n'),___ViewO.push("                    <td>\n"),___ViewO.push('                        <label class="key" id="account_label" for="accounts">'),___ViewO.push(EJS.Scanner.to_text(_("Account"))),___ViewO.push(":</label>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                    <td>\n"),___ViewO.push('                        <select id="account_selection">\n'),___ViewO.push("                            <option></option>\n"),___ViewO.push("                        </select>\n"),___ViewO.push("                    </td>\n"),___ViewO.push("                </tr>\n"),___ViewO.push("                ")),___ViewO.push("\n"),___ViewO.push("            </table>\n"),___ViewO.push("        </div>\n"),___ViewO.push("    </div>\n"),___ViewO.push("</div>\n"),___ViewO.join("")}}catch(e){throw e.lineNumber=null,e}};
;Dependency._js['tpl_bank/ejs/portfolio/search/portfolio_account_search']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("popup"),Dependency.addJS("table"),Dependency.addJS("template"),Dependency.addJS("resourceful/portfolio/group"),Dependency.addJS("lib/jquery/plugins/select2/select2"),Dependency.addCSS("jquery/plugins/select2/select2"),Dependency.addCSS("portfolio/search/portfolio_account_search"),Dependency.addTemplate("portfolio/search/portfolio_account_search")),function(e){function t(t,_){this._defaults=s,this._name=i,this.element=t,this.options=e.extend({},s,_),XPLAN.Template.get("portfolio/search/portfolio_account_search").update(this.element,{id_counter:o,portfolio_only:this.options.portfolio_only,account_group_mode:this.options.account_group_mode}),this.$opener=e(t).find("#portfolio_search_opener_"+o),this.$dialog=e(t).find("#portfolio_search_dialog_"+o),e(t).data(i,this),this.portfolio_only=this.options.portfolio_only,this.account_group_mode=this.options.account_group_mode,this.trigger_change=this.options.trigger_change,this.hide_opener=this.options.hide_opener,this._selected_portfolio_id=this.options.selected_portfolio_id,this._selected_ips_account_id=this.options.selected_ips_account_id,this._selected_xplan_account_id=this.options.selected_xplan_account_id,this._selected_group_code=this.options.selected_group_code,this.close_on_search_finished=this.options.close_on_search_finished,this.modal=this.options.modal,this.include_empty_subfund=this.options.include_empty_subfund,this.empty_subfund_text=this.options.empty_subfund_text,delete this.options.portfolio_only,delete this.options.trigger_change,delete this.options.hide_opener,delete this.options.account_group_mode,delete this.options.selected_portfolio_id,delete this.options.selected_ips_account_id,delete this.options.selected_xplan_account_id,delete this.options.selected_group_code,delete this.options.close_on_search_finished,delete this.options.modal,delete this.options.include_empty_subfund,delete this.options.empty_subfund_text,this.init(this)}var o=0,i="xplan_portfolio_account_search",s={selected_portfolio_id:"",selected_ips_account_id:"",selected_xplan_account_id:"",selected_group_code:"",include_partner:null,include_related:null,include_joint:null,include_shared_portfolio:null,include_shared_owners:null,including_margin_lending:null,include_empty_subfund:!1,empty_subfund_text:"",include_all:!1,portfolio_only:!1,account_group_mode:!1,trigger_change:!1,hide_opener:!1,close_on_search_finished:!0,modal:!1};t.prototype={init:function(e){this.get_details(),this._init_opener(e)},_init_opener:function(e){this.set_opener_text(),this.$opener.on("click",function(t){e.open_dialog()}),this.hide_opener&&this.$opener.hide()},only_selected_portfolio:function(){return this.portfolio_only||this.include_empty_subfund&&!this._selected_ips_account_id},get_details:function(e){if(!e)if(this._selected_xplan_account_id=this._selected_xplan_account_id?this._selected_xplan_account_id:"",this._selected_ips_account_id=this._selected_ips_account_id?this._selected_ips_account_id:"",this._selected_portfolio_id=this._selected_portfolio_id?this._selected_portfolio_id:"",this._selected_group_code=this._selected_group_code?this._selected_group_code:"",this.account_group_mode){if(""!=this._selected_group_code)return!0}else if(this.only_selected_portfolio()){if(""!=this._selected_portfolio_id){var t=XMLRPC.call("portfolio_search.get_portfolio_details",[this._selected_portfolio_id]);return this._selected_xplan_account_id="",this._selected_ips_account_id="",this._selected_account_description="",this._selected_group_code="",this._selected_portfolio_id=t.portfolioid,this._selected_portfolio_description=t.portfolio_name,!0}}else if(""!==this._selected_xplan_account_id||""!==this._selected_portfolio_id&&""!==this._selected_ips_account_id){var o={xplan_subfund_id:this._selected_xplan_account_id,ips_subfund_id:this._selected_ips_account_id,portfolio_id:this._selected_portfolio_id},i=XMLRPC.call("portfolio_search.get_subfund_details",[o]);return this._selected_xplan_account_id=i.accountid,this._selected_ips_account_id=i.ips_subfund_id,this._selected_portfolio_id=i.ips_portfolio_id,this._selected_account_description=i.description,this._selected_portfolio_description=i.portfolioName,this._selected_group_code="",!0}return this._selected_xplan_account_id="",this._selected_ips_account_id="",this._selected_account_description="",this._selected_portfolio_id="",this._selected_portfolio_description="",this._selected_group_code="",!1},is_dialog_modal:function(){return!!this.modal||this.close_on_search_finished},open_dialog:function(){var t=this,o=this.$dialog,i=this.account_group_mode?_("Search For Account Group"):this.portfolio_only?_("Search For Portfolio"):_("Search For Portfolio Account");o.dialog({include_empty_subfund:this.include_empty_subfund,empty_subfund_text:this.empty_subfund_text,search_options:t.options,modal:t.is_dialog_modal(),width:360,title:i,buttons:[{text:"^"+_("Ok"),click:function(){var i=o.find("#portfolio_selection").val();t.account_group_mode?t._selected_group_code=i:t._selected_portfolio_id=i,t._selected_ips_account_id=o.find("#account_selection").val(),t._selected_xplan_account_id="",t.get_details()?(t.set_opener_text(),t.trigger_change&&e(t.element).trigger("change"),t.close_on_search_finished&&o.dialog("close")):PopupMsgBox.show_error_text(_("Please enter valid search term(s)"))},"data-xplan-elem":"ok_button"},{text:_("Cancel"),click:function(){o.dialog("close")},"data-xplan-elem":"cancel_button"}],create:function(e,i){var _=function(e,t){var i=o.find(e);SelectUtil.clearSelect(i.get(0)),i.select2().select2("enable",!1),t&&i.on("change",t)};_("#portfolio_selection",function(e){t.portfolio_only||t.account_group_mode||o.dialog("option").search_accounts()}),t.portfolio_only||t.account_group_mode||_("#account_selection",function(e){t.get_details()});var s=function(e){o.dialog("option").search_portfolio(o.find("input#portfolios_search_string").val())};o.find("#portfolios_search").on("click",s);var n=o.find("#portfolios_search_string");n.on("keydown",function(e){"13"==e.keyCode&&(n.blur(),s())})},close:function(e,t){o.dialog("destroy")},open:function(e,t){o.find("input#portfolios_search_string").val("")},reset_all:function(){o.find("input#portfolios_search_string").val("");underscore.each(["#portfolio_selection","#account_selection"],underscore.bind(function(e){this.reset_select(e,[],!1)},this))},reset_select:function(e,t,i,_){var s=o.find(e),n={dropdownAutoWidth:!0};_&&(n.placeholder=_);var c="";1!==t.length&&(c="<option></option>"),c+=SelectUtil.makeOptionsHTML(t),s.select2("destroy").html(c).select2(n).select2("enable",i),s.trigger("change")},search_portfolio:function(e){if(""!==e)if(e.indexOf("*")>-1)PopupMsgBox.show_error_text(_("Sorry, wildcards are not supported"));else{o.find("td.truncation_warning").hide();var i=o.dialog("option").reset_select;if(this.search_options.search_string=e,i("#portfolio_selection",[],!1),t.portfolio_only||i("#account_selection",[],!1),EggTimer.show(),t.account_group_mode){var s=new(XPLAN.namespace("resourceful.portfolio.group").AccountGroupCollection)([]);s.fetch({data:{term:this.search_options.search_string}}).success(function(){var e=[];underscore.each(s.models,function(t){e.push([t.get("code"),t.get("name")])}),i("#portfolio_selection",e,!0,_("Select an Account Group"))}.bind(this)).always(function(){EggTimer.hide(null,!1)})}else XMLRPC.call("portfolio_search.search_portfolio",[this.search_options],function(e){EggTimer.hide();var t=underscore.pairs(e);(t=underscore.sortBy(t,function(e){return e[1]})).length>100&&(o.find("td.truncation_warning").show(),t=underscore.first(t,100)),i("#portfolio_selection",t,!0,_("Select a Portfolio"))})}else PopupMsgBox.show_error_text(_("Please enter a search term"))},search_accounts:function(){var e=o.find("#portfolio_selection").val();""!==e&&null!=e&&(EggTimer.show(),XMLRPC.call("portfolio_search.get_subfunds_in_portfolio",[e],function(e){EggTimer.hide(),this.include_empty_subfund&&e.splice(0,0,{description:this.empty_subfund_text,external_account_id:null,ips_account_id:-1,subfund:""});var t=o.dialog("option").process_account_options(e);o.dialog("option").reset_select("#account_selection",t,!0,_("Select a Account"))}.bind(this)))},process_account_options:function(e){return underscore.map(e,function(e){var t=e.description;return e.external_account_id&&(t+=" - ("+e.external_account_id+")"),[e.subfund,t]})}})},set_opener_text:function(){var e;e=this.portfolio_only&&""!==this._selected_portfolio_description?this._selected_portfolio_description:""!==this._selected_account_description?this._selected_account_description:_("<Not Selected>"),this.$opener.text(e)},val:function(t){if("undefined"==typeof t)return{portfolio_id:this._selected_portfolio_id,portfolio_description:this._selected_portfolio_description,ips_account_id:this._selected_ips_account_id,xplan_account_id:this._selected_xplan_account_id,account_description:this._selected_account_description,group_code:this._selected_group_code};if(e.isNumeric(t)||1===t.length&&e.isNumeric(t[0]))this._selected_xplan_account_id=t,this._selected_ips_account_id="",this._selected_portfolio_id="",this._selected_group_code="",this.get_details(),this.set_opener_text();else if(1===t.length)this._selected_xplan_account_id="",this._selected_ips_account_id="",this._selected_portfolio_id="",this._selected_group_code=t,this.get_details(),this.set_opener_text();else{if(2!==t.length)throw this._selected_xplan_account_id="",this._selected_ips_account_id="",this._selected_portfolio_id="",this._selected_account_description="",this._selected_portfolio_description="",this._selected_group_code="",this.set_opener_text(),"Invalid arguments to "+i+" plugin: "+t;this._selected_xplan_account_id="",this._selected_portfolio_id=t[0],this._selected_ips_account_id=t[1],this._selected_group_code="",this.get_details(),this.set_opener_text()}}},e.fn[i]=function(){var o=Array.prototype.slice.call(arguments,0);if("string"==typeof o[0]){if(e.inArray(o[0],["val"])<0)throw"Unknown method: "+o[0];var _=e(this).data(i);if(void 0===_)return;return _[o[0]].apply(_,o.slice(1))}if("object"==typeof o[0])return this.each(function(){e.data(this,i)&&e(this).empty(),e.data(this,i,new t(this,o[0]))});throw"Invalid arguments to "+i+" plugin: "+o}}(jQuery);
;Dependency._js['xpt/portfolio/search/portfolio_account_search']=true;

;
(function(){var t;(t=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,r,l,h;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,children:0,disabled:t.disabled}),h=[],i=0,r=(l=t.childNodes).length;i<r;i++)s=l[i],h.push(this.add_option(s,e,t.disabled));return h},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(e){var s,i,r,l,h;for(i=new t,r=0,l=(h=e.childNodes).length;r<l;r++)s=h[r],i.add_node(s);return i.parsed},this.SelectParser=t}).call(this),function(){var t;t=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup())}return t.prototype.set_default_values=function(){var t=this;return this.click_test_action=function(e){return t.test_active_click(e)},this.activate_action=function(e){return t.activate_field(e)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){var e=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return e.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){var e=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return e.blur_test()},100)},t.prototype.result_add_option=function(t){var e,s;return t.disabled?"":(t.dom_id=this.container_id+"_o_"+t.array_index,e=t.selected&&this.is_multiple?[]:["active-result"],t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=""!==t.style.cssText?' style="'+t.style+'"':"",'<li id="'+t.dom_id+'" class="'+e.join(" ")+'"'+s+">"+t.html+"</li>")},t.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keyup_checker=function(t){var e,s;switch(e=null!=(s=t.which)?s:t.keyCode,this.search_field_scale(),e){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},t.prototype.generate_field_id=function(){var t;return t=this.generate_random_id(),this.form_field.id=t,t},t.prototype.generate_random_char=function(){var t,e;return t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",e=Math.floor(Math.random()*t.length),t.substring(e,e+1)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.browser_is_supported=function(){var t;return"Microsoft Internet Explorer"!==window.navigator.appName||null!==(t=document.documentMode)&&t>=8},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),this.AbstractChosen=t}.call(this),function(){var t,e,s,i={}.hasOwnProperty;s=this,(t=jQuery).fn.extend({chosen:function(s){return AbstractChosen.browser_is_supported()?this.each(function(i){var r;if(!(r=t(this)).hasClass("chzn-done"))return r.data("chosen",new e(this,s))}):this}}),e=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return function(t,e){function s(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(r,AbstractChosen),r.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},r.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},r.prototype.set_up_html=function(){var e,s;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",(e=["chzn-container"]).push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chzn-rtl"),s={id:this.container_id,class:e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.container=t("<div />",s),this.is_multiple?this.container.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>'):this.container.html(`<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>${this.default_text}</span><div class="chzn-single__dropdown-icon"><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>`),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},r.prototype.register_observers=function(){var t=this;return this.container.mousedown(function(e){t.container_mousedown(e)}),this.container.mouseup(function(e){t.container_mouseup(e)}),this.container.mouseenter(function(e){t.mouse_enter(e)}),this.container.mouseleave(function(e){t.mouse_leave(e)}),this.search_results.mouseup(function(e){t.search_results_mouseup(e)}),this.search_results.mouseover(function(e){t.search_results_mouseover(e)}),this.search_results.mouseout(function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel DOMMouseScroll",function(e){t.search_results_mousewheel(e)}),this.form_field_jq.bind("liszt:updated",function(e){t.results_update_field(e)}),this.form_field_jq.bind("liszt:activate",function(e){t.activate_field(e)}),this.form_field_jq.bind("liszt:open",function(e){t.container_mousedown(e)}),this.search_field.blur(function(e){t.input_blur(e)}),this.search_field.keyup(function(e){t.keyup_checker(e)}),this.search_field.keydown(function(e){t.keydown_checker(e)}),this.search_field.focus(function(e){t.input_focus(e)}),this.is_multiple?this.search_choices.click(function(e){t.choices_click(e)}):this.container.click(function(t){t.preventDefault()})},r.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field()):(this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus",this.activate_action))},r.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chzn-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(document).click(this.click_test_action),this.results_show()),this.activate_field()},r.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},r.prototype.search_results_mousewheel=function(t){var e,s,i;if(null!=(e=-(null!=(s=t.originalEvent)?s.wheelDelta:void 0)||(null!=(i=t.originialEvent)?i.detail:void 0)))return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},r.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},r.prototype.close_field=function(){return t(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},r.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},r.prototype.test_active_click=function(e){return t(e.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){var t,e,i,r,l;for(this.parsing=!0,this.selected_option_count=null,this.results_data=s.SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),t="",i=0,r=(l=this.results_data).length;i<r;i++)(e=l[i]).group?t+=this.result_add_group(e):e.empty||(t+=this.result_add_option(e),e.selected&&this.is_multiple?this.choice_build(e):e.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(e.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(t),this.parsing=!1},r.prototype.result_add_group=function(e){return e.disabled?"":(e.dom_id=this.container_id+"_g_"+e.array_index,'<li id="'+e.dom_id+'" class="group-result">'+t("<div />").text(e.label).html()+"</li>")},r.prototype.result_do_highlight=function(t){var e,s,i,r,l;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),r=(i=parseInt(this.search_results.css("maxHeight"),10))+(l=this.search_results.scrollTop()),(e=(s=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=r)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<l)return this.search_results.scrollTop(s)}},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){if(null!=this.result_single_selected)this.result_do_highlight(this.result_single_selected);else if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return this.container.addClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},r.prototype.results_hide=function(){return this.result_clear_highlight(),this.container.removeClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.results_showing=!1},r.prototype.set_tab_index=function(t){var e;if(this.form_field_jq.attr("tabindex"))return e=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",e)},r.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.click(function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},r.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},r.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},r.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},r.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},r.prototype.choice_build=function(e){var s,i,r=this;return s=t("<li />",{class:"search-choice"}).html("<span>"+e.html+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{href:"#",class:"search-choice-close",rel:e.array_index})).click(function(t){return r.choice_destroy_link_click(t)}),s.append(i)),this.search_container.before(s)},r.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},r.prototype.choice_destroy=function(t){if(this.result_deselect(t.attr("rel")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},r.prototype.results_reset=function(){if(this.form_field.options[0].selected=!0,this.selected_option_count=null,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},r.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},r.prototype.result_select=function(t){var e,s,i,r;if(this.result_highlight)return s=(e=this.result_highlight).attr("id"),this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(this.is_multiple?this.result_deactivate(e):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=e,this.selected_item.removeClass("chzn-default")),e.addClass("result-selected"),r=s.substr(s.lastIndexOf("_")+1),(i=this.results_data[r]).selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):(this.selected_item.find("span").first().text(i.text),this.allow_single_deselect&&this.single_deselect_control_build()),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},r.prototype.result_activate=function(t){return t.addClass("active-result")},r.prototype.result_deactivate=function(t){return t.removeClass("active-result")},r.prototype.result_deselect=function(e){var s;return s=this.results_data[e],!this.form_field.options[s.options_index].disabled&&(s.selected=!1,this.form_field.options[s.options_index].selected=!1,this.selected_option_count=null,t("#"+this.container_id+"_o_"+e).removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[s.options_index].value}),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chzn-single-with-deselect")},r.prototype.winnow_results=function(){var e,s,i,r,l,h,n,o,a,c,_,u,d,f,p,g,m,v;for(this.no_results_clear(),a=0,c=this.search_field.val()===this.default_text?"":t("<div/>").text(t.trim(this.search_field.val())).html(),h=this.search_contains?"":"\\b",l=new RegExp(h+c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),d=new RegExp(c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),f=0,g=(v=this.results_data).length;f<g;f++)if(!(s=v[f]).disabled&&!s.empty)if(s.group)t("#"+s.dom_id).css("display","none");else if(!this.is_multiple||!s.selected){if(e=!1,o=s.dom_id,n=t("#"+o),l.test(s.html))e=!0,a+=1;else if(this.enable_split_word_search&&(s.html.indexOf(" ")>=0||0===s.html.indexOf("["))&&(r=s.html.replace(/\[|\]/g,"").split(" ")).length)for(p=0,m=r.length;p<m;p++)i=r[p],l.test(i)&&(e=!0,a+=1);e?(c.length?(_=s.html.search(d),u=(u=s.html.substr(0,_+c.length)+"</em>"+s.html.substr(_+c.length)).substr(0,_)+"<em>"+u.substr(_)):u=s.html,n.html(u),this.result_activate(n),null!=s.group_array_index&&t("#"+this.results_data[s.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&o===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(n))}return a<1&&c.length?this.no_results(c):this.winnow_results_set_highlight()},r.prototype.winnow_results_clear=function(){var e,s,i,r,l;for(this.search_field.val(""),l=[],i=0,r=(s=this.search_results.find("li")).length;i<r;i++)e=s[i],(e=t(e)).hasClass("group-result")?l.push(e.css("display","auto")):this.is_multiple&&e.hasClass("result-selected")?l.push(void 0):l.push(this.result_activate(e));return l},r.prototype.winnow_results_set_highlight=function(){var t,e;if(!this.result_highlight&&null!=(t=(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},r.prototype.no_results=function(e){var s;return(s=t('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>')).find("span").first().html(e),this.search_results.append(s)},r.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},r.prototype.keydown_arrow=function(){var e,s;if(this.result_highlight?this.results_showing&&(s=this.result_highlight.nextAll("li.active-result").first())&&this.result_do_highlight(s):(e=this.search_results.find("li.active-result").first())&&this.result_do_highlight(t(e)),!this.results_showing)return this.results_show()},r.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},r.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},r.prototype.keydown_checker=function(t){var e,s;switch(e=null!=(s=t.which)?s:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},r.prototype.search_field_scale=function(){var e,s,i,r,l,h,n;if(this.is_multiple){for(0,l=0,i="position:absolute; left: -1000px; top: -1000px; display:none;",h=0,n=(r=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"]).length;h<n;h++)i+=(s=r[h])+":"+this.search_field.css(s)+";";return(e=t("<div />",{style:i})).text(this.search_field.val()),t("body").append(e),l=e.width()+25,e.remove(),this.f_width||(this.f_width=this.container.outerWidth()),l>this.f_width-10&&(l=this.f_width-10),this.search_field.css({width:l+"px"})}},r.prototype.generate_random_id=function(){var e;for(e="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();t("#"+e).length>0;)e+=this.generate_random_char();return e},r}(),s.Chosen=e}.call(this);
;Dependency._js['lib/jquery/plugins/chosen/jquery.chosen']=true;

;
(function(){var i;(i=jQuery).widget("ui.dialogExtend",{version:"2.0.0",modes:{},options:{closable:!0,dblclick:!1,titlebar:!1,icons:{close:"ui-icon-closethick",restore:"ui-icon-newwin"},load:null,beforeRestore:null,restore:null},_create:function(){return this._state="normal",i(this.element[0]).data("ui-dialog")||i.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted"),this._verifyOptions(),this._initStyles(),this._initButtons(),this._initTitleBar(),this._setState("normal"),this._on("load",function(i){return console.log("test",i)}),this._trigger("load")},_setState:function(t){return i(this.element[0]).removeClass("ui-dialog-"+this._state).addClass("ui-dialog-"+t),this._state=t},_verifyOptions:function(){var t,e,o;for(t in!this.options.dblclick||this.options.dblclick in this.modes||(i.error("jQuery.dialogExtend Error : Invalid <dblclick> value '"+this.options.dblclick+"'"),this.options.dblclick=!1),this.options.titlebar&&"none"!==(e=this.options.titlebar)&&"transparent"!==e&&(i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'"),this.options.titlebar=!1),o=[],this.modes)this["_verifyOptions_"+t]?o.push(this["_verifyOptions_"+t]()):o.push(void 0);return o},_initStyles:function(){var t,e,o;for(t in i(".dialog-extend-css").length||(e="",e+='<style class="dialog-extend-css" type="text/css">',e+=".ui-dialog .ui-dialog-titlebar-buttonpane>a { float: right; margin-top: 2px;}",e+=".ui-dialog .ui-dialog-titlebar-restore { width: 25px; height: 25px; }",e+=".ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: -4px; }",e+=".ui-dialog .ui-dialog-titlebar-restore:hover,",e+=".ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }",e+=".ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }",i(e+="</style>").appendTo("body")),o=[],this.modes)o.push(this["_initStyles_"+t]());return o},_initButtons:function(){var t,e,o,a,n,l=this;for(o in a=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar"),(t=i('<div class="ui-dialog-titlebar-buttonpane"></div>').appendTo(a)).css({position:"absolute",top:"50%",right:"0.3em","margin-top":"-10px",height:"18px"}),a.find(".ui-dialog-titlebar-close").css({position:"relative",float:"right",top:"auto",right:"auto"}).find(".ui-icon").removeClass("ui-icon-closethick").addClass(this.options.icons.close).end().appendTo(t).end(),t.append('<a class="ui-dialog-titlebar-restore ui-corner-all ui-state-default" href="#"><span class="ui-icon '+this.options.icons.restore+'">restore</span></a>').find(".ui-dialog-titlebar-restore").attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-close").toggle(this.options.closable).end().find(".ui-dialog-titlebar-restore").hide().click(function(i){return i.preventDefault(),l.restore()}).end(),n=this.modes)e=n[o],this._initModuleButton(o,e);return a.dblclick(function(i){if(l.options.dblclick)return"normal"!==l._state?l.restore():l[l.options.dblclick]()}).select(function(){return!1})},_initModuleButton:function(t,e){var o=this;return i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-buttonpane").append('<a class="ui-dialog-titlebar-'+t+' ui-corner-all ui-state-default" href="#"><span class="ui-icon '+this.options.icons[t]+'">'+t+"</span></a>").find(".ui-dialog-titlebar-"+t).attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-"+t).toggle(this.options[e.option]).click(function(i){return i.preventDefault(),o[t]()}).end()},_initTitleBar:function(){var t;switch(this.options.titlebar){case!1:return 0;case"none":return i(this.element[0]).dialog("option","draggable")&&(t=i("<div />").addClass("ui-dialog-draggable-handle").css("cursor","move").height(5),i(this.element[0]).dialog("widget").prepend(t).draggable("option","handle",t)),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html("&nbsp;").end().css({"background-color":"transparent","background-image":"none",border:0,position:"absolute",right:0,top:0,"z-index":9999}).end();case"transparent":return i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css({"background-color":"transparent","background-image":"none",border:0});default:return i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'")}},state:function(){return this._state},restore:function(){return this._trigger("beforeRestore"),this._restore(),this._setState("normal"),this._toggleButtons(),this._trigger("restore")},_restore:function(){if("normal"!==this._state)return this["_restore_"+this._state]()},_saveSnapshot:function(){if("normal"===this._state)return this.original_config_resizable=i(this.element[0]).dialog("option","resizable"),this.original_config_draggable=i(this.element[0]).dialog("option","draggable"),this.original_size_height=i(this.element[0]).dialog("widget").outerHeight(),this.original_size_width=i(this.element[0]).dialog("option","width"),this.original_size_maxHeight=i(this.element[0]).dialog("option","maxHeight"),this.original_position_mode=i(this.element[0]).dialog("widget").css("position"),this.original_position_left=i(this.element[0]).dialog("widget").offset().left-i("body").scrollLeft(),this.original_position_top=i(this.element[0]).dialog("widget").offset().top-i("body").scrollTop(),this.original_titlebar_wrap=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css("white-space")},_loadSnapshot:function(){return{config:{resizable:this.original_config_resizable,draggable:this.original_config_draggable},size:{height:this.original_size_height,width:this.original_size_width,maxHeight:this.original_size_maxHeight},position:{mode:this.original_position_mode,left:this.original_position_left,top:this.original_position_top},titlebar:{wrap:this.original_titlebar_wrap}}},_toggleButtons:function(){var t,e,o,a;for(e in i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").toggle("normal"!==this._state).css({right:"1.4em"}).end(),a=[],o=this.modes)t=o[e],a.push(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+e).toggle(this._state!==t.state&&this.options[t.option]));return a}})}).call(this),function(){var i;(i=jQuery).extend(!0,i.ui.dialogExtend.prototype,{modes:{collapse:{option:"collapsable",state:"collapsed"}},options:{collapsable:!1,icons:{collapse:"ui-icon-triangle-1-s"},beforeCollapse:null,collapse:null},collapse:function(){var t;return t=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height()+15,this._trigger("beforeCollapse"),this._saveSnapshot(),i(this.element[0]).dialog("option",{resizable:!1,height:t,maxHeight:t}).on("dialogclose",this._collapse_restore).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content"),this._setState("collapsed"),this._toggleButtons(),this._trigger("collapse")},_restore_collapsed:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,height:t.size.height,maxHeight:t.size.maxHeight}).off("dialogclose",this._collapse_restore)},_initStyles_collapse:function(){var t;if(!i(".dialog-extend-collapse-css").length)return t="",t+='<style class="dialog-extend-collapse-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-collapse { width: 25px; height: 25px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse span { display: block; margin: -4px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse:hover,",t+=".ui-dialog .ui-dialog-titlebar-collapse:focus { padding: 0; }",i(t+="</style>").appendTo("body")},_collapse_restore:function(){return i(this).dialogExtend("restore")}})}.call(this),function(){var i;(i=jQuery).extend(!0,i.ui.dialogExtend.prototype,{modes:{maximize:{option:"maximizable",state:"maximized"}},options:{maximizable:!1,icons:{maximize:"ui-icon-extlink"},beforeMaximize:null,maximize:null},maximize:function(){var t,e;return t=i(window).height(),e=i(window).width(),this._trigger("beforeMaximize"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),i(this.element[0]).dialog("option","draggable")&&i(this.element[0]).dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end(),i(this.element[0]).dialog("widget").css("position","fixed").find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane").show().end().find(".ui-dialog-content").dialog("option",{resizable:!1,draggable:!1,height:t,width:e,position:{my:"left top",at:"left top"}}),this._setState("maximized"),this._toggleButtons(),this._trigger("maximize")},_restore_maximized:function(){var t;if(t=this._loadSnapshot(),i(this.element[0]).dialog("widget").css("position",t.position.mode).find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,draggable:t.config.draggable,height:t.size.height,width:t.size.width,maxHeight:t.size.maxHeight,position:{my:"left top",at:"left+"+t.position.left+" top+"+t.position.top}}),i(this.element[0]).dialog("option","draggable"))return i(this.element[0]).dialog("widget").draggable("option","handle",i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle").length?i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle"):".ui-dialog-titlebar").find(".ui-dialog-draggable-handle").css("cursor","move")},_initStyles_maximize:function(){var t;if(!i(".dialog-extend-maximize-css").length)return t="",t+='<style class="dialog-extend-maximize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-maximize { width: 25px; height: 25px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize span { display: block; margin: -4px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize:hover,",t+=".ui-dialog .ui-dialog-titlebar-maximize:focus { padding: 0; }",i(t+="</style>").appendTo("body")}})}.call(this),function(){var i;(i=jQuery).extend(!0,i.ui.dialogExtend.prototype,{modes:{minimize:{option:"minimizable",state:"minimized"}},options:{minimizable:!1,minimizeLocation:"left",icons:{minimize:"ui-icon-minus"},beforeMinimize:null,minimize:null},minimize:function(){var t,e,o;return e=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height()+15,200,(t=i("#dialog-extend-fixed-container").length?i("#dialog-extend-fixed-container"):i('<div id="dialog-extend-fixed-container"></div>').appendTo("body")).css({position:"fixed",bottom:1,left:1,right:1,"z-index":9999}),o=i("<div/>").css({float:this.options.minimizeLocation,margin:1}),t.append(o),i(this.element[0]).data("dialog-extend-minimize-overlay",o),this._trigger("beforeMinimize"),this._saveSnapshot(),i(this.element[0]).dialog("option","draggable")&&i(this.element[0]).dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end(),i(this.element[0]).dialog("option",{resizable:!1,draggable:!1,height:e,width:200}).on("dialogclose",this._minimize_removeOverlay).dialog("widget").css("position","static").appendTo(o).find(".ui-dialog-content").dialog("widget").find(".ui-dialog-titlebar").each(function(){var t,e;return t=(e=i(this)).find(".ui-dialog-titlebar-buttonpane"),e.find(".ui-dialog-title").css({overflow:"hidden",width:e.width()-t.width()+10})}).end().find(".ui-dialog-content").hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content"),this._setState("minimized"),this._toggleButtons(),this._trigger("minimize")},_restore_minimized:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).dialog("widget").appendTo("body").css({float:"none",margin:0,position:t.position.mode}).find(".ui-dialog-content").dialog("widget").find(".ui-dialog-title").css("width","auto").end().find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,draggable:t.config.draggable,height:t.size.height,width:t.size.width,maxHeight:t.size.maxHeight,position:{my:"left top",at:"left+"+t.position.left+" top+"+t.position.top}}).off("dialogclose",this._minimize_removeOverlay),i(this.element[0]).dialog("option","draggable")&&i(this.element[0]).dialog("widget").draggable("option","handle",i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle").length?i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle"):".ui-dialog-titlebar").find(".ui-dialog-draggable-handle").css("cursor","move"),i(this.element[0]).data("dialog-extend-minimize-overlay").remove(),i(this.element[0]).removeData("dialog-extend-overlay")},_initStyles_minimize:function(){var t;if(!i(".dialog-extend-minimize-css").length)return t="",t+='<style class="dialog-extend-minimize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-minimize { width: 25px; height: 25px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize span { display: block; margin: -4px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize:hover,",t+=".ui-dialog .ui-dialog-titlebar-minimize:focus { padding: 0; }",i(t+="</style>").appendTo("body")},_verifyOptions_minimize:function(){var t;if(!this.options.minimizeLocation||"left"!==(t=this.options.minimizeLocation)&&"right"!==t)return i.error("jQuery.dialogExtend Error : Invalid <minimizeLocation> value '"+this.options.minimizeLocation+"'"),this.options.minimizeLocation="left"},_minimize_removeOverlay:function(){return i(this).dialogExtend("restore"),i(this).dialog("widget").appendTo(i("body")),i(this).data("dialog-extend-minimize-overlay").remove(),i(this).removeData("dialog-extend-overlay")}})}.call(this);
;Dependency._js['lib/jquery/plugins/dialogextend/jquery.dialogextend']=true;

;
!function(e){"use strict";e.extend({tablesorter:new function(){function t(){var e=arguments[0],t=arguments.length>1?Array.prototype.slice.call(arguments):e;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(e)?"error":/warn/i.test(e)?"warn":"log"](t):alert(t)}function r(e,r){t(e+" ("+((new Date).getTime()-r.getTime())+"ms)")}function s(e){for(var t in e)return!1;return!0}function a(t,r,s){if(!r)return"";var a=t.config,n=a.textExtraction,o="";return o="simple"===n?a.supportsTextContent?r.textContent:e(r).text():"function"==typeof n?n(r,t,s):"object"==typeof n&&n.hasOwnProperty(s)?n[s](r,t,s):a.supportsTextContent?r.textContent:e(r).text(),e.trim(o)}function n(e,r,s,n){for(var o,i=w.parsers.length,d=!1,c="",l=!0;""===c&&l;)r[++s]?(c=a(e,d=r[s].cells[n],n),e.config.debug&&t("Checking if value was empty on row "+s+", column: "+n+': "'+c+'"')):l=!1;for(;--i>=0;)if((o=w.parsers[i])&&"text"!==o.id&&o.is&&o.is(c,e,d))return o;return w.getParserById("text")}function o(e){var s,a,o,i,d,c,l,p,u=e.config,f=u.$tbodies=u.$table.children("tbody:not(."+u.cssInfoBlock+")"),g="";if(0===f.length)return u.debug?t("Warning: *Empty table!* Not building a parser cache"):"";if(u.debug&&(p=new Date,t("Detecting parsers for each column")),(s=f[0].rows)[0])for(a=[],o=s[0].cells.length,i=0;i<o;i++)d=(d=u.$headers.filter(":not([colspan])")).add(u.$headers.filter('[colspan="1"]')).filter('[data-column="'+i+'"]:last'),c=u.headers[i],l=w.getParserById(w.getData(d,c,"sorter")),u.empties[i]=w.getData(d,c,"empty")||u.emptyTo||(u.emptyToBottom?"bottom":"top"),u.strings[i]=w.getData(d,c,"string")||u.stringTo||"max",l||(l=n(e,s,-1,i)),u.debug&&(g+="column:"+i+"; parser:"+l.id+"; string:"+u.strings[i]+"; empty: "+u.empties[i]+"\n"),a.push(l);u.debug&&(t(g),r("Completed detecting parsers",p)),u.parsers=a}function i(s){var n,o,i,d,c,l,p,u,f,g,h=s.tBodies,m=s.config,y=m.parsers,b=[];if(m.cache={},!y)return m.debug?t("Warning: *Empty table!* Not building a cache"):"";for(m.debug&&(g=new Date),m.showProcessing&&w.isProcessing(s,!0),p=0;p<h.length;p++)if(m.cache[p]={row:[],normalized:[]},!e(h[p]).hasClass(m.cssInfoBlock)){for(n=h[p]&&h[p].rows.length||0,o=h[p].rows[0]&&h[p].rows[0].cells.length||0,c=0;c<n;++c)if(f=[],(u=e(h[p].rows[c])).hasClass(m.cssChildRow))m.cache[p].row[m.cache[p].row.length-1]=m.cache[p].row[m.cache[p].row.length-1].add(u);else{for(m.cache[p].row.push(u),l=0;l<o;++l)"undefined"!=typeof y[l]?(i=a(s,u[0].cells[l],l),d=y[l].format(i,s,u[0].cells[l],l),f.push(d),"numeric"===(y[l].type||"").toLowerCase()&&(b[l]=Math.max(Math.abs(d)||0,b[l]||0))):m.debug&&t("No parser found for cell:",u[0].cells[l],"does it have a header?");f.push(m.cache[p].normalized.length),m.cache[p].normalized.push(f)}m.cache[p].colMax=b}m.showProcessing&&w.isProcessing(s),m.debug&&r("Building cache for "+n+" rows",g)}function d(t,a){var n,o,i,d,c,l,p,u,f,g,h,m,y=t.config,b=y.widgetOptions,v=t.tBodies,x=[],C=y.cache;if(s(C))return y.appender?y.appender(t,x):t.isUpdating?y.$table.trigger("updateComplete",t):"";for(y.debug&&(m=new Date),f=0;f<v.length;f++)if((c=e(v[f])).length&&!c.hasClass(y.cssInfoBlock)){for(l=w.processTbody(t,c,!0),n=C[f].row,d=(i=(o=C[f].normalized).length)?o[0].length-1:0,p=0;p<i;p++)if(h=o[p][d],x.push(n[h]),!y.appender||y.pager&&(!y.pager.removeRows||!b.pager_removeRows)&&!y.pager.ajax)for(g=n[h].length,u=0;u<g;u++)l.append(n[h][u]);w.processTbody(t,l,!1)}y.appender&&y.appender(t,x),y.debug&&r("Rebuilt table",m),a||y.appender||w.applyWidget(t),t.isUpdating&&y.$table.trigger("updateComplete",t)}function c(e){return/^d/i.test(e)||1===e}function l(s){var a,n,o,i,d,l,p,f=function(t){var r,s,a,n,o,i,d,c,l,p,u,f,g=[],h={},m=0,y=e(t).children("thead, tfoot").children("tr");for(r=0;r<y.length;r++)for(i=y[r].cells,s=0;s<i.length;s++){for(c=(d=(o=i[s]).parentNode.rowIndex)+"-"+o.cellIndex,l=o.rowSpan||1,p=o.colSpan||1,"undefined"==typeof g[d]&&(g[d]=[]),a=0;a<g[d].length+1;a++)if("undefined"==typeof g[d][a]){u=a;break}for(h[c]=u,m=Math.max(u,m),e(o).attr({"data-column":u}),a=d;a<d+l;a++)for("undefined"==typeof g[a]&&(g[a]=[]),f=g[a],n=u;n<u+p;n++)f[n]="x"}return t.config.columns=m+1,h}(s),g=s.config;g.headerList=[],g.headerContent=[],g.debug&&(p=new Date),i=g.cssIcon?'<i class="'+(g.cssIcon===w.css.icon?w.css.icon:g.cssIcon+" "+w.css.icon)+'"></i>':"",g.$headers=e(s).find(g.selectorHeaders).each(function(t){n=e(this),a=g.headers[t],g.headerContent[t]=e(this).html(),d=g.headerTemplate.replace(/\{content\}/g,e(this).html()).replace(/\{icon\}/g,i),g.onRenderTemplate&&(o=g.onRenderTemplate.apply(n,[t,d]))&&"string"==typeof o&&(d=o),e(this).html('<div class="'+w.css.headerIn+'">'+d+"</div>"),g.onRenderHeader&&g.onRenderHeader.apply(n,[t]),this.column=f[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=c(w.getData(n,a,"sortInitialOrder")||g.sortInitialOrder)?[1,0,2]:[0,1,2],this.count=-1,this.lockedOrder=!1,"undefined"!=typeof(l=w.getData(n,a,"lockedOrder")||!1)&&!1!==l&&(this.order=this.lockedOrder=c(l)?[1,1,1]:[0,0,0]),n.addClass(w.css.header+" "+g.cssHeader),g.headerList[t]=this,n.parent().addClass(w.css.headerRow+" "+g.cssHeaderRow).attr("role","row"),g.tabIndex&&n.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"}),u(s),g.debug&&(r("Built headers:",p),t(g.$headers))}function p(e,t,r){var s=e.config;s.$table.find(s.selectorRemove).remove(),o(e),i(e),y(s.$table,t,r)}function u(t){var r,s,a=t.config;a.$headers.each(function(n,o){s=e(o),r="false"===w.getData(o,a.headers[n],"sorter"),o.sortDisabled=r,s[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),t.id&&(r?s.removeAttr("aria-controls"):s.attr("aria-controls",t.id))})}function f(t){var r,s,a,n,o=t.config,i=o.sortList,d=w.css.sortNone+" "+o.cssNone,c=[w.css.sortAsc+" "+o.cssAsc,w.css.sortDesc+" "+o.cssDesc],l=["ascending","descending"],p=e(t).find("tfoot tr").children().removeClass(c.join(" "));for(o.$headers.removeClass(c.join(" ")).addClass(d).attr("aria-sort","none"),n=i.length,s=0;s<n;s++)if(2!==i[s][1]&&(r=o.$headers.not(".sorter-false").filter('[data-column="'+i[s][0]+'"]'+(1===n?":last":""))).length)for(a=0;a<r.length;a++)r[a].sortDisabled||(r.eq(a).removeClass(d).addClass(c[i[s][1]]).attr("aria-sort",l[i[s][1]]),p.length&&p.filter('[data-column="'+i[s][0]+'"]').eq(a).addClass(c[i[s][1]]));o.$headers.not(".sorter-false").each(function(){var t=e(this),r=this.order[(this.count+1)%(o.sortReset?3:2)],s=t.text()+": "+w.language[t.hasClass(w.css.sortAsc)?"sortAsc":t.hasClass(w.css.sortDesc)?"sortDesc":"sortNone"]+w.language[0===r?"nextAsc":1===r?"nextDesc":"nextNone"];t.attr("aria-label",s)})}function g(e,t){return e&&e[t]&&e[t].type||""}function h(e){var t,a,n,o,i,d,c,l,p,u,f,h,m=0,y=e.config,b=y.textSorter||"",v=y.sortList,x=v.length,C=e.tBodies.length;if(!y.serverSideSorting&&!s(y.cache)){for(y.debug&&(p=new Date),a=0;a<C;a++)i=y.cache[a].colMax,(d=y.cache[a].normalized).length,l=d&&d[0]?d[0].length-1:0,d.sort(function(r,s){for(t=0;t<x;t++){if(o=v[t][0],c=v[t][1],m=0===c,y.sortStable&&r[o]===s[o]&&1===x)return r[l]-s[l];if((n=/n/i.test(g(y.parsers,o)))&&y.strings[o]?(n="boolean"==typeof y.string[y.strings[o]]?(m?1:-1)*(y.string[y.strings[o]]?-1:1):y.strings[o]&&y.string[y.strings[o]]||0,u=y.numberSorter?y.numberSorter(r[o],s[o],m,i[o],e):w["sortNumeric"+(m?"Asc":"Desc")](r[o],s[o],n,i[o],o,e)):(f=m?r:s,h=m?s:r,u="function"==typeof b?b(f[o],h[o],m,o,e):"object"==typeof b&&b.hasOwnProperty(o)?b[o](f[o],h[o],m,o,e):w["sortNatural"+(m?"Asc":"Desc")](r[o],s[o],o,e,y)),u)return u}return r[l]-s[l]});y.debug&&r("Sorting on "+v.toString()+" and dir "+c+" time",p)}}function m(e,t){e[0].isUpdating&&e.trigger("updateComplete"),"function"==typeof t&&t(e[0])}function y(e,t,r){var s=e[0].config.sortList;!1!==t&&!e[0].isProcessing&&s.length?e.trigger("sorton",[s,function(){m(e,r)},!0]):m(e,r)}function b(t){var r=t.config,n=r.$table;n.unbind("sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(r.namespace+" ")).bind("sortReset"+r.namespace,function(e){e.stopPropagation(),r.sortList=[],f(t),h(t),d(t)}).bind("updateAll"+r.namespace,function(e,s,a){e.stopPropagation(),t.isUpdating=!0,w.refreshWidgets(t,!0,!0),w.restoreHeaders(t),l(t),w.bindEvents(t,r.$headers),b(t),p(t,s,a)}).bind("update"+r.namespace+" updateRows"+r.namespace,function(e,r,s){e.stopPropagation(),t.isUpdating=!0,u(t),p(t,r,s)}).bind("updateCell"+r.namespace,function(s,o,i,d){s.stopPropagation(),t.isUpdating=!0,n.find(r.selectorRemove).remove();var c,l,p,u=n.find("tbody"),f=u.index(e(o).parents("tbody").filter(":first")),g=e(o).parents("tr").filter(":first");o=e(o)[0],u.length&&f>=0&&(l=u.eq(f).find("tr").index(g),p=o.cellIndex,c=r.cache[f].normalized[l].length-1,r.cache[f].row[t.config.cache[f].normalized[l][c]]=g,r.cache[f].normalized[l][p]=r.parsers[p].format(a(t,o,p),t,o,p),y(n,i,d))}).bind("addRows"+r.namespace,function(e,i,d,c){if(e.stopPropagation(),t.isUpdating=!0,s(r.cache))u(t),p(t,d,c);else{var l,f,g=i.filter("tr").length,h=[],m=i[0].cells.length,b=n.find("tbody").index(i.parents("tbody").filter(":first"));for(r.parsers||o(t),l=0;l<g;l++){for(f=0;f<m;f++)h[f]=r.parsers[f].format(a(t,i[l].cells[f],f),t,i[l].cells[f],f);h.push(r.cache[b].row.length),r.cache[b].row.push([i[l]]),r.cache[b].normalized.push(h),h=[]}y(n,d,c)}}).bind("updateComplete"+r.namespace,function(){t.isUpdating=!1}).bind("sorton"+r.namespace,function(r,a,o,c){var l=t.config;r.stopPropagation(),n.trigger("sortStart",this),function(t,r){var s,a,n,o=t.config,i=r||o.sortList;o.sortList=[],e.each(i,function(t,r){s=[parseInt(r[0],10),parseInt(r[1],10)],(n=o.$headers[s[0]])&&(o.sortList.push(s),a=e.inArray(s[1],n.order),n.count=a>=0?a:s[1]%(o.sortReset?3:2))})}(t,a),f(t),l.delayInit&&s(l.cache)&&i(t),n.trigger("sortBegin",this),h(t),d(t,c),n.trigger("sortEnd",this),"function"==typeof o&&o(t)}).bind("appendCache"+r.namespace,function(e,r,s){e.stopPropagation(),d(t,s),"function"==typeof r&&r(t)}).bind("updateCache"+r.namespace,function(e,s){r.parsers||o(t),i(t),"function"==typeof s&&s(t)}).bind("applyWidgetId"+r.namespace,function(e,s){e.stopPropagation(),w.getWidgetById(s).format(t,r,r.widgetOptions)}).bind("applyWidgets"+r.namespace,function(e,r){e.stopPropagation(),w.applyWidget(t,r)}).bind("refreshWidgets"+r.namespace,function(e,r,s){e.stopPropagation(),w.refreshWidgets(t,r,s)}).bind("destroy"+r.namespace,function(e,r,s){e.stopPropagation(),w.destroy(t,r,s)})}var w=this;w.version="2.15.11",w.parsers=[],w.widgets=[],w.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},w.css={table:"tablesorter",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},w.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},w.log=t,w.benchmark=r,w.construct=function(t){return this.each(function(){var r=e.extend(!0,{},w.defaults,t);!this.hasInitialized&&w.buildTable&&"TABLE"!==this.tagName?w.buildTable(this,r):w.setup(this,r)})},w.setup=function(r,s){if(!r||!r.tHead||0===r.tBodies.length||!0===r.hasInitialized)return s.debug?t("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var a,n="",d=e(r),c=e.metadata;r.hasInitialized=!1,r.isProcessing=!0,r.config=s,e.data(r,"tablesorter",s),s.debug&&e.data(r,"startoveralltimer",new Date),s.supportsTextContent="x"===e("<span>x</span>")[0].textContent,s.supportsDataObject=((a=e.fn.jquery.split("."))[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4),s.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,null:0,top:!0,bottom:!1},/tablesorter\-/.test(d.attr("class"))||(n=""!==s.theme?" tablesorter-"+s.theme:""),s.$table=d.addClass(w.css.table+" "+s.tableClass+n).attr({role:"grid"}),s.namespace?s.namespace="."+s.namespace.replace(/\W/g,""):s.namespace=".tablesorter"+Math.random().toString(16).slice(2),s.$tbodies=d.children("tbody:not(."+s.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),s.$table.find("caption").length&&s.$table.attr("aria-labelledby","theCaption"),s.widgetInit={},l(r),function(t){if(t.config.widthFixed&&0===e(t).find("colgroup").length){var r=e("<colgroup>"),s=e(t).width();e(t.tBodies[0]).find("tr:first").children("td:visible").each(function(){r.append(e("<col>").css("width",parseInt(e(this).width()/s*1e3,10)/10+"%"))}),e(t).prepend(r)}}(r),o(r),s.delayInit||i(r),w.bindEvents(r,s.$headers),b(r),s.supportsDataObject&&"undefined"!=typeof d.data().sortlist?s.sortList=d.data().sortlist:c&&d.metadata()&&d.metadata().sortlist&&(s.sortList=d.metadata().sortlist),w.applyWidget(r,!0),s.sortList.length>0?d.trigger("sorton",[s.sortList,{},!s.initWidgets,!0]):(f(r),s.initWidgets&&w.applyWidget(r)),s.showProcessing&&d.unbind("sortBegin"+s.namespace+" sortEnd"+s.namespace).bind("sortBegin"+s.namespace+" sortEnd"+s.namespace,function(e){w.isProcessing(r,"sortBegin"===e.type)}),r.hasInitialized=!0,r.isProcessing=!1,s.debug&&w.benchmark("Overall initialization time",e.data(r,"startoveralltimer")),d.trigger("tablesorter-initialized",r),"function"==typeof s.initialized&&s.initialized(r)},w.isProcessing=function(t,r,s){var a=(t=e(t))[0].config,n=s||t.find("."+w.css.header);r?("undefined"!=typeof s&&a.sortList.length>0&&(n=n.filter(function(){return!this.sortDisabled&&w.isValueInArray(parseFloat(e(this).attr("data-column")),a.sortList)>=0})),n.addClass(w.css.processing+" "+a.cssProcessing)):n.removeClass(w.css.processing+" "+a.cssProcessing)},w.processTbody=function(t,r,s){var a;if(t=e(t)[0],s)return t.isProcessing=!0,r.before('<span class="tablesorter-savemyplace"/>'),a=e.fn.detach?r.detach():r.remove();a=e(t).find("span.tablesorter-savemyplace"),r.insertAfter(a),a.remove(),t.isProcessing=!1},w.clearTableBody=function(t){e(t)[0].config.$tbodies.empty()},w.bindEvents=function(t,r){var a,n=(t=e(t)[0]).config;r.find(n.selectorSort).add(r.filter(n.selectorSort)).unbind("mousedown mouseup sort keyup ".split(" ").join(n.namespace+" ")).bind("mousedown mouseup sort keyup ".split(" ").join(n.namespace+" "),function(o,c){var l,p=o.type;if(!(1!==(o.which||o.button)&&!/sort|keyup/.test(p)||"keyup"===p&&13!==o.which||"mouseup"===p&&!0!==c&&(new Date).getTime()-a>250)){if("mousedown"===p)return a=(new Date).getTime(),"INPUT"===o.target.tagName?"":!n.cancelSelection;n.delayInit&&s(n.cache)&&i(t),l=/TH|TD/.test(this.tagName)?this:e(this).parents("th, td")[0],(l=n.$headers[r.index(l)]).sortDisabled||function(t,r,s){var a,n,o,i,c,l=t.config,p=!s[l.sortMultiSortKey],u=l.$table;if(u.trigger("sortStart",t),r.count=s[l.sortResetKey]?2:(r.count+1)%(l.sortReset?3:2),l.sortRestart&&(n=r,l.$headers.each(function(){this===n||!p&&e(this).is("."+w.css.sortDesc+",."+w.css.sortAsc)||(this.count=-1)})),n=r.column,p){if(l.sortList=[],null!==l.sortForce)for(a=l.sortForce,o=0;o<a.length;o++)a[o][0]!==n&&l.sortList.push(a[o]);if((i=r.order[r.count])<2&&(l.sortList.push([n,i]),r.colSpan>1))for(o=1;o<r.colSpan;o++)l.sortList.push([n+o,i])}else{if(l.sortAppend&&l.sortList.length>1)for(o=0;o<l.sortAppend.length;o++)(c=w.isValueInArray(l.sortAppend[o][0],l.sortList))>=0&&l.sortList.splice(c,1);if(w.isValueInArray(n,l.sortList)>=0)for(o=0;o<l.sortList.length;o++)c=l.sortList[o],i=l.$headers[c[0]],c[0]===n&&(c[1]=i.order[r.count],2===c[1]&&(l.sortList.splice(o,1),i.count=-1));else if((i=r.order[r.count])<2&&(l.sortList.push([n,i]),r.colSpan>1))for(o=1;o<r.colSpan;o++)l.sortList.push([n+o,i])}if(null!==l.sortAppend)for(a=l.sortAppend,o=0;o<a.length;o++)a[o][0]!==n&&l.sortList.push(a[o]);u.trigger("sortBegin",t),setTimeout(function(){f(t),h(t),d(t),u.trigger("sortEnd",t)},1)}(t,l,o)}}),n.cancelSelection&&r.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},w.restoreHeaders=function(t){var r=e(t)[0].config;r.$table.find(r.selectorHeaders).each(function(t){e(this).find("."+w.css.headerIn).length&&e(this).html(r.headerContent[t])})},w.destroy=function(t,r,s){if((t=e(t)[0]).hasInitialized){w.refreshWidgets(t,!0,!0);var a=e(t),n=t.config,o=a.find("thead:first"),i=o.find("tr."+w.css.headerRow).removeClass(w.css.headerRow+" "+n.cssHeaderRow),d=a.find("tfoot:first > tr").children("th, td");o.find("tr").not(i).remove(),a.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(n.namespace+" ")),n.$headers.add(d).removeClass([w.css.header,n.cssHeader,n.cssAsc,n.cssDesc,w.css.sortAsc,w.css.sortDesc,w.css.sortNone].join(" ")).removeAttr("data-column"),i.find(n.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(n.namespace+" ")),w.restoreHeaders(t),!1!==r&&a.removeClass(w.css.table+" "+n.tableClass+" tablesorter-"+n.theme),t.hasInitialized=!1,"function"==typeof s&&s(t)}},w.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},w.sortNatural=function(e,t){if(e===t)return 0;var r,s,a,n,o,i,d,c,l=w.regex;if(l.hex.test(t)){if((s=parseInt(e.match(l.hex),16))<(n=parseInt(t.match(l.hex),16)))return-1;if(s>n)return 1}for(r=e.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),a=t.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),c=Math.max(r.length,a.length),d=0;d<c;d++){if(o=isNaN(r[d])?r[d]||0:parseFloat(r[d])||0,i=isNaN(a[d])?a[d]||0:parseFloat(a[d])||0,isNaN(o)!==isNaN(i))return isNaN(o)?1:-1;if(typeof o!=typeof i&&(o+="",i+=""),o<i)return-1;if(o>i)return 1}return 0},w.sortNaturalAsc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:w.sortNatural(e,t)},w.sortNaturalDesc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:w.sortNatural(t,e)},w.sortText=function(e,t){return e>t?1:e<t?-1:0},w.getTextValue=function(e,t,r){if(r){var s,a=e?e.length:0,n=r+t;for(s=0;s<a;s++)n+=e.charCodeAt(s);return t*n}return 0},w.sortNumericAsc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:-i||-1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:i||1:(isNaN(e)&&(e=w.getTextValue(e,r,s)),isNaN(t)&&(t=w.getTextValue(t,r,s)),e-t)},w.sortNumericDesc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:i||1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:-i||-1:(isNaN(e)&&(e=w.getTextValue(e,r,s)),isNaN(t)&&(t=w.getTextValue(t,r,s)),t-e)},w.sortNumeric=function(e,t){return e-t},w.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},w.replaceAccents=function(e){var t,r="[",s=w.characterEquivalents;if(!w.characterRegex){for(t in w.characterRegexArray={},s)"string"==typeof t&&(r+=s[t],w.characterRegexArray[t]=new RegExp("["+s[t]+"]","g"));w.characterRegex=new RegExp(r+"]")}if(w.characterRegex.test(e))for(t in s)"string"==typeof t&&(e=e.replace(w.characterRegexArray[t],t));return e},w.isValueInArray=function(e,t){var r,s=t.length;for(r=0;r<s;r++)if(t[r][0]===e)return r;return-1},w.addParser=function(e){var t,r=w.parsers.length,s=!0;for(t=0;t<r;t++)w.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(s=!1);s&&w.parsers.push(e)},w.getParserById=function(e){var t,r=w.parsers.length;for(t=0;t<r;t++)if(w.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return w.parsers[t];return!1},w.addWidget=function(e){w.widgets.push(e)},w.getWidgetById=function(e){var t,r,s=w.widgets.length;for(t=0;t<s;t++)if((r=w.widgets[t])&&r.hasOwnProperty("id")&&r.id.toLowerCase()===e.toLowerCase())return r},w.applyWidget=function(t,s){var a,n,o,i=(t=e(t)[0]).config,d=i.widgetOptions,c=[];i.debug&&(a=new Date),i.widgets.length&&(i.widgets=e.grep(i.widgets,function(t,r){return e.inArray(t,i.widgets)===r}),e.each(i.widgets||[],function(e,t){(o=w.getWidgetById(t))&&o.id&&(o.priority||(o.priority=10),c[e]=o)}),c.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),e.each(c,function(r,a){a&&(!s&&i.widgetInit[a.id]||(a.hasOwnProperty("options")&&(d=t.config.widgetOptions=e.extend(!0,{},a.options,d)),a.hasOwnProperty("init")&&a.init(t,a,i,d),i.widgetInit[a.id]=!0),!s&&a.hasOwnProperty("format")&&a.format(t,i,d,!1))})),i.debug&&(n=i.widgets.length,r("Completed "+(!0===s?"initializing ":"applying ")+n+" widget"+(1!==n?"s":""),a))},w.refreshWidgets=function(r,s,a){var n,o=(r=e(r)[0]).config,i=o.widgets,d=w.widgets,c=d.length;for(n=0;n<c;n++)d[n]&&d[n].id&&(s||e.inArray(d[n].id,i)<0)&&(o.debug&&t('Refeshing widgets: Removing "'+d[n].id+'"'),d[n].hasOwnProperty("remove")&&o.widgetInit[d[n].id]&&(d[n].remove(r,o,o.widgetOptions),o.widgetInit[d[n].id]=!1));!0!==a&&w.applyWidget(r,s)},w.getData=function(t,r,s){var a,n,o="",i=e(t);return i.length?(a=!!e.metadata&&i.metadata(),n=" "+(i.attr("class")||""),"undefined"!=typeof i.data(s)||"undefined"!=typeof i.data(s.toLowerCase())?o+=i.data(s)||i.data(s.toLowerCase()):a&&"undefined"!=typeof a[s]?o+=a[s]:r&&"undefined"!=typeof r[s]?o+=r[s]:" "!==n&&n.match(" "+s+"-")&&(o=n.match(new RegExp("\\s"+s+"-([\\w-]+)"))[1]||""),e.trim(o)):""},w.formatFloat=function(t,r){return"string"!=typeof t||""===t?t:(t=(r&&r.config?!1!==r.config.usNumberFormat:"undefined"==typeof r||r)?t.replace(/,/g,""):t.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(t)&&(t=t.replace(/^\s*\(([.\d]+)\)/,"-$1")),s=parseFloat(t),isNaN(s)?e.trim(t):s);var s},w.isDigit=function(e){return!isNaN(e)||/^[\-+(]?\d+[)]?$/.test(e.toString().replace(/[,.'"\s]/g,""))}}});var t=e.tablesorter;e.fn.extend({tablesorter:t.construct}),t.addParser({id:"text",is:function(){return!0},format:function(r,s){var a=s.config;return r&&(r=e.trim(a.ignoreCase?r.toLocaleLowerCase():r),r=a.sortLocaleCompare?t.replaceAccents(r):r),r},type:"text"}),t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e||"").replace(/[+\-,. ]/g,""))},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"ipAddress",is:function(e){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(e)},format:function(e,r){var s,a=e?e.split("."):"",n="",o=a.length;for(s=0;s<o;s++)n+=("00"+a[s]).slice(-3);return e?t.formatFloat(n,r):e},type:"numeric"}),t.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(t){return t?e.trim(t.replace(/(https?|ftp|file):\/\//,"")):t},type:"text"}),t.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e,r){return e?t.formatFloat(""!==e?new Date(e.replace(/-/g,"/")).getTime()||e:"",r):e},type:"numeric"}),t.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&e.length<15},format:function(e,r){return e?t.formatFloat(e.replace(/%/g,""),r):e},type:"numeric"}),t.addParser({id:"usLongDate",is:function(e){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(e)||/^\d{1,2}\s+[A-Z]{3,10}\.{0,1}\s+\d{4}/i.test(e)},format:function(e,r){return e?t.formatFloat(new Date(e.replace(/(\S)([AP]M)$/i,"$1 $2")).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"shortDate",is:function(e){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((e||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(e,r,s,a){if(e){var n=r.config,o=n.$headers.filter("[data-column="+a+"]:last"),i=o.length&&o[0].dateFormat||t.getData(o,n.headers[a],"dateFormat")||n.dateFormat;e=e.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===i?e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===i?e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===i&&(e=e.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return e?t.formatFloat(new Date(e).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"time",is:function(e){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(e)},format:function(e,r){return e?t.formatFloat(new Date("2000/01/01 "+e.replace(/(\S)([AP]M)$/i,"$1 $2")).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"metadata",is:function(){return!1},format:function(t,r,s){var a=r.config,n=a.parserMetadataName?a.parserMetadataName:"sortValue";return e(s).metadata()[n]},type:"numeric"}),t.addWidget({id:"zebra",priority:90,format:function(r,s,a){var n,o,i,d,c,l,p=new RegExp(s.cssChildRow,"i"),u=s.$tbodies;for(s.debug&&(c=new Date),l=0;l<u.length;l++)(n=u.eq(l)).children("tr").length>1&&(i=0,n.children("tr:visible").not(s.selectorRemove).each(function(){o=e(this),p.test(this.className)||i++,d=i%2==0,o.removeClass(a.zebra[d?1:0]).addClass(a.zebra[d?0:1])}));s.debug&&t.benchmark("Applying Zebra widget",c)},remove:function(t,r,s){var a,n,o=r.$tbodies,i=(s.zebra||["even","odd"]).join(" ");for(a=0;a<o.length;a++)(n=e.tablesorter.processTbody(t,o.eq(a),!0)).children().removeClass(i),e.tablesorter.processTbody(t,n,!1)}})}(jQuery);
;Dependency._js['lib/jquery/plugins/tablesorter/jquery.tablesorter']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/item_list"),Dependency.addJS("docnote/docnote_product_list"),Dependency.addJS("docnote/params"),Dependency.addJS("docnote/container"),Dependency.addJS("docnote/dependency"),Dependency.addJS("docnote/docpriv"),Dependency.addJS("docnote/templates"),Dependency.addJS("docnote/docnote_diary"),Dependency.addJS("docnote/link_listitem"),Dependency.addJS("docnote/portfolio_account_group"),Dependency.addJS("docnote/docnote_preview_container"),Dependency.addCSS("docnote/docnote_change_attachment_name"),Dependency.addCSS("docnote"),Dependency.addJS("ajax/dependency"),Dependency.addJQueryPlugin("chosen",!0),Dependency.addJQueryPlugin("dialogextend",!0),Dependency.addJS("lib/ckeditor/ckeditor"),Dependency.addJS("lib/fileuploader/fileuploader"),Dependency.addCSS("lib/fileuploader/fileuploader"),Dependency.addCSS("lib/fontawesome/css/font-awesome"),Dependency.addCSS("lib/fontawesome/css/font-awesome-solid"),Dependency.addJQueryPlugin("tablesorter"),Dependency.addJS("xpt/portfolio/search/portfolio_account_search"),Dependency.addJS("tooltip"),Dependency.addJS("xpt/task/thread")),function(t){var e=XPLAN.namespace("XPLAN.docnote"),n=function(){const t=new Event("DocnoteSaved");window.dispatchEvent(t)};t.fn.single_double_click=function(t,e,n){return this.each(function(){var i=0,o=this;jQuery(this).click(function(a){1==++i&&setTimeout(function(){1==i?t.call(o,a):e.call(o,a),i=0},n||300)})})};var i={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_edit",category_rootid:"0000000000000000",category_tempid:"0000000000000001",category_xmergeid:"0000000000000002",max_related_entities:20,linked_note_spans:"tr.related-entity-row span.fa-link.docnote-entity-related[data-entityid]",enabled_linked_note_spans:"tr.related-entity-row span.fa-link.docnote-entity-related:not(.is-disabled)[data-entityid]",enabled_unlinked_note_spans:"tr.related-entity-row span.fa-link:not(.docnote-entity-related):not(.is-disabled)[data-entityid]",linked_workflow_spans:"tr.related-entity-row span.fa-project-diagram.workflow-entity-related[data-entityid]",enabled_linked_workflow_spans:"tr.related-entity-row span.fa-project-diagram.workflow-entity-related:not(.is-disabled)[data-entityid]",enabled_unlinked_workflow_spans:"tr.related-entity-row span.fa-project-diagram:not(.workflow-entity-related):not(.is-disabled)[data-entityid]",create:function(t){var n=this;this.elm=t,this.checkout={},this.options.global_params?this.global_params=this.options.global_params:(n.global_params=new e.GlobalParams,n.options.view_params=XPLAN.util.update(n.options.params,n.options.view_params),n.global_params.init(this.options)),this._upload_inited=!1,this._init_doc_priv(),this._data_changed=!1,this._prods_linked_changed=!1,this._editor_ready=!1,this._saving_doc=!1,this.editlog_started=new Date,this.editlog_id=-1,this._load(),XPLAN.event.listen("xevent_prods_linked_changed",function(){n._data_changed=!0,n._prods_linked_changed=!0})},_init_doc_priv:function(){this._doc_priv=new DocPriv,this._doc_priv.setEditPriv(this.options.data.edit_priv)},_load:function(){this.is_new()?this._load_new_doc():this._load_doc()},_load_new_doc:function(){var t=this,e=t.global_params.get_view_params();e.entityid=t.global_params.entityid?t.global_params.entityid:e.entityid,EggTimer.show(),XMLRPC.call(t.options.ajax_rpcs.create,[t.options.params,e],function(e){EggTimer.hide(),"content"in CKEDITOR.instances?alert(_("An instance of CKEDITOR with the same name already exists.")):(t.options.docid=e.doc.docid,t.options.data=e.doc,t.options.ajaxes.docparts_ajax.editable=!0,t.options.ajaxes.docparts_ajax.docid=e.doc.docid,t.options.params.can_link_docnote_account_group&&(t.options.ajaxes.account_group_ajax.data.docid=e.doc.docid),t.options.docnote_container=e.docnote_container,t.options.workflow_entities=e.workflow_entities,t._handle_load(e.html),t._handle_contribution_summary_load(),t._load_ckeditor(function(){t._detect_change(),t.options.autotemplate&&t.load_from_template(this,t.options.autotemplate)}))},t.on_error)},_load_doc:function(){var t=this;EggTimer.show(),XMLRPC.call(t.options.ajax_rpcs.load,[t.options.docid,t.options.params],function(e){EggTimer.hide(),t.options.data=e.doc,t.options.workflow_entities=e.workflow_entities,t._handle_load(e.html),t._load_ckeditor(function(){t._detect_change()})},t.on_error)},_handle_contribution_summary_load:function(){this.options.contribution_summary_toggle_on&&"contribution_summary_subject"in this.options&&this._get_elm("subject").val(this.options.contribution_summary_subject)},_load_ckeditor:function(e){var n=this;n.plaintext_html('textarea[name="content"]'),t('textarea[name="content"]',n.elm).hide(),window.setTimeout(function(){XPLAN.ui.createHTMLEditor(t('textarea[name="content"]',n.elm),"xplan","300px","100%","Xplan",!0,e)},300)},_get_dialog_title:function(){var t=this.is_new()?_("Add Document Note"):_("Edit Document Note");return this.options.share_with_all_toggled_on&&this.is_tpl()&&(t+=" "+_("Template")),t},_handle_load:function(t){var e=this;e.elm.html(t),e.options.params.no_dialog||e.elm.dialog({minHeight:650,minWidth:1e3,title:XPLAN.util.escape(e._get_dialog_title()),beforeClose:function(){return e.before_close(e,this)},close:function(){e.options.onclose&&e.options.onclose();try{for(var t=CKEDITOR.dialog._.currentTop;t;)CKEDITOR.dialog._.currentTop.hide(),t=CKEDITOR.dialog._.currentTop;CKEDITOR.instances.content.destroy(!0)}catch(t){delete CKEDITOR.instances.content}e.elm.remove()},modal:!0,dialogClass:"docnote_dialog"}).dialogExtend({maximizable:!0,maximize:function(){},collapsable:!0,dblclick:"maximize"}),e._init_after_load()},before_close:function(t,e){if(this.is_editable()&&this._data_changed)if(this._saving_doc){if(!confirm(_("Saving note now, do you want to close the dialog?")))return!1}else confirm(_("Document has been modified. Do you wish to save the change?"))?this._save_summary(e,!1,!0):n();return!0},_init_after_load:function(){this._handle_linked_items(),this._init_tabs(),this.options.ajaxes.dep_ajax.child_selector=this.$('select[name="docsubtype"]'),this.elm.find('select[name="doctype"]').xplan_dependency(this.options.ajaxes.dep_ajax),this._init_tags_dependency(),this._handle_tpl(),this._handle_permission(),this._handle_checkout(),this._handle_lock_on_save(),this._handle_edit_priv(),this._handle_client_access(),this.options.params.noentities||this._handle_add_remove_entity(),this._handle_add_remove_subfund(),this.options.params.can_link_docnote_account_group&&this._init_link_account_group(),this._handle_add_remove_categories(),this._handle_container(),this._handle_buttons(),this._handle_editable(),this.options.share_with_all_toggled_on&&this._init_template_inherit_permission(),this._handle_visibility(),this._shared_with_all_check(),this._handle_tags_tooltip(this.options.data.not_visible_tags_count)},_handle_tags_tooltip:function(t){if(0===t)jQuery("#doc-edit-tags-tooltip").attr("title","").hide();else{let e;switch(t){case 1:e=_("One tag on this note is not visible.");break;case 2:e=_("Two tags on this note are not visible.");break;case 3:e=_("Three tags on this note are not visible.");break;case 4:e=_("Four tags on this note are not visible.");break;case 5:e=_("Five tags on this note are not visible.");break;case 6:e=_("Six tags on this note are not visible.");break;default:e=_(`${t} tags on this note are not visible.`)}jQuery("#doc-edit-tags-tooltip").attr("title",e).show()}},_shared_with_all_check:function(){jQuery("select[name='permission']",this.$el).change(function(){jQuery("div#shared_with_all_warning_docnote",this.$el).toggle("2"===jQuery(this).val()),jQuery("div#shared_with_all_warning_template",this.$el).toggle("2"===jQuery(this).val())}).change(),jQuery("select[name='template_permission']",this.$el).change(function(){jQuery("div#shared_with_all_warning_template_docnote",this.$el).toggle("2"===jQuery(this).val())}).change()},_init_template_inherit_permission:function(){if(!jQuery("input[name='template_inherit']",this.$el).is(":checked")){jQuery("input[name='template_inherit']",this.$el).prop("checked",!0);var t=jQuery("select[name='permission']",this.$el).val();jQuery("select[name='template_permission']",this.$el).val(t)}},_init_tags_dependency:function(){if(!this.options.docnote_tag_toggle_on||!this.options.ajaxes.dep_tags_ajax)return;const t=`select[name="${this.options.tags_master_selector}"]`;this.options.ajaxes.dep_tags_ajax.empty_blank_category=!0,this.options.ajaxes.dep_tags_ajax.child_selector=this.$('select[name="tag_ids"]'),this.$(t).xplan_dependency(this.options.ajaxes.dep_tags_ajax)},_handle_editable:function(){this.is_editable()||t(":input",this.elm).prop("disabled",!0),this.is_new()||this.is_tpl()||this._get_elm("threadtemplate").prop("disabled",!0)},_handle_tpl:function(){(this._get_elm("force_container").prop("disabled",!this.is_tpl()||!this.options.editable),t("fieldset.template_options",this.elm).toggle(this.is_tpl()),XPLAN.util.hasFeature("$docnote_policy_uplift or $docnote_policy_uplift_au_nz"))&&t('div[id="xplan-docnote-products-links-root"]').detach().first().appendTo("body")},_handle_linked_items:function(e){var n=this;n.is_tpl()?(t('div[id^="tab-linked-"]',n.elm).hide(),t("li.tab-linked",n.elm).hide()):(t('div[id^="tab-linked-"]',n.elm).show(),t("li.tab-linked",n.elm).show(),t("div.linked_item.content",n.elm).each(function(){var i=t(this),o=i.data("item_type"),a={};t.extend(a,n.options.ajaxes.linked_items_ajax),a.data.list_name=o,e&&e[o].length>0?(a.data.linked_item_ids=e[o],t("div.linked_item.panelbox."+o,n.elm).show(),n._render_item_list(i,a)):e||n._render_item_list(i,a)}))},_render_item_list:function(t,e){XPLAN.util.hasFeature("$docnote_policy_uplift or $docnote_policy_uplift_au_nz")?t.xplan_docnote_prod_list(e):t.xplan_item_list(e)},_detect_change:function(){var t=this,e=["subject","doctype","docsubtype","accessible","referrer_accessible","permission","threadtemplate","template_inherit","content","profadviser_accessible"];XPLAN.util.hasFeature("docnote_tag")&&e.push("tag_ids"),XPLAN.util.hasFeature("docnote_client_notification")?e.push("client_notification_setting"):e.push("notify_client");var n=function(){t._data_changed=!0};for(var i in e)t._get_elm(e[i]).change(n);CKEDITOR.instances.content.on("change",function(){t._data_changed=!0})},_handle_buttons:function(){this.is_editable()?this.is_new()?this._enable_button_group(["new"],["view"]):this._enable_button_group(["view"],["new"]):this._enable_button_group([],["view","new"]),this._handle_btn_pdf(),this._handle_btn_action(),this._handle_btn_template(),this._handle_btn_save(),this._handle_btn_save_new(),this._handle_btn_save_and_close(),this._handle_link_product()},_handle_btn_pdf:function(){var e=this;t(".btn_pdf",this.elm).click(function(){e.is_new()||getHiddenFrame(getBaseURL()+"/docnote/generate_pdf?docid="+e.options.docid)})},_add_task_menu_items:function(t){const e=this,n=[];if(e.options.params.cap_allow_tasks&&e.is_editable()&&!e.is_tpl()&&(n.push(new PopupMenuItem(_("Add Follow-Up Task"),function(){e._add_followup_tasks()})),n.push(new PopupMenuItem(_("Activate Workflow"),function(){e._activate_thread()}))),e.options.params.cap_allow_diary&&e.is_editable()&&!e.is_tpl()&&n.push(new PopupMenuItem(_("Add Diary Event"),function(){e._add_diary_event()})),n.length>0){t.push(new PopupMenuSeparator);for(const e of n)t.push(e)}},_handle_btn_action:function(){var e=this;t(".btn_tasks",e.elm).click(function(){var t=[new PopupMenuItem(_("View Edit Log"),function(){e._show_edit_log()}),new PopupMenuItem(_("View Meta Data"),function(){e._view_meta()})];return e._add_task_menu_items(t),PopupMenu.showDropdown(t,this),!1})},_handle_btn_template:function(){var e=this;t(".btn_template",e.elm).click(function(){e.options.ajaxes.list_template_ajax&&(e.options.ajaxes.list_template_ajax.docnote_edit_ajax=e.options.ajax_plugin_name,e.elm.xplan_docnote_templates_list(e.options.ajaxes.list_template_ajax))})},_handle_btn_save:function(){var e=this;t(".btn_save",e.elm).click(function(){t(".btn_save_and_close").prop("disabled",!0),e._save_summary(this,!1,!1)})},_handle_btn_save_new:function(){var e=this;t(".btn_savenew",e.elm).click(function(){t(".btn_save_and_close").prop("disabled",!0),e._save_summary(this,!0,!1)})},_handle_btn_save_and_close:function(){var e=this;t(".btn_save_and_close",e.elm).click(function(){e._save_summary(this,!1,!0)})},_handle_link_product:function(){var e=this;t(".btn_link_prod",e.elm).click(function(){var t=e._get_related_clients();if(0===t.length)PopupMsgBox.show_info_text(_("The docnote should have at least one related client."));else{var n=e._get_linked_products(),i=e.global_params.get_view_params();if(i.list_name){var o=i.list_name;"insurance_group_general"===o&&(o="general_insurance"),n[o].push(i.list_index)}window.popupProductsListsDialog({clients:t,linkedProducts:n,mountDivId:"xplan-docnote-products-links-root",onHideCallback:e._handle_new_links.bind(e),locale:e.options.locale,version:2,newAUProductsAssociationToggle:XPLAN.util.hasFeature("new_products_association_au"),multiCurrencySite:XPLAN.util.hasFeature("multi_currency")})}})},_handle_new_links:function(e){if(e){var n=!1,i=this._get_linked_products();Object.keys(e).forEach(function(t){e[t].length>0&&(n=!0,Array.prototype.push.apply(i[t],e[t]))}),n&&(this._handle_linked_items(i),this._data_changed=!0,this._prods_linked_changed=!0,t("div.linked_item.empty_content",this.elm).hide())}},_get_related_clients:function(){var e=[];return t(".shared_entities_tbl tbody",this.elm).find("tr").each(function(){var n=t(this);if(n.find("span.fa-link.docnote-entity-related[data-entityid], input").length>0&&"Client"===n.find('td[data-xplan-elem="entitytype_td"]').text()){var i=parseInt(n.attr("data-entityid")),o=n.find("td[data-xplan-elem=entityname_td]").text();e.push({id:i,name:o})}}),e},_get_linked_products:function(){var e={};return t("div.linked_item.content",this.elm).each(function(){var n=t(this),i=n.data("item_type"),o=XPLAN.util.elem2object(n).item_index;void 0===o?o=[]:Array.isArray(o)||(o=new Array(o));for(var a=0;a<o.length;++a)o[a]=parseInt(o[a],10);e[i]=o}),e},_get_edit_log_adjustment:function(){var t=(new Date).getTime(),e=this.editlog_started.getTime(),n=Math.ceil((t-e)/6e4);return prompt(_("How long have you been editing this document? (minutes)"),n)},_process_after_save:function(t,e,i,o,a){if(o)if(this.options.params.no_dialog)this.options.params.new_window?window.close():PopupDiv.hideLast();else try{this.elm.dialog("close")}catch(t){}else this._disable_save_buttons(e,!1),i&&(this._enable_button_group(["view"],["new"]),this._get_elm("checkout").prop("disabled",!1));this.options.on_save&&this.options.on_save(),a&&a(),n()},_save_summary:function(e,n,i,o){var a=this,s=a._get_req_data();if(0===s.entities.length&&0===t(".document_subfund_tbl input").length&&0===t(".document_categories_tbl input").length){var d;d=t(".document_subfund_tbl").length?_("No category, portfolio account or related entities have been set for this note.\nContinue to save?"):_("No category or related entities have been set for this note.\nContinue to save?");var l=a.global_params.get_value("view_type");if(-1==t.inArray(l,["category","client","user"])&&!confirm(d))return}if(s){a.options.view_params?(s.benchmark_item_id=a.options.view_params.benchmark_item_id,s.benchmark_item_type=a.options.view_params.benchmark_item_type):(s.benchmark_item_id=-1,s.benchmark_item_type=""),a.options.contribution_summary_toggle_on&&"contribution_summary_id"in a.options&&XPLAN.util.update(s,{contribution_summary_id:a.options.contribution_summary_id,contribution_summary_entity_id:a.options.entity_id,contribution_summary_start_year:a.options.start_year});var r=[a.options.docid,s];a._disable_save_buttons(e,!0),a._saving_doc=!0,XMLRPC.call(a.options.ajax_rpcs.save_document,r,function(t){if(a._data_changed=!1,a._saving_doc=!1,a.options.params.started=new Date,t.doc.docid&&(n&&(a.options.ajaxes.docnote_diary_ajax=t.docnote_diary_ajax),a.options.docid=t.doc.docid,a.options.ajaxes.docparts_ajax.docid=t.doc.docid,i||a._init_docparts()),t.doc.editlog_id&&(a.editlog_id=t.doc.editlog_id),a._update_container_data(a.options.docid,function(){a._after_update_data(i,t)}),"from_container_item"in a.options.params){var s=a.options.params.from_container_item;return delete a.options.params.from_container_item,XPLAN.Thread.Common.check_review_creation(a,s,a._process_after_save,[t,e,n,i,o])}a._process_after_save(t,e,n,i,o)},function(t){HttpRequest.onerror(t),a._saving_doc=!1,a._disable_save_buttons(e,!1,i)})}},_after_update_data:function(t,e){this._check_redirect(t)},_check_redirect:function(t){t&&this.options.params.no_dialog&&XPLAN.util.form_redirect(XPLAN.util.getURL(this.options.params.back_location,null,!0))},_disable_save_buttons:function(e,n,i){this.$(".btn_save, .btn_savenew, .btn_save_and_close").prop("disabled",n),e&&t(e).text(n?_("Saving..."):i?_("Save and Close"):_("Save"))},_get_req_data:function(){var e={},n=0;if(this.options.params.editlog_adjustment&&(n=parseInt(this._get_edit_log_adjustment(),10),isNaN(n)||n>0&&(n*=60)),isNaN(n)){var i=(new Date).getTime(),o=this.editlog_started.getTime();n=Math.ceil((i-o)/1e3),n=60*parseInt(n/60,10)}e.editlog={id:this.editlog_id,duration:n,started:this.options.params.started};var a=["subject","doctype","docsubtype","permission"];for(var s in XPLAN.util.hasFeature("docnote_tag")&&a.push("tag_ids"),XPLAN.util.hasFeature("docnote_client_notification")&&a.push("client_notification_setting"),a){var d=a[s];e[d]=this._get_elm(d).val()}if(e.docsubtype||(e.docsubtype=""),e.refdate=XPLAN.DateField.getDate(this._get_elm("refdate")),e.edit_priv=this._doc_priv.getEditPriv(),e.permission=parseInt(e.permission,10),3==e.permission){e.shared_entities=[];var l=this._get_elm("shared_entities").val();if(l)for(s in l=l.split(","))e.shared_entities.push(parseInt(l[s],10))}if(e.entities=[],this.options.params.noentities){var r=t(':input[name="selected_entities"]');if(r.val()){var c=r.val().split(",");e.entities=underscore.map(c,function(t){return parseInt(t,10)})}}else{var p=t(".shared_entities_tbl tbody",this.elm);p.find(this.linked_note_spans).each(function(){e.entities.push(parseInt(t(this).attr("data-entityid"),10))}),p.find("input").each(function(){e.entities.push(parseInt(t(this).val(),10))})}if(e.text_mimetype="text/html",e.text_content=this._get_text_content("content"),e.summary=this._get_text_content("summary"),e.accessible=this._get_elm("accessible").is(":checked"),e.referrer_accessible=this._get_elm("referrer_accessible").is(":checked"),e.profadviser_accessible=this._get_elm("profadviser_accessible").is(":checked"),e.client_share_all=this._get_elm("client_share_all").is(":checked"),e.show_at_login=parseInt(this._get_elm("show_at_login").val(),10),XPLAN.util.hasFeature("docnote_client_notification")||(e.notify_client=this._get_elm("notify_client").is(":checked")),this.is_tpl()&&(e.force_container=this._get_elm("force_container").is(":checked")),"-1"!=this._get_elm("threadtemplate")&&(e.threadtemplate=parseInt(this._get_elm("threadtemplate").val(),10)),this.options.params.has_feature_container){var h=this._get_container_data();if(null===h&&!this.is_tpl()&&e.force_container)return void alert(_("You must choose a Case."));e.docnote_container=h}if(this.is_tpl()&&(e.template_inherit=this._get_elm("template_inherit").is(":checked"),e.template_permission=parseInt(this._get_elm("template_permission").val(),10),3===e.template_permission&&(e.template_shared_entities=this._get_elm("template_shared_entities").val())),this.options.params.can_link_docnote_account_group&&this.is_new()){var u=this.elm.find('div[id^="account-group"]');e.account_groups=u.xplan_docnote_account_group("val")}return this._prods_linked_changed&&(e.linked_item_dict=this._get_linked_products()),e},_get_container_data:function(){var e,n=t(".docnote_container_panel",this.elm),i=null;return e=XPLAN.docnote.container.get_container_ids(n),-1===t.inArray(-1,e)&&((i=XPLAN.docnote.container.get_data()).threadid=e,i.from_container_item=this.options.params.from_container_item),i},_update_container_data:function(t,e){var n=this,i=this._get_container_thread_ids();XMLRPC.call(n.options.ajax_rpcs.load_container_data,[t,i],function(t){n.options.docnote_container=t,n._handle_container(),e&&e()},HttpRequest.onerror)},_get_container_thread_ids:function(){var e=t(".docnote_container_panel",this.elm);return XPLAN.docnote.container.get_container_ids(e)},_get_text_content:function(e){var n=t('textarea[name="'+e+'"]',this.elm);if(0===n.length)return"";var i=n.val();return i.match(/^<(p|div)>&nbsp;<\/(p|div)>$/g)&&(i=""),i},plaintext_html:function(t){var e=jQuery(t).val();e.match(/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/)||(e=e.replace(/\t/g,"    ").replace(/  /g,"&nbsp; ").replace(/  /g," &nbsp;").replace(/\r\n|\n|\r/g,"<br />"),jQuery(t).val(e))},_view_meta:function(){var e=this;"new"!==e.options.docid.substring(0,3)&&XMLRPC.call(e.options.ajax_rpcs.get_doc_metadata,[e.options.docid],function(n){var i=t(".dlg-metadata",e.elm);if(0===i.length?i=t('<div class="dlg-metadata"></div>').appendTo(e.elm):i.empty(),0===n.length)t('<tr colspan="2">'+"<td>%a</td>".replace("%a",XPLAN.util.escape(_("No meta data found")))+"</tr>").appendTo(i);else for(var o=0;o<n.length;o++)t("<tr>"+"<td>%a</td>".replace("%a",XPLAN.util.escape(n[o][0]))+"<td>%a</td>".replace("%a",XPLAN.util.escape(n[o][1]))+"</tr>").appendTo(i);i.dialog({title:_("View Meta Data"),modal:!0,height:250,width:400})},HttpRequest.onerror)},_add_followup_tasks:function(){if(this.options.docid){const e=t(this.linked_workflow_spans),n=t(this.linked_note_spans);if(0===e.length&&0===n.length)return void alert(_("A task can not be created when there are no linked workflow or note entities."));PopupURL2.show("/docnote/add_followup_task?docid="+this.options.docid,{width:400,height:480,centre:!0})}},_activate_thread:function(){if(this.options.docid){const e=t(this.linked_workflow_spans),n=t(this.linked_note_spans);if(0===e.length&&0===n.length)return void alert(_("A thread/case can not be created when there are no linked workflow or note entities."));PopupURL2.show("/docnote/activate_thread?docid="+this.options.docid,{width:400,height:200,centre:!0})}},_add_diary_event:function(){if(this.options.ajaxes.docnote_diary_ajax){var e=t("div.docnote_add_dialog",this.elm);0===e.length?e=t('<div class="docnote_add_dialog"></div>').appendTo(this.elm):e.empty(),e.xplan_docnote_diary(this.options.ajaxes.docnote_diary_ajax)}},_show_edit_log:function(){var e=this;if(e.options.docid){var n=t("div.edit_log_dlg tbody.tbody_edit_log",e.elm);0===n.length?n=(n=t('<div class="edit_log_dlg"><table class="list"><tbody class="tbody_edit_log list2"><thead><tr>'+"<th>%a</th>".replace("%a",XPLAN.util.escape(_("Date/Time")))+"<th>%a</th>".replace("%a",XPLAN.util.escape(_("User")))+"<th>%a</th>".replace("%a",XPLAN.util.escape(_("Duration")))+"</tr></thead><tbody></tbody></table></div>").appendTo(e.elm)).find("tbody"):n.empty(),XMLRPC.call(e.options.ajax_rpcs.get_edit_logs,[e.options.docid],function(i){for(var o,a=0;a<i.length;a++)o=n[0].insertRow(a),t(o.insertCell(0)).text(i[a].started),t(o.insertCell(1)).text(i[a].user),t(o.insertCell(2)).text(i[a].duration);0===i.length&&(o=n[0].insertRow(0),t(o.insertCell(0)).text(XPLAN.util.escape(_("No edit log found"))).attr("colspan","3")),t("div.edit_log_dlg",e.elm).dialog({title:XPLAN.util.escape(_("Document Edit Logs")),height:300,width:400})})}},_enable_button_group:function(e,n){var i;for(i=0;i<e.length;i++)t(".btng_"+e[i],this.elm).show();for(i=0;i<n.length;i++)t(".btng_"+n[i],this.elm).hide()},_init_tabs:function(){var t=this;t.elm.find("div.tabs-main").tabs({activate:function(t,e){1===e.newTab.find('a[href^="#tab-summary"]:first').length&&CKEDITOR.document.getWindow().fire("resize")},beforeActivate:function(){t._upload_inited||(t._init_docparts(),t._upload_inited=!0)}})},_init_docparts:function(){if(!this.is_dialog_closed()){this.elm.find('div[id^="tab-attach"]').xplan_docnote_docpart_list(this.options.ajaxes.docparts_ajax)}},_add_related_entities:function(t,e,n){const i=this;EggTimer.show(),XMLRPC.call("docnote.add_entities",[t,e],function(t){n(t),i._data_changed=!0,i._update_container_data(i.options.docid),EggTimer.hide()},function(t){XPLAN.framemain.alert("errormsg"in t?t.errormsg:t.message,!0),EggTimer.hide()})},_remove_related_entities:function(t,e,n){const i=this;EggTimer.show(),XMLRPC.call("docnote.remove_entities",[t,e],function(t){n(t),i._data_changed=!0,i._update_container_data(i.options.docid),EggTimer.hide()},function(t){XPLAN.framemain.alert("errormsg"in t?t.errormsg:t.message,!0),EggTimer.hide()})},_add_workflow_entities:function(t,e,n){const i=this;EggTimer.show(),XMLRPC.call("docnote.add_workflow_entities",[t,e],function(t){n(t),i._data_changed=!0,i._update_container_data(i.options.docid),EggTimer.hide()},function(t){XPLAN.framemain.alert("errormsg"in t?t.errormsg:t.message,!0),EggTimer.hide()})},_remove_workflow_entities:function(t,e,n){const i=this;EggTimer.show(),XMLRPC.call("docnote.remove_workflow_entities",[t,e],function(t){n(t),i._data_changed=!0,i._update_container_data(i.options.docid),EggTimer.hide()},function(t){XPLAN.framemain.alert("errormsg"in t?t.errormsg:t.message,!0),EggTimer.hide()})},_handle_add_remove_entity:function(){var e=this;if(e._reload_entities(),!e.is_editable())return t("button.btn_add_entity",e.elm).hide(),t("button.btn_remove_entity",e.elm).hide(),t('span[data-xplan-elem="select_all_shared_entities"]').hide(),void t('span[data-xplan-elem="select_all_workflow_entities"]').hide();e._init_note_link_events(),t("button.btn_add_entity",e.elm).click(function(){FactFind.doEntityLookup({clientlisting:2,type:["client","user","supplier","profadviser","referral"],allow_archived:!0,close:function(t){t&&XMLRPC.call("docnote.addEntity",[e.options.docid,t.id],function(t){e._data_changed=!0,e._handle_list_entities(t),e._update_container_data(e.options.docid)},HttpRequest.onerror)}})}),t("button.btn_remove_entity",e.elm).click(function(){var n=[];return t(".shared_entities_tbl tbody",e.elm).find("input").each(function(){if(t(this).is(":checked")){var e=t(this).val();n.push(parseInt(e,10))}}),XMLRPC.call("docnote.remove_entities",[e.options.docid,n],function(t){e._data_changed=!0,e._handle_list_entities(t),e._update_container_data(e.options.docid)},HttpRequest.onerror),!1})},_init_note_link_events:function(){const e=this,n=t("table.shared_entities_tbl tbody");t('span[data-xplan-elem="select_all_shared_entities"]').click(function(){const n=[],i=t(this);if(t(this).hasClass("docnote-entity-related")){const o=t(e.enabled_linked_note_spans);o.each(function(){n.push(parseInt(t(this).attr("data-entityid"),10))}),e._remove_related_entities(e.options.docid,n,function(){i.removeClass("docnote-entity-related"),i.prop("title","Click to link note for all listed entities"),o.each(function(){e._refresh_note_link(t(this),!1)})})}else{const o=t(e.enabled_unlinked_note_spans);o.each(function(){n.push(parseInt(t(this).attr("data-entityid"),10))}),e._add_related_entities(e.options.docid,n,function(){i.addClass("docnote-entity-related"),i.prop("title","Click to unlink note for all listed entities"),o.each(function(){e._refresh_note_link(t(this),!0)})})}}),n.on("click",e.enabled_linked_note_spans,function(){const n=[parseInt(t(this).attr("data-entityid"),10)],i=t(this);e._remove_related_entities(e.options.docid,n,function(){e._refresh_note_link(i,!1)})}).on("click",e.enabled_unlinked_note_spans,function(){const n=[parseInt(t(this).attr("data-entityid"),10)],i=t(this);e._add_related_entities(e.options.docid,n,function(){e._refresh_note_link(i,!0)})}),e.is_tpl()||(t('span[data-xplan-elem="select_all_workflow_entities"]').click(function(){const n=[],i=t(this);if(t(this).hasClass("workflow-entity-related")){const o=t(e.enabled_linked_workflow_spans);o.each(function(){n.push(parseInt(t(this).attr("data-entityid"),10))}),e._remove_workflow_entities(e.options.docid,n,function(){i.removeClass("workflow-entity-related"),i.prop("title","Click to link all listed entities to selected workflow"),o.each(function(){e._refresh_workflow_link(t(this),!1)})})}else{const o=t(e.enabled_unlinked_workflow_spans);o.each(function(){n.push(parseInt(t(this).attr("data-entityid"),10))}),e._add_workflow_entities(e.options.docid,n,function(){i.addClass("workflow-entity-related"),i.prop("title","Click to unlink all listed entities from selected workflow"),o.each(function(){const n=t(this);e._refresh_workflow_link(n,!0)})})}}),n.on("click",e.enabled_linked_workflow_spans,function(){const n=[parseInt(t(this).attr("data-entityid"),10)],i=t(this);e._remove_workflow_entities(e.options.docid,n,function(){e._refresh_workflow_link(i,!1)})}).on("click",e.enabled_unlinked_workflow_spans,function(){const n=[parseInt(t(this).attr("data-entityid"),10)],i=t(this);e._add_workflow_entities(e.options.docid,n,function(){e._refresh_workflow_link(i,!0)})}))},_get_related_entity_row:function(e,n,i){const o=this,a=t(`<tr data-entityid="${e.entityid}"></tr>`);a.addClass("related-entity-row");let s=t("<td></td>").addClass("select related-entity-actions").appendTo(a);const _=t("<span>").addClass("icon16 fa-link").attr("data-entityid",e.entityid).appendTo(s);if(o.is_editable()&&!e.not_removable||_.addClass("is-disabled"),o._refresh_note_link(_,n),!o.is_tpl()){s=t("<td></td>").addClass("select workflow-entity-actions").appendTo(a);const n=t("<span>").addClass("icon16 fa-project-diagram").attr("data-entityid",e.entityid).appendTo(s);o.is_editable()&&!e.not_visible||n.addClass("is-disabled"),o._refresh_workflow_link(n,i)}return t('<td data-xplan-elem="entityname_td"></td>').appendTo(a).html(e.entityname_html),t('<td data-xplan-elem="entitytype_td"></td>').appendTo(a).text(e.entitytype),t('<td data-xplan-elem="category_td"></td>').appendTo(a).text(e.category),t('<td data-xplan-elem="adviser_td"></td>').appendTo(a).text(e.adviser),t('<td data-xplan-elem="referrer_td"></td>').appendTo(a).text(e.referrer),a},_refresh_note_link:function(t,e){e?(t.addClass("docnote-entity-related"),t.hasClass("is-disabled")?t.prop("title","Note link is locked"):t.prop("title","Click to unlink note")):t.removeClass("docnote-entity-related").prop("title","Click to link note")},_refresh_workflow_link:function(t,e){e?(t.addClass("workflow-entity-related"),t.hasClass("is-disabled")?t.prop("title","Workflow entity is locked"):t.prop("title","Click to unlink entity from selected workflow")):t.removeClass("workflow-entity-related").prop("title","Click to link entity to selected workflow")},_handle_list_entities:function(e){0!==t(".shared_entities_tbl tbody",this.elm).length&&this._handle_related_entities(e)},_handle_related_entities:function(e){const n=this,i=t(".shared_entities_tbl tbody",n.elm),o={};for(const t of e)t.is_linked=!0,t.is_workflow_linked=!1,o[t.entityid]=t;if(n.options.workflow_entities)for(const t of n.options.workflow_entities)t.entityid in o?o[t.entityid].is_workflow_linked=!0:(t.is_linked=!1,t.is_workflow_linked=!0,o[t.entityid]=t);if(n.is_editable()&&n.options.params.all_client_related_entities)for(const t of n.options.params.all_client_related_entities)t.entityid in o||(t.is_linked=!1,t.is_workflow_linked=!1,o[t.entityid]=t);const a=[];for(const t in o)a.push(o[t]);a.sort((t,e)=>e.is_linked-t.is_linked||e.is_workflow_linked-t.is_workflow_linked||t.entityname_html.localeCompare(e.entityname_html));const s={};i.find("tr").each(function(){s[parseInt(t(this).attr("data-entityid"),10)]=t(this)});for(const t of a)if(t.entityid in s)n._refresh_note_link(s[t.entityid].find(".fa-link"),t.is_linked),n._refresh_workflow_link(s[t.entityid].find(".fa-project-diagram"),t.is_workflow_linked);else{const e=i.find("tr").length;(n.is_editable()&&e<n.max_related_entities||t.is_linked||t.is_workflow_linked)&&n._get_related_entity_row(t,t.is_linked,t.is_workflow_linked).appendTo(i)}},_init_link_account_group:function(){var t=this,e=t.elm.find('div[id^="account-group"]');e.xplan_docnote_account_group(t.options.ajaxes.account_group_ajax),e.on("xevent_on_add_item",function(){t._reload_entities()})},_reload_entities:function(){function e(t){t?i.show():i.hide(),n.is_editable()&&(o.prop("disabled",t),a.prop("disabled",t))}var n=this,i=t("#entity_loading_eggtimer",n.elm),o=t("button.btn_add_entity",n.elm),a=t("button.btn_remove_entity",n.elm);e(!0),XMLRPC.call(n.options.ajax_rpcs.get_entities,[n.options.docid],function(t){n._handle_list_entities(t),e(!1)},function(t){HttpRequest.onerror(t),e(!1)})},_handle_add_remove_categories:function(){var e=this;if(XMLRPC.call("docnote.listCategoriesByDocumentId",[e.options.docid],function(t){e._handle_list_categories(t)},HttpRequest.onerror),!e.is_editable())return t("button.btn_add_category",e.elm).hide(),void t("button.btn_remove_category",e.elm).hide();var n=function(t){var n=t[t.length-1][0];XMLRPC.call("docnote.addDocumentCategory",[e.options.docid,n],function(t){e._data_changed=!0,e._handle_list_categories(t),e._update_container_data(e.options.docid)},HttpRequest.onerror)};t("button.btn_add_category",e.elm).click(function(t){var i=e.global_params.get_category_popup("Add Category",n);return PopupMenu.showByClick(i,t),!1}),t("button.btn_remove_category",e.elm).click(function(){var n=[];return t(".document_categories_tbl tbody",e.elm).find("input:checked").each(function(){n.push(t(this).val())}),XMLRPC.call("docnote.removeDocumentCategory",[e.options.docid,n],function(t){e._data_changed=!0,e._handle_list_categories(t),e._update_container_data(e.options.docid)},HttpRequest.onerror),!1})},_handle_list_categories:function(e){var n=t(".document_categories_tbl tbody",this.elm);if(0!==n.length){n.empty();for(var i=0;i<e.length;i++){var o=e[i],a=0,s=XPLAN.DateTimeUtil.strftime("%d %b %Y %H:%M",o.creat),_=n[0].insertRow(i);this.is_editable()&&t(_.insertCell(a++)).addClass("select").append('<input type="checkbox" value="'+o.catid+'"/>'),t(_.insertCell(a++)).text(o.branch),t(_.insertCell(a++)).text(o.creby),t(_.insertCell(a++)).text(s)}}},_handle_add_remove_subfund:function(){var e=this;if(XMLRPC.call("docnote.listSubfundsByDocumentId",[e.options.docid],function(t){e._handle_list_subfund(t)},HttpRequest.onerror),!e.is_editable())return t("button.btn_add_subfund",e.elm).hide(),void t("button.btn_remove_subfund",e.elm).hide();var n=t("div.add_subfund_dlg",e.elm);n.xplan_portfolio_account_search({include_all:!0,include_shared_owners:!1,trigger_change:!0}).on("change",function(){var t,i=n.xplan_portfolio_account_search("val").xplan_account_id;t=i,XMLRPC.call("docnote.addDocumentSubfund",[e.options.docid,t],function(t){e._data_changed=!0,e._handle_list_subfund(t[0]),e._handle_list_entities(t[1])},HttpRequest.onerror)}),t("button.btn_add_subfund",e.elm).click(function(){return t("div.add_subfund_dlg",e.elm).find(".portfolio_search_opener").click(),!1}),t("button.btn_remove_subfund",e.elm).click(function(){var n=[];return t(".document_subfund_tbl tbody",e.elm).find("input:checked").each(function(){n.push(parseInt(t(this).val(),10))}),XMLRPC.call("docnote.removeDocumentSubfunds",[e.options.docid,n],function(t){e._data_changed=!0,e._handle_list_subfund(t)},HttpRequest.onerror),!1})},_handle_list_subfund:function(e){var n=t(".document_subfund_tbl tbody",this.elm);if(0!==n.length){n.empty();for(var i=0;i<e.length;i++){var o=e[i],a=0,s=n[0].insertRow(i);this.is_editable()&&t(s.insertCell(a++)).addClass("select").append('<input type="checkbox" value="'+o.subfundid+'"/>'),t(s.insertCell(a++)).text(o.portfolio_name),t(s.insertCell(a++)).text(o.account_name)}}},_handle_client_access:function(){var e=this,n=function(n){t(n).is(":checked")?(e._get_elm("client_share_all").prop("disabled",!1),jQuery('[data-showatlogin="true"]').show(),jQuery('[data-shownotifyclient="true"]').show()):(e._get_elm("client_share_all").prop("checked",!1),e._get_elm("client_share_all").prop("disabled",!0),jQuery('[data-showatlogin="true"]').hide(),jQuery('[data-shownotifyclient="true"]').hide()),e.options.params.can_client_share_all||e._get_elm("client_share_all").prop("disabled",!0)};e._get_elm("accessible").click(function(){n(this)}),n(e._get_elm("accessible"))},_handle_edit_priv:function(){var e=this;t("a.btn_edit_priv").click(function(){return e._doc_priv.showEditPriv(!e.is_editable())})},_handle_lock_on_save:function(){var e=this,n=!1;e.options.params.can_lock_note||e._doc_priv.is_docnote_locked()||(n=!0),!e.options.params.can_unlock_note&&e._doc_priv.is_docnote_locked()&&(n=!0),e._get_elm("lock_note_on_save").prop("checked",e._doc_priv.is_docnote_locked()).prop("disabled",n).change(function(){var n=t(this).is(":checked");e._doc_priv.lock_docnote(n)})},_handle_checkout:function(){var e=this;e.is_new()&&e._get_elm("checkout").prop("disabled",!0),e._get_elm("checkout").click(function(){var n=t(this).is(":checked"),i=this;return XMLRPC.call(e.options.ajax_rpcs.checkout_document,[e.options.docid,n],function(o){o?(e.checkout.doc_checkoutat=o[1],e.checkout.doc_checkoutby=e.options.userid,t(i).siblings("span").html(o[0])):(t(this).prop("checked",!n),t(i).siblings("span:first").html("<em>%a</em>".replace("%a",XPLAN.util.escape(_("Not checked out")))))},function(e){t(this).prop("checked",!n),PopupMsgBox.show_error_text(e.message)}),!0})},_handle_permission:function(){this._get_elm("permission").change(function(){"3"==t(this).val()?t(this).parents("td:first").next("td").show():t(this).parents("td:first").next("td").hide()}).change()},_handle_visibility:function(){var e=this,n=function(n){t(n).is(":checked")?(t(".template_permission_div").show(),e._get_elm("template_permission").unbind("change").change(function(){e.options.share_with_all_toggled_on?"3"==t(this).val()?t(this).parents("td:first").next("td").show():t(this).parents("td:first").next("td").hide():"3"==t(this).val()?t(this).next("div").show():t(this).next("div").hide()}).change()):(t(".template_permission_div").hide(),e._get_elm("template_permission").unbind("change"))},i=e._get_elm("template_inherit");i.change(function(){n(this)}),n(i)},_handle_container:function(){if(this.options.params.has_feature_container&&this.options.docnote_container){var e=t(".docnote_container_panel",this.elm);t(".container_panel",this.elm).show(),XPLAN.docnote.container.set_data(this.options.docnote_container),XPLAN.docnote.container.display(e,this.is_editable())}else t(".container_panel",this.elm).hide()},load_from_template:function(e,n){var i=this,o=(i.elm,function(t){return i._get_elm(t)}),a={};(i.options.params.categoryid||""===i.options.params.categoryid)&&(a.categoryid=i.options.params.categoryid);var s=i.global_params.get_value("entityid");s&&s>0&&(a.entityid=s),a.entities=[];var _=t(".shared_entities_tbl tbody",i.elm);_.find(i.linked_note_spans).each(function(){a.entities.push(parseInt(t(this).attr("data-entityid"),10))}),_.find("input").each(function(){a.entities.push(parseInt(t(this).val(),10))}),i.options.params.extra_entityids&&i.options.params.extra_entityids.length>0&&a.entities.push.apply(a.entities,i.options.params.extra_entityids),a.docnote_container=i._get_container_data(),EggTimer.show(),XMLRPC.call(i.options.ajax_rpcs.load_from_template,[i.options.docid,n,a],function(e){EggTimer.hide();e.docid;"-"!=e.doctype&&jQuery('select[name="doctype"]').val(e.doctype).trigger("change"),e.docsubtype&&jQuery('select[name="docsubtype"]').val(e.docsubtype).change(),XPLAN.util.hasFeature("docnote_tag")&&(t('select[name="tag_ids"]',i.elm).val(e.tag_ids).trigger("liszt:updated"),i._handle_tags_tooltip(0)),i._init_accessible_fields(e),i._handle_add_remove_entity();var n={permission:!0,template_permission:!0};for(var a in e){var s=o(a);s.val(e[a]),n[a]&&s.trigger("change")}i._init_docparts();var _=["client_share_all","force_container"];for(var d in _){o(r=_[d]).prop("checked",e[r])}var l=["lock_note_on_save","template_inherit"];for(var d in l){var r;o(r=l[d]).prop("checked",e[r]).trigger("change")}if(XPLAN.DateField.setDate(o("refdate"),new Date),CKEDITOR.instances.content&&CKEDITOR.instances.content.setData?CKEDITOR.instances.content.setData(e.text_content):t('textarea[name="content"]',i.elm).val(e.text_content),i.options.params.has_feature_container&&e.docnote_container){var c=t(".docnote_container_panel",i.elm);t(".container_panel",i.elm).show(),XPLAN.docnote.container.set_data(e.docnote_container),XPLAN.docnote.container.display(c,i.is_editable())}else t(".container_panel",i.elm).hide();i.options.share_with_all_toggled_on&&i._init_template_inherit_permission()},HttpRequest.onerror)},_init_accessible_fields:function(e){const n=this,i=["accessible","referrer_accessible","profadviser_accessible"];t('[data-shownotifyclient="true"]').toggle(e.accessible),XPLAN.util.hasFeature("docnote_client_notification")?t('select[name="client_notification_setting"]').val(e.client_notification_setting).trigger("change"):i.push("notify_client"),i.forEach(t=>{n._get_elm(t).prop("checked",e[t])})},is_new:function(){return"new"===this.options.docid.substring(0,3)},is_tpl:function(){return this.options.data.is_template},is_editable:function(){return this.options.data.editable&&!this.options.data.published},is_dialog_closed:function(){return 0===t("div.docnote_edit_dialog").length&&0===t('div[data-xplan-elem="xplan_docnote_edit"]').length&&0===t('div[data-xplan-elem="xplan_docnote_edit_add_note_to_all"]').length},on_error:function(t){EggTimer.hide(),alert(t)},_get_editor:function(){return t('textarea[name="content"]').ckeditorGet()},_get_elm:function(e){return t(':input[name="'+e+'"]',this.elm)}};XPLAN.namespace("XplanAjax").createClass(i)}(jQuery),function(t){var e={parent_plugin_name:"xplan_docnote_edit",plugin_name:"xplan_docnote_edit_add_note_to_all",_after_update_data:function(t,e){var n=this;e.is_new_doc?PopupMsgBox.show_info_html(n._get_save_msg(),function(){n._check_redirect(t)}):n._check_redirect(t)},_get_save_msg:function(){return _("Docnote will be added to clients in the background.\nYou will be notified by the bell at the top right hand corner.")}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery),function(t){var e={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_docnote_docpart_list",create:function(t){var e=this;e.elm=t,e._load(),XPLAN.event.listen("docparts_"+e.options.docid,function(){e._load()})},_load:function(){var e=this;XMLRPC.call(e.options.ajax_rpcs.load,[e.options.docid],function(n){e.elm.html(n),e._handle_preview_and_download(),e.options.editable&&!e.options.published?(e._handle_upload(),e._handle_actions()):(t("button.btn_upload",e.elm).hide(),t(".icon-action",e.elm).hide()),e._handle_download(),t("table.list",e.elm).tablesorter({ignoreCase:!0,cssAsc:"sortable-asc",cssDesc:"sortable-des",cssHeader:"sortable",headers:{0:{sorter:!1}},textExtraction:function(e,n,i){var o=t(e),a=o.data("sorttext");return void 0!==a?a:o.text().trim()}})},HttpRequest.onerror)},_handle_preview_and_download:function(){var e=this;t("tbody tr",e.elm).each(function(){if(t(this).data("content")){var n=parseInt(t(this).find('input[name="docpartid"]').val(),10);t(this).css("cursor","pointer").single_double_click(function(){XPLAN.util.hasFeature("docnote_attachment_preview")&&e._open_preview(n)},function(){e._open_or_download(n,t(this).find("td")[0])})}})},_handle_actions:function(){var e=this;t("span.icon-action",e.elm).on("click",function(n){var i=t(this).data("deletable"),o=t(this).parents("tr:first").find('input[name="mimetype"]').val(),a=t(this).parents("tr:first").find('input[name="filename"]').val(),s=parseInt(t(this).parents("tr:first").find('input[name="docpartid"]').val(),10),_=t(this).parents("tr:first").data("content"),d=t(this).parents("tr:first").data("onedriveaccess"),l=e._get_menus(e._can_open(o,a),i,_,n,d);e.selected=s,PopupMenu.showByClick(l,n)})},_handle_download:function(){for(var e=t("span.icon-action",this.elm),n=t("span.icon-attachment",this.elm),i=0;i<e.length;i++)t(e[i]).parents("tr:first").data("content")?t(n[i]).click(this._click_download_icon.bind(this)):(t(n[i]).prop("title",_("File not available for download")),t(n[i]).prop("class","icon icon-info"),t(n[i]).prop("disabled",!0))},_click_download_icon:function(e){e.stopPropagation();var n=t(e.target),i=parseInt(n.siblings('input[name="docpartid"]').val(),10);this._open_or_download(i,n)},_open_preview:function(e){e=e||this.selected;var n={docnote_id:this.options.docid,docpart_id:e};XMLRPC.call("docnote.load_attachment_preview_ajax",[n],function(e){var n=XPLAN.ui.Popup.get_dialog("docnote-attachment-preview");n.xplan_docnote_preview_container(e);var i={resizable:!1,draggable:!1,width:t(window).width()-30,height:t(window).height()-30,left:"15px",top:"15px",modal:!0,dialogClass:"fixed-dialog"};n.dialog(i)})},_get_menus:function(t,e,n,i,o){var a=this,s="new"===a.options.docid.substring(0,3),d=0,l=[new PopupMenuItem(_("Download"),function(){a._download()},!n),new PopupMenuItem(_("Open in new window"),function(){a._open_selected()},!n),new PopupMenuItem(_("View meta data"),function(){a._view_meta()},s),new PopupMenuItem(_("Rename"),function(){a._rename()}),new PopupMenuSeparator,new PopupMenuItem(_("Delete"),function(){a._delete()},!e||!a.options.attach_deletable),new PopupMenuItem(_("Delete all"),function(){a._delete_all()},a.options.has_undeletable_digital_signature||!a.options.attach_deletable)];return o&&(l.push(new PopupMenuSeparator),l.push(new PopupMenuItem(_("Upload to OneDrive"),function(){a._upload_onedrive()},!n))),XPLAN.util.hasFeature("docnote_attachment_preview")?(l.unshift(new PopupMenuItem(_("Preview"),function(){a._open_preview()},!n)),l.splice(2,1),d+=1):t||l.splice(1,1),XPLAN.util.hasFeature("generate_certificate_from_note_attachment")&&(l=a._add_download_certificate_to_menu(l,d,i)),l},_add_download_certificate_to_menu:function(t,e,n){var i=this;if("1"===this._get_val_from_evt(n,"digital_signature_status")){var o=this._get_val_from_evt(n,"digital_signature_id"),a=-1!==this._get_val_from_evt(n,"digital_signature_signatories").indexOf(_("Entity not visible"));t.splice(e+1,0,new PopupMenuItem(_("Download with certificate"),function(){i._download_file_with_certificate(o)},a))}return t},_open_or_download:function(e,n){var i=t(n).parents("tr:first").find('input[name="mimetype"]').val(),o=t(n).parents("tr:first").find('input[name="filename"]').val();this._can_open(i,o)||this._is_video(i)?this._open_selected(e):this._download(e)},_can_open:function(t,e){return"text/plain"===t||e.match(/.mht$/i)||t.match(/^image\//)||this._is_video(t)},_download:function(t){t||(t=this.selected),XPLAN.attach.download_docpart(this.options.docid,t)},_download_file_with_certificate:function(t){var e="/digital_signature/certificate/"+XPLAN.util.escape(t,"jsq"),n=XPLAN.util.getURL(e,{include_original:1},!0);XPLAN.util.deviceSpecificDownload(n)},_get_val_from_evt:function(e,n){var i=t(e.target).closest("td").find('input[name="'+n+'"]').first();return i.length>0?i.val():null},_is_video:function(t){return t.match(/^video\//)},_open_selected:function(e){e||(e=this.selected);var n=t("tr.tr_"+String(e)),i=n.find('input[name="mimetype"]').val(),o=n.find('input[name="filename"]').val(),a=!1;(i.match(/^text\//)||o.match(/.mht$/i))&&(a=!0);var s="height=580,width=800,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars="+(a?"yes":"no")+",resizable=yes,border=no",_=this._is_video(i)?"view_video":"files",d=getBaseURL()+"/docnote/"+_+"/"+this.options.docid+"/"+e+"/"+o;XPLAN.util.isAppleMobileDevice()&&!this._is_video(i)?XPLAN.util.download(d):window.open(d,"document_part",s)},_upload_onedrive:function(t){t||(t=this.selected),XMLRPC.call(this.options.ajax_rpcs.upload_onedrive,[this.options.docid,t],function(t){1==t.success?alert(_("Your document is being uploaded as a background job. When the document is finished uploading to OneDrive, you will be notified via the bell icon.")):alert(_("There was an issue with your upload. ")+t.info)},HttpRequest.onerror)},_view_meta:function(e){var n=this;e||(e=n.selected);"new"!==n.options.docid.substring(0,3)&&XMLRPC.call(n.options.ajax_rpcs.get_docpart_metadata,[n.options.docid,e],function(e){var i=t(".dlg-metadata",n.elm);if(0===i.length?i=t('<div class="dlg-metadata"></div>').appendTo(n.elm):i.empty(),0===e.length)t('<tr colspan="2">'+"<td>%a</td>".replace("%a",XPLAN.util.escape(_("No meta data found")))+"</tr>").appendTo(i);else for(var o=0;o<e.length;o++)t("<tr>"+"<td>%a</td>".replace("%a",XPLAN.util.escape(e[o][0]))+"<td>%a</td>".replace("%a",XPLAN.util.escape(e[o][1]))+"</tr>").appendTo(i);i.dialog({title:_("View Meta Data"),modal:!0,height:250,width:400})},HttpRequest.onerror)},validate_filename:function(t){return t.length<1?(alert('Error:\nField "New attachment name": Required and cannot be blank.'),!1):!/[;/:?\\]/.test(t)||(alert('Error:\nField "New attachment name": Cannot contain illegal characters (;/:?).'),!1)},_rename:function(e){var n=this;e||(e=n.selected);var i="."+document.querySelector(`[data-docpartid='${e}'] input[name='filename']`).value.split(".").pop();XMLRPC.call("docnote.set_filename_dialog",[i],function(o){var a=t("div.docnote_attachment_rename_dialog",n.elm);0===a.length?a=t('<div class="docnote_attachment_rename_dialog"></div>').appendTo(n.elm):a.empty(),a.html(o.html),a.dialog({title:XPLAN.util.escape(_("Edit attachment name")),resizable:!1,buttons:[{text:_("Cancel"),click:function(){a.dialog("close")},"data-xplan-elem":"docnote_attachment_rename_cancel_button"},{text:_("Ok"),click:function(){var t=jQuery("#new_attachment_name").val();n.validate_filename(t)&&XMLRPC.call("docnote.set_filename",[n.options.docid,e,t+i],function(){a.dialog("close"),n._load()},HttpRequest.onerror)},"data-xplan-elem":"docnote_attachment_rename_okay_button"}],close:function(){a.dialog("destroy")},modal:!0})},HttpRequest.onerror)},_delete:function(t){var e=this;t||(t=e.selected);PopupMsgBox.show_confirm_text(_("Are you sure that you want to delete this document note attachment permanently?"),function(n){n!=_("Yes")&&"Yes"!=n||XMLRPC.call("docnote.removeDocumentPart",[e.options.docid,t],function(){e._load()},HttpRequest.onerror)})},_delete_all:function(){var t=this;PopupMsgBox.show_confirm_html("<p>"+XPLAN.util.escape(_("Are you sure that you want to delete ALL the attachments belonging to this document note permanently?"))+"</p>",function(e){e!=_("Yes")&&"Yes"!=e||XMLRPC.call("docnote.removeAllDocumentParts",[t.options.docid,!1],function(){t._load()},HttpRequest.onerror)})},_handle_upload:function(){var e=this,n=t("button.btn_upload",e.elm).get(0);if(n){e.options.max_file_size&&t('<span style="float:left;"></span>').html(XPLAN.util.escape(_(`Max file size: ${e.options.max_file_size}MB`),"xmlq")).prependTo(this.elm.find("div.buttonbar"));var i=new qq.FileUploader({element:t('div[data-name="file-uploader-panel"]')[0],button:n,action:getBaseURL()+"/docnote/upload_docpart",params:{name:"docpart",docid:e.options.docid},sizeLimit:e.options.max_file_size?1024*e.options.max_file_size*1024:0,onSubmit:function(){e._disable_save_and_close_buttons(!0)},onComplete:function(t,n,o){e._load(),0===i.getInProgress()&&e._disable_save_and_close_buttons(!1)},onError:function(t,n,i){var o=XPLAN.json.decode(i.response),a=[_("Error:"),o?o.errormsg:i.response].join(" ");alert(a),e._disable_save_and_close_buttons(!1)},onSizeValidationFailure:function(t,n){XMLRPC.call(e.options.ajax_rpcs.log_attachment_over_limit,[t,n],()=>{},()=>{})}})}},_disable_save_and_close_buttons:function(e){t(".btn_save, .btn_savenew, .btn_save_and_close").prop("disabled",e),e?t(".ui-dialog-titlebar-close").hide():t(".ui-dialog-titlebar-close").show()}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery);
;Dependency._js['docnote/ajax_edit']=true;

;
function DependElement(e,d,n,i){this.name=e,this.isMulti=d.length>1,this.ele=this.isMulti?d:d[0],this.field=n,this.isPartner=i}function ufield_dependance_change(e){if(e=jQuery.event.fix(e)){var d=e.currentTarget||e.srcElement||e.originalEvent.srcElement;if(d){d=d.getAttribute("name");var n=ufield_depend.name_dict[d];ufield_depend.prefix=n[0],n=n[1];var i=d.split(":"),l="";i.length>=3&&("0"==(l=i[2])&&(l=""),""!=l&&(l=":"+l+":")),ufield_depend.adjustDepend(n,l),ufield_depend.adjustDefault(n,l),ufield_depend.adjustVisibility(n,l)}}}function ufield_dependance_force_change(e){var d=ufield_depend.name_dict[e];if(d){ufield_depend.prefix=d[0],d=d[1];var n=e.split(":"),i="";n.length>=3&&("0"==(i=n[2])&&(i=""),""!=i&&(i=":"+i+":")),ufield_depend.adjustDepend(d,i),ufield_depend.adjustDefault(d,i)}}DependElement.prototype.connect=function(e){if(this.isMulti){let d=this.ele.length;for(let n=0;n<d-1;n++)XPLAN.event.connect(this.ele[n],"change",e);jQuery(this.ele[0]).off("toggle_content").on("toggle_content",function(d){e(d)})}else XPLAN.event.connect(this.ele,"change",e)};var ufield_depend={defaultnone:{},addDefaultNone:function(e){ufield_depend.defaultnone[e]=1},getElementRaw:function(e,d){var n=ufield_depend.prefix+e+d,i=document.getElementsByName(n);return i&&i.length>0?new DependElement(n,i,e,d):null},getElement:function(e,d){var n=ufield_depend.getElementRaw(e,d);if(n)return n;if(""==d&&(d=":0:",n=ufield_depend.getElementRaw(e,d)))return n;for(var i=0;i<2;i++)if(n=ufield_depend.getElementRaw(e,d+i))return n;return null},isMulti:function(e){return!(!e||void 0!=e.tagName)},clearField:function(e){if(e)for(;e.options.length>0;)e.remove(0)},reconstruct:function(e,d,n,i){var l=ufield_depend.uds[e][n],t=ufield_depend.getElement(n,i),u=ufield_depend.getElement(e,i);if(u&&(u=u.ele),t.isMulti){if(_=l.depends){var f=[];for(var a in l.items){!(m=_[(c=l.items[a])[0]])&&""!=m&&u&&u.options&&u.options.length>0&&(m=u.options[0].value),XPLAN.util.isArray(m)||(m=[m]);for(a=0;a<m.length;a++)if(m[a]==d){f.push(c[0]);break}}t=t.ele;for(a=0;a<t.length;a++){var r=t[a];if("__empty__"!=r.value){var s=XPLAN.util.inArray(r.value,f),p=r.parentElement;"SPAN"==p.tagName&&(p.style.display=s?"":"none",s||(r.checked=!1))}}}}else{var _,o=(t=t.ele).selectedIndex>=0?t.options[t.selectedIndex].value:null;if(ufield_depend.clearField(t),1!=l.required){var v=document.createElement("OPTION");jQuery(v).appendTo(jQuery(t))}if(_=l.depends){for(var a in l.items){var c,m;!(m=_[(c=l.items[a])[0]])&&""!=m&&u&&u.options&&u.options.length>0&&(m=u.options[0].value),XPLAN.util.isArray(m)||(m=[m]);for(var a=0;a<m.length;a++)if(m[a]==d){v=document.createElement("OPTION");jQuery(v).val(c[0]).text(c[1]).appendTo(jQuery(t)),o==c[0]&&v.setAttribute("selected","selected");break}}XPLAN.event.dispatch(t,"change")}}},initElementFromDefaultValue:function(e,d){var n=ufield_depend.prefix+e;n+=""==d?":0:":d;var i=ufield_depend.getDefaultValue(n);if(null!==i&&ufield_depend.uds[e])for(var l in ufield_depend.uds[e]){ufield_depend.getElement(l,d)&&ufield_depend.reconstruct(e,i,l,d)}},adjustDepend:function(e,d){var n=ufield_depend.getElement(e,d);if(n&&ufield_depend.uds[e])for(var i in ufield_depend.uds[e]){if(ufield_depend.getElement(i,d)&&n&&n.ele.options){var l=n.ele;if(l.options.length>0){var t=l.selectedIndex>=0?l.selectedIndex:0,u=l.options[t].value;ufield_depend.reconstruct(e,u,i,d)}}}},adjustVisibility:function(e,d){var n=ufield_depend.getElement(e,d);if(n&&ufield_depend.uvds[e])for(var i in ufield_depend.uvds[e]){var l=ufield_depend.getElement(i,d),t=ufield_depend.uvds[e][i].depends[n.ele.value];void 0==t?window.FieldConditions&&FieldConditions.isFieldUnderEditableCondition(n.ele)||ufield_depend.setVisibility(l,"1"):ufield_depend.setVisibility(l,t.value)}},hideElem:function(e){e.hide(),XPLAN.util.hasFeature("disable_hidden_depends_elements")&&e.prop("disabled",!0)},showElem:function(e){e.show(),XPLAN.util.hasFeature("disable_hidden_depends_elements")&&e.prop("disabled",!1)},hideFieldByEditableCondition:function(e,d,n){e=jQuery(e);var i=!1;for(var l in ufield_depend.uvds){var t=ufield_depend.getElement(l,"");if(t)for(var u in ufield_depend.uvds[l]){var f=ufield_depend.getElement(u,"");if(f.name==d){i=!0;var a=ufield_depend.uvds[l][u].depends[t.ele.value];return void 0==a?void(n?this.showElem(e):this.hideElem(e)):void ufield_depend.setVisibility(f,a.value)}}}i||(n?this.showElem(e):this.hideElem(e))},setVisibility:function(e,d){if(e){var n=e.ele;if(n){var i=(n=jQuery(n)).closest("td"),l=n.closest("tr");void 0!=d&&("0"===d?(this.hideElem(i.children()),0===l.children("td").children(":enabled").length&&this.hideElem(l)):(i.children().each(function(e,d){var n=jQuery(d);(!n.is("textarea")||"hidden"!=n.css("visibility")||1!==n.next('span[id^="cke_"]').length&&1!==n.next('div[id^="cke_"]').length)&&this.showElem(n)}.bind(this)),this.showElem(l)))}}},setDefault:function(e,d){if(e){var n=e.ele;if(void 0!=d)if(e.isMulti)for(var i=0;i<n.length;i++){var l=n[i],t=l.parentElement;"__empty__"==l.value||(t&&"none"==t.style.display?l.checked=!1:l.checked=XPLAN.util.inArray(l.value,d))}else if("checkbox"===n.type&&(n.checked="1"==d),n.value=d,n){if("undefined"!=typeof CKEDITOR&&CKEDITOR.instances[e.name]){var u=jQuery(n).ckeditorGet();u&&u.setData(n.value)}XPLAN.event.dispatch(n,"change")}}},handleLoadDefaults:function(e){ufield_depend.getElement(e.field,e.index);var d=ufield_depend.udds[e.field];if(d)for(i in e.result)if(d[i]&&d[i].depends){var n=d[i].depends[e.value];if(n&&"0"==n.load){var l=ufield_depend.getElement(i,e.index);n.load="1",n.value=e.result[i],ufield_depend.setDefault(l,n.value)}}},loadDefaults:function(e,d,n,i){var l=new HttpRequest;try{l.callRPC("ufield.loadDefaultOptionValue",[ufield_depend.group,e,d,n,i],ufield_depend.handleLoadDefaults)}catch(e){alert(_("Error: %a").replace("%a",e.message))}},adjustDefault:function(e,d){var n=ufield_depend.getElement(e,d),i=[];let l="";if(n&&ufield_depend.udds[e])for(var t in ufield_depend.udds[e]){var u=ufield_depend.getElement(t,d);if(n.isMulti){let d,i=[];for(let l=0;l<n.ele.length-1;l++)(d=n.ele[l]).checked&&i.push(ufield_depend.udds[e][t].depends[d.value]);if(0===i.length)ufield_depend.setDefault(u,"");else{let e=[];for(let d of i)"1"===d.load&&e.push(d.value);if(u){let d="textarea"===u.ele.type?e.join("\n"):e.join();l="textarea"===u.ele.type?u.ele.value:jQuery(u.ele).val(),ufield_depend.init_flag&&null!==l&&void 0!==l||ufield_depend.setDefault(u,d)}}}else{var f=ufield_depend.udds[e][t].depends[n.ele.value];void 0==f?ufield_depend.setDefault(u,""):"1"==f.load?u&&(l="textarea"==u.ele.type?u.ele.value:jQuery(u.ele).val(),ufield_depend.init_flag&&null!=l&&void 0!=l||ufield_depend.setDefault(u,f.value)):ufield_depend.init_flag||i.push(t)}}i.length>0&&ufield_depend.loadDefaults(e,n.ele.value,i,d)},restoreDefaultByCategory:function(e,d,n){var i=ufield_depend.getElement(e,n);if(i&&ufield_depend.udds[e])for(var l in ufield_depend.udds[e]){var t=ufield_depend.getElement(l,n);if(t.name==d){var u=ufield_depend.udds[e][l].depends[i.ele.value];return void(void 0==u?ufield_depend.setDefault(t,""):"1"==u.load?ufield_depend.setDefault(t,u.value):ufield_depend.loadDefaults(e,i.ele.value,[l],n))}}},getDefaultValue:function(e){return null!==ufield_depend.default_value&&e in ufield_depend.default_value?ufield_depend.default_value[e]:null},init_element:function(e,d,n){var i=ufield_depend.getElement(e,d);i?(ufield_depend.name_dict[i.name]=[ufield_depend.prefix,e],n&&ufield_depend.adjustDepend(e,d),i.connect(ufield_dependance_change)):n&&ufield_depend.initElementFromDefaultValue(e,d)},init_element_vis:function(e,d){var n=ufield_depend.getElement(e,d);n&&(ufield_depend.name_dict[n.name]=[ufield_depend.prefix,e],ufield_depend.adjustVisibility(e,d),n.connect(ufield_dependance_change))},sort_depends:function(e){var d=[],n=[];for(var i in e)for(var l in e[i])e[l]||n.push(l);var t={};return jQuery.each(n,function n(i,l){if(1==t[l]);else{for(var u in t[l]=!0,e)for(var f in e[u])f===l&&n(0,u);d.push(l)}}),d},readjust_element_vis:function(e,d){var n=ufield_depend.getElement(e,d);n&&(ufield_depend.name_dict[n.name]=[ufield_depend.prefix,e],ufield_depend.adjustVisibility(e,d))},readjust_vis:function(){var e=ufield_depend.sort_depends(ufield_depend.uvds);for(var d in e)ufield_depend.readjust_element_vis(e[d],""),ufield_depend.readjust_element_vis(e[d],":1:"),ufield_depend.readjust_element_vis(e[d],":3:"),ufield_depend.readjust_element_vis(e[d],":4:")},init:function(){ufield_depend.init_flag=!0;var e=ufield_depend.sort_depends(ufield_depend.uds);for(var d in e)ufield_depend.init_element(e[d],"",!0),ufield_depend.init_element(e[d],":1:",!0),ufield_depend.init_element(e[d],":3:",!0),ufield_depend.init_element(e[d],":4:",!0);var n=ufield_depend.sort_depends(ufield_depend.udds);for(var d in n)ufield_depend.init_element(n[d],"",!1),ufield_depend.init_element(n[d],":1:",!1),ufield_depend.init_element(n[d],":3:",!1),ufield_depend.init_element(n[d],":4:",!1);var i=ufield_depend.sort_depends(ufield_depend.uvds);for(var d in i)ufield_depend.init_element_vis(i[d],""),ufield_depend.init_element_vis(i[d],":1:"),ufield_depend.init_element_vis(i[d],":3:"),ufield_depend.init_element_vis(i[d],":4:");ufield_depend.init_flag=!1}};
;Dependency._js['ufield_depend']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("ajax/ajax"),Dependency.addJS("popup")),function(t){var e=XPLAN.Model.factory.createClass({properties:{hide_on_create:!0,methods:null,init_plugin_elem:function(){this.config=this.methods.options.config.display_style,void 0===this.config.height_control&&(this.config.height_control="parent"),this.hide_on_create&&this.methods.hide()},show_elem:function(){this.methods.$el.show()},hide_elem:function(){this.methods.$el.hide()},action_success:function(t){var e={notify:function(t){(void 0!==t.msg||""!==t.msg)&&("alert"===t.style?alert(t.msg):XPLAN.framemain.alert(t.msg))},reload_page:function(t){t.style="alert",this.notify(t),XPLAN.util.reload()}},i=this.methods.$('button[data-action="'+t+'"]');i.data("autoclose")&&this.hide_elem();var o=i.data("success");if(void 0!==o)for(var n=o.action_sequence,a=0;a<n.length;a++)e[n[a]](o[n[a]])}}}),i=(XPLAN.Model.factory.createClass({parentClass:e,registryName:"page",properties:{hide_on_create:!1}}),XPLAN.Model.factory.createClass({parentClass:e,registryName:"dialog",properties:{is_dialog_created:function(){return this.methods.$el.hasClass("ui-dialog-content")},show_elem:function(){if(!this.is_dialog_created()){var e={};t.extend(!0,e,this.config,{title:XPLAN.util.escape(this.methods.options.config.title)}),t(this.methods.$el).dialog(e)}this.methods.$el.dialog("open")},hide_elem:function(){this.is_dialog_created()?this.methods.$el.dialog("close"):e.prototype.hide_elem.apply(this)}}}),XPLAN.Model.factory.createClass({parentClass:e,registryName:"slideout",slideout:null,properties:{init_plugin_elem:function(){var t=this;e.prototype.init_plugin_elem.apply(this),this.methods.$('div[data-panel="main"] h2 a.close').on("click",function(){t.hide_elem()})},show_elem:function(){this.slideout||(this.slideout=XPLAN.ui.getSlideOutPanel(this.methods.$el.parent(),this.methods.$el));var t=this.methods.$el.parent().height();"content"===this.config.height_control&&(t=this.methods.$el.height()),this.methods.$('div[data-panel="main"]').height(t),"bottom"==this.methods.options.config.action_config.position&&this.methods.$("div.buttonbar:last").css({position:"absolute",right:3,bottom:0}),this.slideout.show(this.config)},hide_elem:function(){this.slideout?this.slideout.hide(this.config):e.prototype.hide_elem.apply(this)}}}),{parent_plugin_name:"xplan_ajax",plugin_name:"xplan_div_panel",public_method_requires_elem:!1,clean_before_reload:!1,reload_before_create:!1,_get_data:function(){return XPLAN.util.elem2object(this.$('div[data-panel="main"]:first'))},events:function(){return{"change select":"_data_changed"}},_data_changed:function(e){var i=t(e.target);this.options.on_data_changed&&!this.options.on_data_changed(i.attr("name"),i.val())||this._handle_data_changed&&this._handle_data_changed(e)||this.options.config.reload_when_data_change&&this.reload()},set_on_action_performed:function(t){this.options.on_action_performed=t},_do_action:function(t,e,i){var o=this,n=function(i){var n=o["_handle_action_"+t]?"_handle_action_"+t:"_handle_action",a=o[n](i,t);!a&&e&&(a=e(i)),!a&&o.options.on_action_performed&&(a=o.options.on_action_performed(t)),a||o.display_style.action_success(t)};this.options.on_action&&!this.options.on_action(t)||(i?n(void 0):this.connection.call("action",[t,this.options.config,this._get_data()]).done(n).fail(function(t){alert(t)}))},_handle_action:function(t,e){},_render_finalised:function(){},_render:function(e){var i=this;this.options.template&&(this.$el.html(this.options.template),this.options.template="",this.$("button[data-action]").on("click",function(){var e=t(this);i._handle_before_action(e,function(){var t=e.data("action");i._do_action(t,void 0,e.data("no_auto_rpc"))})})),this._render_finalised(),this.options.on_after_rendered&&this.options.on_after_rendered(this.$el)},_handle_before_action:function(e,i){var o=t(e).data("action");void 0!==this["_handle_before_action_"+o]&&this["_handle_before_action_"+o](e,i),this._handle_before_action_default(e,i)},_show_confirm_text:function(e,i,o){var n=t(e).data("confirm_title");void 0===n&&(n=_("Confirm"));var a,s=t(e).data("confirm_button_yes_text"),h=t(e).data("confirm_button_no_text"),d=_("Yes");s&&h&&(a=[["yes",s],["no",h]],d=s),PopupMsgBox.show_confirm_text(i,function(t){t==d&&o()},400,n,void 0,a)},_handle_before_action_default:function(e,i){if(t(e).data("confirm")){var o=t(e).data("confirm_text");void 0!==i?this._show_confirm_text(e,o,i):confirm(o)&&i()}else i()},get_html_data:function(){return this._get_data()},get_config:function(){return this.options.config},get_obj:function(){return this.options.obj},reload:function(){var e=this,i=this._get_data();this.clean_before_reload&&this.$el.html(""),this.connection.call("reload",[this.options.config,i]).done(function(i){t.extend(e.options,i),e._render()})},set_html_field_value:function(t,e){this.$(':input[name="'+t+'"]').val(e)},create:function(i){if(this.connection.auto_eggtimer=!0,this.display_style=e.getInstance(this.options.config.display_style.style,{methods:this},!0),this.display_style.init_plugin_elem(),this.reload_before_create){var o=this;this.connection.call("reload",[this.options.config,this.options.obj]).done(function(e){t.extend(o.options,e),o._before_created(),o._render()})}else this._before_created(),this._render()},_before_created:function(){},show:function(){this.display_style.show_elem()},hide:function(){this.display_style.hide_elem()},toggle:function(t){t?this.show():this.hide()}});XPLAN.namespace("XplanAjax").createClass(i)}(jQuery);
;Dependency._js['ajax/div_panel']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS("ajax/div_panel"),function(n){var e={parent_plugin_name:"xplan_div_panel",plugin_name:"xplan_client_summary",_render_finalised:function(){var n=this;this.$("button.switch-btn").on("click",function(){n._switch_view()}),this._get_data().entity_id>0&&this.show()},_switch_view:function(){var e=this,i=this._get_data();this.clean_before_reload&&this.$el.html(""),this.connection.call("switch_view",[this.options.config,i]).done(function(i){n.extend(e.options,i),e._render()})}};XPLAN.namespace("XplanAjax").createClass(e)}(jQuery);
;Dependency._js['factfind/ajax/entity_summary']=true;

;
function showClient(e,t){showEntity(e,"client",t)}function showEntity(e,t,n,i,a){var o="/factfind/view/"+e+"?role="+t+"&refresh=1";n&&(o+="&page="+encodeURIComponent(function(e,t){return{"client,contact":"client_contact"}[e+","+t]||t}(t,n))),i&&(o+="&stack="+encodeURIComponent(i)),a&&(o+="&back_url="+encodeURIComponent(a)),getMainFrame(getBaseURL()+o)}function showReportCategory(e,t){showEntity(e,"reportcat",t)}function showReportTemplate(e,t){showEntity(e,"reporttpl",t)}function showUser(e,t,n,i){showEntity(e,"user",t,n,i)}function showGroup(e,t){showEntity(e,"group",t)}function showProduct(e,t){var n="/portfolio/products/details?c="+e+"&e="+t;getMainFrame(getBaseURL()+n)}function EntitySelector(e,t,n,i,a,o){i&&(this.EntityEvent=new i(this)),e=jQuery(e).append('<div class="entity-selector"/>').children("div:last").data("entity-selector",this);var l=this;return this._searchable=null===a||void 0===a||a,this._searchable&&(this.input=e.append('<input type="text"/>').children("input:last").focus(function(){l._onSearchFocus()}).keypress(function(e){l._onSearchKeyPress(e)})),this.constant_items=[],this._constant_items_hash={},this.current_data=[],this.select=e.append("<select/>").children("select:last").change(function(){"0"!=this.value&&(l.text=this.options[this.selectedIndex].text,l.value=parseInt(this.value,10),l.onchange&&l.onchange())}),t&&this.select.attr("name",t),this.EntityEvent&&this.EntityEvent.registerSelectChange(this.select.get(0)),this._searchable&&(this.select.hide(),this.icon=e.append('<span data-xplan-elem="entity_search_button"/>').children("span:last").click(function(){EntitySelector._onIconClick(l)}).dblclick(function(){EntitySelector._onIconDblClick(l)})),this.setEntityType(n),this.onchange=null,this.parentelm=e,this._createnewURL=o,this._createnewURL&&jQuery(e).append('<a class="button"/>').children("a:last").attr("href",this._createnewURL).css("padding-left","2ex").text(_("Create New")),this}function etypeMap(e){return all_types={client:_("client"),user:_("user"),group:_("group"),referral:_("referrer"),profadviser:_("profadviser"),supplier:_("supplier"),individual:_("individual"),company:_("company")},"undefined"===all_types[e]?e:all_types[e]}"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("framemain"),Dependency.addJS("table"),Dependency.addJS("xcampaign"),Dependency.addJS("popup"),Dependency.addJS("factfind_entity_search"),Dependency.addJS("docnote/params"),Dependency.addJS("docnote/ajax_edit"),Dependency.addJS("ufield_depend"),Dependency.addJS("factfind/ajax/entity_summary"),Dependency.addJS("datefield")),FactFind={clientmenu:null,groupmenu:null,usermenu:null,entityid:null,entityrole:null},FactFind.isValidEntityId=function(e){return e=parseInt(e,10),!isNaN(e)&&e>0},FactFind.emailClient=function(){getMainFrame(getBaseURL()+"/email/edit?new=client&add_to_note=1&client="+FactFind.entityid)},FactFind.emailAllInClientGroup=function(){getMainFrame(getBaseURL()+"/email/edit?new=client&add_to_note=1&clientgroup=1&client="+FactFind.entityid)},FactFind.emailAllInClientGroupInclPartner=function(){getMainFrame(getBaseURL()+"/email/edit?new=client&add_to_note=1&clientgroup=1&inclpartner=1&client="+FactFind.entityid)},FactFind.emailUser=function(){getMainFrame(getBaseURL()+"/email/edit?new=user&add_to_note=1&client="+FactFind.entityid)},FactFind.emailAllInUserGroup=function(){getMainFrame(getBaseURL()+"/email/edit?new=user&add_to_note=1&clientgroup=1&client="+FactFind.entityid)},FactFind.addClientDiary=function(){getMainFrame(getBaseURL()+"/diary/event/edit/-1?choice=my&client="+FactFind.entityid)},FactFind.addClientDiarySlot=function(){getMainFrame(getBaseURL()+"/diary/searchslot?client="+FactFind.entityid)},FactFind.addClientNote=function(){window.parent?window.parent.FactFind.addNote({entityid:FactFind.entityid}):FactFind.addNote({entityid:FactFind.entityid})},FactFind.addClientTask=function(){getMainFrame(getBaseURL()+"/xtasks/edit/-1?new=1&clientid="+FactFind.entityid+"&entityid="+FactFind.entityid+"&option=client")},FactFind.addClientCampaign=function(){var e={entityid:FactFind.entityid,source:XCampaigner.SOURCE_CLIENTLIST,multiclients:0};XCampaigner.getAvailableCampaigns(e)},FactFind.addClientInvoice=function(){getMainFrame(getBaseURL()+"/invoicing/edit_invoice/-1?set_entityid="+FactFind.entityid)},FactFind.addClientInvoiceRecur=function(){getMainFrame(getBaseURL()+"/invoicing/edit_recur/-1?set_entityid="+FactFind.entityid)},FactFind.addAllClientsCampaign=function(e){var t={entityid:-1,source:e||XCampaigner.SOURCE_CLIENTLIST,multiclients:1};XCampaigner.getAvailableCampaigns(t)},FactFind.addAllUsersCampaign=function(){var e={entityid:-1,source:XCampaigner.SOURCE_USERLIST,multiclients:1};XCampaigner.getAvailableCampaigns(e)},FactFind.addAllProfAdvisorsCampaign=function(){var e={entityid:-1,source:XCampaigner.SOURCE_PROFADVISERLIST,multiclients:1};XCampaigner.getAvailableCampaigns(e)},FactFind.addClientThread=function(){getMainFrame(getBaseURL()+"/xtasks/editthread/-1?new=1&clientid="+FactFind.entityid+"&entityid="+FactFind.entityid+"&option=client")},FactFind.loadEditAjaxParams=function(e){return e},FactFind.addNote=function(e,t,n){const i=window.parent&&window.parent.jQuery?window.parent.jQuery:window.jQuery;XMLRPC.call("docnote.load_edit_ajax",["new",FactFind.loadEditAjaxParams(e)],function(a){var o=i("div.docnote_edit_dialog");0===o.length?o=i('<div class="docnote_edit_dialog"></div>').appendTo(i("body")):o.empty(),XPLAN.util.update(a,e),a.view_params=e,a.params&&(a.params.categoryid=""),t&&(a.onclose=t),n&&(a.on_save=n),o.xplan_docnote_edit(a)})},FactFind.editNote=function(e,t,n,i){XMLRPC.call("docnote.load_edit_ajax",[e,FactFind.loadEditAjaxParams(i)],function(e){var a=jQuery("div.docnote_edit_dialog");0===a.length?a=jQuery('<div class="docnote_edit_dialog"></div>').appendTo(jQuery("body")):a.empty(),t&&(e.onclose=t),n&&(e.on_save=n),"undefined"!=typeof i&&(e.view_params=i),a.xplan_docnote_edit(e)})},FactFind.addEntityLookup=function(e){function t(e,t){if(e){var n=e.replace(/[=:]/g,"_"),i=jQuery("#span_"+n+":first");1===i.length&&jQuery('<div id="'+t+'"></div>').appendTo(i)}}if(FactFind._loadEntityLookup(),e.field_id)XPLAN.event.queue("factfind/entitylookup",function(){FactFind.entitylookup.setupField(e)});else{FactFind.entitylookup.options||(FactFind.entitylookup.options=[]);var n=FactFind.entitylookup.options.length,i=jQuery('div[id^="entitylookup-select-"]').length;e.field_id="entitylookup-select-"+Math.max(n,i),jQuery.isReady?(t(e.name,e.field_id),XPLAN.event.queue("factfind/entitylookup",function(){FactFind.entitylookup.setupField(e)})):(document.write('<div id="'+e.field_id+'"></div>'),FactFind.entitylookup.options.push(e),t(e.name,e.field_id))}return e.field_id},FactFind.doEntityLookup=function(e){FactFind._loadEntityLookup(),XPLAN.event.queue("factfind/entitylookup",function(){FactFind.entitylookup.show(e)})},FactFind.setEntityLookupOption=function(e,t){FactFind._loadEntityLookup(),XPLAN.event.queue("factfind/entitylookup",function(){FactFind.entitylookup.setOption(e,t)})},FactFind.resetEntityLookup=function(e){FactFind._loadEntityLookup(),XPLAN.event.queue("factfind/entitylookup",function(){FactFind.entitylookup.resetInput(e)})},FactFind.findEntityLookupElemByName=function(e,t){t&&(FactFind._loadEntityLookup(),XPLAN.event.queue("factfind/entitylookup",function(){var n=jQuery('input[name="'+e+'"][type="hidden"]:first').siblings(".entitylookup-select:first");t(n)}))},FactFind._loadEntityLookup=function(){return!!FactFind.entitylookup||(FactFind.entitylookup={},XPLAN.util.loadScript("/js/factfind/entitylookup.js"),!1)},FactFind.addRoleMenu=function(e,t,n){var i;try{i=XMLRPC.call("factfind.getPageMenu",[t,n])}catch(t){return void e.push(new PopupMenuItem(_("Entity not visible"),null,!0))}FactFind.addRoleMenu2(e,i)},FactFind.addRoleMenu2=function(e,t,n){var i;void 0===n&&(n=FactFind.handleMenuAction);for(var a=0;a<t.length;a++){var o=t[a];if(o.page)(i=new PopupMenuItem(o.title,n)).page=o.page,i.link_target=o.target?o.target:XPLAN.util.get_top_frame_target();else{if(!o.submenu)continue;var l=[];FactFind.addRoleMenu2(l,o.submenu,n),i=new PopupMenu(l,o.title)}e.push(i)}},FactFind.handleMenuAction=function(){var e=new String(this.page);e.match(/^\/frame/)||e.match(/^\//)?window.open(getBaseURL()+e,this.link_target):e.match(/^https?:\/\//)?this.link_target?window.open(e,this.link_target):window.open(e,"_blank"):showEntity(FactFind.entityid,FactFind.entityrole,e)},FactFind.handleShowEntitySummary=function(e,t){var n,i,a="";for(n=0;n<t.fields.length;n++){var o=t.fields[n].title;i=t.fields[n].value,a+='<tr><td nowrap="nowrap" align="right"><b>'+XPLAN.util.escape(o)+'</b>:</td><td nowrap="nowrap">'+XPLAN.util.escape(i)+"</td></tr>"}if(t.contact.length>0||0===t.fields.length)for(t.fields.length>0&&(a+='<tr><td colspan="2">&nbsp;</td></tr>'),a+='<tr><td colspan="2" style="border-bottom:#666 solid 1px"><b>Contact Details</b></td></tr>',n=0;n<t.contact.length;n++){var l=t.contact[n].preferred,c=t.contact[n].type;i=t.contact[n].value,a+='<tr><td nowrap="nowrap" align="right"><b>'+c+'</b>:</td><td nowrap="nowrap">',a+=l?"<i>"+i+"</i>":i,a+="</td>"}PopupHelpTip.showByClick("<table>"+a+"</table>",e,350)},FactFind.getReferralAccessContextMenu=function(e,t,n){var i=FactFind.getTimeoutCache("clientmenu."+e,60);null===i&&((i=FactFind.setTimeoutCache("clientmenu."+e,[])).push(new PopupMenu(FactFind.getClientFavTplMenu,_("Quick Merge"))),i.push(new PopupMenuSeparator),FactFind.addRoleMenu(i,"referral_access",e));for(var a=0;a<i.length;a++)t.push(i[a]);return FactFind.entityid=e,FactFind.entityrole="client",t},FactFind._getContextMenu=function(){return XPLAN.util.isRole("user")?FactFind.getClientContextMenuFromDict:XPLAN.util.isRole("referral")?FactFind.getReferralAccessContextMenu:void 0},FactFind.getEntityVisible=function(e){return XMLRPC.call("factfind.getEntityVisisble",[e])},FactFind.disableEmailToClient=function(e,t){for(var n=0;n<e.length;n++){if(e[n].text===_("Send to Client")){e[n].disabled=t;break}e[n].items&&e[n].items.length&&FactFind.disableEmailToClient(e[n].items,t)}},FactFind.getClientContextMenu=function(e,t,n,i){void 0==i&&(i=FactFind.getEntityVisible(e));var a,o=n&&XPLAN.util.isCapable("allow_email_client")&&XPLAN.util.isCapable("client_focus"),l=FactFind.getTimeoutCache("clientmenu."+e,60);if(null===l){if(l=FactFind.setTimeoutCache("clientmenu."+e,[]),i){var c=XPLAN.util.isCapable("edit_entity_note")||XPLAN.util.isCapable("edit_entity")&&XPLAN.util.isCapable("client_focus"),r=XPLAN.util.isCapable("allow_tasks")&&XPLAN.util.isCapable("edit_tasks")&&XPLAN.util.isCapable("client_focus"),d=XPLAN.util.isCapable("allow_diary")&&XPLAN.util.isCapable("client_focus"),s=XPLAN.util.isCapable("add_client_campaign")&&XPLAN.util.isCapable("client_focus"),u=XPLAN.util.isCapable("allow_email_client")&&XPLAN.util.isCapable("client_focus"),p=XPLAN.util.isCapable("view_portfolio")&&XPLAN.util.isCapable("client_focus"),F=XPLAN.util.isCapable("use_invoice"),f=XPLAN.util.isCapable("use_invoice")&&XPLAN.util.isCapable("edit_existing_invoice");l.push(new PopupMenuItem(_("Show Summary"),function(t){getMainFrame().FactFind.showClientSummary(t,e)})),l.push(new PopupMenuItem(_("Download VCard"),FactFind.downloadVCard)),l.push(new PopupMenuItem(_("Start Time Ticker"),FactFind.startTicker)),l.push(new PopupMenuSeparator);var m=[new PopupMenuItem(_("Add Note"),FactFind.addClientNote,!c),new PopupMenuItem(_("Add Task"),FactFind.addClientTask,!r),new PopupMenuItem(_("Add Thread"),FactFind.addClientThread,!r),new PopupMenuItem(_("Add Diary"),FactFind.addClientDiary,!d),new PopupMenuItem(_("Add Diary With Search Slot"),FactFind.addClientDiarySlot,!d),new PopupMenuItem(_("Add Campaign"),FactFind.addClientCampaign,!s),new PopupMenuItem(_("Add Invoice"),FactFind.addClientInvoice,!F),new PopupMenuItem(_("Add Recurring Invoice"),FactFind.addClientInvoiceRecur,!f)];l.push(new PopupMenu(m,_("Add..."))),m=[new PopupMenuItem(_("Send to Client"),FactFind.emailClient,!o),new PopupMenuItem(_("Send to All Group Members"),FactFind.emailAllInClientGroup,!u),new PopupMenuItem(_("Send to All Group Members Including Partner"),FactFind.emailAllInClientGroupInclPartner,!u)],l.push(new PopupMenu(m,_("Email..."))),l.push(new PopupMenu(FactFind.getClientFavTplMenu,_("Quick Merge"))),p&&l.push(new PopupMenu(FactFind.getIpsReports,_("Quick IPS Reports"))),l.push(new PopupMenuSeparator)}FactFind.addRoleMenu(l,"client",e)}else FactFind.disableEmailToClient(l,!o);for(a=0;a<l.length;a++)t.push(l[a]);return FactFind.entityid=e,FactFind.entityrole="client",t},FactFind.getClientContextMenuFromDict=function(e,t,n,i){void 0==i&&(i=FactFind.getEntityVisible(e));var a,o=FactFind.canEmailClient(e,n),l=FactFind.getTimeoutCache("clientmenu."+e,60);if(null===l){if(l=FactFind.setTimeoutCache("clientmenu."+e,[]),i){var c=PopupMenu.generatePopupMenuFromMenuItems(FactFind.getClientContextMenuDict(e,o,!0));for(a=0;a<c.length;a++)l.push(c[a]);l.push(new PopupMenuSeparator)}FactFind.addRoleMenu(l,"client",e)}else FactFind.disableEmailToClient(l,!o);for(a=0;a<l.length;a++)t.push(l[a]);return FactFind.entityid=e,FactFind.entityrole="client",t},FactFind.hasEntityEmailAddress=function(e){return XMLRPC.call("factfind.hasEntityPreferredEmail",[e])},FactFind.canEmailClient=function(e,t){return t&&XPLAN.util.isCapable("allow_email_client")&&XPLAN.util.isCapable("client_focus")},FactFind.getClientContextMenuDict=function(e,t,n){var i=XPLAN.util.isCapable("edit_entity_note")||XPLAN.util.isCapable("edit_entity")&&XPLAN.util.isCapable("client_focus"),a=XPLAN.util.isCapable("allow_tasks")&&XPLAN.util.isCapable("edit_tasks")&&XPLAN.util.isCapable("client_focus"),o=XPLAN.util.isCapable("allow_diary")&&XPLAN.util.isCapable("client_focus"),l=XPLAN.util.isCapable("add_client_campaign")&&XPLAN.util.isCapable("client_focus"),c=XPLAN.util.isCapable("allow_email_client")&&XPLAN.util.isCapable("client_focus"),r=XPLAN.util.isCapable("view_portfolio")&&XPLAN.util.isCapable("client_focus"),d=XPLAN.util.isCapable("use_invoice"),s=XPLAN.util.isCapable("use_invoice")&&XPLAN.util.isCapable("edit_existing_invoice"),u=[{type:"menuitem",title:_("Show Summary"),action:FactFind.wrapClientFunction(e,function(t){getMainFrame().FactFind.showClientSummary(t,e)})},{type:"menuitem",title:_("Download VCard"),action:FactFind.wrapClientFunction(e,FactFind.downloadVCard)},{type:"menuitem",title:_("Start Time Ticker"),action:FactFind.wrapClientFunction(e,FactFind.startTicker)}];n&&u.push({type:"separator"});var p=[{type:"menuitem",title:_("Add Note"),action:FactFind.wrapClientFunction(e,FactFind.addClientNote),disabled:!i},{type:"menuitem",title:_("Add Task"),action:FactFind.wrapClientFunction(e,FactFind.addClientTask),disabled:!a},{type:"menuitem",title:_("Add Thread"),action:FactFind.wrapClientFunction(e,FactFind.addClientThread),disabled:!a},{type:"menuitem",title:_("Add Diary"),action:FactFind.wrapClientFunction(e,FactFind.addClientDiary),disabled:!o},{type:"menuitem",title:_("Add Diary With Search Slot"),action:FactFind.wrapClientFunction(e,FactFind.addClientDiarySlot),disabled:!o},{type:"menuitem",title:_("Add Campaign"),action:FactFind.wrapClientFunction(e,FactFind.addClientCampaign),disabled:!l},{type:"menuitem",title:_("Add Invoice"),action:FactFind.wrapClientFunction(e,FactFind.addClientInvoice),disabled:!d},{type:"menuitem",title:_("Add Recurring Invoice"),action:FactFind.wrapClientFunction(e,FactFind.addClientInvoiceRecur),disabled:!s}];return u.push({type:"menu",title:_("Add…"),items:p}),p=[{type:"menuitem",title:_("Send to Client"),action:FactFind.wrapClientFunction(e,FactFind.emailClient),disabled:!t},{type:"menuitem",title:_("Send to All Group Members"),action:FactFind.wrapClientFunction(e,FactFind.emailAllInClientGroup),disabled:!c},{type:"menuitem",title:_("Send to All Group Members Including Partner"),action:FactFind.wrapClientFunction(e,FactFind.emailAllInClientGroupInclPartner),disabled:!c}],u.push({type:"menu",title:_("Email…"),items:p}),u.push({type:"menu",title:_("Quick Merge"),items:FactFind.wrapClientFunction(e,FactFind.getClientFavTplMenuDict)}),r&&u.push({type:"menu",title:_("Quick IPS Reports"),items:FactFind.wrapClientFunction(e,FactFind.getIpsReportsDict)}),u},FactFind.wrapClientFunction=function(e,t){return function(){return FactFind.entityid=e,FactFind.entityrole="client",t.call(this,e)}},FactFind.downloadIpsQuickReport=function(e){window.status="downloading...",XMLRPC.call("portfolio.runQuickReport",[e,FactFind.entityid],function(e){FactFind._checkIpsQuickReport(e,1)}),alert(_("Your report will appear soon in this screen. Moving screens will lose your report."))},FactFind._checkIpsQuickReport=function(e,t){if(window.status=_("Waiting for download. %s seconds passed.").replace("%s",5*t),"check"==e.key)XMLRPC.call("portfolio.checkQuickReport",[e.entityid],function(e){setTimeout(function(){FactFind._checkIpsQuickReport(e,t+1)},5e3)});else if("download"==e.key){window.status="";var n=getBaseURL()+e.url;XPLAN.util.download(n)}},FactFind.getIpsReports=function(){for(var e=function(e){return function(){FactFind.downloadIpsQuickReport(e)}},t=XMLRPC.call("portfolio.getQuickReports",[]),n=[],i=0;i<t.length;i++)n.push(new PopupMenuItem(t[i].quickname,e(t[i].id)));return 0===t.length&&n.push(new PopupMenuItem(_("No Quick IPS Reports Found"),null,!0)),n},FactFind.getIpsReportsDict=function(e){for(var t=function(e){return function(){FactFind.downloadIpsQuickReport(e)}},n=XMLRPC.call("portfolio.getQuickReports",[]),i=[],a=0;a<n.length;a++)i.push({type:"menuitem",title:n[a].quickname,action:FactFind.wrapClientFunction(e,t(n[a].id))});return 0===n.length&&i.push({type:"menuitem",title:_("No Quick IPS Reports Found"),disabled:!0}),i},FactFind.getClientFavTplMenu=function(){var e;e=XPLAN.util.isRole("referral")?XMLRPC.call("report.getReferrerAccessTemplates",[]):XMLRPC.call("report.getFavouriteTemplates",["client"]);for(var t=[],n=0;n<e.length;n++){var i=e[n],a=[];t.push(new PopupMenu(a,i.name));for(var o=0;o<i.tpls.length;o++){var l=i.tpls[o];a.push(new PopupMenuItem(l.name,FactFind.runClientFavTpl(l.entityid)))}}return 0===e.length&&t.push(new PopupMenuItem(_("No template found"),null,!0)),t},FactFind.getClientFavTplMenuDict=function(e){var t;t=XPLAN.util.isRole("referral")?XMLRPC.call("report.getReferrerAccessTemplates",[]):XMLRPC.call("report.getFavouriteTemplates",["client"]);for(var n=[],i=0;i<t.length;i++){for(var a=t[i],o=[],l=0;l<a.tpls.length;l++){var c=a.tpls[l];o.push({type:"menuitem",title:c.name,action:FactFind.wrapClientFunction(e,FactFind.runClientFavTpl(c.entityid))})}n.push({type:"menu",title:a.name,items:o})}return 0===t.length&&n.push({type:"menuitem",title:_("No template found"),disabled:!0}),n},FactFind.runClientFavTpl=function(e){return function(){getHiddenFrame(getBaseURL()+"/reporttpl/run_client_report?run=1&"+HttpRequest.buildData({cliid:FactFind.entityid,role:"client",tplid:e}))}},FactFind.showLoanSearchContextMenu=function(e,t,n){var i=XPLAN.util.isCapable("edit_entity_note")||XPLAN.util.isCapable("edit_entity")&&XPLAN.util.isCapable("client_focus"),a=XPLAN.util.isCapable("allow_tasks")&&XPLAN.util.isCapable("edit_tasks")&&XPLAN.util.isCapable("client_focus"),o=function(e){"undefined"!=typeof e&&(getMainFrame().location.href=getBaseURL()+e)},l=[new PopupMenuItem(_("Add Note to All"),function(){o("/docnote/add_note_to_all?option=loanclientlist")},!i),new PopupMenuItem(_("Add Task to All"),function(){o("/xtasks/edit/-1?new=1&multiclients=1&option=loanclientlist")},!a),new PopupMenuItem(_("Add Thread to All"),function(){o("/xtasks/addthreadentities?option=loanclientlist")},!a),new PopupMenuSeparator];FactFind.showClientContextMenu(e,l,t,n)},FactFind.showClientContextMenu=function(e,t,n,i,a){var o=FactFind._getContextMenu();o&&(t||(t=[]),i.preventDefault(),i.stopPropagation(),XPLAN.util.onCapabilitiesLoaded(function(){o(e,t,n),t.title=a,PopupMenu.showByClick(t,i)}))},FactFind.showClientSummary=function(e,t){if("undefined"==typeof FactFind.client_summary_panel){var n=jQuery("#mf-contentinner");FactFind.client_summary_panel=jQuery("<div/>").appendTo(n)}XMLRPC.call("factfind.load_client_summary_ajax",[t],function(e){FactFind.client_summary_panel.xplan_client_summary(e)})},FactFind.showUserSummary=function(e,t){XMLRPC.call("factfind.get_user_summary",[t],function(t){FactFind.handleShowEntitySummary(e,t)})},FactFind.downloadVCard=function(){window.location.href=getBaseURL()+"/factfind/download_vcard?entityid="+FactFind.entityid},FactFind.startTicker=function(){var e=XPLAN.timeticker||parent&&parent.XPLAN&&parent.XPLAN.timeticker;if(e){FactFind.always_client(FactFind.entityid,function(t){e.start(t)})}},FactFind.always_client=function(e,t){XMLRPC.call("factfind.always_client",[e],t)},FactFind.showEntityContextMenu=function(e,t,n,i){n||(n=[]);var a=FactFind.getTimeoutCache(t+"menu."+e,60);null===a&&(a=FactFind.setTimeoutCache(t+"menu."+e,[]),FactFind.addRoleMenu(a,t,e));for(var o=0;o<a.length;o++)n.push(a[o]);FactFind.entityid=e,FactFind.entityrole=t,PopupMenu.showByClick(n,i)},FactFind.showGroupContextMenu=function(e,t,n){FactFind.showEntityContextMenu(e,"group",t,n)},FactFind.showUserContextMenu=function(e,t,n,i){var a=XPLAN.util.isCapable("add_client_campaign")&&XPLAN.util.isCapable("client_focus"),o=n&&""!==n;o=o&&n&&XPLAN.util.isCapable("allow_email_user")&&XPLAN.util.isCapable("client_focus");var l=[new PopupMenuItem(_("Send to User"),FactFind.emailUser,!o)];t||(t=[new PopupMenuItem(_("Add Campaign to All"),FactFind.addAllUsersCampaign,!a),new PopupMenuSeparator,new PopupMenuItem(_("Show Summary"),function(){FactFind.showUserSummary(i,e)}),new PopupMenuSeparator,new PopupMenu(l,_("Email...")),new PopupMenuSeparator]),FactFind.showEntityContextMenu(e,"user",t,i)},FactFind.showProfAdviserContextMenu=function(e,t,n){var i=XPLAN.util.isCapable("add_client_campaign")&&XPLAN.util.isCapable("client_focus");t||(t=[new PopupMenuItem(_("Add Campaign to All"),FactFind.addAllProfAdvisorsCampaign,!i),new PopupMenuSeparator]),FactFind.showEntityContextMenu(e,"profadviser",t,n)},FactFind.showClientSelectionContextMenu=function(e){var t=[new PopupMenuItem(_("All"),function(){ListEntities.entitySelection(0)}),new PopupMenuItem(_("All on this Page"),function(){ListEntities.entitySelection(1)}),new PopupMenuItem(_("None"),function(){ListEntities.entitySelection(2)})];PopupMenu.showByClick(t,e)},EntitySelector._onIconDblClick=function(e){e._searchable&&(e._insearch?e._showSelect():e._onIconSelect())},EntitySelector._onIconClick=function(e){e._searchable&&(e._insearch?e._search():e._onIconSelect())},EntitySelector.prototype.show=function(e){jQuery(this.parentelm).toggle(e)},EntitySelector.prototype.setEntity=function(e,t,n){this.setEntityType(e),t>0&&(this._handleSearch([t,n]),this.select.val(t),this.select.change())},EntitySelector.prototype.setAllEntities=function(e,t){if(this.setEntityType(e),t.adviser_ids.length){this.current_data=[];for(var n=XPLAN.json.decode(t.advisers),i=0;i<t.adviser_ids.length;i++){var a=XPLAN.util.unescape(n[i],"jsq");this.current_data.push([t.adviser_ids[i],a])}this.current_data.sort(function(e,t){return e[1].toUpperCase()>t[1].toUpperCase()?1:e[1].toUpperCase()<t[1].toUpperCase()?-1:0}),this._updateSelector(),this._showSelect(),this.select.val(t.default_adviser),this.select.change()}},EntitySelector.prototype.setFilterPartner=function(e){this._searchable&&this.input.data("filterPartner",!!e)},EntitySelector.prototype.setFilterShowInvisible=function(e){this._searchable&&this.input.data("filterShowInvisible",!!e)},EntitySelector.prototype.getEntity=function(){var e=parseInt(this.select.val(),10);return isNaN(e)?-1:e},EntitySelector._known_types={client:null,user:null,group:null,referral:null,profadviser:null,supplier:null,individual:null,company:null},EntitySelector.prototype.activateSearchIcon=function(){this._searchable&&(this._insearch=!0,this.icon.attr("class","icon icon-search"),this.icon.attr("style","margin-left: 2px;"),this.icon.attr("title",_("Click to Search, Double click to show drop-down")))},EntitySelector.prototype.activateEditIcon=function(){this._searchable&&(this._insearch=!1,this.icon.attr("class","icon icon-edit"),this.icon.attr("style","margin-left: 2px;"),this.icon.attr("title",_("Edit Search Criteria")))},EntitySelector.prototype.setEntityType=function(e){e in EntitySelector._known_types||(e="client"),this.etype=e,this._searchable?(this.input.val(_("[Search %s name]").replace("%s",etypeMap(e))).data("entitytype",e).data("init",!1).show(),this.select.hide()):this.select.show(),this._updateSelector(),this.activateSearchIcon(),this.text=null,this.value=null},EntitySelector.prototype.setWidth=function(e){this.input.width(e),this.select.width(e)},EntitySelector.prototype.setConstantItems=function(e){this.constant_items=e,this._constant_items_hash={};for(var t=0;t<e.length;t++){var n=e[t],i=n[0]+"_"+n[1];this._constant_items_hash[i]=null}this._updateSelector()},EntitySelector.prototype._updateSelector=function(){for(var e=this.select.value,t=[],n=0;n<this.current_data.length;n++){var i=this.current_data[n];i[0]+"_"+i[1]in this._constant_items_hash||t.push(i)}var a=(t.length>0||this.constant_items.length>0?"individual"==this.etype?[[-1,_("- Select an %s -").replace("%s",etypeMap(this.etype))]]:[[-1,_("- Select a %s -").replace("%s",etypeMap(this.etype))]]:[[-1,_("- No %s matches -").replace("%s",etypeMap(this.etype))]]).concat(t);t.length>0&&this.constant_items.length>0&&a.push([-1,"----------------"]),a=a.concat(this.constant_items),SelectUtil.makeSelect(this.select.get(0),a),SelectUtil.setValue(this.select.get(0),e),this.select.value!=e&&this.select.change()},EntitySelector.prototype._handleSearch=function(e){this.current_data=[];for(var t=0;t<e.length;t+=2){var n=parseInt(e[t],10),i=e[t+1];n>0&&this.current_data.push([n,i])}this._updateSelector(),this._showSelect()},EntitySelector.prototype._showSelect=function(){this.select.hide({duration:1,complete:function(){jQuery(this).show({duration:1,complete:function(){jQuery(this).focus()}})}}),this._searchable&&this.input.val("").removeAttr("disabled").hide(),this.activateEditIcon()},EntitySelector.prototype._onIconSelect=function(){this._searchable&&(this.select.val(-1).change().hide(),this.input.show().focus(),this.activateSearchIcon())},EntitySelector.prototype._onSearchFocus=function(){if(this._searchable){this.input;this.input.data("init")||this.input.data("init",!0).val("")}},EntitySelector.prototype._onSearchKeyPress=function(e){this._searchable&&e&&13==e.keyCode&&(e.stopPropagation(),e.preventDefault(),this._search())},EntitySelector.prototype._preFill=function(){if(this._searchable){var e=this;this.input.val("Searching...").prop("disabled","disabled"),this.icon.attr("src",getBaseURL()+"/img/eggtimer_tiny.gif");XMLRPC.call("factfind.searchUsers",["",1,1],function(t){e._handleSearch(t)})}},EntitySelector.prototype._search=function(){if(this._searchable){var e=this.input.val();if(e){var t=this,n=function(e){t._handleSearch(e)};this.input.val("Searching...").prop("disabled","disabled");var i=0!=this.input.data("filterPartner"),a=0!=this.input.data("filterShowInvisible"),o=this.input.data("entitytype");"user"==o?XMLRPC.call("factfind.searchUsers",[e,1],n):"referral"==o?XMLRPC.call("factfind.searchReferrals",[e],n):"profadviser"==o?XMLRPC.call("factfind.searchProfAdvisers",[e],n):"supplier"==o?XMLRPC.call("factfind.searchSuppliers",[e],n):"group"==o?XMLRPC.call("factfind.searchGroups",[e],n):"client"==o?XMLRPC.call("factfind.searchClients",[e,-1,1,i,null,null,{},a],n):"individual"==o&&XMLRPC.call("factfind.searchClients",[e,-1,1,i,"individual",null,{},a],n)}}},EntityEvent=function(e){this.selector=e},EntityEvent.prototype.getSelect=function(){var e=this.selector.input;return jQuery(e).next().get(0)},EntityEvent.prototype.changeSelect=function(){},EntityEvent.prototype.registerSelectChange=function(e){var t=this;XPLAN.event.connect(e,"change",function(){t.changeSelect()})},EntityEvent_FundMember=function(e){this.selector=e,this.rpc_func="factfind.getFundMemberDetails"},EntityEvent_FundMember.prototype=new EntityEvent,EntityEvent_FundMember.prototype.getElem=function(e){var t=this.getSelect().name,n=t.split(":")[1],i=t.replace(n,e),a=this.getSelect().ownerDocument.getElementsByName(i);return a.length>0?a[0]:null},EntityEvent_FundMember.prototype.changeSelect=function(){var e=this.selector.getEntity();if(e>0){var t=this;XMLRPC.call(this.rpc_func,[e],function(e){for(var n in e){var i=t.getElem(n);void 0!=i&&(i.value=e[n],jQuery(i.parentNode.parentNode).show())}})}},EntityEvent_Complainant=function(e){this.selector=e},EntityEvent_Complainant.prototype=new EntityEvent,EntityEvent_Complainant.prototype.getElem=function(e){var t=this.getSelect().name,n=t.split(":")[1],i=t.replace(n,e);return this.getSelect().ownerDocument.getElementsByName(i)[0]},EntityEvent_Complainant.prototype.changeSelect=function(){var e=this.selector.getEntity(),t=this.getElem("complainant_name");t&&(e>0&&(t.value=""),t.parentNode.parentNode.style.display=e>0?"none":"")},EntityEvent_Complainer=function(e){this.selector=e},EntityEvent_Complainer.prototype=new EntityEvent,EntitySelectorHolder={};var Questionnaire={alter:function(e){var t=document.forms.editclient;if(t){var n=t.elements.entityid.value,i=t.elements.iswizard.value,a="&alter=1";":1:"==(e=e.substr(7)).substr(e.length-3)&&(e=e.substr(0,e.length-2),a+="&partner=3");var o=getBaseURL()+"/ufield/questionnaire/start_client_focus?entityid="+n+"&iswizard="+i+"&field="+encodeURIComponent(e)+a;"undefined"!=typeof exitPageHook?exitPageHook(o):window.location.href=o}else alert(_("Not currently in Client Focus editing screen."))},start:function(e){var t=document.forms.editclient;if(t){var n=t.elements.entityid.value,i=t.elements.iswizard.value,a="";":1:"==(e=e.substr(7)).substr(e.length-3)&&(e=e.substr(0,e.length-2),a="&partner=1");var o=getBaseURL()+"/ufield/questionnaire/start_client_focus?entityid="+n+"&iswizard="+i+"&field="+encodeURIComponent(e)+a;"undefined"!=typeof exitPageHook?exitPageHook(o):window.location.href=o}else alert(_("Not currently in Client Focus editing screen."))}};FactFind.getTimeoutCache=function(e,t){var n=FactFind.timeout_cache;if("undefined"==typeof n)return null;if("undefined"==typeof(n=n[e]))return null;var i=(new Date).getTime();return n.time_set+1e3*t<i?null:n.data},FactFind.setTimeoutCache=function(e,t){var n=FactFind.timeout_cache;return"undefined"==typeof n&&(n=FactFind.timeout_cache={}),"undefined"==typeof n[e]&&(n[e]={}),(n=n[e]).time_set=(new Date).getTime(),n.data=t,t},FactFind.defvalues={},FactFind.restoreDefault=function(e,t,n){var i=(e=document.forms[e])[t];if(i&&(void 0===n&&(n=FactFind.defvalues[t]),"INPUT"==i.tagName&&"text"==i.type&&(i.value=n),"TEXTAREA"==i.tagName&&(jQuery(i).val(n),CKEDITOR))){var a=jQuery(i).ckeditorGet();a&&a.setData(n)}},FactFind.restoreDefaultByCategory=function(e,t,n){ufield_depend.restoreDefaultByCategory(e,t,n?""+n:"")},FactFind.addDefaultValue=function(e,t){FactFind.defvalues[e]=t},FactFind.fieldAvailability={},FactFind.installFieldAvailabilityHooks=function(){for(var e in FactFind.fieldAvailability){var t,n,i=FactFind.fieldAvailability[e];for(t=0;t<i.length;++t){var a=i[t];for(n=0;n<a.length;++n){var o=a[n],l=FactFind.findFieldControl(o.fieldname);l&&XPLAN.event.connect(l,"change",FactFind.reviewAvailableFields)}}}FactFind.reviewAvailableFields()},FactFind.reviewAvailableFields=function(e){for(var t in FactFind.fieldAvailability){var n=FactFind.findFieldRow(t);null!==n&&(n=jQuery(n),FactFind.isFieldAvailable(t)?n.show():n.hide())}},FactFind.isFieldAvailable=function(e,t){var n,i,a=FactFind.fieldAvailability[e];for(n=0;n<a.length;++n){var o=a[n],l=!0;for(i=0;i<o.length;++i){var c=o[i],r=FactFind.findFieldControl(c.fieldname,t);if("op_equal"==c.op&&r.value!=c.value||"op_not_equal"==c.op&&r.value==c.value){l=!1;break}}if(l)return!0}return!1},FactFind.findFieldControl=function(e,t){return null!==t&&void 0!==t||(t=document.forms.namedItem("edititem")),t.elements.namedItem("entity:"+e)},FactFind.findFieldRow=function(e,t){var n=FactFind.findFieldControl(e,t);if(null===n||void 0===n)return null;for(var i=(n=n.parentNode?n.parentNode:n[0].parentNode).tagName.toLowerCase();"tr"!=i&&"body"!=i;)i=(n=n.parentNode).tagName.toLowerCase();return n},FactFind.addFieldTemplate=function(e,t,n,i,a){FactFind.field_templates||(FactFind.field_templates=[]);var o='<a class="button" onclick="FactFind.loadFieldTemplateList('+FactFind.field_templates.length+',event||window.event);return false;" href="">'+_("Template")+' <img src="'+getBaseURL()+'/img/minmaxdown-small.png"/></a>';o=i?'<div align="right">'+o+"</div>":"&nbsp;"+o,i?jQuery("textarea[name='"+e+"']").parent().prepend(o):jQuery("input[name='"+e+"']").parent().append(o),FactFind.field_templates.push({field:e,gname:t,fname:n,multiline:i,richtext:a})},FactFind.loadFieldTemplate=function(e,t,n,i){if(FactFind.field_templates&&!(e>=FactFind.field_templates.length)){var a=FactFind.field_templates[e];XMLRPC.call("ufield.getFieldTemplateContent",[a.gname,a.fname,t,n],function(e){var t=a.multiline,n=a.richtext,o=a.field;if(n){var l=jQuery('textarea[name="'+o+'"]').ckeditorGet(),c="append"===i?l.getData():"";c+=e,l.setData(c)}else{var r,d;t?(r=jQuery('textarea[name="'+o+'"]'),d="append"===i&&r.length?r.val()+"\n":""):(r=jQuery('input[name="'+o+'"]'),d="append"===i&&r.length?r.val()+" ":""),r.val(d+e)}})}},FactFind.loadFieldTemplateList=function(e,t){if(FactFind.field_templates&&!(e>=FactFind.field_templates.length)){t=jQuery.event.fix(t);var n=FactFind.field_templates[e],i=jQuery(t.currentTarget||t.target),a=i.getXY(),o=function(t){return function(){var n=["<p>",XPLAN.util.escape(_("Do you want to append or override?")),"</p>"],i=XPLAN.ui.Popup.get_dialog("ufield_content_append_override"),a=[{text:_("Cancel"),click:function(){i.dialog("close").dialog("destroy")}},{text:"^"+_("Override"),click:function(){FactFind.loadFieldTemplate(e,t.name,t.owner,"replace"),i.dialog("close"),i.dialog("close").dialog("destroy")}},{text:"^"+_("Append"),click:function(){FactFind.loadFieldTemplate(e,t.name,t.owner,"append"),i.dialog("close"),i.dialog("close").dialog("destroy")}}];i.html(n.join(""));var o={title:_("Modify content"),width:400,buttons:a};i.dialog(o)}},l=function(e){var t=e.dep_field;if(""===t)return!0;var a,o,l=(a=t,(o=i.parent().parent().find("textarea").attr("name"))||(o=i.parent().parent().find("input").attr("name")),o.replace(n.fname,a)),c=jQuery('select[name^="'+l+'"]');if(0===c.length){if(1===(c=jQuery('span[data-ufield_dep_field="'+t+'"][data-ufield_dep_name="'+l+'"]')).length)var r=c.attr("data-value")}else r=c.val();return r==e.dep_option};XMLRPC.call("ufield.getFieldTemplates",[n.gname,n.fname,!0],function(e){e=e.templates;for(var t=[],n=0;n<e.length;n++){var c=e[n];l(c)&&t.push(new PopupMenuItem(_("%a (%b)").replace("%a",c.name).replace("%b",c.ownername),o(c)))}PopupMenu.show(t,a.x,a.y+i.outerHeight()+1)})}},FactFind.scenario={},FactFind.scenario.getScenarioName=function(e){var t=jQuery(e);return jQuery('input[type="hidden"][name^="scenario_name_"]',t.closest("tr")).val()},FactFind.scenario.getAdviceContainerID=function(e){var t=jQuery(e);return jQuery('input[type="hidden"][name^="advice_container_"]',t.closest("tr")).val()},FactFind.scenario.getScenarioId=function(e){var t=jQuery(e).closest("tr").prevAll("tr").length;return scenario_list_table.keys[t]},FactFind.scenario.editScenario=function(e){var t=FactFind.scenario.getScenarioName(e),n=FactFind.scenario.getAdviceContainerID(e);return jQuery('input[name="wizard_scenario_name"]').val(t),jQuery('select[name="advice_container"] option[value="'+n+'"]').prop("selected",!0),_wizardSaveNext(),!1},FactFind.scenario.createScenario=function(e){for(var t=jQuery('input[name="wizard_scenario_name"]').val(),n=jQuery('input[type="hidden"][name^="scenario_name_"]',document.getElementById("wizard_scenarios")),i=0;i<n.length;i++)if(n.get(i).value==t)return alert(_("A scenario named “%s” already exists").replace("%s",t)),!1;return _wizardSaveNext(),!0},FactFind.scenario.scenarioExists=function(e){for(var t=0;t<scenario_list_table.data.length;++t)if(jQuery("input:hidden",scenario_list_table.data[t][1]).val()==e)return e;return null},FactFind.scenario.copyScenario=function(e){for(var t=jQuery(e).closest("tr").prevAll("tr").length,n=scenario_list_table.keys[t],i=1,a=FactFind.scenario.getScenarioName(e),o=a+" "+_("Copy")+" "+i;FactFind.scenario.scenarioExists(o);)i++,o=a+" "+_("Copy")+" "+i;var l=XPLAN.ui.Popup.get_dialog("copy_wizard_scenario"),c=["<table><tbody>","<tr><td>",_("This scenario will be saved with a new name."),"</td></tr>","<tr><td>",_("Enter new scenario name"),":","</td></tr>","<tr><td>",'<input name="new_scenario" size="50" value="',XPLAN.util.escape(o,"xmlq"),'" ></input>',"</td></tr>","</tbody></table>"];l.html(c.join("")),l.dialog({width:400,title:XPLAN.util.escape(_("Save Scenario As")),buttons:[{text:"Cancel",click:function(){l.dialog("close"),l.dialog("destroy")}},{text:"^Save",click:function(){var e=l.find("input").val();e==a?alert(_("New scenario name cannot be the same as the original scenario")):(XMLRPC.call("factfind.copy_scenario",[n,e],function(t){jQuery('input[name="wizard_scenario_name"]').val(e),_wizardSaveNext()},function(e){XPLAN.framemain.alert_text(_("Error: could not copy scenario. %s").replace("%s",e.message),!0)}),l.dialog("destroy"))}}]}),l.dialog("open")},FactFind.scenario.removeScenario=function(e){var t=jQuery(e).closest("tr").prevAll("tr").length,n=FactFind.scenario.getScenarioName(e),i=scenario_list_table.keys[t],a=_('Are you sure you want to remove scenario "%s"?').replace("%s",n);PopupMsgBox.show_confirm_text(a,function(e){e==_("Yes")&&XMLRPC.call("factfind.remove_scenario",[i,_("Remove wizard scenario %s").replace("%s",n)],function(e){scenario_list_table.keys.splice(t,1),scenario_list_table.data.splice(t,1),scenario_list_table.loadData(scenario_list_table.keys,scenario_list_table.data)},function(e){XPLAN.framemain.alert_text(_("Error: could not remove scenario. %s").replace("%s",e.message),!0)})},400,_("Confirm"),null)},FactFind.scenario.lockScenario=function(e){var t=jQuery(e).closest("tr").prevAll("tr").length,n=FactFind.scenario.getScenarioName(e),i=scenario_list_table.keys[t],a=_('Are you sure you want to lock scenario "%s"?').replace("%s",n);PopupMsgBox.show_confirm_text(a,function(e){e==_("Yes")&&XMLRPC.call("factfind.lock_scenario",[i],function(e){window.location.reload()},function(e){XPLAN.framemain.alert_text(_("Error: could not lock scenario. %s").replace("%s",e.message),!0)})},400,_("Confirm"),null)},FactFind.scenario.unlockScenario=function(e){var t=jQuery(e).closest("tr").prevAll("tr").length,n=FactFind.scenario.getScenarioName(e),i=scenario_list_table.keys[t],a=_('Are you sure you want to unlock scenario "%s"?').replace("%s",n);PopupMsgBox.show_confirm_text(a,function(e){e==_("Yes")&&XMLRPC.call("factfind.unlock_scenario",[i],function(e){window.location.reload()},function(e){XPLAN.framemain.alert_text(_("Error: could not unlock scenario. %s").replace("%s",e.message),!0)})},400,_("Confirm"),null)},FactFind.scenario.renameScenario=function(e,t,n,a){var o="Rename Scenario",l=jQuery(e).closest("tr").prevAll("tr").length,c=FactFind.scenario.getScenarioName(e),r=scenario_list_table.keys[l],d=FactFind.scenario.getAdviceContainerID(e);return XMLRPC.call("factfind.get_wizard_scenario",[t,c,parseInt(d,10),n],function(e){PopupForm2.show(e.html,o,{width:500,onclose:function(o){var d,s,u,p;0===o.descp.length?PopupMsgBox.show_warning_text(_("Scenario name cannot be blank - please try again"),0):(jQuery.extend(e.data,o),d=e.data,s=d.descp,u=parseInt(d.threadid,10),null!==(p=FactFind.scenario.scenarioExists(s))&&void 0!==p&&p!=c?PopupMsgBox.show_warning_text(_("Scenario with same name exists."),null,300,_("Error")):XMLRPC.call("factfind.edit_scenario",[r,s,u,a],function(e){var a=e[0],o=e[1];if(1==a.length&&!0===a[0][1]){var c=jQuery("<span><u>"+XPLAN.util.escape(s)+"</u></span>").attr("title","No"==scenario_list_table.data[l][7]?_("Edit Scenario"):_("View Scenario")).attr("onclick","FactFind.scenario.editScenario(this);");jQuery('<input type="hidden" name="scenario_name_'+l+'" value="'+XPLAN.util.escape(s,"xmlq")+'"/>').appendTo(c),scenario_list_table.data[l][1]="<html>"+jQuery("<div />").append(c).html()+"</html>",n&&(c=jQuery("<span><u>"+XPLAN.util.escape(o)+"</u></span>").attr("title",_("View Thread")).attr("onclick","FactFind.scenario.link_to_container("+u+","+t+");"),jQuery('<input type="hidden" name="advice_container_'+i+'" value="'+u+'"/>').appendTo(c),scenario_list_table.data[l][6]="<html>"+jQuery("<div />").append(c).html()+"</html>"),scenario_list_table.loadData(scenario_list_table.keys,scenario_list_table.data)}else XPLAN.framemain.alert_text(_("Error: could not rename scenario."),!0)},function(e){XPLAN.framemain.alert_text(_("Error: could not rename scenario. %s").replace("%s",e.message),!0)}))}})}),!1},FactFind.scenario.link_to_container=function(e,t,n,i){var a;a=n?getBaseURL()+"/xtasks/viewthread/"+e+"?option=bna&entityid="+t:getBaseURL()+"/xtasks/viewthread/"+e+"?option=wizard_scenario&entityid="+t+"&page="+XPLAN.util.escape(i,"jsq"),XPLAN.util.form_redirect(a)},FactFind.scenario.initScenarioList=function(e,t,n,i,a,o,l,c){for(var r,d=0;d<t.length;++d){var s=t[d][1];r=jQuery("<span/>").append("No"!==t[d][7]?"":jQuery('<span class="icon icon-remove"/>').attr("onclick","FactFind.scenario.removeScenario(this);").attr("title",_("Remove Scenario"))).append("No"!==t[d][7]?"":jQuery('<span class="icon icon-edit"/>').attr("onclick","FactFind.scenario.renameScenario(this,"+a+","+o+',"'+XPLAN.util.escape(l)+'");').attr("title",_("Edit Scenario Name"))).append(n?jQuery('<span class="icon icon-add" />').attr("onclick","FactFind.scenario.copyScenario(this);jQuery.event.fix(event).stopPropagation();").attr("title",_("Save Scenario As")):"").append("No"===t[d][7]?jQuery('<span class="icon icon-lock" />').attr("onclick","FactFind.scenario.lockScenario(this);jQuery.event.fix(event).stopPropagation();").attr("title",_("Lock Scenario")):i?t[d][9]?jQuery('<span class="icon icon-unlock disabled" />').attr("title",_("Scenario wizard locked through case, unlock the linked case to unlock this scenario wizard")):jQuery('<span class="icon icon-unlock" />').attr("onclick","FactFind.scenario.unlockScenario(this);jQuery.event.fix(event).stopPropagation();").attr("title",_("Unlock Scenario")):""),t[d][0]="<html>"+jQuery("<div/>").append(r).html()+"</html>",r=jQuery("<span><u>"+XPLAN.util.escape(s)+"</u></span>").attr("title","No"==t[d][7]?_("Edit Scenario"):_("View Scenario")).attr("onclick","FactFind.scenario.editScenario(this);"),jQuery('<input type="hidden" name="scenario_name_'+d+'" value="'+XPLAN.util.escape(s,"xmlq")+'"/>').appendTo(r),t[d][1]="<html>"+jQuery("<div />").append(r).html()+"</html>";var u=t[d][6][0],p=t[d][6][1];r=jQuery("<span><u>"+XPLAN.util.escape(p)+"</u></span>").attr("title",_("View Thread")).attr("onclick","FactFind.scenario.link_to_container("+u+","+a+","+c+',"'+XPLAN.util.escape(l)+'");'),jQuery('<input type="hidden" name="advice_container_'+d+'" value="'+u+'"/>').appendTo(r),t[d][6]="<html>"+jQuery("<div />").append(r).html()+"</html>",t[d][9]=null}var F=new ListTable(document.getElementById("wizard_scenarios"));return F.trans=[null,null,CellTransform.datetime,null,CellTransform.datetime,null,null],F.loadData(e,t),jQuery(document.forms.editclient).submit(FactFind.scenario.createScenario),F},FactFind.showInputOnSelectIn=function(e,t,n,i,a,o,l,c,r,d){null!==a&&void 0!==a||(a="entity:"),null!==o&&void 0!==o||(o=":0:"),null!==i&&void 0!==i||(i="input"),null!==c&&void 0!==c||(c=!1),d=d||!1;var s=jQuery('select[name="'+a+e+o+'"]');r&&(o+="[year]");var u=jQuery(i+'[name="'+a+t+o+'"]');if(0!==s.length&&0!==u.length){var p=u.parent().parent();l&&(p=p.parent());var F=!1,f=s.val();f instanceof Object?jQuery.each(f,function(e,t){F=F||jQuery.inArray(t,n)>=0}):F=jQuery.inArray(s.val(),n)>=0,F?p.show():(c?u.val(d?s.find("option:selected").text():s.val()):u.val(""),p.hide())}},FactFind.showInputOnSelectEqual=function(e,t,n,i,a,o,l,c,r){return FactFind.showInputOnSelectIn(e,t,[n],i,a,o,l,c,r)},FactFind.showInputOnSelectEqualWithPartner=function(e,t,n,i,a,o,l){var c={};c.master_name=e,c.target_name=t,c.target_type=i,c.prefix=a,c.suffix_client=o,c.suffix_partner=l,c.show_func=function(e){return n==e},FactFind.toggleInputWithPartner(c)},FactFind.toggleInputWithPartner=function(e){var t=e.prefix;void 0!==t&&null!==t||(t="entity:");var n=e.target_type||"input",i=e.master_type||"select",a=e.suffix_client;void 0!==a&&null!==a||(a=":0:");var o=e.suffix_partner;void 0!==o&&null!==a||(o=":1:");var l=e.master_name,c=e.target_name,r=e.show_func,d="undefined"!=typeof e.target_is_date_field&&e.target_is_date_field,s="undefined"==typeof e.empty_if_hide||e.empty_if_hide,u=jQuery(i+'[name="'+t+l+a+'"]'),p=jQuery(n+'[name="'+t+c+a+'"]'),F=jQuery(i+'[name="'+t+l+o+'"]'),f=jQuery(n+'[name="'+t+c+o+'"]');if(0!==u.length&&0!==p){var _=p.closest("tr"),m=p,h=f;d&&(m=p.closest("span"),h=f.closest("span")),r(u.val())||0!==F.length&&0!==f.length&&r(F.val())?(r(u.val())?m.show():(m.hide(),s&&p.val("")),0!==F.length&&0!==f.length&&(r(F.val())?h.show():(h.hide(),s&&f.val(""))),_.show()):(_.hide(),s&&(p.val(""),0!==f.length&&f.val("")))}},FactFind.setMindmapDisplayMode=function(e){var t=new HttpRequest;try{var n=jQuery(e).val();t.callRPC("factfind.saveClientFocusPreference",["mindmap_display_mode",n])}catch(e){alert(_("Error: %a").replace("%a",e.message))}},FactFind.setMindmapVisualOption=function(e,t){var n=jQuery(e).val();XMLRPC.call("factfind.save_clientfocus_mindmap_visual_option",[n],function(){t&&t(n)},function(e){alert(_("Error: %a").replace("%a",e.message))})},FactFind.setMindmapLinkedSubfundOption=function(e,t){var n=jQuery(e).val();XMLRPC.call("factfind.save_clientfocus_mindmap_linked_subfund_option",[n],function(){t&&t(n)},function(e){alert(_("Error: %a").replace("%a",e.message))})},FactFind.setMindmapVisualOptionCOA=function(e,t){var n=jQuery(e).val();XMLRPC.call("factfind.saveClientFocusPreference",["mindmap_visual_option",n],function(){t&&t(n)},function(e){alert(_("Error: %a").replace("%a",e.message))})},FactFind.setMindmapDataFilter=function(e,t){var n=new HttpRequest;try{var i="off";e.checked&&(i="on");var a="mindmap_show_"+e.name;n.callRPC("factfind.saveClientFocusPreferencePerClient",[t,a,i],function(){window.location.reload()})}catch(e){alert(_("Error: %a").replace("%a",e.message))}},FactFind.setMindmapShowSecondLevel=function(e,t){var n=new HttpRequest;try{var i="off";e.checked&&(i="on");n.callRPC("factfind.saveClientFocusPreferencePerClient",[t,"mindmap_show_second_level",i],function(){window.location.reload()})}catch(e){alert(_("Error: %a").replace("%a",e.message))}},FactFind.saveMindmap=function(e,t,n){var i=new HttpRequest;try{jQuery(e).prop("disabled",!0).addClass("btn_loading"),i.callRPC("factfind.saveMindmap",[t,n],function(){jQuery(e).prop("disabled",!1).removeClass("btn_loading")})}catch(e){alert(_("Error: %a").replace("%a",e.message))}},FactFind.showMindmapSnapshot=function(e,t){var n=jQuery(e);n.dialog({modal:!0,overlay:{"background-color":"#454545",opacity:.5},title:"Mindmap Snapshot",width:950,height:700,buttons:{Ok:function(){n.dialog("close")}},autoOpen:!1}).bind("dialogclose",function(t,n){jQuery(e).empty()}),n.dialog("open"),XMLRPC.call("factfind.getMindmapSnapshot",[t],function(t){t&&"None"!=t?jQuery(e).html(t):jQuery(e).html(XPLAN.util.escape(_("Mindmap snapshot not available. Please make sure that you have clicked the Save Mindmap button to use this function.")))},function(e){XPLAN.framemain.alert_text(e.message,!0)})},FactFind.launchCPDPlus=function(e){XMLRPC.call("factfind.get_cpdplus_url",[e],function(e){if(e)window.open(e,"CPDPlus","resizable=1,location=1,status=1,scrollbars=1");else XPLAN.framemain.alert_text(_("Error: could not launch CPDPlus."),!0)},function(e){XPLAN.framemain.alert_text(e.message,!0)})},FactFind.toggle_tab=function(e,t,n){FactFind.toggle_tab_custom(jQuery,"#tabs-main",e,t,n,!1)},FactFind.toggle_tab_custom=function(e,t,n,i,a,o){var l,c,r,d,s;a&&(t=t+"-"+a,n=n+"-"+a),(r=(s=e(t+' a[href="#'+n+'"]').parent()).index())>=0&&(d=e("#"+n),c=(l=e(t)).tabs("option","active"),o?(s.toggle(i),l.tabs("option","active",0)):(d.toggle(i),s.toggle(i),i||c!=r?(l.tabs("option","active",r),l.tabs("option","active",c)):l.tabs("option","active",0)))},FactFind.FIELD_VALUE_TITLE_OTHER="99",FactFind.FIELD_VALUE_BANK_TYPE_BANK="0",FactFind.FIELD_VALUE_BANK_TYPE_BUILDING_SOCIETY="1",FactFind.FIELD_VALUE_BOOL_YES="1",FactFind.FIELD_VALUE_BOOL_NO="0",FactFind.FIELD_VALUE_ESCALATION_BASIS_FIXED_PERCENTAGE="1",FactFind.FIELD_VALUE_POLICY_STATUS_PAID_UP="Paid Up",FactFind.FIELD_VALUE_POLICY_STATUS_LEFT_SCHEME="Left Scheme",FactFind.FIELD_VALUE_CHOICE_OTHER="Other";
;Dependency._js['factfind']=true;

;
!function(t,e){"object"==typeof module&&module.exports?module.exports=t.document?e(t):function(t){return e(t)}:t.Highcharts=e()}("undefined"!=typeof window?window:this,function(t){function e(t,e){var i="Highcharts error #"+t+": www.highcharts.com/errors/"+t;if(e)throw new Error(i);pt.console&&console.log(i)}function i(){var t,e,i=arguments,n={},o=function(t,e){var i,n;for(n in"object"!=typeof t&&(t={}),e)e.hasOwnProperty(n)&&((i=e[n])&&"object"==typeof i&&"[object Array]"!==Object.prototype.toString.call(i)&&"renderTo"!==n&&"number"!=typeof i.nodeType?t[n]=o(t[n]||{},i):t[n]=e[n]);return t};for(!0===i[0]&&(n=i[1],i=Array.prototype.slice.call(i,2)),e=i.length,t=0;t<e;t++)n=o(n,i[t]);return n}function n(t,e){return parseInt(t,e||10)}function o(t){return"string"==typeof t}function s(t){return t&&"object"==typeof t}function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return"number"==typeof t}function l(t){return ft.log(t)/ft.LN10}function h(t){return ft.pow(10,t)}function c(t,e){for(var i=t.length;i--;)if(t[i]===e){t.splice(i,1);break}}function d(t){return t!==X&&null!==t}function p(t,e,i){var n,r;if(o(e))d(i)?t.setAttribute(e,i):t&&t.getAttribute&&(r=t.getAttribute(e));else if(d(e)&&s(e))for(n in e)t.setAttribute(n,e[n]);return r}function u(t){return r(t)?t:[t]}function f(t,e,i){if(e)return setTimeout(t,e,i);t.call(0,i)}function g(t,e){Ct&&!Ot&&e&&e.opacity!==X&&(e.filter="alpha(opacity="+100*e.opacity+")"),de(t.style,e)}function m(t,e,i,n,o){var s=ut.createElement(t);return e&&de(s,e),o&&g(s,{padding:0,border:"none",margin:0}),i&&g(s,i),n&&n.appendChild(s),s}function x(t,e){var i=function(){};return i.prototype=new t,de(i.prototype,e),i}function y(t,e){return new Array((e||2)+1-String(t).length).join(0)+t}function v(t,e){return/%$/.test(t)?e*parseFloat(t)/100:parseFloat(t)}function b(t){return 6e4*($&&$(t)||q||0)}function k(t,e){var i,n=N.lang;return/f$/.test(t)?(i=(i=t.match(/\.([0-9])/))?i[1]:-1,null!==e&&(e=dt.numberFormat(e,i,n.decimalPoint,t.indexOf(",")>-1?n.thousandsSep:""))):e=V(t,e),e}function w(t,e){for(var i,n,o,s,r,a,l,h="{",c=!1,d=[];-1!==(l=t.indexOf(h));){if(i=t.slice(0,l),c){for(r=(o=(n=i.split(":")).shift().split(".")).length,a=e,s=0;s<r;s++)a=a[o[s]];n.length&&(a=k(n.join(":"),a)),d.push(a)}else d.push(i);t=t.slice(l+1),h=(c=!c)?"}":"{"}return d.push(t),d.join("")}function A(t){return ft.pow(10,mt(ft.log(t)/ft.LN10))}function S(t,e,i,n,o){var s,r,a=t;for(s=t/(i=pe(i,1)),e||(e=[1,2,2.5,5,10],!1===n&&(1===i?e=[1,2,5,10]:i<=.1&&(e=[1/i]))),r=0;r<e.length&&(a=e[r],!(o&&a*i>=t||!o&&s<=(e[r]+(e[r+1]||e[r]))/2));r++);return a*=i}function T(t,e){var i,n,o=t.length;for(n=0;n<o;n++)t[n].safeI=n;for(t.sort(function(t,n){return 0===(i=e(t,n))?t.safeI-n.safeI:i}),n=0;n<o;n++)delete t[n].safeI}function P(t){for(var e=t.length,i=t[0];e--;)t[e]<i&&(i=t[e]);return i}function C(t){for(var e=t.length,i=t[0];e--;)t[e]>i&&(i=t[e]);return i}function M(t,e){var i;for(i in t)t[i]&&t[i]!==e&&t[i].destroy&&t[i].destroy(),delete t[i]}function L(t){F||(F=m(Yt)),t&&F.appendChild(t),F.innerHTML=""}function D(t,e){return parseFloat(t.toPrecision(e||14))}function I(t,e){e.renderer.globalAnimation=pe(t,e.animation)}function B(){var t=N.global,e=t.useUTC,i=e?"getUTC":"get",n=e?"setUTC":"set";Z=t.Date||window.Date,q=e&&t.timezoneOffset,$=e&&t.getTimezoneOffset,K=function(t,i,n,o,s,r){var a;return e?(a=Z.UTC.apply(0,arguments),a+=b(a)):a=new Z(t,i,pe(n,1),pe(o,0),pe(s,0),pe(r,0)).getTime(),a},J=i+"Minutes",Q=i+"Hours",tt=i+"Day",et=i+"Date",it=i+"Month",nt=i+"FullYear",ot=n+"Milliseconds",st=n+"Seconds",rt=n+"Minutes",at=n+"Hours",lt=n+"Date",ht=n+"Month",ct=n+"FullYear"}function O(t){if(!(this instanceof O))return new O(t);this.init(t)}function z(){}function R(t,e,i,n){this.axis=t,this.pos=e,this.type=i||"",this.isNew=!0,i||n||this.addLabel()}function E(t,e,i,n,o){var s=t.chart.inverted;this.axis=t,this.isNegative=i,this.options=e,this.x=n,this.total=null,this.points={},this.stack=o,this.alignOptions={align:e.align||(s?i?"left":"right":"center"),verticalAlign:e.verticalAlign||(s?"middle":i?"bottom":"top"),y:pe(e.y,s?4:i?14:-6),x:pe(e.x,s?i?-6:6:0)},this.textAlign=e.textAlign||(s?i?"right":"left":"center")}function W(t){var e=t.options,i=e.navigator,n=i.enabled,o=e.scrollbar,s=o.enabled,r=n?i.height:0,a=s?o.height:0;this.handles=[],this.scrollbarButtons=[],this.elementsToDestroy=[],this.chart=t,this.setBaseSeries(),this.height=r,this.scrollbarHeight=a,this.scrollbarEnabled=s,this.navigatorEnabled=n,this.navigatorOptions=i,this.scrollbarOptions=o,this.outlineHeight=r+a,this.init()}function H(t){this.init(t)}var X,G,Y,F,N,V,_,U,j,Z,K,q,$,J,Q,tt,et,it,nt,ot,st,rt,at,lt,ht,ct,dt,pt=t||window,ut=pt.document,ft=Math,gt=ft.round,mt=ft.floor,xt=ft.ceil,yt=ft.max,vt=ft.min,bt=ft.abs,kt=ft.cos,wt=ft.sin,At=ft.PI,St=2*At/360,Tt=navigator.userAgent,Pt=pt.opera,Ct=/(msie|trident|edge)/i.test(Tt)&&!Pt,Mt=8===ut.documentMode,Lt=!Ct&&/AppleWebKit/.test(Tt),Dt=/Firefox/.test(Tt),It=/(Mobile|Android|Windows Phone)/.test(Tt),Bt="http://www.w3.org/2000/svg",Ot=!!ut.createElementNS&&!!ut.createElementNS(Bt,"svg").createSVGRect,zt=Dt&&parseInt(Tt.split("Firefox/")[1],10)<4,Rt=!Ot&&!Ct&&!!ut.createElement("canvas").getContext,Et={},Wt=0,Ht=function(){},Xt=[],Gt=0,Yt="div",Ft="absolute",Nt="hidden",Vt="highcharts-",_t="visible",Ut="px",jt="none",Zt="M",Kt="L",qt=/^[0-9]+$/,$t=["plotTop","marginRight","marginBottom","plotLeft"],Jt={};if(pt.Highcharts)return pt.Highcharts;(dt=pt.Highcharts?e(16,!0):function(t){return dt.loadAdapter(t),dt}).seriesTypes=Jt;var Qt,te,ee,ie,ne,oe,se,re,ae,le,he,ce,de=dt.extend=function(t,e){var i;for(i in t||(t={}),e)t[i]=e[i];return t},pe=dt.pick=function(){var t,e,i=arguments,n=i.length;for(t=0;t<n;t++)if((e=i[t])!==X&&null!==e)return e},ue=dt.wrap=function(t,e,i){var n=t[e];t[e]=function(){var t=Array.prototype.slice.call(arguments);return t.unshift(n),i.apply(this,t)}};V=function(t,e,i){if(!d(e)||isNaN(e))return N.lang.invalidDate||"";t=pe(t,"%Y-%m-%d %H:%M:%S");var n,o=new Z(e-b(e)),s=o[Q](),r=o[tt](),a=o[et](),l=o[it](),h=o[nt](),c=N.lang,p=c.weekdays,u=de({a:p[r].substr(0,3),A:p[r],d:y(a),e:a,w:r,b:c.shortMonths[l],B:c.months[l],m:y(l+1),y:h.toString().substr(2,2),Y:h,H:y(s),k:s,I:y(s%12||12),l:s%12||12,M:y(o[J]()),p:s<12?"AM":"PM",P:s<12?"am":"pm",S:y(o.getSeconds()),L:y(gt(e%1e3),3)},dt.dateFormats);for(n in u)for(;-1!==t.indexOf("%"+n);)t=t.replace("%"+n,"function"==typeof u[n]?u[n](e):u[n]);return i?t.substr(0,1).toUpperCase()+t.substr(1):t},U={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},dt.numberFormat=function(t,e,i,o){var s=N.lang,r=+t||0,a=-1===e?Math.min((r.toString().split(".")[1]||"").length,20):isNaN(e=Math.abs(e))?2:e,l=void 0===i?s.decimalPoint:i,h=void 0===o?s.thousandsSep:o,c=r<0?"-":"",d=String(n(r=bt(r).toFixed(a))),p=d.length>3?d.length%3:0;return c+(p?d.substr(0,p)+h:"")+d.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+h)+(a?l+bt(r-d).toFixed(a).slice(2):"")},_={init:function(t,e,i){e=e||"";var n,o,s,r,a,l=t.shift,h=e.indexOf("C")>-1,c=h?7:3,d=e.split(" "),p=[].concat(i),u=function(t){for(s=t.length;s--;)t[s]===Zt&&t.splice(s+1,0,t[s+1],t[s+2],t[s+1],t[s+2])};if(h&&(u(d),u(p)),t.isArea&&(r=d.splice(d.length-6,6),a=p.splice(p.length-6,6)),l<=p.length/c&&d.length===p.length)for(;l--;)p=[].concat(p).splice(0,c).concat(p);if(t.shift=0,d.length)for(n=p.length;d.length<n;)o=[].concat(d).splice(d.length-c,c),h&&(o[c-6]=o[c-2],o[c-5]=o[c-1]),d=d.concat(o);return r&&(d=d.concat(r),p=p.concat(a)),[d,p]},step:function(t,e,i,n){var o,s=[],r=t.length;if(1===i)s=n;else if(r===e.length&&i<1)for(;r--;)o=parseFloat(t[r]),s[r]=isNaN(o)?t[r]:i*parseFloat(e[r]-o)+o;else s=e;return s}},dt.loadAdapter=function(t){var e;t&&(t.fn&&t.fn.jquery&&(t={init:function(t){var i=e.fx;e.extend(e.easing,{easeOutQuad:function(t,e,i,n,o){return-n*(e/=o)*(e-2)+i}}),e.each(["cur","_default","width","height","opacity"],function(t,n){var o,s=i.step;"cur"===n?s=i.prototype:"_default"===n&&e.Tween&&(s=e.Tween.propHooks[n],n="set"),(o=s[n])&&(s[n]=function(e){var i,s;if("align"!==(s=t?e:this).prop)return(i=s.elem).attr?i.attr(s.prop.replace("strokeWidth","stroke-width"),"cur"===n?void 0:s.now):o.apply(this,arguments)})}),ue(e.cssHooks.opacity,"get",function(t,e,i){return e.attr?e.opacity||0:t.call(this,e,i)}),this.addAnimSetter("d",function(e){var i,n=e.elem;e.started||(i=t.init(n,n.d,n.toD),e.start=i[0],e.end=i[1],e.started=!0),n.attr("d",t.step(e.start,e.end,e.pos,n.toD))}),this.each=Array.prototype.forEach?function(t,e){return Array.prototype.forEach.call(t,e)}:function(t,e){var i,n=t.length;for(i=0;i<n;i++)if(!1===e.call(t[i],t[i],i,t))return i},e.fn.highcharts=function(){var t,e,i="Chart",n=arguments;return this[0]&&(o(n[0])&&(i=n[0],n=Array.prototype.slice.call(n,1)),(t=n[0])!==X&&(t.chart=t.chart||{},t.chart.renderTo=this[0],e=new dt[i](t,n[1]),e=this),t===X&&(e=Xt[p(this[0],"data-highcharts-chart")])),e}},addAnimSetter:function(t,i){e.Tween?e.Tween.propHooks[t]={set:i}:e.fx.step[t]=i},getScript:(e=t).getScript,inArray:e.inArray,adapterRun:function(t,i){return e(t)[i]()},grep:e.grep,map:function(t,e){var i,n=[],o=t.length;for(i=0;i<o;i++)n[i]=e.call(t[i],t[i],i,t);return n},offset:function(t){return e(t).offset()},addEvent:function(t,i,n){e(t).bind(i,n)},removeEvent:function(t,i,n){var o=ut.removeEventListener?"removeEventListener":"detachEvent";ut[o]&&t&&!t[o]&&(t[o]=function(){}),e(t).unbind(i,n)},fireEvent:function(t,i,n,o){var s,r=e.Event(i),a="detached"+i;!Ct&&n&&(delete n.layerX,delete n.layerY,delete n.returnValue),de(r,n),t[i]&&(t[a]=t[i],t[i]=null),e.each(["preventDefault","stopPropagation"],function(t,e){var i=r[e];r[e]=function(){try{i.call(r)}catch(t){"preventDefault"===e&&(s=!0)}}}),e(t).trigger(r),t[a]&&(t[i]=t[a],t[a]=null),!o||r.isDefaultPrevented()||s||o(r)},washMouseEvent:function(t){var e=t.originalEvent||t;return e.pageX===X&&(e.pageX=t.pageX,e.pageY=t.pageY),e},animate:function(t,i,n){var o=e(t);t.style||(t.style={}),i.d&&(t.toD=i.d,i.d=1),o.stop(),i.opacity!==X&&t.attr&&(i.opacity+="px"),t.hasAnim=1,o.animate(i,n)},stop:function(t){t.hasAnim&&e(t).stop()}}),t.init&&(t.init(_),delete t.init),dt.extend(dt,t),Qt=dt.adapterRun,te=dt.inArray,ee=dt.each,ie=dt.grep,ne=dt.offset,oe=dt.map,se=dt.addEvent,re=dt.removeEvent,ae=dt.fireEvent,le=dt.washMouseEvent,he=dt.animate,ce=dt.stop)},dt.loadAdapter(pt.HighchartsAdapter||pt.jQuery);var fe=(N={colors:["#7cb5ec","#434348","#90ed7d","#f7a35c","#8085e9","#f15c80","#e4d354","#2b908f","#f45b5b","#91e8e1"],symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",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"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",numericSymbols:["k","M","G","T","P","E"],resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/stock/2.1.10/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":dt.numberFormat(this.y,-1)},style:{color:"contrast",fontSize:"11px",fontWeight:"bold",textShadow:"0 0 6px contrast, 0 0 3px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3}},labels:{style:{position:Ft,color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:Ft,width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:Ft,backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:Ot,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:It?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}}).plotOptions,ge=fe.line;B(),O.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(t){return[n(t[1]),n(t[2]),n(t[3]),parseFloat(t[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(t){return[n(t[1],16),n(t[2],16),n(t[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(t){return[n(t[1]),n(t[2]),n(t[3]),1]}}],init:function(t){var e,i,n,o;if(this.input=t,t&&t.stops)this.stops=oe(t.stops,function(t){return new O(t[1])});else for(n=this.parsers.length;n--&&!i;)(e=(o=this.parsers[n]).regex.exec(t))&&(i=o.parse(e));this.rgba=i||[]},get:function(t){var e,n=this.input,o=this.rgba;return this.stops?((e=i(n)).stops=[].concat(e.stops),ee(this.stops,function(i,n){e.stops[n]=[e.stops[n][0],i.get(t)]})):e=o&&!isNaN(o[0])?"rgb"===t||!t&&1===o[3]?"rgb("+o[0]+","+o[1]+","+o[2]+")":"a"===t?o[3]:"rgba("+o.join(",")+")":n,e},brighten:function(t){var e,i=this.rgba;if(this.stops)ee(this.stops,function(e){e.brighten(t)});else if(a(t)&&0!==t)for(e=0;e<3;e++)i[e]+=n(255*t),i[e]<0&&(i[e]=0),i[e]>255&&(i[e]=255);return this},setOpacity:function(t){return this.rgba[3]=t,this}},z.prototype={opacity:1,textProps:["direction","fontSize","fontWeight","fontFamily","fontStyle","color","lineHeight","width","textDecoration","textOverflow","textShadow"],init:function(t,e){this.element="span"===e?m(e):ut.createElementNS(Bt,e),this.renderer=t},animate:function(t,e,n){var o=pe(e,this.renderer.globalAnimation,!0);return ce(this),o?(o=i(o,{}),n&&(o.complete=n),he(this,t,o)):this.attr(t,null,n),this},colorGradient:function(t,e,n){var o,s,a,l,h,c,p,u,f,g,m,x,y,v=this.renderer,b=[];if(t.linearGradient?s="linearGradient":t.radialGradient&&(s="radialGradient"),s){for(m in a=t[s],h=v.gradients,p=t.stops,g=n.radialReference,r(a)&&(t[s]=a={x1:a[0],y1:a[1],x2:a[2],y2:a[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===s&&g&&!d(a.gradientUnits)&&(l=a,a=i(a,v.getRadialAttr(g,l),{gradientUnits:"userSpaceOnUse"})),a)"id"!==m&&b.push(m,a[m]);for(m in p)b.push(p[m]);h[b=b.join(",")]?x=h[b].attr("id"):(a.id=x=Vt+Wt++,h[b]=c=v.createElement(s).attr(a).add(v.defs),c.radAttr=l,c.stops=[],ee(p,function(t){var e;0===t[1].indexOf("rgba")?(o=O(t[1]),u=o.get("rgb"),f=o.get("a")):(u=t[1],f=1),e=v.createElement("stop").attr({offset:t[0],"stop-color":u,"stop-opacity":f}).add(c),c.stops.push(e)})),y="url("+v.url+"#"+x+")",n.setAttribute(e,y),n.gradient=b,t.toString=function(){return y}}},applyTextShadow:function(t){var e,i=this.element,o=-1!==t.indexOf("contrast"),s={},r=this.renderer.forExport,a=r||i.style.textShadow!==X&&!Ct;o&&(s.textShadow=t=t.replace(/contrast/g,this.renderer.getContrast(i.style.fill))),(Lt||r)&&(s.textRendering="geometricPrecision"),a?this.css(s):(this.fakeTS=!0,this.ySetter=this.xSetter,e=[].slice.call(i.getElementsByTagName("tspan")),ee(t.split(/\s?,\s?/g),function(t){var o,s,r=i.firstChild;t=t.split(" "),o=t[t.length-1],(s=t[t.length-2])&&ee(e,function(t,e){var a;0===e&&(t.setAttribute("x",i.getAttribute("x")),e=i.getAttribute("y"),t.setAttribute("y",e||0),null===e&&i.setAttribute("y",0)),p(a=t.cloneNode(1),{class:Vt+"text-shadow",fill:o,stroke:o,"stroke-opacity":1/yt(n(s),3),"stroke-width":s,"stroke-linejoin":"round"}),i.insertBefore(a,r)})}))},attr:function(t,e,i){var n,o,s,r,a=this.element,l=this;if("string"==typeof t&&e!==X&&(n=t,(t={})[n]=e),"string"==typeof t)l=(this[t+"Getter"]||this._defaultGetter).call(this,t,a);else{for(n in t)o=t[n],r=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(n)&&(s||(this.symbolAttr(t),s=!0),r=!0),!this.rotation||"x"!==n&&"y"!==n||(this.doTransform=!0),r||(this[n+"Setter"]||this._defaultSetter).call(this,o,n,a),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(n)&&this.updateShadows(n,o);this.doTransform&&(this.updateTransform(),this.doTransform=!1)}return i&&i(),l},updateShadows:function(t,e){for(var i=this.shadows,n=i.length;n--;)i[n].setAttribute(t,"height"===t?Math.max(e-(i[n].cutHeight||0),0):"d"===t?this.d:e)},addClass:function(t){var e=this.element,i=p(e,"class")||"";return-1===i.indexOf(t)&&p(e,"class",i+" "+t),this},symbolAttr:function(t){var e=this;ee(["x","y","r","start","end","width","height","innerR","anchorX","anchorY"],function(i){e[i]=pe(t[i],e[i])}),e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})},clip:function(t){return this.attr("clip-path",t?"url("+this.renderer.url+"#"+t.id+")":jt)},crisp:function(t){var e,i,n={},o=t.strokeWidth||this.strokeWidth||0;for(e in i=gt(o)%2/2,t.x=mt(t.x||this.x||0)+i,t.y=mt(t.y||this.y||0)+i,t.width=mt((t.width||this.width||0)-2*i),t.height=mt((t.height||this.height||0)-2*i),t.strokeWidth=o,t)this[e]!==t[e]&&(this[e]=n[e]=t[e]);return n},css:function(t){var e,i,o,s=this.styles,r={},a=this.element,l="",h=!s;if(t&&t.color&&(t.fill=t.color),s)for(i in t)t[i]!==s[i]&&(r[i]=t[i],h=!0);if(h){if(e=this.textWidth=t&&t.width&&"text"===a.nodeName.toLowerCase()&&n(t.width)||this.textWidth,s&&(t=de(s,r)),this.styles=t,e&&(Rt||!Ot&&this.renderer.forExport)&&delete t.width,Ct&&!Ot)g(this.element,t);else{for(i in o=function(t,e){return"-"+e.toLowerCase()},t)l+=i.replace(/([A-Z])/g,o)+":"+t[i]+";";p(a,"style",l)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(t,e){var i=this,n=i.element;return Y&&"click"===t?(n.ontouchstart=function(t){i.touchEventFired=Z.now(),t.preventDefault(),e.call(n,t)},n.onclick=function(t){(-1===Tt.indexOf("Android")||Z.now()-(i.touchEventFired||0)>1100)&&e.call(n,t)}):n["on"+t]=e,this},setRadialReference:function(t){var e=this.renderer.gradients[this.element.gradient];return this.element.radialReference=t,e&&e.radAttr&&e.animate(this.renderer.getRadialAttr(t,e.radAttr)),this},translate:function(t,e){return this.attr({translateX:t,translateY:e})},invert:function(){return this.inverted=!0,this.updateTransform(),this},updateTransform:function(){var t,e=this.translateX||0,i=this.translateY||0,n=this.scaleX,o=this.scaleY,s=this.inverted,r=this.rotation,a=this.element;s&&(e+=this.attr("width"),i+=this.attr("height")),t=["translate("+e+","+i+")"],s?t.push("rotate(90) scale(-1,1)"):r&&t.push("rotate("+r+" "+(a.getAttribute("x")||0)+" "+(a.getAttribute("y")||0)+")"),(d(n)||d(o))&&t.push("scale("+pe(n,1)+" "+pe(o,1)+")"),t.length&&a.setAttribute("transform",t.join(" "))},toFront:function(){var t=this.element;return t.parentNode.appendChild(t),this},align:function(t,e,i){var n,s,r,a,l,h={},d=this.renderer,p=d.alignedObjects;return t?(this.alignOptions=t,this.alignByTranslate=e,i&&!o(i)||(this.alignTo=l=i||"renderer",c(p,this),p.push(this),i=null)):(t=this.alignOptions,e=this.alignByTranslate,l=this.alignTo),i=pe(i,d[l],d),n=t.align,s=t.verticalAlign,r=(i.x||0)+(t.x||0),a=(i.y||0)+(t.y||0),"right"!==n&&"center"!==n||(r+=(i.width-(t.width||0))/{right:1,center:2}[n]),h[e?"translateX":"x"]=gt(r),"bottom"!==s&&"middle"!==s||(a+=(i.height-(t.height||0))/({bottom:1,middle:2}[s]||1)),h[e?"translateY":"y"]=gt(a),this[this.placed?"animate":"attr"](h),this.placed=!0,this.alignAttr=h,this},getBBox:function(t,e){var i,n,o,s,r,a,l,h,c=this.renderer,d=this.element,p=this.styles,u=this.textStr,f=d.style,g=c.cache,m=c.cacheKeys;if(r=(s=pe(e,this.rotation))*St,u!==X&&(h=["",s||0,p&&p.fontSize,d.style.width].join(","),h=""===u||qt.test(u)?"num:"+u.toString().length+h:u+h),h&&!t&&(i=g[h]),!i){if(d.namespaceURI===Bt||c.forExport){try{l=this.fakeTS&&function(t){ee(d.querySelectorAll("."+Vt+"text-shadow"),function(e){e.style.display=t})},Dt&&f.textShadow?(a=f.textShadow,f.textShadow=""):l&&l(jt),i=d.getBBox?de({},d.getBBox()):{width:d.offsetWidth,height:d.offsetHeight},a?f.textShadow=a:l&&l("")}catch(t){}(!i||i.width<0)&&(i={width:0,height:0})}else i=this.htmlGetBBox();if(c.isSVG&&(n=i.width,o=i.height,Ct&&p&&"11px"===p.fontSize&&"16.9"===o.toPrecision(3)&&(i.height=o=14),s&&(i.width=bt(o*wt(r))+bt(n*kt(r)),i.height=bt(o*kt(r))+bt(n*wt(r)))),h){for(;m.length>250;)delete g[m.shift()];g[h]||m.push(h),g[h]=i}}return i},show:function(t){return this.attr({visibility:t?"inherit":_t})},hide:function(){return this.attr({visibility:Nt})},fadeOut:function(t){var e=this;e.animate({opacity:0},{duration:t||150,complete:function(){e.attr({y:-9999})}})},add:function(t){var e,i=this.renderer,n=this.element;return t&&(this.parentGroup=t),this.parentInverted=t&&t.inverted,void 0!==this.textStr&&i.buildText(this),this.added=!0,(!t||t.handleZ||this.zIndex)&&(e=this.zIndexSetter()),e||(t?t.element:i.box).appendChild(n),this.onAdd&&this.onAdd(),this},safeRemoveChild:function(t){var e=t.parentNode;e&&e.removeChild(t)},destroy:function(){var t,e,i,n=this,o=n.element||{},s=n.shadows,r=n.renderer.isSVG&&"SPAN"===o.nodeName&&n.parentGroup;if(o.onclick=o.onmouseout=o.onmouseover=o.onmousemove=o.point=null,ce(n),n.clipPath&&(n.clipPath=n.clipPath.destroy()),n.stops){for(i=0;i<n.stops.length;i++)n.stops[i]=n.stops[i].destroy();n.stops=null}for(n.safeRemoveChild(o),s&&ee(s,function(t){n.safeRemoveChild(t)});r&&r.div&&0===r.div.childNodes.length;)t=r.parentGroup,n.safeRemoveChild(r.div),delete r.div,r=t;for(e in n.alignTo&&c(n.renderer.alignedObjects,n),n)delete n[e];return null},shadow:function(t,e,i){var n,o,s,r,a,l,h=[],c=this.element;if(t){for(r=pe(t.width,3),a=(t.opacity||.15)/r,l=this.parentInverted?"(-1,-1)":"("+pe(t.offsetX,1)+", "+pe(t.offsetY,1)+")",n=1;n<=r;n++)s=2*r+1-2*n,p(o=c.cloneNode(0),{isShadow:"true",stroke:t.color||"black","stroke-opacity":a*n,"stroke-width":s,transform:"translate"+l,fill:jt}),i&&(p(o,"height",yt(p(o,"height")-s,0)),o.cutHeight=s),e?e.element.appendChild(o):c.parentNode.insertBefore(o,c),h.push(o);this.shadows=h}return this},xGetter:function(t){return"circle"===this.element.nodeName&&(t={x:"cx",y:"cy"}[t]||t),this._defaultGetter(t)},_defaultGetter:function(t){var e=pe(this[t],this.element?this.element.getAttribute(t):null,0);return/^[\-0-9\.]+$/.test(e)&&(e=parseFloat(e)),e},dSetter:function(t,e,i){t&&t.join&&(t=t.join(" ")),/(NaN| {2}|^$)/.test(t)&&(t="M 0 0"),i.setAttribute(e,t),this[e]=t},dashstyleSetter:function(t){var e;if(t=t&&t.toLowerCase()){for(e=(t=t.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",")).length;e--;)t[e]=n(t[e])*this["stroke-width"];t=t.join(",").replace("NaN","none"),this.element.setAttribute("stroke-dasharray",t)}},alignSetter:function(t){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[t])},opacitySetter:function(t,e,i){this[e]=t,i.setAttribute(e,t)},titleSetter:function(t){var e=this.element.getElementsByTagName("title")[0];e||(e=ut.createElementNS(Bt,"title"),this.element.appendChild(e)),e.appendChild(ut.createTextNode(String(pe(t),"").replace(/<[^>]*>/g,"")))},textSetter:function(t){t!==this.textStr&&(delete this.bBox,this.textStr=t,this.added&&this.renderer.buildText(this))},fillSetter:function(t,e,i){"string"==typeof t?i.setAttribute(e,t):t&&this.colorGradient(t,e,i)},visibilitySetter:function(t,e,i){"inherit"===t?i.removeAttribute(e):i.setAttribute(e,t)},zIndexSetter:function(t,e){var i,o,s,r,a,l=this.renderer,h=this.parentGroup,c=(h||l).element||l.box,u=this.element,f=this.added;if(d(t)&&(u.setAttribute(e,t),t=+t,this[e]===t&&(f=!1),this[e]=t),f){for((t=this.zIndex)&&h&&(h.handleZ=!0),i=c.childNodes,a=0;a<i.length&&!r;a++)s=p(o=i[a],"zIndex"),o!==u&&(n(s)>t||!d(t)&&d(s))&&(c.insertBefore(u,o),r=!0);r||c.appendChild(u)}return r},_defaultSetter:function(t,e,i){i.setAttribute(e,t)}},z.prototype.yGetter=z.prototype.xGetter,z.prototype.translateXSetter=z.prototype.translateYSetter=z.prototype.rotationSetter=z.prototype.verticalAlignSetter=z.prototype.scaleXSetter=z.prototype.scaleYSetter=function(t,e){this[e]=t,this.doTransform=!0},z.prototype["stroke-widthSetter"]=z.prototype.strokeSetter=function(t,e,i){this[e]=t,this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],z.prototype.fillSetter.call(this,this.stroke,"stroke",i),i.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===e&&0===t&&this.hasStroke&&(i.removeAttribute("stroke"),this.hasStroke=!1)};var me,xe,ye,ve,be=function(){this.init.apply(this,arguments)};if(be.prototype={Element:z,init:function(t,e,i,n,o,s){var r,a,l,h,c=location;a=(r=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(n))).element,t.appendChild(a),-1===t.innerHTML.indexOf("xmlns")&&p(a,"xmlns",Bt),this.isSVG=!0,this.box=a,this.boxWrapper=r,this.alignedObjects=[],this.url=(Dt||Lt)&&ut.getElementsByTagName("base").length?c.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(ut.createTextNode("Created with Highstock 2.1.10")),this.defs=this.createElement("defs").add(),this.allowHTML=s,this.forExport=o,this.gradients={},this.cache={},this.cacheKeys=[],this.setSize(e,i,!1),Dt&&t.getBoundingClientRect&&(this.subPixelFix=l=function(){g(t,{left:0,top:0}),h=t.getBoundingClientRect(),g(t,{left:xt(h.left)-h.left+Ut,top:xt(h.top)-h.top+Ut})},l(),se(pt,"resize",l))},getStyle:function(t){return this.style=de({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},t),this.style},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),M(this.gradients||{}),this.gradients=null,t&&(this.defs=t.destroy()),this.subPixelFix&&re(pt,"resize",this.subPixelFix),this.alignedObjects=null,null},createElement:function(t){var e=new this.Element;return e.init(this,t),e},draw:function(){},getRadialAttr:function(t,e){return{cx:t[0]-t[2]/2+e.cx*t[2],cy:t[1]-t[2]/2+e.cy*t[2],r:e.r*t[2]}},buildText:function(t){for(var e,i,o,s=t.element,r=this,a=r.forExport,l=pe(t.textStr,"").toString(),h=-1!==l.indexOf("<"),c=s.childNodes,d=p(s,"x"),u=t.styles,f=t.textWidth,m=u&&u.lineHeight,x=u&&u.textShadow,y=u&&"ellipsis"===u.textOverflow,v=c.length,b=f&&!t.added&&this.box,k=function(t){return m?n(m):r.fontMetrics(/(px|em)$/.test(t&&t.style.fontSize)?t.style.fontSize:u&&u.fontSize||r.style.fontSize||12,t).h},w=function(t){return t.replace(/&lt;/g,"<").replace(/&gt;/g,">")};v--;)s.removeChild(c[v]);h||x||y||-1!==l.indexOf(" ")?(i=/<.*style="([^"]+)".*>/,o=/<.*href="(http[^"]+)".*>/,b&&b.appendChild(s),""===(e=h?l.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[l])[e.length-1]&&e.pop(),ee(e,function(e,n){var l,h=0;e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||"),l=e.split("|||"),ee(l,function(e){if(""!==e||1===l.length){var c,m={},x=ut.createElementNS(Bt,"tspan");if(i.test(e)&&p(x,"style",c=e.match(i)[1].replace(/(;| |^)color([ :])/,"$1fill$2")),o.test(e)&&!a&&(p(x,"onclick",'location.href="'+e.match(o)[1]+'"'),g(x,{cursor:"pointer"}))," "!==(e=w(e.replace(/<(.|\n)*?>/g,"")||" "))){if(x.appendChild(ut.createTextNode(e)),h?m.dx=0:n&&null!==d&&(m.x=d),p(x,m),s.appendChild(x),!h&&n&&(!Ot&&a&&g(x,{display:"block"}),p(x,"dy",k(x))),f){for(var v,b,A,S=e.replace(/([^\^])-/g,"$1- ").split(" "),T=l.length>1||n||S.length>1&&"nowrap"!==u.whiteSpace,P=[],C=k(x),M=t.rotation,L=e,D=L.length;(T||y)&&(S.length||P.length);)t.rotation=0,A=t.getBBox(!0).width,!Ot&&r.forExport&&(A=r.measureSpanWidth(x.firstChild.data,t.styles)),v=A>f,void 0===b&&(b=v),y&&b?(D/=2,""===L||!v&&D<.5?S=[]:(v&&(b=!0),S=[(L=e.substring(0,L.length+(v?-1:1)*xt(D)))+(f>3?"…":"")],x.removeChild(x.firstChild))):v&&1!==S.length?(x.removeChild(x.firstChild),P.unshift(S.pop())):(S=P,P=[],S.length&&(0,p(x=ut.createElementNS(Bt,"tspan"),{dy:C,x:d}),c&&p(x,"style",c),s.appendChild(x)),A>f&&(f=A)),S.length&&x.appendChild(ut.createTextNode(S.join(" ").replace(/- /g,"-")));b&&t.attr("title",t.textStr),t.rotation=M}h++}}})}),b&&b.removeChild(s),x&&t.applyTextShadow&&t.applyTextShadow(x)):s.appendChild(ut.createTextNode(w(l)))},getContrast:function(t){return(t=O(t).rgba)[0]+t[1]+t[2]>384?"#000000":"#FFFFFF"},button:function(t,e,n,o,s,r,a,l,h){var c,d,p,u,f,g,m=this.label(t,e,n,h,null,null,null,null,"button"),x=0,y={x1:0,y1:0,x2:0,y2:1};return s=i({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:y,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},s),p=s.style,delete s.style,r=i(s,{stroke:"#68A",fill:{linearGradient:y,stops:[[0,"#FFF"],[1,"#ACF"]]}},r),u=r.style,delete r.style,a=i(s,{stroke:"#68A",fill:{linearGradient:y,stops:[[0,"#9BD"],[1,"#CDF"]]}},a),f=a.style,delete a.style,l=i(s,{style:{color:"#CCC"}},l),g=l.style,delete l.style,se(m.element,Ct?"mouseover":"mouseenter",function(){3!==x&&m.attr(r).css(u)}),se(m.element,Ct?"mouseout":"mouseleave",function(){3!==x&&(c=[s,r,a][x],d=[p,u,f][x],m.attr(c).css(d))}),m.setState=function(t){m.state=x=t,t?2===t?m.attr(a).css(f):3===t&&m.attr(l).css(g):m.attr(s).css(p)},m.on("click",function(t){3!==x&&o.call(m,t)}).attr(s).css(de({cursor:"default"},p))},crispLine:function(t,e){return t[1]===t[4]&&(t[1]=t[4]=gt(t[1])-e%2/2),t[2]===t[5]&&(t[2]=t[5]=gt(t[2])+e%2/2),t},path:function(t){var e={fill:jt};return r(t)?e.d=t:s(t)&&de(e,t),this.createElement("path").attr(e)},circle:function(t,e,i){var n=s(t)?t:{x:t,y:e,r:i},o=this.createElement("circle");return o.xSetter=function(t){this.element.setAttribute("cx",t)},o.ySetter=function(t){this.element.setAttribute("cy",t)},o.attr(n)},arc:function(t,e,i,n,o,r){var a;return s(t)&&(e=t.y,i=t.r,n=t.innerR,o=t.start,r=t.end,t=t.x),(a=this.symbol("arc",t||0,e||0,i||0,i||0,{innerR:n||0,start:o||0,end:r||0})).r=i,a},rect:function(t,e,i,n,o,r){o=s(t)?t.r:o;var a=this.createElement("rect"),l=s(t)?t:t===X?{}:{x:t,y:e,width:yt(i,0),height:yt(n,0)};return r!==X&&(l.strokeWidth=r,l=a.crisp(l)),o&&(l.r=o),a.rSetter=function(t){p(this.element,{rx:t,ry:t})},a.attr(l)},setSize:function(t,e,i){var n=this.alignedObjects,o=n.length;for(this.width=t,this.height=e,this.boxWrapper[pe(i,!0)?"animate":"attr"]({width:t,height:e});o--;)n[o].align()},g:function(t){var e=this.createElement("g");return d(t)?e.attr({class:Vt+t}):e},image:function(t,e,i,n,o){var s,r={preserveAspectRatio:jt};return arguments.length>1&&de(r,{x:e,y:i,width:n,height:o}),(s=this.createElement("image").attr(r)).element.setAttributeNS?s.element.setAttributeNS("http://www.w3.org/1999/xlink","href",t):s.element.setAttribute("hc-svg-href",t),s},symbol:function(t,e,i,n,o,s){var r,a,l,h,c=this.symbols[t],d=c&&c(gt(e),gt(i),n,o,s),p=/^url\((.*?)\)$/;return d?(r=this.path(d),de(r,{symbolName:t,x:e,y:i,width:n,height:o}),s&&de(r,s)):p.test(t)&&(h=function(t,e){t.element&&(t.attr({width:e[0],height:e[1]}),t.alignByTranslate||t.translate(gt((n-e[0])/2),gt((o-e[1])/2)))},a=t.match(p)[1],l=Et[a]||s&&s.width&&s.height&&[s.width,s.height],(r=this.image(a).attr({x:e,y:i})).isImg=!0,l?h(r,l):(r.attr({width:0,height:0}),m("img",{onload:function(){0===this.width&&(g(this,{position:Ft,top:"-999em"}),document.body.appendChild(this)),h(r,Et[a]=[this.width,this.height]),this.parentNode&&this.parentNode.removeChild(this)},src:a}))),r},symbols:{circle:function(t,e,i,n){var o=.166*i;return[Zt,t+i/2,e,"C",t+i+o,e,t+i+o,e+n,t+i/2,e+n,"C",t-o,e+n,t-o,e,t+i/2,e,"Z"]},square:function(t,e,i,n){return[Zt,t,e,Kt,t+i,e,t+i,e+n,t,e+n,"Z"]},triangle:function(t,e,i,n){return[Zt,t+i/2,e,Kt,t+i,e+n,t,e+n,"Z"]},"triangle-down":function(t,e,i,n){return[Zt,t,e,Kt,t+i,e,t+i/2,e+n,"Z"]},diamond:function(t,e,i,n){return[Zt,t+i/2,e,Kt,t+i,e+n/2,t+i/2,e+n,t,e+n/2,"Z"]},arc:function(t,e,i,n,o){var s=o.start,r=o.r||i||n,a=o.end-.001,l=o.innerR,h=o.open,c=kt(s),d=wt(s),p=kt(a),u=wt(a),f=o.end-s<At?0:1;return[Zt,t+r*c,e+r*d,"A",r,r,0,f,1,t+r*p,e+r*u,h?Zt:Kt,t+l*p,e+l*u,"A",l,l,0,f,0,t+l*c,e+l*d,h?"":"Z"]},callout:function(t,e,i,n,o){var s,r=vt(o&&o.r||0,i,n),a=r+6,l=o&&o.anchorX,h=o&&o.anchorY;return s=["M",t+r,e,"L",t+i-r,e,"C",t+i,e,t+i,e,t+i,e+r,"L",t+i,e+n-r,"C",t+i,e+n,t+i,e+n,t+i-r,e+n,"L",t+r,e+n,"C",t,e+n,t,e+n,t,e+n-r,"L",t,e+r,"C",t,e,t,e,t+r,e],l&&l>i&&h>e+a&&h<e+n-a?s.splice(13,3,"L",t+i,h-6,t+i+6,h,t+i,h+6,t+i,e+n-r):l&&l<0&&h>e+a&&h<e+n-a?s.splice(33,3,"L",t,h+6,t-6,h,t,h-6,t,e+r):h&&h>n&&l>t+a&&l<t+i-a?s.splice(23,3,"L",l+6,e+n,l,e+n+6,l-6,e+n,t+r,e+n):h&&h<0&&l>t+a&&l<t+i-a&&s.splice(3,3,"L",l-6,e,l,e-6,l+6,e,i-r,e),s}},clipRect:function(t,e,i,n){var o,s=Vt+Wt++,r=this.createElement("clipPath").attr({id:s}).add(this.defs);return(o=this.rect(t,e,i,n,0).add(r)).id=s,o.clipPath=r,o.count=0,o},text:function(t,e,i,n){var o,s=Rt||!Ot&&this.forExport,r={};return!n||!this.allowHTML&&this.forExport?(r.x=Math.round(e||0),i&&(r.y=Math.round(i)),(t||0===t)&&(r.text=t),o=this.createElement("text").attr(r),s&&o.css({position:Ft}),n||(o.xSetter=function(t,e,i){var n,o,s=i.getElementsByTagName("tspan"),r=i.getAttribute(e);for(o=0;o<s.length;o++)(n=s[o]).getAttribute(e)===r&&n.setAttribute(e,t);i.setAttribute(e,t)}),o):this.html(t,e,i)},fontMetrics:function(t,e){var i,o;return!(t=t||this.style.fontSize)&&e&&pt.getComputedStyle&&(e=e.element||e,t=(o=pt.getComputedStyle(e,""))&&o.fontSize),{h:i=(t=/px/.test(t)?n(t):/em/.test(t)?12*parseFloat(t):12)<24?t+3:gt(1.2*t),b:gt(.8*i),f:t}},rotCorr:function(t,e,i){var n=t;return e&&i&&(n=yt(n*kt(e*St),4)),{x:-t/3*wt(e*St),y:n}},label:function(t,e,n,o,s,r,a,l,h){var c,p,u,f,g,m,x,y,v,b,k,w=this,A=w.g(h),S=w.text("",0,0,a).attr({zIndex:1}),T=0,P=3,C=0,M=0,L={};v=function(){var t,e,i=S.element.style;p=(void 0===u||void 0===f||A.styles.textAlign)&&d(S.textStr)&&S.getBBox(),A.width=(u||p.width||0)+2*P+C,A.height=(f||p.height||0)+2*P,x=P+w.fontMetrics(i&&i.fontSize,S).b,y&&(c||(t=M,e=(l?-x:0)+M,A.box=c=o?w.symbol(o,t,e,A.width,A.height,L):w.rect(t,e,A.width,A.height,0,L["stroke-width"]),c.isImg||c.attr("fill",jt),c.add(A)),c.isImg||c.attr(de({width:gt(A.width),height:gt(A.height)},L)),L=null)},b=function(){var t,e=A.styles,i=e&&e.textAlign,n=C+P;t=l?0:x,d(u)&&p&&("center"===i||"right"===i)&&(n+={center:.5,right:1}[i]*(u-p.width)),n===S.x&&t===S.y||(S.attr("x",n),t!==X&&S.attr("y",t)),S.x=n,S.y=t},k=function(t,e){c?c.attr(t,e):L[t]=e},A.onAdd=function(){S.add(A),A.attr({text:t||0===t?t:"",x:e,y:n}),c&&d(s)&&A.attr({anchorX:s,anchorY:r})},A.widthSetter=function(t){u=t},A.heightSetter=function(t){f=t},A.paddingSetter=function(t){d(t)&&t!==P&&(P=A.padding=t,b())},A.paddingLeftSetter=function(t){d(t)&&t!==C&&(C=t,b())},A.alignSetter=function(t){(t={left:0,center:.5,right:1}[t])!==T&&(T=t,p&&A.attr({x:e}))},A.textSetter=function(t){t!==X&&S.textSetter(t),v(),b()},A["stroke-widthSetter"]=function(t,e){t&&(y=!0),M=t%2/2,k(e,t)},A.strokeSetter=A.fillSetter=A.rSetter=function(t,e){"fill"===e&&t&&(y=!0),k(e,t)},A.anchorXSetter=function(t,e){s=t,k(e,gt(t)-M-g)},A.anchorYSetter=function(t,e){r=t,k(e,t-m)},A.xSetter=function(t){A.x=t,T&&(t-=T*((u||p.width)+2*P)),g=gt(t),A.attr("translateX",g)},A.ySetter=function(t){m=A.y=gt(t),A.attr("translateY",m)};var D=A.css;return de(A,{css:function(t){if(t){var e={};t=i(t),ee(A.textProps,function(i){t[i]!==X&&(e[i]=t[i],delete t[i])}),S.css(e)}return D.call(A,t)},getBBox:function(){return{width:p.width+2*P,height:p.height+2*P,x:p.x-P,y:p.y-P}},shadow:function(t){return c&&c.shadow(t),A},destroy:function(){re(A.element,"mouseenter"),re(A.element,"mouseleave"),S&&(S=S.destroy()),c&&(c=c.destroy()),z.prototype.destroy.call(A),A=w=v=b=k=null}})}},G=be,de(z.prototype,{htmlCss:function(t){var e=this.element,i=t&&"SPAN"===e.tagName&&t.width;return i&&(delete t.width,this.textWidth=i,this.updateTransform()),t&&"ellipsis"===t.textOverflow&&(t.whiteSpace="nowrap",t.overflow="hidden"),this.styles=de(this.styles,t),g(this.element,t),this},htmlGetBBox:function(){var t=this.element;return"text"===t.nodeName&&(t.style.position=Ft),{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var t=this.renderer,e=this.element,i=this.translateX||0,o=this.translateY||0,s=this.x||0,r=this.y||0,a=this.textAlign||"left",l={left:0,center:.5,right:1}[a],h=this.shadows,c=this.styles;if(g(e,{marginLeft:i,marginTop:o}),h&&ee(h,function(t){g(t,{marginLeft:i+1,marginTop:o+1})}),this.inverted&&ee(e.childNodes,function(i){t.invertChild(i,e)}),"SPAN"===e.tagName){var p,u,f=this.rotation,m=n(this.textWidth),x=[f,a,e.innerHTML,this.textWidth,this.textAlign].join(",");x!==this.cTT&&(u=t.fontMetrics(e.style.fontSize).b,d(f)&&this.setSpanRotation(f,l,u),(p=pe(this.elemWidth,e.offsetWidth))>m&&/[ \-]/.test(e.textContent||e.innerText)&&(g(e,{width:m+Ut,display:"block",whiteSpace:c&&c.whiteSpace||"normal"}),p=m),this.getSpanCorrection(p,u,l,f,a)),g(e,{left:s+(this.xCorr||0)+Ut,top:r+(this.yCorr||0)+Ut}),Lt&&(u=e.offsetHeight),this.cTT=x}}else this.alignOnAdd=!0},setSpanRotation:function(t,e,i){var n={},o=Ct?"-ms-transform":Lt?"-webkit-transform":Dt?"MozTransform":Pt?"-o-transform":"";n[o]=n.transform="rotate("+t+"deg)",n[o+(Dt?"Origin":"-origin")]=n.transformOrigin=100*e+"% "+i+"px",g(this.element,n)},getSpanCorrection:function(t,e,i){this.xCorr=-t*i,this.yCorr=-e}}),de(be.prototype,{html:function(t,e,i){var n=this.createElement("span"),o=n.element,s=n.renderer;return n.textSetter=function(t){t!==o.innerHTML&&delete this.bBox,o.innerHTML=this.textStr=t,n.htmlUpdateTransform()},n.xSetter=n.ySetter=n.alignSetter=n.rotationSetter=function(t,e){"align"===e&&(e="textAlign"),n[e]=t,n.htmlUpdateTransform()},n.attr({text:t,x:gt(e),y:gt(i)}).css({position:Ft,fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),o.style.whiteSpace="nowrap",n.css=n.htmlCss,s.isSVG&&(n.add=function(t){var e,i,r=s.box.parentNode,a=[];if(this.parentGroup=t,t){if(!(e=t.div)){for(i=t;i;)a.push(i),i=i.parentGroup;ee(a.reverse(),function(t){var i,n=p(t.element,"class");n&&(n={className:n}),e=t.div=t.div||m(Yt,n,{position:Ft,left:(t.translateX||0)+Ut,top:(t.translateY||0)+Ut},e||r),i=e.style,de(t,{translateXSetter:function(e,n){i.left=e+Ut,t[n]=e,t.doTransform=!0},translateYSetter:function(e,n){i.top=e+Ut,t[n]=e,t.doTransform=!0}}),ee(["opacity","visibility"],function(e){ue(t,e+"Setter",function(t,e,n,o){t.call(this,e,n,o),i[n]=e})})})}}else e=r;return e.appendChild(o),n.added=!0,n.alignOnAdd&&n.htmlUpdateTransform(),n}),n}}),!Ot&&!Rt){xe={init:function(t,e){var i=["<",e,' filled="f" stroked="f"'],n=["position: ",Ft,";"],o=e===Yt;("shape"===e||o)&&n.push("left:0;top:0;width:1px;height:1px;"),n.push("visibility: ",o?Nt:_t),i.push(' style="',n.join(""),'"/>'),e&&(i=o||"span"===e||"img"===e?i.join(""):t.prepVML(i),this.element=m(i)),this.renderer=t},add:function(t){var e=this.renderer,i=this.element,n=e.box,o=t&&t.inverted,s=t?t.element||t:n;return t&&(this.parentGroup=t),o&&e.invertChild(i,s),s.appendChild(i),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:z.prototype.htmlUpdateTransform,setSpanRotation:function(){var t=this.rotation,e=kt(t*St),i=wt(t*St);g(this.element,{filter:t?["progid:DXImageTransform.Microsoft.Matrix(M11=",e,", M12=",-i,", M21=",i,", M22=",e,", sizingMethod='auto expand')"].join(""):jt})},getSpanCorrection:function(t,e,i,n,o){var s,r=n?kt(n*St):1,a=n?wt(n*St):0,l=pe(this.elemHeight,this.element.offsetHeight),h=o&&"left"!==o;this.xCorr=r<0&&-t,this.yCorr=a<0&&-l,s=r*a<0,this.xCorr+=a*e*(s?1-i:i),this.yCorr-=r*e*(n?s?i:1-i:1),h&&(this.xCorr-=t*i*(r<0?-1:1),n&&(this.yCorr-=l*i*(a<0?-1:1)),g(this.element,{textAlign:o}))},pathToVML:function(t){for(var e=t.length,i=[];e--;)a(t[e])?i[e]=gt(10*t[e])-5:"Z"===t[e]?i[e]="x":(i[e]=t[e],!t.isArc||"wa"!==t[e]&&"at"!==t[e]||(i[e+5]===i[e+7]&&(i[e+7]+=t[e+7]>t[e+5]?1:-1),i[e+6]===i[e+8]&&(i[e+8]+=t[e+8]>t[e+6]?1:-1)));return i.join(" ")||"x"},clip:function(t){var e,i,n=this;return t?(c(e=t.members,n),e.push(n),n.destroyClip=function(){c(e,n)},i=t.getCSS(n)):(n.destroyClip&&n.destroyClip(),i={clip:Mt?"inherit":"rect(auto)"}),n.css(i)},css:z.prototype.htmlCss,safeRemoveChild:function(t){t.parentNode&&L(t)},destroy:function(){return this.destroyClip&&this.destroyClip(),z.prototype.destroy.apply(this)},on:function(t,e){return this.element["on"+t]=function(){var t=pt.event;t.target=t.srcElement,e(t)},this},cutOffPath:function(t,e){var i;return 9!==(i=(t=t.split(/[ ,]/)).length)&&11!==i||(t[i-4]=t[i-2]=n(t[i-2])-10*e),t.join(" ")},shadow:function(t,e,i){var o,s,r,a,l,h,c,d=[],p=this.element,u=this.renderer,f=p.style,g=p.path;if(g&&"string"!=typeof g.value&&(g="x"),l=g,t){for(h=pe(t.width,3),c=(t.opacity||.15)/h,o=1;o<=3;o++)a=2*h+1-2*o,i&&(l=this.cutOffPath(g.value,a+.5)),r=['<shape isShadow="true" strokeweight="',a,'" filled="false" path="',l,'" coordsize="10 10" style="',p.style.cssText,'" />'],s=m(u.prepVML(r),null,{left:n(f.left)+pe(t.offsetX,1),top:n(f.top)+pe(t.offsetY,1)}),i&&(s.cutOff=a+1),r=['<stroke color="',t.color||"black",'" opacity="',c*o,'"/>'],m(u.prepVML(r),null,null,s),e?e.element.appendChild(s):p.parentNode.insertBefore(s,p),d.push(s);this.shadows=d}return this},updateShadows:Ht,setAttr:function(t,e){Mt?this.element[t]=e:this.element.setAttribute(t,e)},classSetter:function(t){this.element.className=t},dashstyleSetter:function(t,e,i){(i.getElementsByTagName("stroke")[0]||m(this.renderer.prepVML(["<stroke/>"]),null,null,i))[e]=t||"solid",this[e]=t},dSetter:function(t,e,i){var n,o=this.shadows;if(t=t||[],this.d=t.join&&t.join(" "),i.path=t=this.pathToVML(t),o)for(n=o.length;n--;)o[n].path=o[n].cutOff?this.cutOffPath(t,o[n].cutOff):t;this.setAttr(e,t)},fillSetter:function(t,e,i){var n=i.nodeName;"SPAN"===n?i.style.color=t:"IMG"!==n&&(i.filled=t!==jt,this.setAttr("fillcolor",this.renderer.color(t,i,e,this)))},opacitySetter:Ht,rotationSetter:function(t,e,i){var n=i.style;this[e]=n[e]=t,n.left=-gt(wt(t*St)+1)+Ut,n.top=gt(kt(t*St))+Ut},strokeSetter:function(t,e,i){this.setAttr("strokecolor",this.renderer.color(t,i,e))},"stroke-widthSetter":function(t,e,i){i.stroked=!!t,this[e]=t,a(t)&&(t+=Ut),this.setAttr("strokeweight",t)},titleSetter:function(t,e){this.setAttr(e,t)},visibilitySetter:function(t,e,i){"inherit"===t&&(t=_t),this.shadows&&ee(this.shadows,function(i){i.style[e]=t}),"DIV"===i.nodeName&&(t=t===Nt?"-999em":0,Mt||(i.style[e]=t?_t:Nt),e="top"),i.style[e]=t},xSetter:function(t,e,i){this[e]=t,"x"===e?e="left":"y"===e&&(e="top"),this.updateClipping?(this[e]=t,this.updateClipping()):i.style[e]=t},zIndexSetter:function(t,e,i){i.style[e]=t}},dt.VMLElement=xe=x(z,xe),xe.prototype.ySetter=xe.prototype.widthSetter=xe.prototype.heightSetter=xe.prototype.xSetter;var ke={Element:xe,isIE8:Tt.indexOf("MSIE 8.0")>-1,init:function(t,e,i,n){var o,s,r;if(this.alignedObjects=[],s=(o=this.createElement(Yt).css(de(this.getStyle(n),{position:"relative"}))).element,t.appendChild(o.element),this.isVML=!0,this.box=s,this.boxWrapper=o,this.gradients={},this.cache={},this.cacheKeys=[],this.setSize(e,i,!1),!ut.namespaces.hcv){ut.namespaces.add("hcv","urn:schemas-microsoft-com:vml"),r="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } ";try{ut.createStyleSheet().cssText=r}catch(t){ut.styleSheets[0].cssText+=r}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(t,e,i,n){var o=this.createElement(),r=s(t);return de(o,{members:[],count:0,left:(r?t.x:t)+1,top:(r?t.y:e)+1,width:(r?t.width:i)-1,height:(r?t.height:n)-1,getCSS:function(t){var e=t.element,i=e.nodeName,n="shape"===i,o=t.inverted,s=this.top-(n?e.offsetTop:0),r=this.left,a=r+this.width,l=s+this.height,h={clip:"rect("+gt(o?r:s)+"px,"+gt(o?l:a)+"px,"+gt(o?a:l)+"px,"+gt(o?s:r)+"px)"};return!o&&Mt&&"DIV"===i&&de(h,{width:a+Ut,height:l+Ut}),h},updateClipping:function(){ee(o.members,function(t){t.element&&t.css(o.getCSS(t))})}})},color:function(t,e,i,n){var o,s,r,a=this,l=/^rgba/,h=jt;if(t&&t.linearGradient?r="gradient":t&&t.radialGradient&&(r="pattern"),r){var c,d,p,u,f,g,x,y,v,b,k,w,A=t.linearGradient||t.radialGradient,S="",T=t.stops,P=[],C=function(){s=['<fill colors="'+P.join(",")+'" opacity="',y,'" o:opacity2="',x,'" type="',r,'" ',S,'focus="100%" method="any" />'],m(a.prepVML(s),null,null,e)};if(k=T[0],w=T[T.length-1],k[0]>0&&T.unshift([0,k[1]]),w[0]<1&&T.push([1,w[1]]),ee(T,function(t,e){l.test(t[1])?(o=O(t[1]),c=o.get("rgb"),d=o.get("a")):(c=t[1],d=1),P.push(100*t[0]+"% "+c),e?(y=d,v=c):(x=d,b=c)}),"fill"===i)if("gradient"===r)p=A.x1||A[0]||0,u=A.y1||A[1]||0,f=A.x2||A[2]||0,g=A.y2||A[3]||0,S='angle="'+(90-180*ft.atan((g-u)/(f-p))/At)+'"',C();else{var M,L=A.r,D=2*L,I=2*L,B=A.cx,z=A.cy,R=e.radialReference,E=function(){R&&(M=n.getBBox(),B+=(R[0]-M.x)/M.width-.5,z+=(R[1]-M.y)/M.height-.5,D*=R[2]/M.width,I*=R[2]/M.height),S='src="'+N.global.VMLRadialGradientURL+'" size="'+D+","+I+'" origin="0.5,0.5" position="'+B+","+z+'" color2="'+b+'" ',C()};n.added?E():n.onAdd=E,h=v}else h=c}else if(l.test(t)&&"IMG"!==e.tagName)o=O(t),s=["<",i,' opacity="',o.get("a"),'"/>'],m(this.prepVML(s),null,null,e),h=o.get("rgb");else{var W=e.getElementsByTagName(i);W.length&&(W[0].opacity=1,W[0].type="solid"),h=t}return h},prepVML:function(t){var e="display:inline-block;behavior:url(#default#VML);",i=this.isIE8;return t=t.join(""),t=i?-1===(t=t.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />')).indexOf('style="')?t.replace("/>",' style="'+e+'" />'):t.replace('style="','style="'+e):t.replace("<","<hcv:")},text:be.prototype.html,path:function(t){var e={coordsize:"10 10"};return r(t)?e.d=t:s(t)&&de(e,t),this.createElement("shape").attr(e)},circle:function(t,e,i){var n=this.symbol("circle");return s(t)&&(i=t.r,e=t.y,t=t.x),n.isCircle=!0,n.r=i,n.attr({x:t,y:e})},g:function(t){var e;return t&&(e={className:Vt+t,class:Vt+t}),this.createElement(Yt).attr(e)},image:function(t,e,i,n,o){var s=this.createElement("img").attr({src:t});return arguments.length>1&&s.attr({x:e,y:i,width:n,height:o}),s},createElement:function(t){return"rect"===t?this.symbol(t):be.prototype.createElement.call(this,t)},invertChild:function(t,e){var i=this,o=e.style,s="IMG"===t.tagName&&t.style;g(t,{flip:"x",left:n(o.width)-(s?n(s.top):1),top:n(o.height)-(s?n(s.left):1),rotation:-90}),ee(t.childNodes,function(e){i.invertChild(e,t)})},symbols:{arc:function(t,e,i,n,o){var s,r=o.start,a=o.end,l=o.r||i||n,h=o.innerR,c=kt(r),d=wt(r),p=kt(a),u=wt(a);return a-r==0?["x"]:(s=["wa",t-l,e-l,t+l,e+l,t+l*c,e+l*d,t+l*p,e+l*u],o.open&&!h&&s.push("e",Zt,t,e),s.push("at",t-h,e-h,t+h,e+h,t+h*p,e+h*u,t+h*c,e+h*d,"x","e"),s.isArc=!0,s)},circle:function(t,e,i,n,o){return o&&(i=n=2*o.r),o&&o.isCircle&&(t-=i/2,e-=n/2),["wa",t,e,t+i,e+n,t+i,e+n/2,t+i,e+n/2,"e"]},rect:function(t,e,i,n,o){return be.prototype.symbols[d(o)&&o.r?"callout":"square"].call(0,t,e,i,n,o)}}};dt.VMLRenderer=me=function(){this.init.apply(this,arguments)},me.prototype=i(be.prototype,ke),G=me}be.prototype.measureSpanWidth=function(t,e){var i,n=ut.createElement("span"),o=ut.createTextNode(t);return n.appendChild(o),g(n,e),this.box.appendChild(n),i=n.offsetWidth,L(n),i},Rt&&(dt.CanVGRenderer=ye=function(){Bt="http://www.w3.org/1999/xhtml"},ye.prototype.symbols={},ve=function(){function t(){var t,i=e.length;for(t=0;t<i;t++)e[t]();e=[]}var e=[];return{push:function(i,n){0===e.length&&dt.getScript(n,t),e.push(i)}}}(),G=ye),R.prototype={addLabel:function(){var t,e,n=this.axis,o=n.options,s=n.chart,r=n.categories,a=n.names,l=this.pos,c=o.labels,p=n.tickPositions,u=l===p[0],f=l===p[p.length-1],g=r?pe(r[l],a[l],l):l,m=this.label,x=p.info;n.isDatetimeAxis&&x&&(e=o.dateTimeLabelFormats[x.higherRanks[l]||x.unitName]),this.isFirst=u,this.isLast=f,t=n.labelFormatter.call({axis:n,chart:s,isFirst:u,isLast:f,dateTimeLabelFormat:e,value:n.isLog?D(h(g)):g}),d(m)?m&&m.attr({text:t}):(this.label=m=d(t)&&c.enabled?s.renderer.text(t,0,0,c.useHTML).css(i(c.style)).add(n.labelGroup):null,this.labelLength=m&&m.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(t){var e,i,n=this.axis,o=t.x,s=n.chart.chartWidth,r=n.chart.spacing,a=pe(n.labelLeft,vt(n.pos,r[3])),l=pe(n.labelRight,yt(n.pos+n.len,s-r[1])),h=this.label,c=this.rotation,d={left:0,center:.5,right:1}[n.labelAlign],p=h.getBBox().width,u=n.slotWidth,f=d,g=1,m={};c?c<0&&o-d*p<a?i=gt(o/kt(c*St)-a):c>0&&o+d*p>l&&(i=gt((s-o)/kt(c*St))):(e=o+(1-d)*p,o-d*p<a?u=t.x+u*(1-d)-a:e>l&&(u=l-t.x+u*d,g=-1),(u=vt(n.slotWidth,u))<n.slotWidth&&"center"===n.labelAlign&&(t.x+=g*(n.slotWidth-u-f*(n.slotWidth-vt(p,u)))),(p>u||n.autoRotation&&h.styles.width)&&(i=u)),i&&(m.width=i,n.options.labels.style.textOverflow||(m.textOverflow="ellipsis"),h.css(m))},getPosition:function(t,e,i,n){var o=this.axis,s=o.chart,r=n&&s.oldChartHeight||s.chartHeight;return{x:t?o.translate(e+i,null,null,n)+o.transB:o.left+o.offset+(o.opposite?(n&&s.oldChartWidth||s.chartWidth)-o.right-o.left:0),y:t?r-o.bottom+o.offset-(o.opposite?o.height:0):r-o.translate(e+i,null,null,n)-o.transB}},getLabelPosition:function(t,e,i,n,o,s,r,a){var l,h=this.axis,c=h.transA,p=h.reversed,u=h.staggerLines,f=h.tickRotCorr||{x:0,y:0},g=o.y;return d(g)||(g=2===h.side?f.y+8:g=kt(i.rotation*St)*(f.y-i.getBBox(!1,0).height/2)),t=t+o.x+f.x-(s&&n?s*c*(p?-1:1):0),e=e+g-(s&&!n?s*c*(p?1:-1):0),u&&(l=r/(a||1)%u,h.opposite&&(l=u-l-1),e+=l*(h.labelOffset/u)),{x:t,y:gt(e)}},getMarkPath:function(t,e,i,n,o,s){return s.crispLine([Zt,t,e,Kt,t+(o?0:-i),e+(o?i:0)],n)},render:function(t,e,i){var n,o,s,r=this.axis,a=r.options,l=r.chart.renderer,h=r.horiz,c=this.type,d=this.label,p=this.pos,u=a.labels,f=this.gridLine,g=c?c+"Grid":"grid",m=c?c+"Tick":"tick",x=a[g+"LineWidth"],y=a[g+"LineColor"],v=a[g+"LineDashStyle"],b=a[m+"Length"],k=pe(a[m+"Width"],!c&&r.isXAxis?1:0),w=a[m+"Color"],A=a[m+"Position"],S=this.mark,T=u.step,P=!0,C=r.tickmarkOffset,M=this.getPosition(h,p,C,e),L=M.x,D=M.y,I=h&&L===r.pos+r.len||!h&&D===r.pos?-1:1;i=pe(i,1),this.isActive=!0,x&&(n=r.getPlotLinePath(p+C,x*I,e,!0),f===X&&(s={stroke:y,"stroke-width":x},v&&(s.dashstyle=v),c||(s.zIndex=1),e&&(s.opacity=0),this.gridLine=f=x?l.path(n).attr(s).add(r.gridGroup):null),!e&&f&&n&&f[this.isNew?"attr":"animate"]({d:n,opacity:i})),k&&b&&("inside"===A&&(b=-b),r.opposite&&(b=-b),o=this.getMarkPath(L,D,b,k*I,h,l),S?S.animate({d:o,opacity:i}):this.mark=l.path(o).attr({stroke:w,"stroke-width":k,opacity:i}).add(r.axisGroup)),d&&!isNaN(L)&&(d.xy=M=this.getLabelPosition(L,D,d,h,u,C,t,T),this.isFirst&&!this.isLast&&!pe(a.showFirstLabel,1)||this.isLast&&!this.isFirst&&!pe(a.showLastLabel,1)?P=!1:!h||r.isRadial||u.step||u.rotation||e||0===i||this.handleOverflow(M),T&&t%T&&(P=!1),P&&!isNaN(M.y)?(M.opacity=i,d[this.isNew?"attr":"animate"](M),this.isNew=!1):d.attr("y",-9999))},destroy:function(){M(this,this.axis)}},dt.PlotLineOrBand=function(t,e){this.axis=t,e&&(this.options=e,this.id=e.id)},dt.PlotLineOrBand.prototype={render:function(){var t,e,n,o,s,r,a=this,h=a.axis,c=h.horiz,p=a.options,u=p.label,f=a.label,g=p.width,m=p.to,x=p.from,y=d(x)&&d(m),v=p.value,b=p.dashStyle,k=a.svgElem,w=[],A=p.color,S=p.zIndex,T=p.events,M={},L=h.chart.renderer;if(h.isLog&&(x=l(x),m=l(m),v=l(v)),g)w=h.getPlotLinePath(v,g),M={stroke:A,"stroke-width":g},b&&(M.dashstyle=b);else{if(!y)return;w=h.getPlotBandPath(x,m,p),A&&(M.fill=A),p.borderWidth&&(M.stroke=p.borderColor,M["stroke-width"]=p.borderWidth)}if(d(S)&&(M.zIndex=S),k)w?(k.show(),k.animate({d:w})):(k.hide(),f&&(a.label=f=f.destroy()));else if(w&&w.length&&(a.svgElem=k=L.path(w).attr(M).add(),T))for(e in t=function(t){k.on(t,function(e){T[t].apply(a,[e])})},T)t(e);return u&&d(u.text)&&w&&w.length&&h.width>0&&h.height>0&&!w.flat?(u=i({align:c&&y&&"center",x:c?!y&&4:10,verticalAlign:!c&&y&&"middle",y:c?y?16:10:y?6:-4,rotation:c&&!y&&90},u),f||(M={align:u.textAlign||u.align,rotation:u.rotation},d(S)&&(M.zIndex=S),a.label=f=L.text(u.text,0,0,u.useHTML).attr(M).css(u.style).add()),n=[w[1],w[4],y?w[6]:w[1]],o=[w[2],w[5],y?w[7]:w[2]],s=P(n),r=P(o),f.align(u,!1,{x:s,y:r,width:C(n)-s,height:C(o)-r}),f.show()):f&&f.hide(),a},destroy:function(){c(this.axis.plotLinesAndBands,this),delete this.axis,M(this)}},j={getPlotBandPath:function(t,e){var i=this.getPlotLinePath(e,null,null,!0),n=this.getPlotLinePath(t,null,null,!0);return n&&i?(n.flat=n.toString()===i.toString(),n.push(i[4],i[5],i[1],i[2])):n=null,n},addPlotBand:function(t){return this.addPlotBandOrLine(t,"plotBands")},addPlotLine:function(t){return this.addPlotBandOrLine(t,"plotLines")},addPlotBandOrLine:function(t,e){var i=new dt.PlotLineOrBand(this,t).render(),n=this.userOptions;return i&&(e&&(n[e]=n[e]||[],n[e].push(t)),this.plotLinesAndBands.push(i)),i},removePlotBandOrLine:function(t){for(var e=this.plotLinesAndBands,i=this.options,n=this.userOptions,o=e.length;o--;)e[o].id===t&&e[o].destroy();ee([i.plotLines||[],n.plotLines||[],i.plotBands||[],n.plotBands||[]],function(e){for(o=e.length;o--;)e[o].id===t&&c(e,e[o])})}};var we=dt.Axis=function(){this.init.apply(this,arguments)};we.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#D8D8D8",labels:{enabled:!0,style:{color:"#606060",cursor:"default",fontSize:"11px"},x:0,y:15},lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return dt.numberFormat(this.total,-1)},style:i(fe.line.dataLabels.style,{color:"#000000"})}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0,y:-15},title:{rotation:0}},init:function(t,e){var i=e.isX;this.chart=t,this.horiz=t.inverted?!i:i,this.isXAxis=i,this.coll=i?"xAxis":"yAxis",this.opposite=e.opposite,this.side=e.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(e);var n=this.options,o=n.type,s="datetime"===o;this.labelFormatter=n.labels.formatter||this.defaultLabelFormatter,this.userOptions=e,this.minPixelPadding=0,this.reversed=n.reversed,this.visible=!1!==n.visible,this.zoomEnabled=!1!==n.zoomEnabled,this.categories=n.categories||"category"===o,this.names=this.names||[],this.isLog="logarithmic"===o,this.isDatetimeAxis=s,this.isLinked=d(n.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=n.minRange||n.maxZoom,this.range=n.range,this.offset=n.offset||0,this.stacks={},this.oldStacks={},this.stacksTouched=0,this.max=null,this.min=null,this.crosshair=pe(n.crosshair,u(t.options.tooltip.crosshairs)[i?0:1],!1);var r,a=this.options.events;for(r in-1===te(this,t.axes)&&(i&&!this.isColorAxis?t.axes.splice(t.xAxis.length,0,this):t.axes.push(this),t[this.coll].push(this)),this.series=this.series||[],t.inverted&&i&&this.reversed===X&&(this.reversed=!0),this.removePlotBand=this.removePlotBandOrLine,this.removePlotLine=this.removePlotBandOrLine,a)se(this,r,a[r]);this.isLog&&(this.val2lin=l,this.lin2val=h)},setOptions:function(t){this.options=i(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],i(N[this.coll],t))},defaultLabelFormatter:function(){var t,e,i=this.axis,n=this.value,o=i.categories,s=this.dateTimeLabelFormat,r=N.lang.numericSymbols,a=r&&r.length,l=i.options.labels.format,h=i.isLog?n:i.tickInterval;if(l)e=w(l,this);else if(o)e=n;else if(s)e=V(s,n);else if(a&&h>=1e3)for(;a--&&e===X;)h>=(t=Math.pow(1e3,a+1))&&10*n%t==0&&null!==r[a]&&(e=dt.numberFormat(n/t,-1)+r[a]);return e===X&&(e=bt(n)>=1e4?dt.numberFormat(n,-1):dt.numberFormat(n,-1,X,"")),e},getSeriesExtremes:function(){var t=this,e=t.chart;t.hasVisibleSeries=!1,t.dataMin=t.dataMax=t.threshold=null,t.softThreshold=!t.isXAxis,t.buildStacks&&t.buildStacks(),ee(t.series,function(i){if(i.visible||!e.options.chart.ignoreHiddenSeries){var n,o,s,r=i.options,a=r.threshold;t.hasVisibleSeries=!0,t.isLog&&a<=0&&(a=null),t.isXAxis?(n=i.xData).length&&(t.dataMin=vt(pe(t.dataMin,n[0]),P(n)),t.dataMax=yt(pe(t.dataMax,n[0]),C(n))):(i.getExtremes(),s=i.dataMax,d(o=i.dataMin)&&d(s)&&(t.dataMin=vt(pe(t.dataMin,o),o),t.dataMax=yt(pe(t.dataMax,s),s)),d(a)&&(t.threshold=a),r.softThreshold&&!t.isLog||(t.softThreshold=!1))}})},translate:function(t,e,i,n,o,s){var r,l=this.linkedParent||this,h=1,c=0,d=n?l.oldTransA:l.transA,p=n?l.oldMin:l.min,u=l.minPixelPadding,f=(l.doPostTranslate||l.isLog&&o)&&l.lin2val;return d||(d=l.transA),i&&(h*=-1,c=l.len),l.reversed&&(c-=(h*=-1)*(l.sector||l.len)),e?(t=t*h+c,r=(t-=u)/d+p,f&&(r=l.lin2val(r))):(f&&(t=l.val2lin(t)),"between"===s&&(s=.5),r=h*(t-p)*d+c+h*u+(a(s)?d*s*l.pointRange:0)),r},toPixels:function(t,e){return this.translate(t,!1,!this.horiz,null,!0)+(e?0:this.pos)},toValue:function(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(t,e,i,n,o){var s,r,a,l,h,c=this.chart,d=this.left,p=this.top,u=i&&c.oldChartHeight||c.chartHeight,f=i&&c.oldChartWidth||c.chartWidth,g=this.transB,m=function(t,e,i){return(t<e||t>i)&&(n?t=vt(yt(e,t),i):h=!0),t};return o=pe(o,this.translate(t,null,null,i)),s=a=gt(o+g),r=l=gt(u-o-g),isNaN(o)?h=!0:this.horiz?(r=p,l=u-this.bottom,s=a=m(s,d,d+this.width)):(s=d,a=f-this.right,r=l=m(r,p,p+this.height)),h&&!n?null:c.renderer.crispLine([Zt,s,r,Kt,a,l],e||1)},getLinearTickPositions:function(t,e,i){var n,o,s=D(mt(e/t)*t),r=D(xt(i/t)*t),l=[];if(e===i&&a(e))return[e];for(n=s;n<=r&&(l.push(n),(n=D(n+t))!==o);)o=n;return l},getMinorTickPositions:function(){var t,e,i,n=this.options,o=this.tickPositions,s=this.minorTickInterval,r=[],a=this.pointRangePadding||0,l=this.min-a,h=this.max+a,c=h-l;if(c&&c/s<this.len/3)if(this.isLog)for(i=o.length,e=1;e<i;e++)r=r.concat(this.getLogTickPositions(s,o[e-1],o[e],!0));else if(this.isDatetimeAxis&&"auto"===n.minorTickInterval)r=r.concat(this.getTimeTicks(this.normalizeTimeTickInterval(s),l,h,n.startOfWeek));else for(t=l+(o[0]-l)%s;t<=h;t+=s)r.push(t);return 0!==r.length&&this.trimTicks(r,n.startOnTick,n.endOnTick),r},adjustForMinRange:function(){var t,e,i,n,o,s,r,a,l,h=this.options,c=this.min,p=this.max,u=this.dataMax-this.dataMin>=this.minRange;this.isXAxis&&this.minRange===X&&!this.isLog&&(d(h.min)||d(h.max)?this.minRange=null:(ee(this.series,function(t){for(o=t.xData,s=t.xIncrement?1:o.length-1,i=s;i>0;i--)n=o[i]-o[i-1],(e===X||n<e)&&(e=n)}),this.minRange=vt(5*e,this.dataMax-this.dataMin))),p-c<this.minRange&&(r=[c-(t=((l=this.minRange)-p+c)/2),pe(h.min,c-t)],u&&(r[2]=this.dataMin),a=[(c=C(r))+l,pe(h.max,c+l)],u&&(a[2]=this.dataMax),(p=P(a))-c<l&&(r[0]=p-l,r[1]=pe(h.min,p-l),c=C(r))),this.min=c,this.max=p},setAxisTranslation:function(t){var e,i,n=this,s=n.max-n.min,r=n.axisPointRange||0,a=0,l=0,h=n.linkedParent,c=!!n.categories,p=n.transA,u=n.isXAxis;(u||c||r)&&(h?(a=h.minPointOffset,l=h.pointRangePadding):(ee(n.series,function(t){var i=t.closestPointRange;!t.noSharedTooltip&&d(i)&&(e=d(e)?vt(e,i):i)}),ee(n.series,function(t){var i=c?1:u?pe(t.options.pointRange,e,0):n.axisPointRange||0,s=t.options.pointPlacement;r=yt(r,i),n.single||(a=yt(a,o(s)?0:i/2),l=yt(l,"on"===s?0:i))})),i=n.ordinalSlope&&e?n.ordinalSlope/e:1,n.minPointOffset=a*=i,n.pointRangePadding=l*=i,n.pointRange=vt(r,s),u&&(n.closestPointRange=e)),t&&(n.oldTransA=p),n.translationSlope=n.transA=p=n.len/(s+l||1),n.transB=n.horiz?n.left:n.bottom,n.minPixelPadding=p*a},minFromRange:function(){return this.max-this.range},setTickInterval:function(t){var i,n,o,s,r,h,c,p=this,u=p.chart,f=p.options,g=p.isLog,m=p.isDatetimeAxis,x=p.isXAxis,y=p.isLinked,v=f.maxPadding,b=f.minPadding,k=f.tickInterval,w=f.tickPixelInterval,T=p.categories,P=p.threshold,C=p.softThreshold;m||T||y||this.getTickAmount(),h=pe(p.userMin,f.min),c=pe(p.userMax,f.max),y?(p.linkedParent=u[p.coll][f.linkedTo],n=p.linkedParent.getExtremes(),p.min=pe(n.min,n.dataMin),p.max=pe(n.max,n.dataMax),f.type!==p.linkedParent.options.type&&e(11,1)):(!C&&d(P)&&(p.dataMin>=P?(s=P,b=0):p.dataMax<=P&&(r=P,v=0)),p.min=pe(h,s,p.dataMin),p.max=pe(c,r,p.dataMax)),g&&(!t&&vt(p.min,pe(p.dataMin,p.min))<=0&&e(10,1),p.min=D(l(p.min),15),p.max=D(l(p.max),15)),p.range&&d(p.max)&&(p.userMin=p.min=h=yt(p.min,p.minFromRange()),p.userMax=c=p.max,p.range=null),p.beforePadding&&p.beforePadding(),p.adjustForMinRange(),T||p.axisPointRange||p.usePercentage||y||!d(p.min)||!d(p.max)||(i=p.max-p.min)&&(!d(h)&&b&&(p.min-=i*b),!d(c)&&v&&(p.max+=i*v)),a(f.floor)&&(p.min=yt(p.min,f.floor)),a(f.ceiling)&&(p.max=vt(p.max,f.ceiling)),C&&d(p.dataMin)&&(P=P||0,!d(h)&&p.min<P&&p.dataMin>=P?p.min=P:!d(c)&&p.max>P&&p.dataMax<=P&&(p.max=P)),p.min===p.max||void 0===p.min||void 0===p.max?p.tickInterval=1:y&&!k&&w===p.linkedParent.options.tickPixelInterval?p.tickInterval=k=p.linkedParent.tickInterval:p.tickInterval=pe(k,this.tickAmount?(p.max-p.min)/yt(this.tickAmount-1,1):void 0,T?1:(p.max-p.min)*w/yt(p.len,w)),x&&!t&&ee(p.series,function(t){t.processData(p.min!==p.oldMin||p.max!==p.oldMax)}),p.setAxisTranslation(!0),p.beforeSetTickPositions&&p.beforeSetTickPositions(),p.postProcessTickInterval&&(p.tickInterval=p.postProcessTickInterval(p.tickInterval)),p.pointRange&&!k&&(p.tickInterval=yt(p.pointRange,p.tickInterval)),o=pe(f.minTickInterval,p.isDatetimeAxis&&p.closestPointRange),!k&&p.tickInterval<o&&(p.tickInterval=o),m||g||k||(p.tickInterval=S(p.tickInterval,null,A(p.tickInterval),pe(f.allowDecimals,!(p.tickInterval>.5&&p.tickInterval<5&&p.max>1e3&&p.max<9999)),!!this.tickAmount)),!this.tickAmount&&this.len&&(p.tickInterval=p.unsquish()),this.setTickPositions()},setTickPositions:function(){var t,e,i=this.options,n=i.tickPositions,o=i.tickPositioner,s=i.startOnTick,r=i.endOnTick;this.tickmarkOffset=this.categories&&"between"===i.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===i.minorTickInterval&&this.tickInterval?this.tickInterval/5:i.minorTickInterval,this.tickPositions=t=n&&n.slice(),t||((t=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,i.units),this.min,this.max,i.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max)).length>this.len&&(t=[t[0],t.pop()]),this.tickPositions=t,o&&(o=o.apply(this,[this.min,this.max]))&&(this.tickPositions=t=o)),this.isLinked||(this.trimTicks(t,s,r),this.min===this.max&&d(this.min)&&!this.tickAmount&&(e=!0,this.min-=.5,this.max+=.5),this.single=e,n||o||this.adjustTickAmount())},trimTicks:function(t,e,i){var n=t[0],o=t[t.length-1],s=this.minPointOffset||0;e?this.min=n:this.min-s>n&&t.shift(),i?this.max=o:this.max+s<o&&t.pop(),0===t.length&&d(n)&&t.push((o+n)/2)},alignToOthers:function(){var t,e={},i=this.options;return!1!==this.chart.options.chart.alignTicks&&!1!==i.alignTicks&&ee(this.chart[this.coll],function(i){var n=i.options,o=[i.horiz?n.left:n.top,n.width,n.height,n.pane].join(",");i.series.length&&(e[o]?t=!0:e[o]=1)}),t},getTickAmount:function(){var t=this.options,e=t.tickAmount,i=t.tickPixelInterval;!d(t.tickInterval)&&this.len<i&&!this.isRadial&&!this.isLog&&t.startOnTick&&t.endOnTick&&(e=2),!e&&this.alignToOthers()&&(e=xt(this.len/i)+1),e<4&&(this.finalTickAmt=e,e=5),this.tickAmount=e},adjustTickAmount:function(){var t,e,i=this.tickInterval,n=this.tickPositions,o=this.tickAmount,s=this.finalTickAmt,r=n&&n.length;if(r<o){for(;n.length<o;)n.push(D(n[n.length-1]+i));this.transA*=(r-1)/(o-1),this.max=n[n.length-1]}else r>o&&(this.tickInterval*=2,this.setTickPositions());if(d(s)){for(t=e=n.length;t--;)(3===s&&t%2==1||s<=2&&t>0&&t<e-1)&&n.splice(t,1);this.finalTickAmt=X}},setScale:function(){var t,e;this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),e=this.len!==this.oldAxisLength,ee(this.series,function(e){(e.isDirtyData||e.isDirty||e.xAxis.isDirty)&&(t=!0)}),e||t||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},setExtremes:function(t,e,i,n,o){var s=this,r=s.chart;i=pe(i,!0),ee(s.series,function(t){delete t.kdTree}),o=de(o,{min:t,max:e}),ae(s,"setExtremes",o,function(){s.userMin=t,s.userMax=e,s.eventArgs=o,i&&r.redraw(n)})},zoom:function(t,e){var i=this.dataMin,n=this.dataMax,o=this.options,s=vt(i,pe(o.min,i)),r=yt(n,pe(o.max,n));return this.allowZoomOutside||(d(i)&&t<=s&&(t=s),d(n)&&e>=r&&(e=r)),this.displayBtn=t!==X||e!==X,this.setExtremes(t,e,!1,X,{trigger:"zoom"}),!0},setAxisSize:function(){var t=this.chart,e=this.options,i=e.offsetLeft||0,n=e.offsetRight||0,o=this.horiz,s=pe(e.width,t.plotWidth-i+n),r=pe(e.height,t.plotHeight),a=pe(e.top,t.plotTop),l=pe(e.left,t.plotLeft+i),h=/%$/;h.test(r)&&(r=parseFloat(r)/100*t.plotHeight),h.test(a)&&(a=parseFloat(a)/100*t.plotHeight+t.plotTop),this.left=l,this.top=a,this.width=s,this.height=r,this.bottom=t.chartHeight-r-a,this.right=t.chartWidth-s-l,this.len=yt(o?s:r,0),this.pos=o?l:a},getExtremes:function(){var t=this.isLog;return{min:t?D(h(this.min)):this.min,max:t?D(h(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(t){var e=this.isLog,i=e?h(this.min):this.min,n=e?h(this.max):this.max;return null===t?t=n<0?n:i:i>t?t=i:n<t&&(t=n),this.translate(t,0,1,0,1)},autoLabelAlign:function(t){var e=(pe(t,0)-90*this.side+720)%360;return e>15&&e<165?"right":e>195&&e<345?"left":"center"},unsquish:function(){var t,e,i,n=this.chart,o=this.ticks,s=this.options.labels,r=this.horiz,a=this.tickInterval,l=a,h=this.len/(((this.categories?1:0)+this.max-this.min)/a),c=s.rotation,p=n.renderer.fontMetrics(s.style.fontSize,o[0]&&o[0].label),u=Number.MAX_VALUE,f=function(t){var e=t/(h||1);return(e=e>1?xt(e):1)*a};return r?(i=!s.staggerLines&&!s.step&&(d(c)?[c]:h<pe(s.autoRotationLimit,80)&&s.autoRotation))&&ee(i,function(i){var n;(i===c||i&&i>=-90&&i<=90)&&(n=(e=f(bt(p.h/wt(St*i))))+bt(i/360))<u&&(u=n,t=i,l=e)}):s.step||(l=f(p.h)),this.autoRotation=i,this.labelRotation=pe(t,c),l},renderUnsquish:function(){var t,e,n,s,r=this.chart,a=r.renderer,l=this.tickPositions,h=this.ticks,c=this.options.labels,d=this.horiz,p=r.margin,u=this.categories?l.length:l.length-1,f=this.slotWidth=d&&(c.step||0)<2&&!c.rotation&&(this.staggerLines||1)*r.plotWidth/u||!d&&(p[3]&&p[3]-r.spacing[3]||.33*r.chartWidth),g=yt(1,gt(f-2*(c.padding||5))),m={},x=a.fontMetrics(c.style.fontSize,h[0]&&h[0].label),y=c.style.textOverflow,v=0;if(o(c.rotation)||(m.rotation=c.rotation||0),this.autoRotation)ee(l,function(t){(t=h[t])&&t.labelLength>v&&(v=t.labelLength)}),v>g&&v>x.h?m.rotation=this.labelRotation:this.labelRotation=0;else if(f&&(t={width:g+Ut},!y))for(t.textOverflow="clip",n=l.length;!d&&n--;)s=l[n],(e=h[s].label)&&("ellipsis"===e.styles.textOverflow&&e.css({textOverflow:"clip"}),(e.getBBox().height>this.len/l.length-(x.h-x.f)||h[s].labelLength>f)&&(e.specCss={textOverflow:"ellipsis"}));m.rotation&&(t={width:(v>.5*r.chartHeight?.33*r.chartHeight:r.chartHeight)+Ut},y||(t.textOverflow="ellipsis")),this.labelAlign=m.align=c.align||this.autoLabelAlign(this.labelRotation),ee(l,function(e){var n=h[e],o=n&&n.label;o&&(o.attr(m),t&&o.css(i(t,o.specCss)),delete o.specCss,n.rotation=m.rotation)}),this.tickRotCorr=a.rotCorr(x.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||d(this.min)&&d(this.max)&&!!this.tickPositions},getOffset:function(){var t,e,i,n,o,s,r,a=this,l=a.chart,h=l.renderer,c=a.options,p=a.tickPositions,u=a.ticks,f=a.horiz,g=a.side,m=l.inverted?[1,0,3,2][g]:g,x=0,y=0,v=c.title,b=c.labels,k=0,w=a.opposite,A=l.axisOffset,S=l.clipOffset,T=[-1,1,1,-1][g],P=a.axisParent;if(t=a.hasData(),a.showAxis=e=t||pe(c.showEmpty,!0),a.staggerLines=a.horiz&&b.staggerLines,a.axisGroup||(a.gridGroup=h.g("grid").attr({zIndex:c.gridZIndex||1}).add(P),a.axisGroup=h.g("axis").attr({zIndex:c.zIndex||2}).add(P),a.labelGroup=h.g("axis-labels").attr({zIndex:b.zIndex||7}).addClass(Vt+a.coll.toLowerCase()+"-labels").add(P)),t||a.isLinked)ee(p,function(t){u[t]?u[t].addLabel():u[t]=new R(a,t)}),a.renderUnsquish(),!1===b.reserveSpace||0!==g&&2!==g&&{1:"left",3:"right"}[g]!==a.labelAlign&&"center"!==a.labelAlign||ee(p,function(t){k=yt(u[t].getLabelSize(),k)}),a.staggerLines&&(k*=a.staggerLines,a.labelOffset=k*(a.opposite?-1:1));else for(s in u)u[s].destroy(),delete u[s];v&&v.text&&!1!==v.enabled&&(a.axisTitle||(a.axisTitle=h.text(v.text,0,0,v.useHTML).attr({zIndex:7,rotation:v.rotation||0,align:v.textAlign||{low:w?"right":"left",middle:"center",high:w?"left":"right"}[v.align]}).addClass(Vt+this.coll.toLowerCase()+"-title").css(v.style).add(a.axisGroup),a.axisTitle.isNew=!0),e&&(x=a.axisTitle.getBBox()[f?"height":"width"],y=d(i=v.offset)?0:pe(v.margin,f?5:10)),a.axisTitle[e?"show":"hide"](!0)),a.offset=T*pe(c.offset,A[g]),a.tickRotCorr=a.tickRotCorr||{x:0,y:0},r=2===g?a.tickRotCorr.y:0,n=Math.abs(k)+y+(k&&T*(f?pe(b.y,a.tickRotCorr.y+8):b.x)-r),a.axisTitleMargin=pe(i,n),A[g]=yt(A[g],a.axisTitleMargin+x+T*a.offset,n),o=c.offset?0:2*mt(c.lineWidth/2),S[m]=yt(S[m],o)},getLinePath:function(t){var e=this.chart,i=this.opposite,n=this.offset,o=this.horiz,s=this.left+(i?this.width:0)+n,r=e.chartHeight-this.bottom-(i?this.height:0)+n;return i&&(t*=-1),e.renderer.crispLine([Zt,o?this.left:s,o?r:this.top,Kt,o?e.chartWidth-this.right:s,o?r:e.chartHeight-this.bottom],t)},getTitlePosition:function(){var t=this.horiz,e=this.left,i=this.top,o=this.len,s=this.options.title,r=t?e:i,a=this.opposite,l=this.offset,h=s.x||0,c=s.y||0,d=n(s.style.fontSize||12),p={low:r+(t?0:o),middle:r+o/2,high:r+(t?o:0)}[s.align],u=(t?i+this.height:e)+(t?1:-1)*(a?-1:1)*this.axisTitleMargin+(2===this.side?d:0);return{x:t?p+h:u+(a?this.width:0)+l+h,y:t?u+c-(a?this.height:0)+l:p+c}},render:function(){var t,e,i,n=this,o=n.chart,s=o.renderer,r=n.options,a=n.isLog,l=n.isLinked,c=n.tickPositions,p=n.axisTitle,u=n.ticks,g=n.minorTicks,m=n.alternateBands,x=r.stackLabels,y=r.alternateGridColor,v=n.tickmarkOffset,b=r.lineWidth,k=o.hasRendered&&d(n.oldMin)&&!isNaN(n.oldMin),w=n.showAxis,A=s.globalAnimation;n.labelEdge.length=0,n.overlap=!1,ee([u,g,m],function(t){var e;for(e in t)t[e].isActive=!1}),(n.hasData()||l)&&(n.minorTickInterval&&!n.categories&&ee(n.getMinorTickPositions(),function(t){g[t]||(g[t]=new R(n,t,"minor")),k&&g[t].isNew&&g[t].render(null,!0),g[t].render(null,!1,1)}),c.length&&(ee(c,function(t,e){(!l||t>=n.min&&t<=n.max)&&(u[t]||(u[t]=new R(n,t)),k&&u[t].isNew&&u[t].render(e,!0,.1),u[t].render(e))}),v&&(0===n.min||n.single)&&(u[-1]||(u[-1]=new R(n,-1,null,!0)),u[-1].render(-1))),y&&ee(c,function(t,s){i=c[s+1]!==X?c[s+1]+v:n.max-v,s%2==0&&t<n.max&&i<=n.max+(o.polar?-v:v)&&(m[t]||(m[t]=new dt.PlotLineOrBand(n)),e=t+v,m[t].options={from:a?h(e):e,to:a?h(i):i,color:y},m[t].render(),m[t].isActive=!0)}),n._addedPlotLB||(ee((r.plotLines||[]).concat(r.plotBands||[]),function(t){n.addPlotBandOrLine(t)}),n._addedPlotLB=!0)),ee([u,g,m],function(t){var e,i,n=[],s=A?A.duration||500:0;for(e in t)t[e].isActive||(t[e].render(e,!1,0),t[e].isActive=!1,n.push(e));f(function(){for(i=n.length;i--;)t[n[i]]&&!t[n[i]].isActive&&(t[n[i]].destroy(),delete t[n[i]])},t!==m&&o.hasRendered&&s?s:0)}),b&&(t=n.getLinePath(b),n.axisLine?n.axisLine.animate({d:t}):n.axisLine=s.path(t).attr({stroke:r.lineColor,"stroke-width":b,zIndex:7}).add(n.axisGroup),n.axisLine[w?"show":"hide"](!0)),p&&w&&(p[p.isNew?"attr":"animate"](n.getTitlePosition()),p.isNew=!1),x&&x.enabled&&n.renderStackTotals(),n.isDirty=!1},redraw:function(){this.visible&&(this.render(),ee(this.plotLinesAndBands,function(t){t.render()})),ee(this.series,function(t){t.isDirty=!0})},destroy:function(t){var e,i,n=this,o=n.stacks,s=n.plotLinesAndBands;for(e in t||re(n),o)M(o[e]),o[e]=null;for(ee([n.ticks,n.minorTicks,n.alternateBands],function(t){M(t)}),i=s.length;i--;)s[i].destroy();ee(["stackTotalGroup","axisLine","axisTitle","axisGroup","cross","gridGroup","labelGroup"],function(t){n[t]&&(n[t]=n[t].destroy())}),this.cross&&this.cross.destroy()},drawCrosshair:function(t,e){var i,n,o,s,r,a=this.crosshair;if(!this.crosshair||!1===(d(e)||!pe(a.snap,!0))||e&&e.series&&e.series[this.coll]!==this)this.hideCrosshair();else{if(pe(a.snap,!0)?d(e)&&(n=this.isXAxis?e.plotX:this.len-e.plotY):n=this.horiz?t.chartX-this.pos:this.len-t.chartY+this.pos,null===(i=this.isRadial?this.getPlotLinePath(this.isXAxis?e.x:pe(e.stackY,e.y))||null:this.getPlotLinePath(null,null,null,null,n)||null))return void this.hideCrosshair();s=this.categories&&!this.isRadial,r=pe(a.width,s?this.transA:1),this.cross?this.cross.attr({d:i,visibility:"visible","stroke-width":r}):(o={"stroke-width":r,stroke:a.color||(s?"rgba(155,200,255,0.2)":"#C0C0C0"),zIndex:pe(a.zIndex,2)},a.dashStyle&&(o.dashstyle=a.dashStyle),this.cross=this.chart.renderer.path(i).attr(o).add())}},hideCrosshair:function(){this.cross&&this.cross.hide()}},de(we.prototype,j),we.prototype.getTimeTicks=function(t,e,i,n){var o,s,r=[],a={},l=N.global.useUTC,h=new Z(e-b(e)),c=t.unitRange,p=t.count;if(d(e)){h[ot](c>=U.second?0:p*mt(h.getMilliseconds()/p)),c>=U.second&&h[st](c>=U.minute?0:p*mt(h.getSeconds()/p)),c>=U.minute&&h[rt](c>=U.hour?0:p*mt(h[J]()/p)),c>=U.hour&&h[at](c>=U.day?0:p*mt(h[Q]()/p)),c>=U.day&&h[lt](c>=U.month?1:p*mt(h[et]()/p)),c>=U.month&&(h[ht](c>=U.year?0:p*mt(h[it]()/p)),s=h[nt]()),c>=U.year&&(s-=s%p,h[ct](s)),c===U.week&&h[lt](h[et]()-h[tt]()+pe(n,1)),o=1,(q||$)&&(h=h.getTime(),h=new Z(h+b(h))),s=h[nt]();for(var u=h.getTime(),f=h[it](),g=h[et](),m=(U.day+(l?b(h):60*h.getTimezoneOffset()*1e3))%U.day;u<i;)r.push(u),c===U.year?u=K(s+o*p,0):c===U.month?u=K(s,f+o*p):l||c!==U.day&&c!==U.week?u+=c*p:u=K(s,f,g+o*p*(c===U.day?1:7)),o++;r.push(u),ee(ie(r,function(t){return c<=U.hour&&t%U.day===m}),function(t){a[t]="day"})}return r.info=de(t,{higherRanks:a,totalRange:c*p}),r},we.prototype.normalizeTimeTickInterval=function(t,e){var i,n=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],o=n[n.length-1],s=U[o[0]],r=o[1];for(i=0;i<n.length;i++){if(o=n[i],s=U[o[0]],r=o[1],n[i+1])if(t<=(s*r[r.length-1]+U[n[i+1][0]])/2)break}return s===U.year&&t<5*s&&(r=[1,2,5]),{unitRange:s,count:S(t/s,r,"year"===o[0]?yt(A(t/s),1):1),unitName:o[0]}},we.prototype.getLogTickPositions=function(t,e,i,n){var o=this.options,s=this.len,r=[];if(n||(this._minorAutoInterval=null),t>=.5)t=gt(t),r=this.getLinearTickPositions(t,e,i);else if(t>=.08){var a,c,d,p,u,f,g,m=mt(e);for(a=t>.3?[1,2,4]:t>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9],c=m;c<i+1&&!g;c++)for(p=a.length,d=0;d<p&&!g;d++)(u=l(h(c)*a[d]))>e&&(!n||f<=i)&&f!==X&&r.push(f),f>i&&(g=!0),f=u}else{var x=h(e),y=h(i),v=o[n?"minorTickInterval":"tickInterval"],b="auto"===v?null:v,k=o.tickPixelInterval/(n?5:1),w=n?s/this.tickPositions.length:s;t=S(t=pe(b,this._minorAutoInterval,(y-x)*k/(w||1)),null,A(t)),r=oe(this.getLinearTickPositions(t,x,y),l),n||(this._minorAutoInterval=t/5)}return n||(this.tickInterval=t),r};var Ae,Se=dt.Tooltip=function(){this.init.apply(this,arguments)};Se.prototype={init:function(t,e){var i=e.borderWidth,o=e.style,s=n(o.padding);this.chart=t,this.options=e,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.label=t.renderer.label("",0,0,e.shape||"callout",null,null,e.useHTML,null,"tooltip").attr({padding:s,fill:e.backgroundColor,"stroke-width":i,r:e.borderRadius,zIndex:8}).css(o).css({padding:0}).add().attr({y:-9999}),Rt||this.label.shadow(e.shadow),this.shared=e.shared},destroy:function(){this.label&&(this.label=this.label.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(t,e,i,n){var o=this,s=o.now,r=!1!==o.options.animation&&!o.isHidden&&(bt(t-s.x)>1||bt(e-s.y)>1),a=o.followPointer||o.len>1;de(s,{x:r?(2*s.x+t)/3:t,y:r?(s.y+e)/2:e,anchorX:a?X:r?(2*s.anchorX+i)/3:i,anchorY:a?X:r?(s.anchorY+n)/2:n}),o.label.attr(s),r&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){o&&o.move(t,e,i,n)},32))},hide:function(t){var e=this;clearTimeout(this.hideTimer),t=pe(t,this.options.hideDelay,500),this.isHidden||(this.hideTimer=f(function(){e.label[t?"fadeOut":"hide"](),e.isHidden=!0},t))},getAnchor:function(t,e){var i,n,o,s=this.chart,r=s.inverted,a=s.plotTop,l=s.plotLeft,h=0,c=0;return i=(t=u(t))[0].tooltipPos,this.followPointer&&e&&(e.chartX===X&&(e=s.pointer.normalize(e)),i=[e.chartX-s.plotLeft,e.chartY-a]),i||(ee(t,function(t){n=t.series.yAxis,o=t.series.xAxis,h+=t.plotX+(!r&&o?o.left-l:0),c+=(t.plotLow?(t.plotLow+t.plotHigh)/2:t.plotY)+(!r&&n?n.top-a:0)}),h/=t.length,c/=t.length,i=[r?s.plotWidth-c:h,this.shared&&!r&&t.length>1&&e?e.chartY-a:r?s.plotHeight-h:c]),oe(i,gt)},getPosition:function(t,e,i){var n,o=this.chart,s=this.distance,r={},a=i.h||0,l=["y",o.chartHeight,e,i.plotY+o.plotTop,o.plotTop,o.plotTop+o.plotHeight],h=["x",o.chartWidth,t,i.plotX+o.plotLeft,o.plotLeft,o.plotLeft+o.plotWidth],c=pe(i.ttBelow,o.inverted&&!i.negative||!o.inverted&&i.negative),d=function(t){var e=l;l=h,h=e,n=t},p=function(){!1!==function(t,e,i,n,o,l){var h=i<n-s,d=n+s+i<e,p=n-s-i,u=n+s;if(c&&d)r[t]=u;else if(!c&&h)r[t]=p;else if(h)r[t]=vt(l-i,p-a<0?p:p-a);else{if(!d)return!1;r[t]=yt(o,u+a+i>e?u:u+a)}}.apply(0,l)?!1!==function(t,e,i,n){var o;return n<s||n>e-s?o=!1:r[t]=n<i/2?1:n>e-i/2?e-i-2:n-i/2,o}.apply(0,h)||n||(d(!0),p()):n?r.x=r.y=0:(d(!0),p())};return(o.inverted||this.len>1)&&d(),p(),r},defaultFormatter:function(t){var e,i=this.points||u(this);return(e=(e=[t.tooltipFooterHeaderFormatter(i[0])]).concat(t.bodyFormatter(i))).push(t.tooltipFooterHeaderFormatter(i[0],!0)),e.join("")},refresh:function(t,e){var i,n,o,s,r,a,l=this.chart,h=this.label,c=this.options,d={},p=[],f=c.formatter||this.defaultFormatter,g=l.hoverPoints,m=this.shared;clearTimeout(this.hideTimer),this.followPointer=u(t)[0].series.tooltipOptions.followPointer,i=(o=this.getAnchor(t,e))[0],n=o[1],!m||t.series&&t.series.noSharedTooltip?d=t.getLabelConfig():(l.hoverPoints=t,g&&ee(g,function(t){t.setState()}),ee(t,function(t){t.setState("hover"),p.push(t.getLabelConfig())}),(d={x:t[0].category,y:t[0].y}).points=p,this.len=p.length,t=t[0]),s=f.call(d,this),a=t.series,this.distance=pe(a.tooltipOptions.distance,16),!1===s?this.hide():(this.isHidden&&(ce(h),h.attr("opacity",1).show()),h.attr({text:s}),r=c.borderColor||t.color||a.color||"#606060",h.attr({stroke:r}),this.updatePosition({plotX:i,plotY:n,negative:t.negative,ttBelow:t.ttBelow,h:o[2]||0}),this.isHidden=!1),ae(l,"tooltipRefresh",{text:s,x:i+l.plotLeft,y:n+l.plotTop,borderColor:r})},updatePosition:function(t){var e=this.chart,i=this.label,n=(this.options.positioner||this.getPosition).call(this,i.width,i.height,t);this.move(gt(n.x),gt(n.y||0),t.plotX+e.plotLeft,t.plotY+e.plotTop)},getXDateFormat:function(t,e,i){var n,o,s,r=e.dateTimeLabelFormats,a=i&&i.closestPointRange,l="01-01 00:00:00.000",h={millisecond:15,second:12,minute:9,hour:6,day:3},c="millisecond";if(a){for(o in s=V("%m-%d %H:%M:%S.%L",t.x),U){if(a===U.week&&+V("%w",t.x)===i.options.startOfWeek&&s.substr(6)===l.substr(6)){o="week";break}if(U[o]>a){o=c;break}if(h[o]&&s.substr(h[o])!==l.substr(h[o]))break;"week"!==o&&(c=o)}o&&(n=r[o])}else n=r.day;return n||r.year},tooltipFooterHeaderFormatter:function(t,e){var i=e?"footer":"header",n=t.series,o=n.tooltipOptions,s=o.xDateFormat,r=n.xAxis,l=r&&"datetime"===r.options.type&&a(t.key),h=o[i+"Format"];return l&&!s&&(s=this.getXDateFormat(t,o,r)),l&&s&&(h=h.replace("{point.key}","{point.key:"+s+"}")),w(h,{point:t,series:n})},bodyFormatter:function(t){return oe(t,function(t){var e=t.series.tooltipOptions;return(e.pointFormatter||t.point.tooltipFormatter).call(t.point,e.pointFormat)})}},Y=ut.documentElement.ontouchstart!==X;var Te=dt.Pointer=function(t,e){this.init(t,e)};if(Te.prototype={init:function(t,e){var i,n,o=e.chart,s=o.events,r=Rt?"":o.zoomType,a=t.inverted;this.options=e,this.chart=t,this.zoomX=i=/x/.test(r),this.zoomY=n=/y/.test(r),this.zoomHor=i&&!a||n&&a,this.zoomVert=n&&!a||i&&a,this.hasZoom=i||n,this.runChartClick=s&&!!s.click,this.pinchDown=[],this.lastValidTouch={},dt.Tooltip&&e.tooltip.enabled&&(t.tooltip=new Se(t,e.tooltip),this.followTouchMove=pe(e.tooltip.followTouchMove,!0)),this.setDOMEvents()},normalize:function(t,e){var i,n,o;return t=t||window.event,(t=le(t)).target||(t.target=t.srcElement),o=t.touches?t.touches.length?t.touches.item(0):t.changedTouches[0]:t,e||(this.chartPosition=e=ne(this.chart.container)),o.pageX===X?(i=yt(t.x,t.clientX-e.left),n=t.y):(i=o.pageX-e.left,n=o.pageY-e.top),de(t,{chartX:gt(i),chartY:gt(n)})},getCoordinates:function(t){var e={xAxis:[],yAxis:[]};return ee(this.chart.axes,function(i){e[i.isXAxis?"xAxis":"yAxis"].push({axis:i,value:i.toValue(t[i.horiz?"chartX":"chartY"])})}),e},runPointActions:function(t){var e,i,n,o,s,r,a,l,h=this.chart,c=h.series,d=h.tooltip,p=!!d&&d.shared,u=h.hoverPoint,f=h.hoverSeries,g=Number.MAX_VALUE,m=[];if(!p&&!f)for(i=0;i<c.length;i++)!c[i].directTouch&&c[i].options.stickyTracking||(c=[]);if(f&&(p?f.noSharedTooltip:f.directTouch)&&u?a=u:(ee(c,function(e){o=e.noSharedTooltip&&p,s=!p&&e.directTouch,e.visible&&!o&&!s&&pe(e.options.enableMouseTracking,!0)&&(l=e.searchPoint(t,!o&&1===e.kdDimensions))&&m.push(l)}),ee(m,function(t){r=p||1!==t.series.kdDimensions?t.distX:t.dist,t&&"number"==typeof r&&r<g&&(g=r,a=t)})),a&&(a!==this.prevKDPoint||d&&d.isHidden)){if(p&&!a.series.noSharedTooltip){for(i=m.length;i--;)(m[i].clientX!==a.clientX||m[i].series.noSharedTooltip)&&m.splice(i,1);m.length&&d&&d.refresh(m,t),ee(m,function(e){e.onMouseOver(t,e!==(f&&f.directTouch&&u||a))})}else d&&d.refresh(a,t),f&&f.directTouch||a.onMouseOver(t);this.prevKDPoint=a}else e=f&&f.tooltipOptions.followPointer,d&&e&&!d.isHidden&&(n=d.getAnchor([{}],t),d.updatePosition({plotX:n[0],plotY:n[1]}));this._onDocumentMouseMove||(this._onDocumentMouseMove=function(t){Xt[Ae]&&Xt[Ae].pointer.onDocumentMouseMove(t)},se(ut,"mousemove",this._onDocumentMouseMove)),ee(h.axes,function(e){e.drawCrosshair(t,pe(a,u))})},reset:function(t,e){var i=this.chart,n=i.hoverSeries,o=i.hoverPoint,s=i.hoverPoints,r=i.tooltip,a=r&&r.shared?s:o;(t=t&&r&&a)&&ee(u(a),function(e){void 0===e.plotX&&(t=!1)}),t?(r.refresh(a),o&&(o.setState(o.state,!0),ee(i.axes,function(t){pe(t.options.crosshair&&t.options.crosshair.snap,!0)?t.drawCrosshair(null,o):t.hideCrosshair()}))):(o&&o.onMouseOut(),s&&ee(s,function(t){t.setState()}),n&&n.onMouseOut(),r&&r.hide(e),this._onDocumentMouseMove&&(re(ut,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),ee(i.axes,function(t){t.hideCrosshair()}),this.hoverX=i.hoverPoints=i.hoverPoint=null)},scaleGroups:function(t,e){var i,n=this.chart;ee(n.series,function(o){i=t||o.getPlotBox(),o.xAxis&&o.xAxis.zoomEnabled&&(o.group.attr(i),o.markerGroup&&(o.markerGroup.attr(i),o.markerGroup.clip(e?n.clipRect:null)),o.dataLabelsGroup&&o.dataLabelsGroup.attr(i))}),n.clipRect.attr(e||n.clipBox)},dragStart:function(t){var e=this.chart;e.mouseIsDown=t.type,e.cancelClick=!1,e.mouseDownX=this.mouseDownX=t.chartX,e.mouseDownY=this.mouseDownY=t.chartY},drag:function(t){var e,i,n=this.chart,o=n.options.chart,s=t.chartX,r=t.chartY,a=this.zoomHor,l=this.zoomVert,h=n.plotLeft,c=n.plotTop,d=n.plotWidth,p=n.plotHeight,u=this.selectionMarker,f=this.mouseDownX,g=this.mouseDownY,m=o.panKey&&t[o.panKey+"Key"];u&&u.touch||(s<h?s=h:s>h+d&&(s=h+d),r<c?r=c:r>c+p&&(r=c+p),this.hasDragged=Math.sqrt(Math.pow(f-s,2)+Math.pow(g-r,2)),this.hasDragged>10&&(e=n.isInsidePlot(f-h,g-c),n.hasCartesianSeries&&(this.zoomX||this.zoomY)&&e&&!m&&(u||(this.selectionMarker=u=n.renderer.rect(h,c,a?1:d,l?1:p,0).attr({fill:o.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add())),u&&a&&(i=s-f,u.attr({width:bt(i),x:(i>0?0:i)+f})),u&&l&&(i=r-g,u.attr({height:bt(i),y:(i>0?0:i)+g})),e&&!u&&o.panning&&n.pan(t,o.panning)))},drop:function(t){var e=this,i=this.chart,n=this.hasPinched;if(this.selectionMarker){var o,s={xAxis:[],yAxis:[],originalEvent:t.originalEvent||t},r=this.selectionMarker,a=r.attr?r.attr("x"):r.x,l=r.attr?r.attr("y"):r.y,h=r.attr?r.attr("width"):r.width,c=r.attr?r.attr("height"):r.height;(this.hasDragged||n)&&(ee(i.axes,function(i){if(i.zoomEnabled&&d(i.min)&&(n||e[{xAxis:"zoomX",yAxis:"zoomY"}[i.coll]])){var r=i.horiz,p="touchend"===t.type?i.minPixelPadding:0,u=i.toValue((r?a:l)+p),f=i.toValue((r?a+h:l+c)-p);s[i.coll].push({axis:i,min:vt(u,f),max:yt(u,f)}),o=!0}}),o&&ae(i,"selection",s,function(t){i.zoom(de(t,n?{animation:!1}:null))})),this.selectionMarker=this.selectionMarker.destroy(),n&&this.scaleGroups()}i&&(g(i.container,{cursor:i._cursor}),i.cancelClick=this.hasDragged>10,i.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(t){(t=this.normalize(t)).preventDefault&&t.preventDefault(),this.dragStart(t)},onDocumentMouseUp:function(t){Xt[Ae]&&Xt[Ae].pointer.drop(t)},onDocumentMouseMove:function(t){var e=this.chart,i=this.chartPosition;t=this.normalize(t,i),!i||this.inClass(t.target,"highcharts-tracker")||e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||this.reset()},onContainerMouseLeave:function(){var t=Xt[Ae];t&&(t.pointer.reset(),t.pointer.chartPosition=null)},onContainerMouseMove:function(t){var e=this.chart;Ae=e.index,(t=this.normalize(t)).returnValue=!1,"mousedown"===e.mouseIsDown&&this.drag(t),!this.inClass(t.target,"highcharts-tracker")&&!e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||e.openMenu||this.runPointActions(t)},inClass:function(t,e){for(var i;t;){if(i=p(t,"class")){if(-1!==i.indexOf(e))return!0;if(-1!==i.indexOf(Vt+"container"))return!1}t=t.parentNode}},onTrackerMouseOut:function(t){var e=this.chart.hoverSeries,i=t.relatedTarget||t.toElement;!e||e.options.stickyTracking||this.inClass(i,Vt+"tooltip")||this.inClass(i,Vt+"series-"+e.index)||e.onMouseOut()},onContainerClick:function(t){var e=this.chart,i=e.hoverPoint,n=e.plotLeft,o=e.plotTop;(t=this.normalize(t)).originalEvent=t,e.cancelClick||(i&&this.inClass(t.target,Vt+"tracker")?(ae(i.series,"click",de(t,{point:i})),e.hoverPoint&&i.firePointEvent("click",t)):(de(t,this.getCoordinates(t)),e.isInsidePlot(t.chartX-n,t.chartY-o)&&ae(e,"click",t)))},setDOMEvents:function(){var t=this,e=t.chart.container;e.onmousedown=function(e){t.onContainerMouseDown(e)},e.onmousemove=function(e){t.onContainerMouseMove(e)},e.onclick=function(e){t.onContainerClick(e)},se(e,"mouseleave",t.onContainerMouseLeave),1===Gt&&se(ut,"mouseup",t.onDocumentMouseUp),Y&&(e.ontouchstart=function(e){t.onContainerTouchStart(e)},e.ontouchmove=function(e){t.onContainerTouchMove(e)},1===Gt&&se(ut,"touchend",t.onDocumentTouchEnd))},destroy:function(){var t;for(t in re(this.chart.container,"mouseleave",this.onContainerMouseLeave),Gt||(re(ut,"mouseup",this.onDocumentMouseUp),re(ut,"touchend",this.onDocumentTouchEnd)),clearInterval(this.tooltipTimeout),this)this[t]=null}},de(dt.Pointer.prototype,{pinchTranslate:function(t,e,i,n,o,s){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,t,e,i,n,o,s),(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,t,e,i,n,o,s)},pinchTranslateDirection:function(t,e,i,n,o,s,r,a){var l,h,c,d,p,u,f=this.chart,g=t?"x":"y",m=t?"X":"Y",x="chart"+m,y=t?"width":"height",v=f["plot"+(t?"Left":"Top")],b=a||1,k=f.inverted,w=f.bounds[t?"h":"v"],A=1===e.length,S=e[0][x],T=i[0][x],P=!A&&e[1][x],C=!A&&i[1][x],M=function(){!A&&bt(S-P)>20&&(b=a||bt(T-C)/bt(S-P)),c=(v-T)/b+S,l=f["plot"+(t?"Width":"Height")]/b};M(),(h=c)<w.min?(h=w.min,d=!0):h+l>w.max&&(h=w.max-l,d=!0),d?(T-=.8*(T-r[g][0]),A||(C-=.8*(C-r[g][1])),M()):r[g]=[T,C],k||(s[g]=c-v,s[y]=l),u=k?t?"scaleY":"scaleX":"scale"+m,p=k?1/b:b,o[y]=l,o[g]=h,n[u]=b,n["translate"+m]=p*v+(T-p*S)},pinch:function(t){var e=this,i=e.chart,n=e.pinchDown,o=t.touches,s=o.length,r=e.lastValidTouch,a=e.hasZoom,l=e.selectionMarker,h={},c=1===s&&(e.inClass(t.target,Vt+"tracker")&&i.runTrackerClick||e.runChartClick),d={};s>1&&(e.initiated=!0),a&&e.initiated&&!c&&t.preventDefault(),oe(o,function(t){return e.normalize(t)}),"touchstart"===t.type?(ee(o,function(t,e){n[e]={chartX:t.chartX,chartY:t.chartY}}),r.x=[n[0].chartX,n[1]&&n[1].chartX],r.y=[n[0].chartY,n[1]&&n[1].chartY],ee(i.axes,function(t){if(t.zoomEnabled){var e=i.bounds[t.horiz?"h":"v"],n=t.minPixelPadding,o=t.toPixels(pe(t.options.min,t.dataMin)),s=t.toPixels(pe(t.options.max,t.dataMax)),r=vt(o,s),a=yt(o,s);e.min=vt(t.pos,r-n),e.max=yt(t.pos+t.len,a+n)}}),e.res=!0):n.length&&(l||(e.selectionMarker=l=de({destroy:Ht,touch:!0},i.plotBox)),e.pinchTranslate(n,o,h,l,d,r),e.hasPinched=a,e.scaleGroups(h,d),!a&&e.followTouchMove&&1===s?this.runPointActions(e.normalize(t)):e.res&&(e.res=!1,this.reset(!1,0)))},touch:function(t,e){var i=this.chart;Ae=i.index,1===t.touches.length?(t=this.normalize(t),i.isInsidePlot(t.chartX-i.plotLeft,t.chartY-i.plotTop)&&!i.openMenu?(e&&this.runPointActions(t),this.pinch(t)):e&&this.reset()):2===t.touches.length&&this.pinch(t)},onContainerTouchStart:function(t){this.touch(t,!0)},onContainerTouchMove:function(t){this.touch(t)},onDocumentTouchEnd:function(t){Xt[Ae]&&Xt[Ae].pointer.drop(t)}}),pt.PointerEvent||pt.MSPointerEvent){var Pe={},Ce=!!pt.PointerEvent,Me=function(t,e,i,n){"touch"!==(t=t.originalEvent||t).pointerType&&t.pointerType!==t.MSPOINTER_TYPE_TOUCH||!Xt[Ae]||(n(t),Xt[Ae].pointer[e]({type:i,target:t.currentTarget,preventDefault:Ht,touches:function(){var t,e=[];for(t in e.item=function(t){return this[t]},Pe)Pe.hasOwnProperty(t)&&e.push({pageX:Pe[t].pageX,pageY:Pe[t].pageY,target:Pe[t].target});return e}()}))};de(Te.prototype,{onContainerPointerDown:function(t){Me(t,"onContainerTouchStart","touchstart",function(t){Pe[t.pointerId]={pageX:t.pageX,pageY:t.pageY,target:t.currentTarget}})},onContainerPointerMove:function(t){Me(t,"onContainerTouchMove","touchmove",function(t){Pe[t.pointerId]={pageX:t.pageX,pageY:t.pageY},Pe[t.pointerId].target||(Pe[t.pointerId].target=t.currentTarget)})},onDocumentPointerUp:function(t){Me(t,"onDocumentTouchEnd","touchend",function(t){delete Pe[t.pointerId]})},batchMSEvents:function(t){t(this.chart.container,Ce?"pointerdown":"MSPointerDown",this.onContainerPointerDown),t(this.chart.container,Ce?"pointermove":"MSPointerMove",this.onContainerPointerMove),t(ut,Ce?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),ue(Te.prototype,"init",function(t,e,i){t.call(this,e,i),this.hasZoom&&g(e.container,{"-ms-touch-action":jt,"touch-action":jt})}),ue(Te.prototype,"setDOMEvents",function(t){t.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(se)}),ue(Te.prototype,"destroy",function(t){this.batchMSEvents(re),t.call(this)})}var Le=dt.Legend=function(t,e){this.init(t,e)};Le.prototype={init:function(t,e){var n,o=this,s=e.itemStyle,r=e.itemMarginTop||0;this.options=e,e.enabled&&(o.itemStyle=s,o.itemHiddenStyle=i(s,e.itemHiddenStyle),o.itemMarginTop=r,o.padding=n=pe(e.padding,8),o.initialItemX=n,o.initialItemY=n-5,o.maxItemWidth=0,o.chart=t,o.itemHeight=0,o.symbolWidth=pe(e.symbolWidth,16),o.pages=[],o.render(),se(o.chart,"endResize",function(){o.positionCheckboxes()}))},colorizeItem:function(t,e){var i,n,o=this.options,s=t.legendItem,r=t.legendLine,a=t.legendSymbol,l=this.itemHiddenStyle.color,h=e?o.itemStyle.color:l,c=e?t.legendColor||t.color||"#CCC":l,d=t.options&&t.options.marker,p={fill:c};if(s&&s.css({fill:h,color:h}),r&&r.attr({stroke:c}),a){if(d&&a.isMarker)for(i in p.stroke=c,d=t.convertAttribs(d))(n=d[i])!==X&&(p[i]=n);a.attr(p)}},positionItem:function(t){var e=this.options,i=e.symbolPadding,n=!e.rtl,o=t._legendItemPos,s=o[0],r=o[1],a=t.checkbox,l=t.legendGroup;l&&l.element&&l.translate(n?s:this.legendWidth-s-2*i-4,r),a&&(a.x=s,a.y=r)},destroyItem:function(t){var e=t.checkbox;ee(["legendItem","legendLine","legendSymbol","legendGroup"],function(e){t[e]&&(t[e]=t[e].destroy())}),e&&L(t.checkbox)},destroy:function(){var t=this.group,e=this.box;e&&(this.box=e.destroy()),t&&(this.group=t.destroy())},positionCheckboxes:function(t){var e,i=this.group.alignAttr,n=this.clipHeight||this.legendHeight;i&&(e=i.translateY,ee(this.allItems,function(o){var s,r=o.checkbox;r&&(s=e+r.y+(t||0)+3,g(r,{left:i.translateX+o.checkboxOffset+r.x-20+Ut,top:s+Ut,display:s>e-6&&s<e+n-6?"":jt}))}))},renderTitle:function(){var t,e=this.options,i=this.padding,n=e.title,o=0;n.text&&(this.title||(this.title=this.chart.renderer.label(n.text,i-3,i-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(n.style).add(this.group)),o=(t=this.title.getBBox()).height,this.offsetWidth=t.width,this.contentGroup.attr({translateY:o})),this.titleHeight=o},setText:function(t){var e=this.options;t.legendItem.attr({text:e.labelFormat?w(e.labelFormat,t):e.labelFormatter.call(t)})},renderItem:function(t){var e,n,o,s=this.chart,r=s.renderer,a=this.options,l="horizontal"===a.layout,h=this.symbolWidth,c=a.symbolPadding,d=this.itemStyle,p=this.itemHiddenStyle,u=this.padding,f=l?pe(a.itemDistance,20):0,g=!a.rtl,m=a.width,x=a.itemMarginBottom||0,y=this.itemMarginTop,v=this.initialItemX,b=t.legendItem,k=t.series&&t.series.drawLegendSymbol?t.series:t,w=k.options,A=this.createCheckboxForItem&&w&&w.showCheckbox,S=a.useHTML;b||(t.legendGroup=r.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),t.legendItem=b=r.text("",g?h+c:-c,this.baseline||0,S).css(i(t.visible?d:p)).attr({align:g?"left":"right",zIndex:2}).add(t.legendGroup),this.baseline||(this.fontMetrics=r.fontMetrics(d.fontSize,b),this.baseline=this.fontMetrics.f+3+y,b.attr("y",this.baseline)),k.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,b,S,d,p),this.colorizeItem(t,t.visible),A&&this.createCheckboxForItem(t)),this.setText(t),n=b.getBBox(),o=t.checkboxOffset=a.itemWidth||t.legendItemWidth||h+c+n.width+f+(A?20:0),this.itemHeight=e=gt(t.legendItemHeight||n.height),l&&this.itemX-v+o>(m||s.chartWidth-2*u-v-a.x)&&(this.itemX=v,this.itemY+=y+this.lastLineHeight+x,this.lastLineHeight=0),this.maxItemWidth=yt(this.maxItemWidth,o),this.lastItemY=y+this.itemY+x,this.lastLineHeight=yt(e,this.lastLineHeight),t._legendItemPos=[this.itemX,this.itemY],l?this.itemX+=o:(this.itemY+=y+e+x,this.lastLineHeight=e),this.offsetWidth=m||yt((l?this.itemX-v-f:o)+u,this.offsetWidth)},getAllItems:function(){var t=[];return ee(this.chart.series,function(e){var i=e.options;pe(i.showInLegend,!d(i.linkedTo)&&X,!0)&&(t=t.concat(e.legendItems||("point"===i.legendType?e.data:e)))}),t},adjustMargins:function(t,e){var i=this.chart,n=this.options,o=n.align.charAt(0)+n.verticalAlign.charAt(0)+n.layout.charAt(0);this.display&&!n.floating&&ee([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(s,r){s.test(o)&&!d(t[r])&&(i[$t[r]]=yt(i[$t[r]],i.legend[(r+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][r]*n[r%2?"x":"y"]+pe(n.margin,12)+e[r]))})},render:function(){var t,e,i,n,o=this,s=o.chart,r=s.renderer,a=o.group,l=o.box,h=o.options,c=o.padding,d=h.borderWidth,p=h.backgroundColor;o.itemX=o.initialItemX,o.itemY=o.initialItemY,o.offsetWidth=0,o.lastItemY=0,a||(o.group=a=r.g("legend").attr({zIndex:7}).add(),o.contentGroup=r.g().attr({zIndex:1}).add(a),o.scrollGroup=r.g().add(o.contentGroup)),o.renderTitle(),T(t=o.getAllItems(),function(t,e){return(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)}),h.reversed&&t.reverse(),o.allItems=t,o.display=e=!!t.length,o.lastLineHeight=0,ee(t,function(t){o.renderItem(t)}),i=(h.width||o.offsetWidth)+c,n=o.lastItemY+o.lastLineHeight+o.titleHeight,n=o.handleOverflow(n),n+=c,(d||p)&&(l?i>0&&n>0&&(l[l.isNew?"attr":"animate"](l.crisp({width:i,height:n})),l.isNew=!1):(o.box=l=r.rect(0,0,i,n,h.borderRadius,d||0).attr({stroke:h.borderColor,"stroke-width":d||0,fill:p||jt}).add(a).shadow(h.shadow),l.isNew=!0),l[e?"show":"hide"]()),o.legendWidth=i,o.legendHeight=n,ee(t,function(t){o.positionItem(t)}),e&&a.align(de({width:i,height:n},h),!0,"spacingBox"),s.isResizing||this.positionCheckboxes()},handleOverflow:function(t){var e,i,n=this,o=this.chart,s=o.renderer,r=this.options,a=r.y,l="top"===r.verticalAlign,h=o.spacingBox.height+(l?-a:a)-this.padding,c=r.maxHeight,d=this.clipRect,p=r.navigation,u=pe(p.animation,!0),f=p.arrowSize||12,g=this.nav,m=this.pages,x=this.padding,y=this.allItems,v=function(t){d.attr({height:t}),n.contentGroup.div&&(n.contentGroup.div.style.clip="rect("+x+"px,9999px,"+(x+t)+"px,0)")};return"horizontal"===r.layout&&(h/=2),c&&(h=vt(h,c)),m.length=0,t>h?(this.clipHeight=e=yt(h-20-this.titleHeight-x,0),this.currentPage=pe(this.currentPage,1),this.fullHeight=t,ee(y,function(t,n){var o=t._legendItemPos[1],s=gt(t.legendItem.getBBox().height),r=m.length;(!r||o-m[r-1]>e&&(i||o)!==m[r-1])&&(m.push(i||o),r++),n===y.length-1&&o+s-m[r-1]>e&&m.push(o),o!==i&&(i=o)}),d||(d=n.clipRect=s.clipRect(0,x,9999,0),n.contentGroup.clip(d)),v(e),g||(this.nav=g=s.g().attr({zIndex:1}).add(this.group),this.up=s.symbol("triangle",0,0,f,f).on("click",function(){n.scroll(-1,u)}).add(g),this.pager=s.text("",15,10).css(p.style).add(g),this.down=s.symbol("triangle-down",0,0,f,f).on("click",function(){n.scroll(1,u)}).add(g)),n.scroll(0),t=h):g&&(v(o.chartHeight),g.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t},scroll:function(t,e){var i,n=this.pages,o=n.length,s=this.currentPage+t,r=this.clipHeight,a=this.options.navigation,l=a.activeColor,h=a.inactiveColor,c=this.pager,d=this.padding;s>o&&(s=o),s>0&&(e!==X&&I(e,this.chart),this.nav.attr({translateX:d,translateY:r+this.padding+7+this.titleHeight,visibility:_t}),this.up.attr({fill:1===s?h:l}).css({cursor:1===s?"default":"pointer"}),c.attr({text:s+"/"+o}),this.down.attr({x:18+this.pager.getBBox().width,fill:s===o?h:l}).css({cursor:s===o?"default":"pointer"}),i=-n[s-1]+this.initialItemY,this.scrollGroup.animate({translateY:i}),this.currentPage=s,this.positionCheckboxes(i))}};var De=dt.LegendSymbolMixin={drawRectangle:function(t,e){var i=t.options.symbolHeight||t.fontMetrics.f;e.legendSymbol=this.chart.renderer.rect(0,t.baseline-i+1,t.symbolWidth,i,t.options.symbolRadius||0).attr({zIndex:3}).add(e.legendGroup)},drawLineMarker:function(t){var e,i,n,o=this.options,s=o.marker,r=t.symbolWidth,a=this.chart.renderer,l=this.legendGroup,h=t.baseline-gt(.3*t.fontMetrics.b);o.lineWidth&&(n={"stroke-width":o.lineWidth},o.dashStyle&&(n.dashstyle=o.dashStyle),this.legendLine=a.path([Zt,0,h,Kt,r,h]).attr(n).add(l)),s&&!1!==s.enabled&&(e=s.radius,this.legendSymbol=i=a.symbol(this.symbol,r/2-e,h-e,2*e,2*e).add(l),i.isMarker=!0)}};(/Trident\/7\.0/.test(Tt)||Dt)&&ue(Le.prototype,"positionItem",function(t,e){var i=this,n=function(){e._legendItemPos&&t.call(i,e)};n(),setTimeout(n)});var Ie=dt.Chart=function(){this.init.apply(this,arguments)};Ie.prototype={callbacks:[],init:function(t,e){var n,o=t.series;t.series=null,(n=i(N,t)).series=t.series=o,this.userOptions=t;var s=n.chart;this.margin=this.splashArray("margin",s),this.spacing=this.splashArray("spacing",s);var r=s.events;this.bounds={h:{},v:{}},this.callback=e,this.isResizing=0,this.options=n,this.axes=[],this.series=[],this.hasCartesianSeries=s.showAxes;var a,l=this;if(l.index=Xt.length,Xt.push(l),Gt++,!1!==s.reflow&&se(l,"load",function(){l.initReflow()}),r)for(a in r)se(l,a,r[a]);l.xAxis=[],l.yAxis=[],l.animation=!Rt&&pe(s.animation,!0),l.pointCount=l.colorCounter=l.symbolCounter=0,l.firstRender()},initSeries:function(t){var i,n=this.options.chart,o=t.type||n.type||n.defaultSeriesType,s=Jt[o];return s||e(17,!0),(i=new s).init(this,t),i},isInsidePlot:function(t,e,i){var n=i?e:t,o=i?t:e;return n>=0&&n<=this.plotWidth&&o>=0&&o<=this.plotHeight},redraw:function(t){var e,i,n,o=this.axes,s=this.series,r=this.pointer,a=this.legend,l=this.isDirtyLegend,h=this.hasCartesianSeries,c=this.isDirtyBox,d=s.length,p=d,u=this.renderer,f=u.isHidden(),g=[];for(I(t,this),f&&this.cloneRenderTo(),this.layOutTitles();p--;)if((n=s[p]).options.stacking&&(e=!0,n.isDirty)){i=!0;break}if(i)for(p=d;p--;)(n=s[p]).options.stacking&&(n.isDirty=!0);ee(s,function(t){t.isDirty&&"point"===t.options.legendType&&(t.updateTotals&&t.updateTotals(),l=!0)}),l&&a.options.enabled&&(a.render(),this.isDirtyLegend=!1),e&&this.getStacks(),h&&(this.isResizing||(this.maxTicks=null,ee(o,function(t){t.setScale()}))),this.getMargins(),h&&(ee(o,function(t){t.isDirty&&(c=!0)}),ee(o,function(t){var i=t.min+","+t.max;t.extKey!==i&&(t.extKey=i,g.push(function(){ae(t,"afterSetExtremes",de(t.eventArgs,t.getExtremes())),delete t.eventArgs})),(c||e)&&t.redraw()})),c&&this.drawChartBox(),ee(s,function(t){t.isDirty&&t.visible&&(!t.isCartesian||t.xAxis)&&t.redraw()}),r&&r.reset(!0),u.draw(),ae(this,"redraw"),f&&this.cloneRenderTo(!0),ee(g,function(t){t.call()})},get:function(t){var e,i,n,o=this.axes,s=this.series;for(e=0;e<o.length;e++)if(o[e].options.id===t)return o[e];for(e=0;e<s.length;e++)if(s[e].options.id===t)return s[e];for(e=0;e<s.length;e++)for(n=s[e].points||[],i=0;i<n.length;i++)if(n[i].id===t)return n[i];return null},getAxes:function(){var t,e=this,i=this.options,n=i.xAxis=u(i.xAxis||{}),o=i.yAxis=u(i.yAxis||{});ee(n,function(t,e){t.index=e,t.isX=!0}),ee(o,function(t,e){t.index=e}),t=n.concat(o),ee(t,function(t){new we(e,t)})},getSelectedPoints:function(){var t=[];return ee(this.series,function(e){t=t.concat(ie(e.points||[],function(t){return t.selected}))}),t},getSelectedSeries:function(){return ie(this.series,function(t){return t.selected})},setTitle:function(t,e,n){var o,s,r=this,a=r.options;o=a.title=i(a.title,t),s=a.subtitle=i(a.subtitle,e),ee([["title",t,o],["subtitle",e,s]],function(t){var e=t[0],i=r[e],n=t[1],o=t[2];i&&n&&(r[e]=i=i.destroy()),o&&o.text&&!i&&(r[e]=r.renderer.text(o.text,0,0,o.useHTML).attr({align:o.align,class:Vt+e,zIndex:o.zIndex||4}).css(o.style).add())}),r.layOutTitles(n)},layOutTitles:function(t){var e,i=0,n=this.title,o=this.subtitle,s=this.options,r=s.title,a=s.subtitle,l=this.renderer,h=this.spacingBox.width-44;n&&(n.css({width:(r.width||h)+Ut}).align(de({y:l.fontMetrics(r.style.fontSize,n).b-3},r),!1,"spacingBox"),r.floating||r.verticalAlign||(i=n.getBBox().height)),o&&(o.css({width:(a.width||h)+Ut}).align(de({y:i+(r.margin-13)+l.fontMetrics(a.style.fontSize,n).b},a),!1,"spacingBox"),a.floating||a.verticalAlign||(i=xt(i+o.getBBox().height))),e=this.titleOffset!==i,this.titleOffset=i,!this.isDirtyBox&&e&&(this.isDirtyBox=e,this.hasRendered&&pe(t,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var t=this.options.chart,e=t.width,i=t.height,n=this.renderToClone||this.renderTo;d(e)||(this.containerWidth=Qt(n,"width")),d(i)||(this.containerHeight=Qt(n,"height")),this.chartWidth=yt(0,e||this.containerWidth||600),this.chartHeight=yt(0,pe(i,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(t){var e=this.renderToClone,i=this.container;t?e&&(this.renderTo.appendChild(i),L(e),delete this.renderToClone):(i&&i.parentNode===this.renderTo&&this.renderTo.removeChild(i),this.renderToClone=e=this.renderTo.cloneNode(0),g(e,{position:Ft,top:"-9999px",display:"block"}),e.style.setProperty&&e.style.setProperty("display","block","important"),ut.body.appendChild(e),i&&e.appendChild(i))},getContainer:function(){var t,i,s,r,a,l,h,c=this.options,d=c.chart;this.renderTo=r=d.renderTo,h=Vt+Wt++,o(r)&&(this.renderTo=r=ut.getElementById(r)),r||e(13,!0),a=n(p(r,"data-highcharts-chart")),!isNaN(a)&&Xt[a]&&Xt[a].hasRendered&&Xt[a].destroy(),p(r,"data-highcharts-chart",this.index),r.innerHTML="",d.skipClone||r.offsetWidth||this.cloneRenderTo(),this.getChartSize(),i=this.chartWidth,s=this.chartHeight,this.container=t=m(Yt,{className:Vt+"container"+(d.className?" "+d.className:""),id:h},de({position:"relative",overflow:Nt,width:i+Ut,height:s+Ut,textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},d.style),this.renderToClone||r),this._cursor=t.style.cursor,l=dt[d.renderer]||G,this.renderer=new l(t,i,s,d.style,d.forExport,c.exporting&&c.exporting.allowHTML),Rt&&this.renderer.create(this,t,i,s),this.renderer.chartIndex=this.index},getMargins:function(t){var e=this.spacing,i=this.margin,n=this.titleOffset;this.resetMargins(),n&&!d(i[0])&&(this.plotTop=yt(this.plotTop,n+this.options.title.margin+e[0])),this.legend.adjustMargins(i,e),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),t||this.getAxisMargins()},getAxisMargins:function(){var t=this,e=t.axisOffset=[0,0,0,0],i=t.margin;t.hasCartesianSeries&&ee(t.axes,function(t){t.visible&&t.getOffset()}),ee($t,function(n,o){d(i[o])||(t[n]+=e[o])}),t.setChartSize()},reflow:function(t){var e=this,i=e.options.chart,n=e.renderTo,o=i.width||Qt(n,"width"),s=i.height||Qt(n,"height"),r=t?t.target:pt;e.hasUserSize||e.isPrinting||!o||!s||r!==pt&&r!==ut||(o===e.containerWidth&&s===e.containerHeight||(clearTimeout(e.reflowTimeout),e.reflowTimeout=f(function(){e.container&&(e.setSize(o,s,!1),e.hasUserSize=null)},t?100:0)),e.containerWidth=o,e.containerHeight=s)},initReflow:function(){var t=this,e=function(e){t.reflow(e)};se(pt,"resize",e),se(t,"destroy",function(){re(pt,"resize",e)})},setSize:function(t,e,i){var n,o,s,r=this,a=r.renderer;r.isResizing+=1,I(i,r),r.oldChartHeight=r.chartHeight,r.oldChartWidth=r.chartWidth,d(t)&&(r.chartWidth=n=yt(0,gt(t)),r.hasUserSize=!!n),d(e)&&(r.chartHeight=o=yt(0,gt(e))),((s=a.globalAnimation)?he:g)(r.container,{width:n+Ut,height:o+Ut},s),r.setChartSize(!0),a.setSize(n,o,i),r.maxTicks=null,ee(r.axes,function(t){t.isDirty=!0,t.setScale()}),ee(r.series,function(t){t.isDirty=!0}),r.isDirtyLegend=!0,r.isDirtyBox=!0,r.layOutTitles(),r.getMargins(),r.redraw(i),r.oldChartHeight=null,ae(r,"resize"),f(function(){r&&ae(r,"endResize",null,function(){r.isResizing-=1})},!1===(s=a.globalAnimation)?0:s&&s.duration||500)},setChartSize:function(t){var e,i,n,o,s,r,a,l=this.inverted,h=this.renderer,c=this.chartWidth,d=this.chartHeight,p=this.options.chart,u=this.spacing,f=this.clipOffset;this.plotLeft=n=gt(this.plotLeft),this.plotTop=o=gt(this.plotTop),this.plotWidth=s=yt(0,gt(c-n-this.marginRight)),this.plotHeight=r=yt(0,gt(d-o-this.marginBottom)),this.plotSizeX=l?r:s,this.plotSizeY=l?s:r,this.plotBorderWidth=p.plotBorderWidth||0,this.spacingBox=h.spacingBox={x:u[3],y:u[0],width:c-u[3]-u[1],height:d-u[0]-u[2]},this.plotBox=h.plotBox={x:n,y:o,width:s,height:r},a=2*mt(this.plotBorderWidth/2),e=xt(yt(a,f[3])/2),i=xt(yt(a,f[0])/2),this.clipBox={x:e,y:i,width:mt(this.plotSizeX-yt(a,f[1])/2-e),height:yt(0,mt(this.plotSizeY-yt(a,f[2])/2-i))},t||ee(this.axes,function(t){t.setAxisSize(),t.setAxisTranslation()})},resetMargins:function(){var t=this;ee($t,function(e,i){t[e]=pe(t.margin[i],t.spacing[i])}),t.axisOffset=[0,0,0,0],t.clipOffset=[0,0,0,0]},drawChartBox:function(){var t,e,i=this.options.chart,n=this.renderer,o=this.chartWidth,s=this.chartHeight,r=this.chartBackground,a=this.plotBackground,l=this.plotBorder,h=this.plotBGImage,c=i.borderWidth||0,d=i.backgroundColor,p=i.plotBackgroundColor,u=i.plotBackgroundImage,f=i.plotBorderWidth||0,g=this.plotLeft,m=this.plotTop,x=this.plotWidth,y=this.plotHeight,v=this.plotBox,b=this.clipRect,k=this.clipBox;t=c+(i.shadow?8:0),(c||d)&&(r?r.animate(r.crisp({width:o-t,height:s-t})):(e={fill:d||jt},c&&(e.stroke=i.borderColor,e["stroke-width"]=c),this.chartBackground=n.rect(t/2,t/2,o-t,s-t,i.borderRadius,c).attr(e).addClass(Vt+"background").add().shadow(i.shadow))),p&&(a?a.animate(v):this.plotBackground=n.rect(g,m,x,y,0).attr({fill:p}).add().shadow(i.plotShadow)),u&&(h?h.animate(v):this.plotBGImage=n.image(u,g,m,x,y).add()),b?b.animate({width:k.width,height:k.height}):this.clipRect=n.clipRect(k),f&&(l?l.animate(l.crisp({x:g,y:m,width:x,height:y,strokeWidth:-f})):this.plotBorder=n.rect(g,m,x,y,0,-f).attr({stroke:i.plotBorderColor,"stroke-width":f,fill:jt,zIndex:1}).add()),this.isDirtyBox=!1},propFromSeries:function(){var t,e,i,n=this,o=n.options.chart,s=n.options.series;ee(["inverted","angular","polar"],function(r){for(t=Jt[o.type||o.defaultSeriesType],i=n[r]||o[r]||t&&t.prototype[r],e=s&&s.length;!i&&e--;)(t=Jt[s[e].type])&&t.prototype[r]&&(i=!0);n[r]=i})},linkSeries:function(){var t=this,e=t.series;ee(e,function(t){t.linkedSeries.length=0}),ee(e,function(e){var i=e.options.linkedTo;o(i)&&(i=":previous"===i?t.series[e.index-1]:t.get(i))&&(i.linkedSeries.push(e),e.linkedParent=i,e.visible=pe(e.options.visible,i.options.visible,e.visible))})},renderSeries:function(){ee(this.series,function(t){t.translate(),t.render()})},renderLabels:function(){var t=this,e=t.options.labels;e.items&&ee(e.items,function(i){var o=de(e.style,i.style),s=n(o.left)+t.plotLeft,r=n(o.top)+t.plotTop+12;delete o.left,delete o.top,t.renderer.text(i.html,s,r).attr({zIndex:2}).css(o).add()})},render:function(){var t,e,i,n,o=this.axes,s=this.renderer,r=this.options;this.setTitle(),this.legend=new Le(this,r.legend),this.getStacks&&this.getStacks(),this.getMargins(!0),this.setChartSize(),t=this.plotWidth,e=this.plotHeight=this.plotHeight-21,ee(o,function(t){t.setScale()}),this.getAxisMargins(),i=t/this.plotWidth>1.1,n=e/this.plotHeight>1.05,(i||n)&&(this.maxTicks=null,ee(o,function(t){(t.horiz&&i||!t.horiz&&n)&&t.setTickInterval(!0)}),this.getMargins()),this.drawChartBox(),this.hasCartesianSeries&&ee(o,function(t){t.visible&&t.render()}),this.seriesGroup||(this.seriesGroup=s.g("series-group").attr({zIndex:3}).add()),this.renderSeries(),this.renderLabels(),this.showCredits(r.credits),this.hasRendered=!0},showCredits:function(t){t.enabled&&!this.credits&&(this.credits=this.renderer.text(t.text,0,0).on("click",function(){t.href&&(location.href=t.href)}).attr({align:t.position.align,zIndex:8}).css(t.style).add().align(t.position))},destroy:function(){var t,e=this,i=e.axes,n=e.series,o=e.container,s=o&&o.parentNode;for(ae(e,"destroy"),Xt[e.index]=X,Gt--,e.renderTo.removeAttribute("data-highcharts-chart"),re(e),t=i.length;t--;)i[t]=i[t].destroy();for(t=n.length;t--;)n[t]=n[t].destroy();for(t in ee(["title","subtitle","chartBackground","plotBackground","plotBGImage","plotBorder","seriesGroup","clipRect","credits","pointer","scroller","rangeSelector","legend","resetZoomButton","tooltip","renderer"],function(t){var i=e[t];i&&i.destroy&&(e[t]=i.destroy())}),o&&(o.innerHTML="",re(o),s&&L(o)),e)delete e[t]},isReadyToRender:function(){var t=this;return!(!Ot&&pt==pt.top&&"complete"!==ut.readyState||Rt&&!pt.canvg)||(Rt?ve.push(function(){t.firstRender()},t.options.global.canvasToolsURL):ut.attachEvent("onreadystatechange",function(){ut.detachEvent("onreadystatechange",t.firstRender),"complete"===ut.readyState&&t.firstRender()}),!1)},firstRender:function(){var t=this,e=t.options,i=t.callback;t.isReadyToRender()&&(t.getContainer(),ae(t,"init"),t.resetMargins(),t.setChartSize(),t.propFromSeries(),t.getAxes(),ee(e.series||[],function(e){t.initSeries(e)}),t.linkSeries(),ae(t,"beforeRender"),dt.Pointer&&(t.pointer=new Te(t,e)),t.render(),t.renderer.draw(),i&&i.apply(t,[t]),ee(t.callbacks,function(e){t.index!==X&&e.apply(t,[t])}),ae(t,"load"),t.cloneRenderTo(!0))},splashArray:function(t,e){var i=e[t],n=s(i)?i:[i,i,i,i];return[pe(e[t+"Top"],n[0]),pe(e[t+"Right"],n[1]),pe(e[t+"Bottom"],n[2]),pe(e[t+"Left"],n[3])]}};var Be=dt.CenteredSeriesMixin={getCenter:function(){var t,e,i,n=this.options,o=this.chart,s=2*(n.slicedOffset||0),r=o.plotWidth-2*s,a=o.plotHeight-2*s,l=n.center,h=[pe(l[0],"50%"),pe(l[1],"50%"),n.size||"100%",n.innerSize||0],c=vt(r,a);for(e=0;e<4;++e)i=h[e],t=e<2||2===e&&/%$/.test(i),h[e]=v(i,[r,a,c,h[2]][e])+(t?s:0);return h[3]>h[2]&&(h[3]=h[2]),h}},Oe=function(){};Oe.prototype={init:function(t,e,i){var n;return this.series=t,this.color=t.color,this.applyOptions(e,i),this.pointAttr={},t.options.colorByPoint&&(n=t.options.colors||t.chart.options.colors,this.color=this.color||n[t.colorCounter++],t.colorCounter===n.length&&(t.colorCounter=0)),t.chart.pointCount++,this},applyOptions:function(t,e){var i=this.series,n=i.options.pointValKey||i.pointValKey;return t=Oe.prototype.optionsToObject.call(this,t),de(this,t),this.options=this.options?de(this.options,t):t,n&&(this.y=this[n]),this.x===X&&i&&(this.x=e===X?i.autoIncrement():e),this},optionsToObject:function(t){var e,i={},n=this.series,o=n.options.keys,s=o||n.pointArrayMap||["y"],a=s.length,l=0,h=0;if("number"==typeof t||null===t)i[s[0]]=t;else if(r(t))for(!o&&t.length>a&&("string"===(e=typeof t[0])?i.name=t[0]:"number"===e&&(i.x=t[0]),l++);h<a;)o&&void 0===t[l]||(i[s[h]]=t[l]),l++,h++;else"object"==typeof t&&(i=t,t.dataLabels&&(n._hasPointLabels=!0),t.marker&&(n._hasPointMarkers=!0));return i},destroy:function(){var t,e=this.series.chart,i=e.hoverPoints;for(t in e.pointCount--,i&&(this.setState(),c(i,this),i.length||(e.hoverPoints=null)),this===e.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(re(this),this.destroyElements()),this.legendItem&&e.legend.destroyItem(this),this)this[t]=null},destroyElements:function(){for(var t,e=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],i=6;i--;)this[t=e[i]]&&(this[t]=this[t].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(t){var e=this.series,i=e.tooltipOptions,n=pe(i.valueDecimals,""),o=i.valuePrefix||"",s=i.valueSuffix||"";return ee(e.pointArrayMap||["y"],function(e){e="{point."+e,(o||s)&&(t=t.replace(e+"}",o+e+"}"+s)),t=t.replace(e+"}",e+":,."+n+"f}")}),w(t,{point:this,series:this.series})},firePointEvent:function(t,e,i){var n=this,o=this.series.options;(o.point.events[t]||n.options&&n.options.events&&n.options.events[t])&&this.importEvents(),"click"===t&&o.allowPointSelect&&(i=function(t){n.select&&n.select(null,t.ctrlKey||t.metaKey||t.shiftKey)}),ae(this,t,e,i)},visible:!0};var ze=dt.Series=function(){};ze.prototype={isCartesian:!0,type:"line",pointClass:Oe,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(t,e){var i,n,o=this,s=t.series,r=function(t,e){return pe(t.options.index,t._i)-pe(e.options.index,e._i)};for(i in o.chart=t,o.options=e=o.setOptions(e),o.linkedSeries=[],o.bindAxes(),de(o,{name:e.name,state:"",pointAttr:{},visible:!1!==e.visible,selected:!0===e.selected}),Rt&&(e.animation=!1),n=e.events)se(o,i,n[i]);(n&&n.click||e.point&&e.point.events&&e.point.events.click||e.allowPointSelect)&&(t.runTrackerClick=!0),o.getColor(),o.getSymbol(),ee(o.parallelArrays,function(t){o[t+"Data"]=[]}),o.setData(e.data,!1),o.isCartesian&&(t.hasCartesianSeries=!0),s.push(o),o._i=s.length-1,T(s,r),this.yAxis&&T(this.yAxis.series,r),ee(s,function(t,e){t.index=e,t.name=t.name||"Series "+(e+1)})},bindAxes:function(){var t,i=this,n=i.options,o=i.chart;ee(i.axisTypes||[],function(s){ee(o[s],function(e){t=e.options,(n[s]===t.index||n[s]!==X&&n[s]===t.id||n[s]===X&&0===t.index)&&(e.series.push(i),i[s]=e,e.isDirty=!0)}),i[s]||i.optionalAxis===s||e(18,!0)})},updateParallelArrays:function(t,e){var i=t.series,n=arguments,o="number"==typeof e?function(n){var o="y"===n&&i.toYData?i.toYData(t):t[n];i[n+"Data"][e]=o}:function(t){Array.prototype[e].apply(i[t+"Data"],Array.prototype.slice.call(n,2))};ee(i.parallelArrays,o)},autoIncrement:function(){var t,e,i=this.options,n=this.xIncrement,o=i.pointIntervalUnit;return n=pe(n,i.pointStart,0),this.pointInterval=e=pe(this.pointInterval,i.pointInterval,1),"month"!==o&&"year"!==o||(t=new Z(n),e=(t="month"===o?+t[ht](t[it]()+e):+t[ct](t[nt]()+e))-n),this.xIncrement=n+e,n},getSegments:function(){var t,e=-1,i=[],n=this.points,o=n.length;if(o)if(this.options.connectNulls){for(t=o;t--;)null===n[t].y&&n.splice(t,1);n.length&&(i=[n])}else ee(n,function(t,s){null===t.y?(s>e+1&&i.push(n.slice(e+1,s)),e=s):s===o-1&&i.push(n.slice(e+1,s+1))});this.segments=i},setOptions:function(t){var e,n,o=this.chart,s=o.options.plotOptions,r=o.userOptions||{},a=r.plotOptions||{},l=s[this.type];return this.userOptions=t,e=i(l,s.series,t),this.tooltipOptions=i(N.tooltip,N.plotOptions[this.type].tooltip,r.tooltip,a.series&&a.series.tooltip,a[this.type]&&a[this.type].tooltip,t.tooltip),null===l.marker&&delete e.marker,this.zoneAxis=e.zoneAxis,n=this.zones=(e.zones||[]).slice(),!e.negativeColor&&!e.negativeFillColor||e.zones||n.push({value:e[this.zoneAxis+"Threshold"]||e.threshold||0,color:e.negativeColor,fillColor:e.negativeFillColor}),n.length&&d(n[n.length-1].value)&&n.push({color:this.color,fillColor:this.fillColor}),e},getCyclic:function(t,e,i){var n,o=this.userOptions,s="_"+t+"Index",r=t+"Counter";e||(d(o[s])?n=o[s]:(o[s]=n=this.chart[r]%i.length,this.chart[r]+=1),e=i[n]),this[t]=e},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||fe[this.type].color,this.chart.options.colors)},getSymbol:function(){var t=this.options.marker;this.getCyclic("symbol",t.symbol,this.chart.options.symbols),/^url/.test(this.symbol)&&(t.radius=0)},drawLegendSymbol:De.drawLineMarker,setData:function(t,i,n,s){var l,h,c,p=this,u=p.points,f=u&&u.length||0,g=p.options,m=p.chart,x=null,y=p.xAxis,v=y&&!!y.categories,b=g.turboThreshold,k=this.xData,w=this.yData,A=p.pointArrayMap,S=A&&A.length;if(l=(t=t||[]).length,i=pe(i,!0),!1!==s&&l&&f===l&&!p.cropped&&!p.hasGroupedData&&p.visible)ee(t,function(t,e){u[e].update&&t!==g.data[e]&&u[e].update(t,!1,null,!1)});else{if(p.xIncrement=null,p.colorCounter=0,ee(this.parallelArrays,function(t){p[t+"Data"].length=0}),b&&l>b){for(h=0;null===x&&h<l;)x=t[h],h++;if(a(x)){var T=pe(g.pointStart,0),P=pe(g.pointInterval,1);for(h=0;h<l;h++)k[h]=T,w[h]=t[h],T+=P;p.xIncrement=T}else if(r(x))if(S)for(h=0;h<l;h++)c=t[h],k[h]=c[0],w[h]=c.slice(1,S+1);else for(h=0;h<l;h++)c=t[h],k[h]=c[0],w[h]=c[1];else e(12)}else for(h=0;h<l;h++)t[h]!==X&&(c={series:p},p.pointClass.prototype.applyOptions.apply(c,[t[h]]),p.updateParallelArrays(c,h),v&&d(c.name)&&(y.names[c.x]=c.name));for(o(w[0])&&e(14,!0),p.data=[],p.options.data=t,h=f;h--;)u[h]&&u[h].destroy&&u[h].destroy();y&&(y.minRange=y.userMinRange),p.isDirty=p.isDirtyData=m.isDirtyBox=!0,n=!1}"point"===g.legendType&&(this.processData(),this.generatePoints()),i&&m.redraw(n)},processData:function(t){var i,n,o,s,r,a,l,h,c=this.xData,d=this.yData,p=c.length,u=0,f=this.xAxis,g=this.options,m=g.cropThreshold,x=this.getExtremesFromAll||g.getExtremesFromAll,y=this.isCartesian;if(y&&!this.isDirty&&!f.isDirty&&!this.yAxis.isDirty&&!t)return!1;for(f&&(l=(a=f.getExtremes()).min,h=a.max),y&&this.sorted&&!x&&(!m||p>m||this.forceCrop)&&(c[p-1]<l||c[0]>h?(c=[],d=[]):(c[0]<l||c[p-1]>h)&&(c=(i=this.cropData(this.xData,this.yData,l,h)).xData,d=i.yData,u=i.start,n=!0)),r=c.length-1;r>=0;r--)(o=c[r]-c[r-1])>0&&(s===X||o<s)?s=o:o<0&&this.requireSorting&&e(15);this.cropped=n,this.cropStart=u,this.processedXData=c,this.processedYData=d,this.closestPointRange=s},cropData:function(t,e,i,n){var o,s,r=t.length,a=0,l=r,h=pe(this.cropShoulder,1);for(o=0;o<r;o++)if(t[o]>=i){a=yt(0,o-h);break}for(s=o;s<r;s++)if(t[s]>n){l=s+h;break}return{xData:t.slice(a,l),yData:e.slice(a,l),start:a,end:l}},generatePoints:function(){var t,e,i,n,o=this.options.data,s=this.data,r=this.processedXData,a=this.processedYData,l=this.pointClass,h=r.length,c=this.cropStart||0,d=this.hasGroupedData,p=[];if(!s&&!d){var f=[];f.length=o.length,s=this.data=f}for(n=0;n<h;n++)e=c+n,d?p[n]=(new l).init(this,[r[n]].concat(u(a[n]))):(s[e]?i=s[e]:o[e]!==X&&(s[e]=i=(new l).init(this,o[e],r[n])),p[n]=i),p[n].index=e;if(s&&(h!==(t=s.length)||d))for(n=0;n<t;n++)n!==c||d||(n+=h),s[n]&&(s[n].destroyElements(),s[n].plotX=X);this.data=s,this.points=p},getExtremes:function(t){var e,i,n,o,s,r,a,l=this.xAxis,h=this.yAxis,c=this.processedXData,d=[],p=0,u=l.getExtremes(),f=u.min,g=u.max;for(e=(t=t||this.stackedYData||this.processedYData).length,r=0;r<e;r++)if(o=c[r],i=null!==(s=t[r])&&s!==X&&(!h.isLog||s.length||s>0),n=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(c[r+1]||o)>=f&&(c[r-1]||o)<=g,i&&n)if(a=s.length)for(;a--;)null!==s[a]&&(d[p++]=s[a]);else d[p++]=s;this.dataMin=P(d),this.dataMax=C(d)},translate:function(){this.processedXData||this.processData(),this.generatePoints();var t,i,n,o,s,r=this.options,l=r.stacking,h=this.xAxis,c=h.categories,p=this.yAxis,u=this.points,f=u.length,g=!!this.modifyValue,m=r.pointPlacement,x="between"===m||a(m),y=r.threshold,v=r.startFromThreshold?y:0,b=Number.MAX_VALUE;for(t=0;t<f;t++){var k,w,A=u[t],S=A.x,T=A.y,P=A.low,C=l&&p.stacks[(this.negStacks&&T<(v?0:y)?"-":"")+this.stackKey];p.isLog&&null!==T&&T<=0&&(A.y=T=null,e(10)),A.plotX=i=vt(yt(-1e5,h.translate(S,0,0,0,1,m,"flags"===this.type)),1e5),l&&this.visible&&C&&C[S]&&(s=this.getStackIndicator(s,S,this.index),P=(w=(k=C[S]).points[s.key])[0],T=w[1],P===v&&(P=pe(y,p.min)),p.isLog&&P<=0&&(P=null),A.total=A.stackTotal=k.total,A.percentage=k.total&&A.y/k.total*100,A.stackY=T,k.setOffset(this.pointXOffset||0,this.barW||0)),A.yBottom=d(P)?p.translate(P,0,1,0,1):null,g&&(T=this.modifyValue(T,A)),A.plotY=n="number"==typeof T&&T!==1/0?vt(yt(-1e5,p.translate(T,0,1,0,1)),1e5):X,A.isInside=n!==X&&n>=0&&n<=p.len&&i>=0&&i<=h.len,A.clientX=x?h.translate(S,0,0,0,1):i,A.negative=A.y<(y||0),A.category=c&&c[A.x]!==X?c[A.x]:A.x,t&&(b=vt(b,bt(i-o))),o=i}this.closestPointRangePx=b,this.getSegments()},setClip:function(t){var e=this.chart,i=this.options,n=e.renderer,o=e.inverted,s=this.clipBox,r=s||e.clipBox,a=this.sharedClipKey||["_sharedClip",t&&t.duration,t&&t.easing,r.height,i.xAxis,i.yAxis].join(","),l=e[a],h=e[a+"m"];l||(t&&(r.width=0,e[a+"m"]=h=n.clipRect(-99,o?-e.plotLeft:-e.plotTop,99,o?e.chartWidth:e.chartHeight)),e[a]=l=n.clipRect(r)),t&&(l.count+=1),!1!==i.clip&&(this.group.clip(t||s?l:e.clipRect),this.markerGroup.clip(h),this.sharedClipKey=a),t||(l.count-=1,l.count<=0&&a&&e[a]&&(s||(e[a]=e[a].destroy()),e[a+"m"]&&(e[a+"m"]=e[a+"m"].destroy())))},animate:function(t){var e,i,n=this.chart,o=this.options.animation;o&&!s(o)&&(o=fe[this.type].animation),t?this.setClip(o):((e=n[i=this.sharedClipKey])&&e.animate({width:n.plotSizeX},o),n[i+"m"]&&n[i+"m"].animate({width:n.plotSizeX+99},o),this.animate=null)},afterAnimate:function(){this.setClip(),ae(this,"afterAnimate")},drawPoints:function(){var t,e,i,n,o,s,r,a,l,h,c,d,p,u=this.points,f=this.chart,g=this.options.marker,m=this.pointAttr[""],x=this.markerGroup,y=this.xAxis,v=pe(g.enabled,y.isRadial,this.closestPointRangePx>2*g.radius);if(!1!==g.enabled||this._hasPointMarkers)for(n=u.length;n--;)o=u[n],e=mt(o.plotX),i=o.plotY,l=o.graphic,h=o.marker||{},c=!!o.marker,d=v&&h.enabled===X||h.enabled,p=o.isInside,d&&i!==X&&!isNaN(i)&&null!==o.y?(s=(t=o.pointAttr[o.selected?"select":""]||m).r,a=0===(r=pe(h.symbol,this.symbol)).indexOf("url"),l?l[p?"show":"hide"](!0).animate(de({x:e-s,y:i-s},l.symbolName?{width:2*s,height:2*s}:{})):p&&(s>0||a)&&(o.graphic=l=f.renderer.symbol(r,e-s,i-s,2*s,2*s,c?h:g).attr(t).add(x))):l&&(o.graphic=l.destroy())},convertAttribs:function(t,e,i,n){var o,s,r=this.pointAttrToOptions,a={};for(o in t=t||{},e=e||{},i=i||{},n=n||{},r)s=r[o],a[o]=pe(t[s],e[o],i[o],n[o]);return a},getAttribs:function(){var t,e,i,n,o,s,r,a,l=this,h=l.options,c=fe[l.type].marker?h.marker:h,p=c.states,u=p.hover,f=l.color,g=l.options.negativeColor,m={stroke:f,fill:f},x=l.points||[],y=[],v=l.pointAttrToOptions,b=l.hasPointSpecificOptions,k=c.lineColor,w=c.fillColor,A=h.turboThreshold,S=l.zones,T=l.zoneAxis||"y";if(h.marker?(u.radius=u.radius||c.radius+u.radiusPlus,u.lineWidth=u.lineWidth||c.lineWidth+u.lineWidthPlus):(u.color=u.color||O(u.color||f).brighten(u.brightness).get(),u.negativeColor=u.negativeColor||O(u.negativeColor||g).brighten(u.brightness).get()),y[""]=l.convertAttribs(c,m),ee(["hover","select"],function(t){y[t]=l.convertAttribs(p[t],y[""])}),l.pointAttr=y,e=x.length,!A||e<A||b)for(;e--;){if((c=(o=x[e]).options&&o.options.marker||o.options)&&!1===c.enabled&&(c.radius=0),S.length){for(n=S[i=0];o[T]>=n.value;)n=S[++i];o.color=o.fillColor=pe(n.color,l.color)}if(b=h.colorByPoint||o.color,o.options)for(a in v)d(c[v[a]])&&(b=!0);b?(s=[],t=(p=(c=c||{}).states||{}).hover=p.hover||{},h.marker&&(!o.negative||t.fillColor||u.fillColor)||(t[l.pointAttrToOptions.fill]=t.color||!o.options.color&&u[o.negative&&g?"negativeColor":"color"]||O(o.color).brighten(t.brightness||u.brightness).get()),r={color:o.color},w||(r.fillColor=o.color),k||(r.lineColor=o.color),c.hasOwnProperty("color")&&!c.color&&delete c.color,s[""]=l.convertAttribs(de(r,c),y[""]),s.hover=l.convertAttribs(p.hover,y.hover,s[""]),s.select=l.convertAttribs(p.select,y.select,s[""])):s=y,o.pointAttr=s}},destroy:function(){var t,e,i,n,o,s=this,r=s.chart,a=/AppleWebKit\/533/.test(Tt),l=s.data||[];for(ae(s,"destroy"),re(s),ee(s.axisTypes||[],function(t){(o=s[t])&&(c(o.series,s),o.isDirty=o.forceRedraw=!0)}),s.legendItem&&s.chart.legend.destroyItem(s),e=l.length;e--;)(i=l[e])&&i.destroy&&i.destroy();for(n in s.points=null,clearTimeout(s.animationTimeout),s)s[n]instanceof z&&!s[n].survive&&(t=a&&"group"===n?"hide":"destroy",s[n][t]());for(n in r.hoverSeries===s&&(r.hoverSeries=null),c(r.series,s),s)delete s[n]},getSegmentPath:function(t){var e=this,i=[],n=e.options.step;return ee(t,function(o,s){var r,a=o.plotX,l=o.plotY;e.getPointSpline?i.push.apply(i,e.getPointSpline(t,o,s)):(i.push(s?Kt:Zt),n&&s&&(r=t[s-1],"right"===n?i.push(r.plotX,l,Kt):"center"===n?i.push((r.plotX+a)/2,r.plotY,Kt,(r.plotX+a)/2,l,Kt):i.push(a,r.plotY,Kt)),i.push(o.plotX,o.plotY))}),i},getGraphPath:function(){var t,e=this,i=[],n=[];return ee(e.segments,function(o){t=e.getSegmentPath(o),o.length>1?i=i.concat(t):n.push(o[0])}),e.singlePoints=n,e.graphPath=i,i},drawGraph:function(){var t=this,e=this.options,i=[["graph",e.lineColor||this.color,e.dashStyle]],n=e.lineWidth,o="square"!==e.linecap,s=this.getGraphPath(),r=this.fillGraph&&this.color||jt,a=this.zones;ee(a,function(n,o){i.push(["zoneGraph"+o,n.color||t.color,n.dashStyle||e.dashStyle])}),ee(i,function(i,a){var l,h=i[0],c=t[h];c?c.animate({d:s}):(n||r)&&s.length&&(l={stroke:i[1],"stroke-width":n,fill:r,zIndex:1},i[2]?l.dashstyle=i[2]:o&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),t[h]=t.chart.renderer.path(s).attr(l).add(t.group).shadow(a<2&&e.shadow))})},applyZones:function(){var t,e,i,n,o,s,r,a=this,l=this.chart,h=l.renderer,c=this.zones,d=this.clips||[],p=this.graph,u=this.area,f=yt(l.chartWidth,l.chartHeight),g=this[(this.zoneAxis||"y")+"Axis"],m=g.reversed,x=l.inverted,y=g.horiz,v=!1;c.length&&(p||u)&&g.min!==X&&(p&&p.hide(),u&&u.hide(),n=g.getExtremes(),ee(c,function(c,b){t=m?y?l.plotWidth:0:y?0:g.toPixels(n.min),t=vt(yt(pe(e,t),0),f),e=vt(yt(gt(g.toPixels(pe(c.value,n.max),!0)),0),f),v&&(t=e=g.toPixels(n.max)),o=Math.abs(t-e),s=vt(t,e),r=yt(t,e),g.isXAxis?(i={x:x?r:s,y:0,width:o,height:f},y||(i.x=l.plotHeight-i.x)):(i={x:0,y:x?r:s,width:f,height:o},y&&(i.y=l.plotWidth-i.y)),l.inverted&&h.isVML&&(i=g.isXAxis?{x:0,y:m?s:r,height:i.width,width:l.chartWidth}:{x:i.y-l.plotLeft-l.spacingBox.x,y:0,width:i.height,height:l.chartHeight}),d[b]?d[b].animate(i):(d[b]=h.clipRect(i),p&&a["zoneGraph"+b].clip(d[b]),u&&a["zoneArea"+b].clip(d[b])),v=c.value>n.max}),this.clips=d)},invertGroups:function(){function t(){var t={width:e.yAxis.len,height:e.xAxis.len};ee(["group","markerGroup"],function(i){e[i]&&e[i].attr(t).invert()})}var e=this,i=e.chart;e.xAxis&&(se(i,"resize",t),se(e,"destroy",function(){re(i,"resize",t)}),t(),e.invertGroups=t)},plotGroup:function(t,e,i,n,o){var s=this[t],r=!s;return r&&(this[t]=s=this.chart.renderer.g(e).attr({visibility:i,zIndex:n||.1}).add(o),s.addClass("highcharts-series-"+this.index)),s[r?"attr":"animate"](this.getPlotBox()),s},getPlotBox:function(){var t=this.chart,e=this.xAxis,i=this.yAxis;return t.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:t.plotLeft,translateY:i?i.top:t.plotTop,scaleX:1,scaleY:1}},render:function(){var t,e=this,i=e.chart,n=e.options,o=n.animation,s=o&&!!e.animate&&i.renderer.isSVG&&pe(o.duration,500)||0,r=e.visible?"inherit":"hidden",a=n.zIndex,l=e.hasRendered,h=i.seriesGroup;t=e.plotGroup("group","series",r,a,h),e.markerGroup=e.plotGroup("markerGroup","markers",r,a,h),s&&e.animate(!0),e.getAttribs(),t.inverted=!!e.isCartesian&&i.inverted,e.drawGraph&&(e.drawGraph(),e.applyZones()),ee(e.points,function(t){t.redraw&&t.redraw()}),e.drawDataLabels&&e.drawDataLabels(),e.visible&&e.drawPoints(),e.drawTracker&&!1!==e.options.enableMouseTracking&&e.drawTracker(),i.inverted&&e.invertGroups(),!1===n.clip||e.sharedClipKey||l||t.clip(i.clipRect),s&&e.animate(),l||(e.animationTimeout=f(function(){e.afterAnimate()},s)),e.isDirty=e.isDirtyData=!1,e.hasRendered=!0},redraw:function(){var t=this.chart,e=this.isDirtyData,i=this.isDirty,n=this.group,o=this.xAxis,s=this.yAxis;n&&(t.inverted&&n.attr({width:t.plotWidth,height:t.plotHeight}),n.animate({translateX:pe(o&&o.left,t.plotLeft),translateY:pe(s&&s.top,t.plotTop)})),this.translate(),this.render(),e&&ae(this,"updatedData"),(i||e)&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(t,e){var i=this.xAxis,n=this.yAxis,o=this.chart.inverted;return this.searchKDTree({clientX:o?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:o?n.len-t.chartX+n.pos:t.chartY-n.pos},e)},buildKDTree:function(){var t=this,e=t.kdDimensions;delete t.kdTree,f(function(){var i=ie(t.points||[],function(t){return null!==t.y});t.kdTree=function e(i,n,o){var s,r,a=i&&i.length;if(a)return s=t.kdAxisArray[n%o],i.sort(function(t,e){return t[s]-e[s]}),{point:i[r=Math.floor(a/2)],left:e(i.slice(0,r),n+1,o),right:e(i.slice(r+1),n+1,o)}}(i,e,e)},t.options.kdNow?0:1)},searchKDTree:function(t,e){var i=this,n=this.kdAxisArray[0],o=this.kdAxisArray[1],s=e?"distX":"dist";if(this.kdTree||this.buildKDTree(),this.kdTree)return function t(e,r,a,l){var h,c,p,u,f,g,m,x,y,v,b=r.point,k=i.kdAxisArray[a%l],w=b;return m=b,x=d((g=e)[n])&&d(m[n])?Math.pow(g[n]-m[n],2):null,y=d(g[o])&&d(m[o])?Math.pow(g[o]-m[o],2):null,v=(x||0)+(y||0),m.dist=d(v)?Math.sqrt(v):Number.MAX_VALUE,m.distX=d(x)?Math.sqrt(x):Number.MAX_VALUE,c=(h=e[k]-b[k])<0?"left":"right",p=h<0?"right":"left",r[c]&&(w=(u=t(e,r[c],a+1,l))[s]<w[s]?u:b),r[p]&&Math.sqrt(h*h)<w[s]&&(w=(f=t(e,r[p],a+1,l))[s]<w[s]?f:w),w}(t,this.kdTree,this.kdDimensions,this.kdDimensions)}},E.prototype={destroy:function(){M(this,this.axis)},render:function(t){var e=this.options,i=e.format,n=i?w(i,this):e.formatter.call(this);this.label?this.label.attr({text:n,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(n,null,null,e.useHTML).css(e.style).attr({align:this.textAlign,rotation:e.rotation,visibility:Nt}).add(t)},setOffset:function(t,e){var i,n=this.axis,o=n.chart,s=o.inverted,r=n.reversed,a=this.isNegative&&!r||!this.isNegative&&r,l=n.translate(n.usePercentage?100:this.total,0,0,0,1),h=n.translate(0),c=bt(l-h),d=o.xAxis[0].translate(this.x)+t,p=o.plotHeight,u={x:s?a?l:l-c:d,y:s?p-d-e:a?p-l-c:p-l,width:s?c:e,height:s?e:c},f=this.label;f&&(f.align(this.alignOptions,null,u),i=f.alignAttr,f[!1===this.options.crop||o.isInsidePlot(i.x,i.y)?"show":"hide"](!0))}},Ie.prototype.getStacks=function(){var t=this;ee(t.yAxis,function(t){t.stacks&&t.hasVisibleSeries&&(t.oldStacks=t.stacks)}),ee(t.series,function(e){!e.options.stacking||!0!==e.visible&&!1!==t.options.chart.ignoreHiddenSeries||(e.stackKey=e.type+pe(e.options.stack,""))})},we.prototype.buildStacks=function(){var t=this.series,e=pe(this.options.reversedStacks,!0),i=t.length;if(!this.isXAxis){for(this.usePercentage=!1;i--;)t[e?i:t.length-i-1].setStackedPoints();if(this.usePercentage)for(i=0;i<t.length;i++)t[i].setPercentStacks()}},we.prototype.renderStackTotals=function(){var t,e,i,n=this.chart,o=n.renderer,s=this.stacks,r=this.stackTotalGroup;for(t in r||(this.stackTotalGroup=r=o.g("stack-labels").attr({visibility:_t,zIndex:6}).add()),r.translate(n.plotLeft,n.plotTop),s)for(i in e=s[t])e[i].render(r)},we.prototype.resetStacks=function(){var t,e,i=this.stacks;if(!this.isXAxis)for(t in i)for(e in i[t])i[t][e].touched<this.stacksTouched?(i[t][e].destroy(),delete i[t][e]):(i[t][e].total=null,i[t][e].cum=0)},we.prototype.cleanStacks=function(){var t,e,i;if(!this.isXAxis)for(e in this.oldStacks&&(t=this.stacks=this.oldStacks),t)for(i in t[e])t[e][i].cum=t[e][i].total},ze.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var t,e,i,n,o,s,r,a,l,h=this.processedXData,c=this.processedYData,d=[],p=c.length,u=this.options,f=u.threshold,g=u.startFromThreshold?f:0,m=u.stack,x=u.stacking,y=this.stackKey,v="-"+y,b=this.negStacks,k=this.yAxis,w=k.stacks,A=k.oldStacks;for(k.stacksTouched+=1,r=0;r<p;r++)a=h[r],l=c[r],s=(t=this.getStackIndicator(t,a,this.index)).key,w[o=(e=b&&l<(g?0:f))?v:y]||(w[o]={}),w[o][a]||(A[o]&&A[o][a]?(w[o][a]=A[o][a],w[o][a].total=null):w[o][a]=new E(k,k.options.stackLabels,e,a,m)),(i=w[o][a]).points[s]=[pe(i.cum,g)],i.touched=k.stacksTouched,t.index>0&&!1===this.singleStacks&&(i.points[s][0]=i.points[this.index+","+a+",0"][0]),"percent"===x?(n=e?y:v,b&&w[n]&&w[n][a]?(n=w[n][a],i.total=n.total=yt(n.total,i.total)+bt(l)||0):i.total=D(i.total+(bt(l)||0))):i.total=D(i.total+(l||0)),i.cum=pe(i.cum,g)+(l||0),i.points[s].push(i.cum),d[r]=i.cum;"percent"===x&&(k.usePercentage=!0),this.stackedYData=d,k.oldStacks={}}},ze.prototype.setPercentStacks=function(){var t,e=this,i=e.stackKey,n=e.yAxis.stacks,o=e.processedXData;ee([i,"-"+i],function(i){for(var s,r,a,l,h=o.length;h--;)s=o[h],t=e.getStackIndicator(t,s,e.index),(a=(r=n[i]&&n[i][s])&&r.points[t.key])&&(l=r.total?100/r.total:0,a[0]=D(a[0]*l),a[1]=D(a[1]*l),e.stackedYData[h]=a[1])})},ze.prototype.getStackIndicator=function(t,e,i){return d(t)&&t.x===e?t.index++:t={x:e,index:0},t.key=[i,e,t.index].join(","),t},de(Ie.prototype,{addSeries:function(t,e,i){var n,o=this;return t&&(e=pe(e,!0),ae(o,"addSeries",{options:t},function(){n=o.initSeries(t),o.isDirtyLegend=!0,o.linkSeries(),e&&o.redraw(i)})),n},addAxis:function(t,e,n,o){var s=e?"xAxis":"yAxis",r=this.options;new we(this,i(t,{index:this[s].length,isX:e})),r[s]=u(r[s]||{}),r[s].push(t),pe(n,!0)&&this.redraw(o)},showLoading:function(t){var e=this,i=e.options,n=e.loadingDiv,o=i.loading,s=function(){n&&g(n,{left:e.plotLeft+Ut,top:e.plotTop+Ut,width:e.plotWidth+Ut,height:e.plotHeight+Ut})};n||(e.loadingDiv=n=m(Yt,{className:Vt+"loading"},de(o.style,{zIndex:10,display:jt}),e.container),e.loadingSpan=m("span",null,o.labelStyle,n),se(e,"redraw",s)),e.loadingSpan.innerHTML=t||i.lang.loading,e.loadingShown||(g(n,{opacity:0,display:""}),he(n,{opacity:o.style.opacity},{duration:o.showDuration||0}),e.loadingShown=!0),s()},hideLoading:function(){var t=this.options,e=this.loadingDiv;e&&he(e,{opacity:0},{duration:t.loading.hideDuration||100,complete:function(){g(e,{display:jt})}}),this.loadingShown=!1}}),de(Oe.prototype,{update:function(t,e,i,n){function o(){l.applyOptions(t),null===l.y&&c&&(l.graphic=c.destroy()),s(t)&&!r(t)&&(l.redraw=function(){c&&c.element&&t&&t.marker&&t.marker.symbol&&(l.graphic=c.destroy()),t&&t.dataLabels&&l.dataLabel&&(l.dataLabel=l.dataLabel.destroy()),l.redraw=null}),a=l.index,h.updateParallelArrays(l,a),u&&l.name&&(u[l.x]=l.name),p.data[a]=s(p.data[a])?l.options:t,h.isDirty=h.isDirtyData=!0,!h.fixedBox&&h.hasCartesianSeries&&(d.isDirtyBox=!0),"point"===p.legendType&&(d.isDirtyLegend=!0),e&&d.redraw(i)}var a,l=this,h=l.series,c=l.graphic,d=h.chart,p=h.options,u=h.xAxis&&h.xAxis.names;e=pe(e,!0),!1===n?o():l.firePointEvent("update",{options:t},o)},remove:function(t,e){this.series.removePoint(te(this,this.series.data),t,e)}}),de(ze.prototype,{addPoint:function(t,e,i,n){var o,s,r,a,l=this,h=l.options,c=l.data,d=l.graph,p=l.area,u=l.chart,f=l.xAxis&&l.xAxis.names,g=d&&d.shift||0,m=["graph","area"],x=h.data,y=l.xData;if(I(n,u),i){for(r=l.zones.length;r--;)m.push("zoneGraph"+r,"zoneArea"+r);ee(m,function(t){l[t]&&(l[t].shift=g+(h.step?2:1))})}if(p&&(p.isArea=!0),e=pe(e,!0),o={series:l},l.pointClass.prototype.applyOptions.apply(o,[t]),a=o.x,r=y.length,l.requireSorting&&a<y[r-1])for(s=!0;r&&y[r-1]>a;)r--;l.updateParallelArrays(o,"splice",r,0,0),l.updateParallelArrays(o,r),f&&o.name&&(f[a]=o.name),x.splice(r,0,t),s&&(l.data.splice(r,0,null),l.processData()),"point"===h.legendType&&l.generatePoints(),i&&(c[0]&&c[0].remove?c[0].remove(!1):(c.shift(),l.updateParallelArrays(o,"shift"),x.shift())),l.isDirty=!0,l.isDirtyData=!0,e&&(l.getAttribs(),u.redraw())},removePoint:function(t,e,i){var n=this,o=n.data,s=o[t],r=n.points,a=n.chart,l=function(){o.length===r.length&&r.splice(t,1),o.splice(t,1),n.options.data.splice(t,1),n.updateParallelArrays(s||{series:n},"splice",t,1),s&&s.destroy(),n.isDirty=!0,n.isDirtyData=!0,e&&a.redraw()};I(i,a),e=pe(e,!0),s?s.firePointEvent("remove",null,l):l()},remove:function(t,e){var i=this,n=i.chart;t=pe(t,!0),i.isRemoving||(i.isRemoving=!0,ae(i,"remove",null,function(){i.destroy(),n.isDirtyLegend=n.isDirtyBox=!0,n.linkSeries(),t&&n.redraw(e)})),i.isRemoving=!1},update:function(t,e){var n,o=this,s=this.chart,r=this.userOptions,a=this.type,l=Jt[a].prototype,h=["group","markerGroup","dataLabelsGroup"];for(n in(t.type&&t.type!==a||void 0!==t.zIndex)&&(h.length=0),ee(h,function(t){h[t]=o[t],delete o[t]}),t=i(r,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},t),this.remove(!1),l)this[n]=X;de(this,Jt[t.type||a].prototype),ee(h,function(t){o[t]=h[t]}),this.init(s,t),s.linkSeries(),pe(e,!0)&&s.redraw(!1)}}),de(we.prototype,{update:function(t,e){var n=this.chart;t=n.options[this.coll][this.options.index]=i(this.userOptions,t),this.destroy(!0),this._addedPlotLB=this.chart._labelPanes=X,this.init(n,de(t,{events:X})),n.isDirtyBox=!0,pe(e,!0)&&n.redraw()},remove:function(t){for(var e=this.chart,i=this.coll,n=this.series,o=n.length;o--;)n[o]&&n[o].remove(!1);c(e.axes,this),c(e[i],this),e.options[i].splice(this.options.index,1),ee(e[i],function(t,e){t.options.index=e}),this.destroy(),e.isDirtyBox=!0,pe(t,!0)&&e.redraw()},setTitle:function(t,e){this.update({title:t},e)},setCategories:function(t,e){this.update({categories:t},e)}});var Re=x(ze);Jt.line=Re,fe.area=i(ge,{softThreshold:!1,threshold:0});var Ee=x(ze,{type:"area",singleStacks:!1,getSegments:function(){var t,e,i,n,o,s=this,r=[],a=[],l=[],h=this.xAxis,c=this.yAxis,d=c.stacks[this.stackKey],p={},u=this.points,f=this.options.connectNulls;if(this.options.stacking&&!this.cropped){for(n=0;n<u.length;n++)p[u[n].x]=u[n];for(o in d)null!==d[o].total&&l.push(+o);l.sort(function(t,e){return t-e}),ee(l,function(o){var r,l=null;if(!(f&&(!p[o]||null===p[o].y)))if(p[o])a.push(p[o]);else{for(n=s.index;n<=c.series.length;n++)if(i=s.getStackIndicator(null,o,n),r=d[o].points[i.key]){l=r[1];break}t=h.translate(o),e=c.getThreshold(l),a.push({y:null,plotX:t,clientX:t,plotY:e,yBottom:e,onMouseOver:Ht})}}),a.length&&r.push(a)}else ze.prototype.getSegments.call(this),r=this.segments;this.segments=r},getSegmentPath:function(t){var e,i,n=ze.prototype.getSegmentPath.call(this,t),o=[].concat(n),s=this.options,r=n.length,a=this.yAxis.getThreshold(s.threshold);if(3===r&&o.push(Kt,n[1],n[2]),s.stacking&&!this.closedStacks)for(e=t.length-1;e>=0;e--)i=pe(t[e].yBottom,a),e<t.length-1&&s.step&&o.push(t[e+1].plotX,i),o.push(t[e].plotX,i);else this.closeSegment(o,t,a);return this.areaPath=this.areaPath.concat(o),n},closeSegment:function(t,e,i){t.push(Kt,e[e.length-1].plotX,i,Kt,e[0].plotX,i)},drawGraph:function(){this.areaPath=[],ze.prototype.drawGraph.apply(this);var t=this,e=this.areaPath,i=this.options,n=this.zones,o=[["area",this.color,i.fillColor]];ee(n,function(e,n){o.push(["zoneArea"+n,e.color||t.color,e.fillColor||i.fillColor])}),ee(o,function(n){var o=n[0],s=t[o];s?s.animate({d:e}):t[o]=t.chart.renderer.path(e).attr({fill:pe(n[2],O(n[1]).setOpacity(pe(i.fillOpacity,.75)).get()),zIndex:0}).add(t.group)})},drawLegendSymbol:De.drawRectangle});Jt.area=Ee,fe.spline=i(ge);var We=x(ze,{type:"spline",getPointSpline:function(t,e,i){var n,o,s,r,a,l=e.plotX,h=e.plotY,c=t[i-1],d=t[i+1];if(c&&d){var p,u=c.plotX,f=c.plotY,g=d.plotX,m=d.plotY;r=(1.5*h+m)/2.5,r+=p=(r-(o=(1.5*h+f)/2.5))*((s=(1.5*l+g)/2.5)-l)/(s-(n=(1.5*l+u)/2.5))+h-r,(o+=p)>f&&o>h?r=2*h-(o=yt(f,h)):o<f&&o<h&&(r=2*h-(o=vt(f,h))),r>m&&r>h?o=2*h-(r=yt(m,h)):r<m&&r<h&&(o=2*h-(r=vt(m,h))),e.rightContX=s,e.rightContY=r}return i?(a=["C",c.rightContX||c.plotX,c.rightContY||c.plotY,n||l,o||h,l,h],c.rightContX=c.rightContY=null):a=[Zt,l,h],a}});Jt.spline=We,fe.areaspline=i(fe.area);var He=Ee.prototype,Xe=x(We,{type:"areaspline",closedStacks:!0,getSegmentPath:He.getSegmentPath,closeSegment:He.closeSegment,drawGraph:He.drawGraph,drawLegendSymbol:De.drawRectangle});Jt.areaspline=Xe,fe.column=i(ge,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0});var Ge=x(ze,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){ze.prototype.init.apply(this,arguments);var t=this,e=t.chart;e.hasRendered&&ee(e.series,function(e){e.type===t.type&&(e.isDirty=!0)})},getColumnMetrics:function(){var t,e,i=this,n=i.options,o=i.xAxis,s=i.yAxis,r=o.reversed,a={},l=0;!1===n.grouping?l=1:ee(i.chart.series,function(n){var o=n.options,r=n.yAxis;n.type===i.type&&n.visible&&s.len===r.len&&s.pos===r.pos&&(o.stacking?(t=n.stackKey,a[t]===X&&(a[t]=l++),e=a[t]):!1!==o.grouping&&(e=l++),n.columnIndex=e)});var h=vt(bt(o.transA)*(o.ordinalSlope||n.pointRange||o.closestPointRange||o.tickInterval||1),o.len),c=h*n.groupPadding,d=(h-2*c)/l,p=vt(n.maxPointWidth||o.len,pe(n.pointWidth,d*(1-2*n.pointPadding))),u=(d-p)/2+(c+((i.columnIndex||0)+(r?1:0))*d-h/2)*(r?-1:1);return i.columnMetrics={width:p,offset:u},i.columnMetrics},crispCol:function(t,e,i,n){var o,s,r=this.chart,a=this.borderWidth,l=-(a%2?.5:0),h=a%2?.5:1;return r.inverted&&r.renderer.isVML&&(h+=1),i=Math.round(t+i)+l-(t=Math.round(t)+l),o=Math.round(e+n)+h,s=bt(e)<=.5&&o>.5,n=o-(e=Math.round(e)+h),s&&(e-=1,n+=1),{x:t,y:e,width:i,height:n}},translate:function(){var t=this,e=t.chart,i=t.options,n=t.borderWidth=pe(i.borderWidth,t.closestPointRange*t.xAxis.transA<2?0:1),o=t.yAxis,s=i.threshold,r=t.translatedThreshold=o.getThreshold(s),a=pe(i.minPointLength,5),l=t.getColumnMetrics(),h=l.width,c=t.barW=yt(h,1+2*n),d=t.pointXOffset=l.offset;e.inverted&&(r-=.5),i.pointPadding&&(c=xt(c)),ze.prototype.translate.apply(t),ee(t.points,function(i){var n,s=vt(pe(i.yBottom,r),9e4),l=999+bt(s),p=vt(yt(-l,i.plotY),o.len+l),u=i.plotX+d,f=c,g=vt(p,s),m=yt(p,s)-g;bt(m)<a&&a&&(m=a,n=!o.reversed&&!i.negative||o.reversed&&i.negative,g=bt(g-r)>a?s-a:r-(n?a:0)),i.barX=u,i.pointWidth=h,i.tooltipPos=e.inverted?[o.len+o.pos-e.plotLeft-p,t.xAxis.len-u-f/2,m]:[u+f/2,p+o.pos-e.plotTop,m],i.shapeType="rect",i.shapeArgs=t.crispCol(u,g,f,m)})},getSymbol:Ht,drawLegendSymbol:De.drawRectangle,drawGraph:Ht,drawPoints:function(){var t,e,n=this,o=this.chart,s=n.options,r=o.renderer,a=s.animationLimit||250;ee(n.points,function(l){var h,c=l.plotY,p=l.graphic;c===X||isNaN(c)||null===l.y?p&&(l.graphic=p.destroy()):(t=l.shapeArgs,h=d(n.borderWidth)?{"stroke-width":n.borderWidth}:{},e=l.pointAttr[l.selected?"select":""]||n.pointAttr[""],p?(ce(p),p.attr(h).attr(e)[o.pointCount<a?"animate":"attr"](i(t))):l.graphic=p=r[l.shapeType](t).attr(h).attr(e).add(l.group||n.group).shadow(s.shadow,null,s.stacking&&!s.borderRadius))})},animate:function(t){var e,i=this.yAxis,n=this.options,o=this.chart.inverted,s={};Ot&&(t?(s.scaleY=.001,e=vt(i.pos+i.len,yt(i.pos,i.toPixels(n.threshold))),o?s.translateX=e-i.len:s.translateY=e,this.group.attr(s)):(s.scaleY=1,s[o?"translateX":"translateY"]=i.pos,this.group.animate(s,this.options.animation),this.animate=null))},remove:function(){var t=this,e=t.chart;e.hasRendered&&ee(e.series,function(e){e.type===t.type&&(e.isDirty=!0)}),ze.prototype.remove.apply(t,arguments)}});Jt.column=Ge,fe.bar=i(fe.column);var Ye=x(Ge,{type:"bar",inverted:!0});Jt.bar=Ye,fe.scatter=i(ge,{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}});var Fe=x(ze,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&ze.prototype.drawGraph.call(this)}});Jt.scatter=Fe,fe.pie=i(ge,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});var Ne={type:"pie",isCartesian:!1,pointClass:x(Oe,{init:function(){Oe.prototype.init.apply(this,arguments);var t,e=this;return e.name=pe(e.name,"Slice"),se(e,"select",t=function(t){e.slice("select"===t.type)}),se(e,"unselect",t),e},setVisible:function(t,e){var i=this,n=i.series,o=n.chart,s=n.options.ignoreHiddenPoint;e=pe(e,s),t!==i.visible&&(i.visible=i.options.visible=t=t===X?!i.visible:t,n.options.data[te(i,n.data)]=i.options,ee(["graphic","dataLabel","connector","shadowGroup"],function(e){i[e]&&i[e][t?"show":"hide"](!0)}),i.legendItem&&o.legend.colorizeItem(i,t),t||"hover"!==i.state||i.setState(""),s&&(n.isDirty=!0),e&&o.redraw())},slice:function(t,e,i){var n,o=this.series;I(i,o.chart),e=pe(e,!0),this.sliced=this.options.sliced=t=d(t)?t:!this.sliced,o.options.data[te(this,o.data)]=this.options,n=t?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(n),this.shadowGroup&&this.shadowGroup.animate(n)},haloPath:function(t){var e=this.shapeArgs,i=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(i.plotLeft+e.x,i.plotTop+e.y,e.r+t,e.r+t,{innerR:this.shapeArgs.r,start:e.start,end:e.end})}}),requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},animate:function(t){var e=this,i=e.points,n=e.startAngleRad;t||(ee(i,function(t){var i=t.graphic,o=t.shapeArgs;i&&(i.attr({r:t.startR||e.center[3]/2,start:n,end:n}),i.animate({r:o.r,start:o.start,end:o.end},e.options.animation))}),e.animate=null)},updateTotals:function(){var t,e,i=0,n=this.points,o=n.length,s=this.options.ignoreHiddenPoint;for(t=0;t<o;t++)e=n[t],i+=s&&!e.visible?0:e.y;for(this.total=i,t=0;t<o;t++)(e=n[t]).percentage=i>0&&(e.visible||!s)?e.y/i*100:0,e.total=i},generatePoints:function(){ze.prototype.generatePoints.call(this),this.updateTotals()},translate:function(t){this.generatePoints();var e,i,n,o,s,r,a,l=0,h=this.options,c=h.slicedOffset,d=c+h.borderWidth,p=h.startAngle||0,u=this.startAngleRad=At/180*(p-90),f=(this.endAngleRad=At/180*(pe(h.endAngle,p+360)-90))-u,g=this.points,m=h.dataLabels.distance,x=h.ignoreHiddenPoint,y=g.length;for(t||(this.center=t=this.getCenter()),this.getX=function(e,i){return n=ft.asin(vt((e-t[1])/(t[2]/2+m),1)),t[0]+(i?-1:1)*(kt(n)*(t[2]/2+m))},r=0;r<y;r++)a=g[r],e=u+l*f,x&&!a.visible||(l+=a.percentage/100),i=u+l*f,a.shapeType="arc",a.shapeArgs={x:t[0],y:t[1],r:t[2]/2,innerR:t[3]/2,start:gt(1e3*e)/1e3,end:gt(1e3*i)/1e3},(n=(i+e)/2)>1.5*At?n-=2*At:n<-At/2&&(n+=2*At),a.slicedTranslation={translateX:gt(kt(n)*c),translateY:gt(wt(n)*c)},o=kt(n)*t[2]/2,s=wt(n)*t[2]/2,a.tooltipPos=[t[0]+.7*o,t[1]+.7*s],a.half=n<-At/2||n>At/2?1:0,a.angle=n,d=vt(d,m/2),a.labelPos=[t[0]+o+kt(n)*m,t[1]+s+wt(n)*m,t[0]+o+kt(n)*d,t[1]+s+wt(n)*d,t[0]+o,t[1]+s,m<0?"center":a.half?"right":"left",n]},drawGraph:null,drawPoints:function(){var t,e,i,n,o,s,r=this,a=r.chart.renderer,l=r.options.shadow;l&&!r.shadowGroup&&(r.shadowGroup=a.g("shadow").add(r.group)),ee(r.points,function(h){null!==h.y&&(e=h.graphic,o=h.shapeArgs,i=h.shadowGroup,(n=h.pointAttr[h.selected?"select":""]).stroke||(n.stroke=n.fill),l&&!i&&(i=h.shadowGroup=a.g("shadow").add(r.shadowGroup)),t=h.sliced?h.slicedTranslation:{translateX:0,translateY:0},i&&i.attr(t),e?e.setRadialReference(r.center).attr(n).animate(de(o,t)):(s={"stroke-linejoin":"round"},h.visible||(s.visibility="hidden"),h.graphic=e=a[h.shapeType](o).setRadialReference(r.center).attr(n).attr(s).attr(t).add(r.group).shadow(l,i)))})},searchPoint:Ht,sortByAngle:function(t,e){t.sort(function(t,i){return void 0!==t.angle&&(i.angle-t.angle)*e})},drawLegendSymbol:De.drawRectangle,getCenter:Be.getCenter,getSymbol:Ht};Ne=x(ze,Ne),Jt.pie=Ne,ze.prototype.drawDataLabels=function(){var t,e,n,o,s=this,r=s.options,a=r.cursor,l=r.dataLabels,h=s.points,c=s.hasRendered||0,p=s.chart.renderer;(l.enabled||s._hasPointLabels)&&(s.dlProcessOptions&&s.dlProcessOptions(l),o=s.plotGroup("dataLabelsGroup","data-labels",l.defer?Nt:_t,l.zIndex||6),pe(l.defer,!0)&&(o.attr({opacity:+c}),c||se(s,"afterAnimate",function(){s.visible&&o.show(),o[r.animation?"animate":"attr"]({opacity:1},{duration:200})})),e=l,ee(h,function(h){var c,u,f,g,m,x,y=h.dataLabel,v=h.connector,b=!0,k={};if(t=h.dlOptions||h.options&&h.options.dataLabels,c=pe(t&&t.enabled,e.enabled)&&null!==h.y,y&&!c)h.dataLabel=y.destroy();else if(c){if(x=(l=i(e,t)).style,m=l.rotation,u=h.getLabelConfig(),n=l.format?w(l.format,u):l.formatter.call(u,l),x.color=pe(l.color,x.color,s.color,"black"),y)d(n)?(y.attr({text:n}),b=!1):(h.dataLabel=y=y.destroy(),v&&(h.connector=v.destroy()));else if(d(n)){for(g in f={fill:l.backgroundColor,stroke:l.borderColor,"stroke-width":l.borderWidth,r:l.borderRadius||0,rotation:m,padding:l.padding,zIndex:1},"contrast"===x.color&&(k.color=l.inside||l.distance<0||r.stacking?p.getContrast(h.color||s.color):"#000000"),a&&(k.cursor=a),f)f[g]===X&&delete f[g];y=h.dataLabel=p[m?"text":"label"](n,0,-9999,l.shape,null,null,l.useHTML).attr(f).css(de(x,k)).add(o).shadow(l.shadow)}y&&s.alignDataLabel(h,y,l,null,b)}}))},ze.prototype.alignDataLabel=function(t,e,i,n,o){var s,r,a=this.chart,l=a.inverted,h=pe(t.plotX,-9999),c=pe(t.plotY,-9999),d=e.getBBox(),p=a.renderer.fontMetrics(i.style.fontSize).b,u=this.visible&&(t.series.forceDL||a.isInsidePlot(h,gt(c),l)||n&&a.isInsidePlot(h,l?n.x+1:n.y+n.height-1,l));u&&(n=de({x:l?a.plotWidth-c:h,y:gt(l?a.plotHeight-h:c),width:0,height:0},n),de(i,{width:d.width,height:d.height}),i.rotation?(s=a.renderer.rotCorr(p,i.rotation),e[o?"attr":"animate"]({x:n.x+i.x+n.width/2+s.x,y:n.y+i.y+n.height/2}).attr({align:i.align})):(e.align(i,null,n),r=e.alignAttr,"justify"===pe(i.overflow,"justify")?this.justifyDataLabel(e,i,r,d,n,o):pe(i.crop,!0)&&(u=a.isInsidePlot(r.x,r.y)&&a.isInsidePlot(r.x+d.width,r.y+d.height)),i.shape&&e.attr({anchorX:t.plotX,anchorY:t.plotY}))),u||(ce(e),e.attr({y:-9999}),e.placed=!1)},ze.prototype.justifyDataLabel=function(t,e,i,n,o,s){var r,a,l=this.chart,h=e.align,c=e.verticalAlign,d=t.box?0:t.padding||0;(r=i.x+d)<0&&("right"===h?e.align="left":e.x=-r,a=!0),(r=i.x+n.width-d)>l.plotWidth&&("left"===h?e.align="right":e.x=l.plotWidth-r,a=!0),(r=i.y+d)<0&&("bottom"===c?e.verticalAlign="top":e.y=-r,a=!0),(r=i.y+n.height-d)>l.plotHeight&&("top"===c?e.verticalAlign="bottom":e.y=l.plotHeight-r,a=!0),a&&(t.placed=!s,t.align(e,null,o))},Jt.pie&&(Jt.pie.prototype.drawDataLabels=function(){var t,e,i,n,o,s,r,a,l,h,c,d,p,u=this,f=u.data,g=u.chart,m=u.options.dataLabels,x=pe(m.connectorPadding,10),y=pe(m.connectorWidth,1),v=g.plotWidth,b=g.plotHeight,k=pe(m.softConnector,!0),w=m.distance,A=u.center,S=A[2]/2,T=A[1],P=w>0,M=[[],[]],L=[0,0,0,0],D=function(t,e){return e.y-t.y};if(u.visible&&(m.enabled||u._hasPointLabels)){for(ze.prototype.drawDataLabels.apply(u),ee(f,function(t){t.dataLabel&&t.visible&&M[t.half].push(t)}),d=2;d--;){var I,B,O,z,R=[],E=[],W=M[d],H=W.length;if(H){for(u.sortByAngle(W,d-.5),p=r=0;!r&&W[p];)r=W[p]&&W[p].dataLabel&&(W[p].dataLabel.getBBox().height||21),p++;if(w>0){for(O=vt(T+S+w,g.plotHeight),B=yt(0,T-S-w);B<=O;B+=r)R.push(B);if(H>(I=R.length)){for((c=[].concat(W)).sort(D),p=H;p--;)c[p].rank=p;for(p=H;p--;)W[p].rank>=I&&W.splice(p,1);H=W.length}for(p=0;p<H;p++){t=W[p],s=t.labelPos;var X,G,Y=9999;for(G=0;G<I;G++)(X=bt(R[G]-s[1]))<Y&&(Y=X,z=G);if(z<p&&null!==R[p])z=p;else if(I<H-p+z&&null!==R[p])for(z=I-H+p;null===R[z];)z++;else for(;null===R[z];)z++;E.push({i:z,y:R[z]}),R[z]=null}E.sort(D)}for(p=0;p<H;p++){var F,N;t=W[p],s=t.labelPos,n=t.dataLabel,h=!1===t.visible?Nt:"inherit",N=s[1],w>0?(z=(F=E.pop()).i,(N>(l=F.y)&&null!==R[z+1]||N<l&&null!==R[z-1])&&(l=vt(yt(0,N),g.plotHeight))):l=N,a=m.justify?A[0]+(d?-1:1)*(S+w):u.getX(l===T-S-w||l===T+S+w?N:l,d),n._attr={visibility:h,align:s[6]},n._pos={x:a+m.x+({left:x,right:-x}[s[6]]||0),y:l+m.y-10},n.connX=a,n.connY=l,null===this.options.size&&(o=n.width,a-o<x?L[3]=yt(gt(o-a+x),L[3]):a+o>v-x&&(L[1]=yt(gt(a+o-v+x),L[1])),l-r/2<0?L[0]=yt(gt(r/2-l),L[0]):l+r/2>b&&(L[2]=yt(gt(l+r/2-b),L[2])))}}}(0===C(L)||this.verifyDataLabelOverflow(L))&&(this.placeDataLabels(),P&&y&&ee(this.points,function(t){e=t.connector,s=t.labelPos,(n=t.dataLabel)&&n._pos&&t.visible?(h=n._attr.visibility,a=n.connX,l=n.connY,i=k?[Zt,a+("left"===s[6]?5:-5),l,"C",a,l,2*s[2]-s[4],2*s[3]-s[5],s[2],s[3],Kt,s[4],s[5]]:[Zt,a+("left"===s[6]?5:-5),l,Kt,s[2],s[3],Kt,s[4],s[5]],e?(e.animate({d:i}),e.attr("visibility",h)):t.connector=e=u.chart.renderer.path(i).attr({"stroke-width":y,stroke:m.connectorColor||t.color||"#606060",visibility:h}).add(u.dataLabelsGroup)):e&&(t.connector=e.destroy())}))}},Jt.pie.prototype.placeDataLabels=function(){ee(this.points,function(t){var e,i=t.dataLabel;i&&t.visible&&((e=i._pos)?(i.attr(i._attr),i[i.moved?"animate":"attr"](e),i.moved=!0):i&&i.attr({y:-9999}))})},Jt.pie.prototype.alignDataLabel=Ht,Jt.pie.prototype.verifyDataLabelOverflow=function(t){var e,i=this.center,n=this.options,o=n.center,s=n.minSize||80,r=s;return null!==o[0]?r=yt(i[2]-yt(t[1],t[3]),s):(r=yt(i[2]-t[1]-t[3],s),i[0]+=(t[3]-t[1])/2),null!==o[1]?r=yt(vt(r,i[2]-yt(t[0],t[2])),s):(r=yt(vt(r,i[2]-t[0]-t[2]),s),i[1]+=(t[0]-t[2])/2),r<i[2]?(i[2]=r,i[3]=Math.min(v(n.innerSize||0,r),r),this.translate(i),ee(this.points,function(t){t.dataLabel&&(t.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):e=!0,e}),Jt.column&&(Jt.column.prototype.alignDataLabel=function(t,e,n,o,s){var r,a=this.chart.inverted,l=t.series,h=t.dlBox||t.shapeArgs,c=pe(t.below,t.plotY>pe(this.translatedThreshold,l.yAxis.len)),d=pe(n.inside,!!this.options.stacking);h&&((o=i(h)).y<0&&(o.height+=o.y,o.y=0),(r=o.y+o.height-l.yAxis.len)>0&&(o.height-=r),a&&(o={x:l.yAxis.len-o.y-o.height,y:l.xAxis.len-o.x-o.width,width:o.height,height:o.width}),d||(a?(o.x+=c?0:o.width,o.width=0):(o.y+=c?o.height:0,o.height=0))),n.align=pe(n.align,!a||d?"center":c?"right":"left"),n.verticalAlign=pe(n.verticalAlign,a||d?"middle":c?"top":"bottom"),ze.prototype.alignDataLabel.call(this,t,e,n,o,s)}),function(t){var e=t.Chart,i=t.each,n=t.pick,o=t.addEvent;e.prototype.callbacks.push(function(t){function e(){var e=[];i(t.series,function(t){var o=t.options.dataLabels,s=t.dataLabelCollections||["dataLabel"];(o.enabled||t._hasPointLabels)&&!o.allowOverlap&&t.visible&&i(s,function(o){i(t.points,function(t){t[o]&&(t[o].labelrank=n(t.labelrank,t.shapeArgs&&t.shapeArgs.height),e.push(t[o]))})})}),t.hideOverlappingLabels(e)}e(),o(t,"redraw",e)}),e.prototype.hideOverlappingLabels=function(t){var e,n,o,s,r,a,l,h,c,d,p,u,f,g,m,x,y=t.length;for(n=0;n<y;n++)(e=t[n])&&(e.oldOpacity=e.opacity,e.newOpacity=1);for(t.sort(function(t,e){return(e.labelrank||0)-(t.labelrank||0)}),n=0;n<y;n++)for(s=t[n],o=n+1;o<y;++o)r=t[o],s&&r&&s.placed&&r.placed&&0!==s.newOpacity&&0!==r.newOpacity&&(a=s.alignAttr,l=r.alignAttr,h=2*(s.box?0:s.padding),c=a.x,d=a.y,p=s.width-h,u=s.height-h,f=l.x,g=l.y,m=r.width-h,x=r.height-h,!(f>c+p||f+m<c||g>d+u||g+x<d)&&((s.labelrank<r.labelrank?s:r).newOpacity=0));i(t,function(t){var e,i;t&&(i=t.newOpacity,t.oldOpacity!==i&&t.placed&&(i?t.show(!0):e=function(){t.hide()},t.alignAttr.opacity=i,t[t.isOld?"animate":"attr"](t.alignAttr,null,e)),t.isOld=!0)})}}(dt);var Ve,_e=dt.TrackerMixin={drawTrackerPoint:function(){var t=this,e=t.chart,i=e.pointer,n=t.options.cursor,o=n&&{cursor:n},s=function(t){for(var i,n=t.target;n&&!i;)i=n.point,n=n.parentNode;i!==X&&i!==e.hoverPoint&&i.onMouseOver(t)};ee(t.points,function(t){t.graphic&&(t.graphic.element.point=t),t.dataLabel&&(t.dataLabel.element.point=t)}),t._hasTracking||(ee(t.trackerGroups,function(e){t[e]&&(t[e].addClass(Vt+"tracker").on("mouseover",s).on("mouseout",function(t){i.onTrackerMouseOut(t)}).css(o),Y&&t[e].on("touchstart",s))}),t._hasTracking=!0)},drawTrackerGraph:function(){var t,e,i=this,n=i.options,o=n.trackByArea,s=[].concat(o?i.areaPath:i.graphPath),r=s.length,a=i.chart,l=a.pointer,h=a.renderer,c=a.options.tooltip.snap,d=i.tracker,p=n.cursor,u=p&&{cursor:p},f=i.singlePoints,g=function(){a.hoverSeries!==i&&i.onMouseOver()},m="rgba(192,192,192,"+(Ot?1e-4:.002)+")";if(r&&!o)for(e=r+1;e--;)s[e]===Zt&&s.splice(e+1,0,s[e+1]-c,s[e+2],Kt),(e&&s[e]===Zt||e===r)&&s.splice(e,0,Kt,s[e-2]+c,s[e-1]);for(e=0;e<f.length;e++)t=f[e],s.push(Zt,t.plotX-c,t.plotY,Kt,t.plotX+c,t.plotY);d?d.attr({d:s}):(i.tracker=h.path(s).attr({"stroke-linejoin":"round",visibility:i.visible?_t:Nt,stroke:m,fill:o?m:jt,"stroke-width":n.lineWidth+(o?0:2*c),zIndex:2}).add(i.group),ee([i.tracker,i.markerGroup],function(t){t.addClass(Vt+"tracker").on("mouseover",g).on("mouseout",function(t){l.onTrackerMouseOut(t)}).css(u),Y&&t.on("touchstart",g)}))}};Jt.column&&(Ge.prototype.drawTracker=_e.drawTrackerPoint),Jt.pie&&(Jt.pie.prototype.drawTracker=_e.drawTrackerPoint),Jt.scatter&&(Fe.prototype.drawTracker=_e.drawTrackerPoint),de(Le.prototype,{setItemEvents:function(t,e,i,n,o){var s=this;(i?e:t.legendGroup).on("mouseover",function(){t.setState("hover"),e.css(s.options.itemHoverStyle)}).on("mouseout",function(){e.css(t.visible?n:o),t.setState()}).on("click",function(e){var i=function(){t.setVisible&&t.setVisible()};e={browserEvent:e},t.firePointEvent?t.firePointEvent("legendItemClick",e,i):ae(t,"legendItemClick",e,i)})},createCheckboxForItem:function(t){t.checkbox=m("input",{type:"checkbox",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),se(t.checkbox,"click",function(e){var i=e.target;ae(t.series||t,"checkboxClick",{checked:i.checked,item:t},function(){t.select()})})}}),N.legend.itemStyle.cursor="pointer",de(Ie.prototype,{showResetZoom:function(){var t=this,e=N.lang,i=t.options.chart.resetZoomButton,n=i.theme,o=n.states,s="chart"===i.relativeTo?null:"plotBox";this.resetZoomButton=t.renderer.button(e.resetZoom,null,null,function(){t.zoomOut()},n,o&&o.hover).attr({align:i.position.align,title:e.resetZoomTitle}).add().align(i.position,!1,s)},zoomOut:function(){var t=this;ae(t,"selection",{resetSelection:!0},function(){t.zoom()})},zoom:function(t){var e,i,n=this.pointer,o=!1;!t||t.resetSelection?ee(this.axes,function(t){e=t.zoom()}):ee(t.xAxis.concat(t.yAxis),function(t){var i=t.axis,s=i.isXAxis;(n[s?"zoomX":"zoomY"]||n[s?"pinchX":"pinchY"])&&(e=i.zoom(t.min,t.max),i.displayBtn&&(o=!0))}),i=this.resetZoomButton,o&&!i?this.showResetZoom():!o&&s(i)&&(this.resetZoomButton=i.destroy()),e&&this.redraw(pe(this.options.chart.animation,t&&t.animation,this.pointCount<100))},pan:function(t,e){var i,n=this,o=n.hoverPoints;o&&ee(o,function(t){t.setState()}),ee("xy"===e?[1,0]:[1],function(e){var o=t[e?"chartX":"chartY"],s=n[e?"xAxis":"yAxis"][0],r=n[e?"mouseDownX":"mouseDownY"],a=(s.pointRange||0)/2,l=s.getExtremes(),h=s.toValue(r-o,!0)+a,c=s.toValue(r+n[e?"plotWidth":"plotHeight"]-o,!0)-a,d=r>o;s.series.length&&(d||h>vt(l.dataMin,l.min))&&(!d||c<yt(l.dataMax,l.max))&&(s.setExtremes(h,c,!1,!1,{trigger:"pan"}),i=!0),n[e?"mouseDownX":"mouseDownY"]=o}),i&&n.redraw(!1),g(n.container,{cursor:"move"})}}),de(Oe.prototype,{select:function(t,e){var i=this,n=i.series,o=n.chart;t=pe(t,!i.selected),i.firePointEvent(t?"select":"unselect",{accumulate:e},function(){i.selected=i.options.selected=t,n.options.data[te(i,n.data)]=i.options,i.setState(t&&"select"),e||ee(o.getSelectedPoints(),function(t){t.selected&&t!==i&&(t.selected=t.options.selected=!1,n.options.data[te(t,n.data)]=t.options,t.setState(""),t.firePointEvent("unselect"))})})},onMouseOver:function(t,e){var i=this.series,n=i.chart,o=n.tooltip,s=n.hoverPoint;n.hoverSeries!==i&&i.onMouseOver(),s&&s!==this&&s.onMouseOut(),this.series&&(this.firePointEvent("mouseOver"),!o||o.shared&&!i.noSharedTooltip||o.refresh(this,t),this.setState("hover"),e||(n.hoverPoint=this))},onMouseOut:function(){var t=this.series.chart,e=t.hoverPoints;this.firePointEvent("mouseOut"),e&&-1!==te(this,e)||(this.setState(),t.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var t,e=i(this.series.options.point,this.options).events;for(t in this.events=e,e)se(this,t,e[t]);this.hasImportedEvents=!0}},setState:function(t,e){var n,o,s,r,a=mt(this.plotX),l=this.plotY,h=this.series,c=h.options.states,d=fe[h.type].marker&&h.options.marker,p=d&&!d.enabled,u=d&&d.states[t],f=u&&!1===u.enabled,g=h.stateMarkerGraphic,m=this.marker||{},x=h.chart,y=h.halo;t=t||"",r=this.pointAttr[t]||h.pointAttr[t],t===this.state&&!e||this.selected&&"select"!==t||c[t]&&!1===c[t].enabled||t&&(f||p&&!1===u.enabled)||t&&m.states&&m.states[t]&&!1===m.states[t].enabled||(this.graphic?(n=d&&this.graphic.symbolName&&r.r,this.graphic.attr(i(r,n?{x:a-n,y:l-n,width:2*n,height:2*n}:{})),g&&g.hide()):(t&&u&&(n=u.radius,s=m.symbol||h.symbol,g&&g.currentSymbol!==s&&(g=g.destroy()),g?g[e?"animate":"attr"]({x:a-n,y:l-n}):s&&(h.stateMarkerGraphic=g=x.renderer.symbol(s,a-n,l-n,2*n,2*n).attr(r).add(h.markerGroup),g.currentSymbol=s)),g&&(g[t&&x.isInsidePlot(a,l,x.inverted)?"show":"hide"](),g.element.point=this)),(o=c[t]&&c[t].halo)&&o.size?(y||(h.halo=y=x.renderer.path().add(x.seriesGroup)),y.attr(de(Ot?{fill:this.color||h.color,"fill-opacity":o.opacity}:{fill:O(this.color||h.color).setOpacity(o.opacity).get()},o.attributes))[e?"animate":"attr"]({d:this.haloPath(o.size)})):y&&y.attr({d:[]}),this.state=t)},haloPath:function(t){var e=this.series,i=e.chart,n=e.getPlotBox(),o=i.inverted,s=Math.floor(this.plotX);return i.renderer.symbols.circle(n.translateX+(o?e.yAxis.len-this.plotY:s)-t,n.translateY+(o?e.xAxis.len-s:this.plotY)-t,2*t,2*t)}}),de(ze.prototype,{onMouseOver:function(){var t=this.chart,e=t.hoverSeries;e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&ae(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this},onMouseOut:function(){var t=this.options,e=this.chart,i=e.tooltip,n=e.hoverPoint;e.hoverSeries=null,n&&n.onMouseOut(),this&&t.events.mouseOut&&ae(this,"mouseOut"),!i||t.stickyTracking||i.shared&&!this.noSharedTooltip||i.hide(),this.setState()},setState:function(t){var e,i=this.options,n=this.graph,o=i.states,s=i.lineWidth,r=0;if(t=t||"",this.state!==t){if(this.state=t,o[t]&&!1===o[t].enabled)return;if(t&&(s=o[t].lineWidth||s+(o[t].lineWidthPlus||0)),n&&!n.dashstyle)for(e={"stroke-width":s},n.attr(e);this["zoneGraph"+r];)this["zoneGraph"+r].attr(e),r+=1}},setVisible:function(t,e){var i,n=this,o=n.chart,s=n.legendItem,r=o.options.chart.ignoreHiddenSeries,a=n.visible;n.visible=t=n.userOptions.visible=t===X?!a:t,i=t?"show":"hide",ee(["group","dataLabelsGroup","markerGroup","tracker"],function(t){n[t]&&n[t][i]()}),o.hoverSeries!==n&&(o.hoverPoint&&o.hoverPoint.series)!==n||n.onMouseOut(),s&&o.legend.colorizeItem(n,t),n.isDirty=!0,n.options.stacking&&ee(o.series,function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)}),ee(n.linkedSeries,function(e){e.setVisible(t,!1)}),r&&(o.isDirtyBox=!0),!1!==e&&o.redraw(),ae(n,i)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(t){this.selected=t=t===X?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),ae(this,t?"select":"unselect")},drawTracker:_e.drawTrackerGraph}),ue(ze.prototype,"init",function(t){var e;t.apply(this,Array.prototype.slice.call(arguments,1)),(e=this.xAxis)&&e.options.ordinal&&se(this,"updatedData",function(){delete e.ordinalIndex})}),ue(we.prototype,"getTimeTicks",function(t,e,i,n,o,s,r,a){var l,h,c,p,u,f,g=0,m={},x=[],y=-Number.MAX_VALUE,v=this.options.tickPixelInterval;if(!this.options.ordinal&&!this.options.breaks||!s||s.length<3||i===X)return t.call(this,e,i,n,o);for(u=s.length,l=0;l<u;l++){if(f=l&&s[l-1]>n,s[l]<i&&(g=l),l===u-1||s[l+1]-s[l]>5*r||f){if(s[l]>y){for(h=t.call(this,e,s[g],s[l],o);h.length&&h[0]<=y;)h.shift();h.length&&(y=h[h.length-1]),x=x.concat(h)}g=l+1}if(f)break}if(p=h.info,a&&p.unitRange<=U.hour){for(l=x.length-1,g=1;g<l;g++)V("%d",x[g])!==V("%d",x[g-1])&&(m[x[g]]="day",c=!0);c&&(m[x[0]]="day"),p.higherRanks=m}if(x.info=p,a&&d(v)){for(var b,k,w,A,S,T=x.length,P=T,C=[],M=[];P--;)k=this.translate(x[P]),w&&(M[P]=w-k),C[P]=w=k;for(M.sort(),(A=M[mt(M.length/2)])<.6*v&&(A=null),P=x[T-1]>n?T-1:T,w=void 0;P--;)S=w-(k=C[P]),w&&S<.8*v&&(null===A||S<.8*A)?(m[x[P]]&&!m[x[P+1]]?(b=P+1,w=k):b=P,x.splice(b,1)):w=k}return x}),de(we.prototype,{beforeSetTickPositions:function(){var t,e,i,n,o,s,r=[],a=!1,l=this.getExtremes(),h=l.min,c=l.max,d=this.isXAxis&&!!this.options.breaks,p=this.options.ordinal;if(p||d){if(ee(this.series,function(e,i){if(!1!==e.visible&&(!1!==e.takeOrdinalPosition||d)&&(r=r.concat(e.processedXData),t=r.length,r.sort(function(t,e){return t-e}),t))for(i=t-1;i--;)r[i]===r[i+1]&&r.splice(i,1)}),(t=r.length)>2){for(e=r[1]-r[0],s=t-1;s--&&!a;)r[s+1]-r[s]!==e&&(a=!0);!this.options.keepOrdinalPadding&&(r[0]-h>e||c-r[r.length-1]>e)&&(a=!0)}a?(this.ordinalPositions=r,i=this.val2lin(yt(h,r[0]),!0),n=yt(this.val2lin(vt(c,r[r.length-1]),!0),1),this.ordinalSlope=o=(c-h)/(n-i),this.ordinalOffset=h-i*o):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=X}this.doPostTranslate=p&&a||d,this.groupIntervalFactor=null},val2lin:function(t,e){var i,n=this.ordinalPositions;if(n){var o,s,r=n.length;for(o=r;o--;)if(n[o]===t){s=o;break}for(o=r-1;o--;)if(t>n[o]||0===o){s=o+(t-n[o])/(n[o+1]-n[o]);break}i=e?s:this.ordinalSlope*(s||0)+this.ordinalOffset}else i=t;return i},lin2val:function(t,e){var i,n=this.ordinalPositions;if(n){var o,s,r=this.ordinalSlope,a=this.ordinalOffset,l=n.length-1;if(e)t<0?t=n[0]:t>l?t=n[l]:s=t-(l=mt(t));else for(;l--;)if(t>=(o=r*l+a)){s=(t-o)/(r*(l+1)+a-o);break}i=s!==X&&n[l]!==X?n[l]+(s?s*(n[l+1]-n[l]):0):t}else i=t;return i},getExtendedPositions:function(){var t,e,i=this.chart,n=this.series[0].currentDataGrouping,o=this.ordinalIndex,s=n?n.count+n.unitName:"raw",r=this.getExtremes();return o||(o=this.ordinalIndex={}),o[s]||(t={series:[],getExtremes:function(){return{min:r.dataMin,max:r.dataMax}},options:{ordinal:!0},val2lin:we.prototype.val2lin},ee(this.series,function(o){(e={xAxis:t,xData:o.xData,chart:i,destroyGroupedData:Ht}).options={dataGrouping:n?{enabled:!0,forced:!0,approximation:"open",units:[[n.unitName,[n.count]]]}:{enabled:!1}},o.processData.apply(e),t.series.push(e)}),this.beforeSetTickPositions.apply(t),o[s]=t.ordinalPositions),o[s]},getGroupIntervalFactor:function(t,e,i){var n,o,s=i.processedXData,r=s.length,a=[],l=this.groupIntervalFactor;if(!l){for(n=0;n<r-1;n++)a[n]=s[n+1]-s[n];a.sort(function(t,e){return t-e}),o=a[mt(r/2)],t=yt(t,s[0]),e=vt(e,s[r-1]),this.groupIntervalFactor=l=r*o/(e-t)}return l},postProcessTickInterval:function(t){var e=this.ordinalSlope;return e?this.options.breaks?this.closestPointRange:t/(e/this.closestPointRange):t}}),ue(Ie.prototype,"pan",function(t,e){var i=this.xAxis[0],n=e.chartX,o=!1;if(i.options.ordinal&&i.series.length){var s,r,a,l,h=this.mouseDownX,c=i.getExtremes(),d=c.dataMax,p=c.min,u=c.max,f=this.hoverPoints,m=i.closestPointRange,x=(h-n)/(i.translationSlope*(i.ordinalSlope||m)),y={ordinalPositions:i.getExtendedPositions()},v=i.lin2val,b=i.val2lin;y.ordinalPositions?bt(x)>1&&(f&&ee(f,function(t){t.setState()}),x<0?(a=y,l=i.ordinalPositions?i:y):(a=i.ordinalPositions?i:y,l=y),d>(r=l.ordinalPositions)[r.length-1]&&r.push(d),this.fixedRange=u-p,(s=i.toFixedRange(null,null,v.apply(a,[b.apply(a,[p,!0])+x,!0]),v.apply(l,[b.apply(l,[u,!0])+x,!0]))).min>=vt(c.dataMin,p)&&s.max<=yt(d,u)&&i.setExtremes(s.min,s.max,!0,!1,{trigger:"pan"}),this.mouseDownX=n,g(this.container,{cursor:"move"})):o=!0}else o=!0;o&&t.apply(this,Array.prototype.slice.call(arguments,1))}),ue(ze.prototype,"getSegments",function(t){var e,i=this.options.gapSize,n=this.xAxis;t.apply(this,Array.prototype.slice.call(arguments,1)),i&&(e=this.segments,ee(e,function(t,o){for(var s=t.length-1;s--;){if(t[s].x<n.min&&t[s+1].x>n.max){e.length=0;break}t[s+1].x-t[s].x>n.closestPointRange*i&&e.splice(o+1,0,t.splice(s+1,t.length-s))}}))}),Ve=function(t){"use strict";function e(t){t.apply(this),this.drawBreaks()}var i=t.pick,n=t.wrap,o=t.each,s=t.extend,r=t.fireEvent,a=t.Axis,l=t.Series;s(a.prototype,{isInBreak:function(t,e){var i=t.repeat||1/0,n=t.from,o=t.to-t.from,s=e>=n?(e-n)%i:i-(n-e)%i;return t.inclusive?s<=o:s<o&&0!==s},isInAnyBreak:function(t,e){var n,o,s,r=this.options.breaks,a=r&&r.length;if(a){for(;a--;)this.isInBreak(r[a],t)&&(n=!0,o||(o=i(r[a].showPoints,!this.isXAxis)));s=n&&e?n&&!o:n}return s}}),n(a.prototype,"setTickPositions",function(t){if(t.apply(this,Array.prototype.slice.call(arguments,1)),this.options.breaks){var e,i=this.tickPositions,n=this.tickPositions.info,o=[];for(e=0;e<i.length;e++)this.isInAnyBreak(i[e])||o.push(i[e]);this.tickPositions=o,this.tickPositions.info=n}}),n(a.prototype,"init",function(t,e,i){if(i.breaks&&i.breaks.length&&(i.ordinal=!1),t.call(this,e,i),this.options.breaks){var n=this;n.doPostTranslate=!0,this.val2lin=function(t){var e,i,o=t;for(i=0;i<n.breakArray.length;i++)if((e=n.breakArray[i]).to<=t)o-=e.len;else{if(e.from>=t)break;if(n.isInBreak(e,t)){o-=t-e.from;break}}return o},this.lin2val=function(t){var e,i,o=t;for(i=0;i<n.breakArray.length&&!((e=n.breakArray[i]).from>=o);i++)e.to<o?o+=e.len:n.isInBreak(e,o)&&(o+=e.len);return o},this.setExtremes=function(t,e,i,n,o){for(;this.isInAnyBreak(t);)t-=this.closestPointRange;for(;this.isInAnyBreak(e);)e-=this.closestPointRange;a.prototype.setExtremes.call(this,t,e,i,n,o)},this.setAxisTranslation=function(t){a.prototype.setAxisTranslation.call(this,t);var e,i,o,s,l,h,c=n.options.breaks,d=[],p=[],u=0,f=n.userMin||n.min,g=n.userMax||n.max;for(l in c)i=(o=c[l]).repeat||1/0,n.isInBreak(o,f)&&(f+=o.to%i-f%i),n.isInBreak(o,g)&&(g-=g%i-o.from%i);for(l in c){for(s=(o=c[l]).from,i=o.repeat||1/0;s-i>f;)s-=i;for(;s<f;)s+=i;for(h=s;h<g;h+=i)d.push({value:h,move:"in"}),d.push({value:h+(o.to-o.from),move:"out",size:o.breakSize})}for(l in d.sort(function(t,e){return t.value===e.value?("in"===t.move?0:1)-("in"===e.move?0:1):t.value-e.value}),e=0,s=f,d)1===(e+="in"===(o=d[l]).move?1:-1)&&"in"===o.move&&(s=o.value),0===e&&(p.push({from:s,to:o.value,len:o.value-s-(o.size||0)}),u+=o.value-s-(o.size||0));n.breakArray=p,r(n,"afterBreaks"),n.transA*=(g-n.min)/(g-f-u),n.min=f,n.max=g}}}),n(l.prototype,"generatePoints",function(t){t.apply(this,function(){return Array.prototype.slice.call(arguments,1)}(arguments));var e,i=this.xAxis,n=this.yAxis,o=this.points,s=o.length,r=this.options.connectNulls;if(i&&n&&(i.options.breaks||n.options.breaks))for(;s--;)null===(e=o[s]).y&&!1===r||!i.isInAnyBreak(e.x,!0)&&!n.isInAnyBreak(e.y,!0)||(o.splice(s,1),this.data[s]&&this.data[s].destroyElements())}),t.Series.prototype.drawBreaks=function(){var t,e,n,s,a,l=this,h=l.points;o(["y","x"],function(c){t=l[c+"Axis"],e=t.breakArray||[],n=t.isXAxis?t.min:i(l.options.threshold,t.min),o(h,function(l){a=i(l["stack"+c.toUpperCase()],l[c]),o(e,function(e){s=!1,n<e.from&&a>e.to||n>e.from&&a<e.from?s="pointBreak":(n<e.from&&a>e.from&&a<e.to||n>e.from&&a>e.to&&a<e.from)&&(s="pointInBreak"),s&&r(t,s,{point:l,brk:e})})})})},n(t.seriesTypes.column.prototype,"drawPoints",e),n(t.Series.prototype,"drawPoints",e)},"object"==typeof module&&module.exports?module.exports=Ve:Ve(dt);var Ue=ze.prototype,je=Ue.processData,Ze=Ue.generatePoints,Ke=Ue.destroy,qe={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},$e={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},Je=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],Qe={sum:function(t){var e,i=t.length;if(!i&&t.hasNulls)e=null;else if(i)for(e=0;i--;)e+=t[i];return e},average:function(t){var e=t.length,i=Qe.sum(t);return"number"==typeof i&&e&&(i/=e),i},open:function(t){return t.length?t[0]:t.hasNulls?null:X},high:function(t){return t.length?C(t):t.hasNulls?null:X},low:function(t){return t.length?P(t):t.hasNulls?null:X},close:function(t){return t.length?t[t.length-1]:t.hasNulls?null:X},ohlc:function(t,e,i,n){if(t=Qe.open(t),e=Qe.high(e),i=Qe.low(i),n=Qe.close(n),"number"==typeof t||"number"==typeof e||"number"==typeof i||"number"==typeof n)return[t,e,i,n]},range:function(t,e){if(t=Qe.low(t),e=Qe.high(e),"number"==typeof t||"number"==typeof e)return[t,e]}};Ue.groupData=function(t,e,i,n){var o,s,r,a,l=this.data,h=this.options.data,c=[],d=[],p=t.length,u=!!e,f=[[],[],[],[]],g="function"==typeof n?n:Qe[n],m=this.pointArrayMap,x=m&&m.length;for(a=0;a<=p&&!(t[a]>=i[0]);a++);for(;a<=p;a++){for(;(i[1]!==X&&t[a]>=i[1]||a===p)&&(o=i.shift(),(r=g.apply(0,f))!==X&&(c.push(o),d.push(r)),f[0]=[],f[1]=[],f[2]=[],f[3]=[],a!==p););if(a===p)break;if(m){var y,v,b=this.cropStart+a,k=l&&l[b]||this.pointClass.prototype.applyOptions.apply({series:this},[h[b]]);for(y=0;y<x;y++)"number"==typeof(v=k[m[y]])?f[y].push(v):null===v&&(f[y].hasNulls=!0)}else"number"==typeof(s=u?e[a]:null)?f[0].push(s):null===s&&(f[0].hasNulls=!0)}return[c,d]},Ue.processData=function(){var t,e=this.chart,i=this.options.dataGrouping,n=!1!==this.allowDG&&i&&pe(i.enabled,e.options._stock);if(this.forceCrop=n,this.groupPixelWidth=null,this.hasProcessed=!0,!(!1===je.apply(this,arguments)||!n)){this.destroyGroupedData();var o,s=this.processedXData,r=this.processedYData,a=e.plotSizeX,l=this.xAxis,h=l.options.ordinal,c=this.groupPixelWidth=l.getGroupPixelWidth&&l.getGroupPixelWidth();if(c){t=!0,this.points=null;var p=l.getExtremes(),u=p.min,f=p.max,g=c*(f-u)/a*(h&&l.getGroupIntervalFactor(u,f,this)||1),m=l.getTimeTicks(l.normalizeTimeTickInterval(g,i.units||Je),u,f,l.options.startOfWeek,s,this.closestPointRange),x=Ue.groupData.apply(this,[s,r,m,i.approximation]),y=x[0],v=x[1];if(i.smoothed){for(y[o=y.length-1]=Math.min(y[o],f);o--&&o>0;)y[o]+=g/2;y[0]=Math.max(y[0],u)}this.currentDataGrouping=m.info,this.closestPointRange=m.info.totalRange,d(y[0])&&y[0]<l.dataMin&&(l.min===l.dataMin&&(l.min=y[0]),l.dataMin=y[0]),this.processedXData=y,this.processedYData=v}else this.currentDataGrouping=null;this.hasGroupedData=t}},Ue.destroyGroupedData=function(){var t=this.groupedData;ee(t||[],function(e,i){e&&(t[i]=e.destroy?e.destroy():null)}),this.groupedData=null},Ue.generatePoints=function(){Ze.apply(this),this.destroyGroupedData(),this.groupedData=this.hasGroupedData?this.points:null},ue(Se.prototype,"tooltipFooterHeaderFormatter",function(t,e,i){var n,o,s,r,l,h=e.series,c=h.options,d=h.tooltipOptions,p=c.dataGrouping,u=d.xDateFormat,f=h.xAxis;return f&&"datetime"===f.options.type&&p&&a(e.key)?(o=h.currentDataGrouping,s=p.dateTimeLabelFormats,o?(r=s[o.unitName],1===o.count?u=r[0]:(u=r[1],n=r[2])):!u&&s&&(u=this.getXDateFormat(e,d,f)),l=V(u,e.key),n&&(l+=V(n,e.key+o.totalRange-1)),w(d[(i?"footer":"header")+"Format"],{point:de(e,{key:l}),series:h})):t.call(this,e,i)}),Ue.destroy=function(){for(var t=this.groupedData||[],e=t.length;e--;)t[e]&&t[e].destroy();Ke.apply(this)},ue(Ue,"setOptions",function(t,e){var n=t.call(this,e),o=this.type,s=this.chart.options.plotOptions,r=fe[o].dataGrouping;return $e[o]&&(r||(r=i(qe,$e[o])),n.dataGrouping=i(r,s.series&&s.series.dataGrouping,s[o].dataGrouping,e.dataGrouping)),this.chart.options._stock&&(this.requireSorting=!0),n}),ue(we.prototype,"setScale",function(t){t.call(this),ee(this.series,function(t){t.hasProcessed=!1})}),we.prototype.getGroupPixelWidth=function(){var t,e,i,n=this.series,o=n.length,s=0,r=!1;for(t=o;t--;)(i=n[t].options.dataGrouping)&&(s=yt(s,i.groupPixelWidth));for(t=o;t--;)(i=n[t].options.dataGrouping)&&n[t].hasProcessed&&(e=(n[t].processedXData||n[t].data).length,(n[t].groupPixelWidth||e>this.chart.plotSizeX/s||e&&i.forced)&&(r=!0));return r?s:0},we.prototype.setDataGrouping=function(t,e){var i;if(e=pe(e,!0),t||(t={forced:!1,units:null}),this instanceof we)for(i=this.series.length;i--;)this.series[i].update({dataGrouping:t},!1);else ee(this.chart.options.series,function(e){e.dataGrouping=t},!1);e&&this.chart.redraw()},fe.ohlc=i(fe.column,{lineWidth:1,tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},states:{hover:{lineWidth:3}},threshold:null});var ti=x(Jt.column,{type:"ohlc",pointArrayMap:["open","high","low","close"],toYData:function(t){return[t.open,t.high,t.low,t.close]},pointValKey:"high",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},upColorProp:"stroke",getAttribs:function(){Jt.column.prototype.getAttribs.apply(this,arguments);var t=this.options,e=t.states,n=t.upColor||this.color,o=i(this.pointAttr),s=this.upColorProp;o[""][s]=n,o.hover[s]=e.hover.upColor||n,o.select[s]=e.select.upColor||n,ee(this.points,function(t){t.open<t.close&&!t.options.color&&(t.pointAttr=o)})},translate:function(){var t=this.yAxis;Jt.column.prototype.translate.apply(this),ee(this.points,function(e){null!==e.open&&(e.plotOpen=t.translate(e.open,0,1,0,1)),null!==e.close&&(e.plotClose=t.translate(e.close,0,1,0,1))})},drawPoints:function(){var t,e,i,n,o,s,r,a,l=this,h=l.points,c=l.chart;ee(h,function(h){h.plotY!==X&&(r=h.graphic,t=h.pointAttr[h.selected?"selected":""]||l.pointAttr[""],n=t["stroke-width"]%2/2,a=gt(h.plotX)-n,o=gt(h.shapeArgs.width/2),s=["M",a,gt(h.yBottom),"L",a,gt(h.plotY)],null!==h.open&&(e=gt(h.plotOpen)+n,s.push("M",a,e,"L",a-o,e)),null!==h.close&&(i=gt(h.plotClose)+n,s.push("M",a,i,"L",a+o,i)),r?r.attr(t).animate({d:s}):h.graphic=c.renderer.path(s).attr(t).add(l.group))})},animate:null});Jt.ohlc=ti,fe.candlestick=i(fe.column,{lineColor:"black",lineWidth:1,states:{hover:{lineWidth:2}},tooltip:fe.ohlc.tooltip,threshold:null,upColor:"white"});var ei=x(ti,{type:"candlestick",pointAttrToOptions:{fill:"color",stroke:"lineColor","stroke-width":"lineWidth"},upColorProp:"fill",getAttribs:function(){Jt.ohlc.prototype.getAttribs.apply(this,arguments);var t=this.options,e=t.states,n=t.upLineColor||t.lineColor,o=e.hover.upLineColor||n,s=e.select.upLineColor||n;ee(this.points,function(t){t.open<t.close&&(t.lineColor&&(t.pointAttr=i(t.pointAttr),n=t.lineColor),t.pointAttr[""].stroke=n,t.pointAttr.hover.stroke=o,t.pointAttr.select.stroke=s)})},drawPoints:function(){var t,e,i,n,o,s,r,a,l,h,c,d,p=this,u=p.points,f=p.chart,g=p.pointAttr[""];ee(u,function(u){h=u.graphic,u.plotY!==X&&(t=u.pointAttr[u.selected?"selected":""]||g,a=t["stroke-width"]%2/2,l=gt(u.plotX)-a,e=u.plotOpen,i=u.plotClose,n=ft.min(e,i),o=ft.max(e,i),d=gt(u.shapeArgs.width/2),s=gt(n)!==gt(u.plotY),r=o!==u.yBottom,n=gt(n)+a,o=gt(o)+a,c=["M",l-d,o,"L",l-d,n,"L",l+d,n,"L",l+d,o,"Z","M",l,n,"L",l,s?gt(u.plotY):n,"M",l,o,"L",l,r?gt(u.yBottom):o],h?h.attr(t).animate({d:c}):u.graphic=f.renderer.path(c).attr(t).add(p.group).shadow(p.options.shadow))})}});Jt.candlestick=ei;var ii=be.prototype.symbols;fe.flags=i(fe.column,{fillColor:"white",lineWidth:1,pointRange:0,shape:"flag",stackDistance:12,states:{hover:{lineColor:"black",fillColor:"#FCFFC5"}},style:{fontSize:"11px",fontWeight:"bold",textAlign:"center"},tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30}),Jt.flags=x(Jt.column,{type:"flags",sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:ze.prototype.init,pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth",r:"radius"},translate:function(){Jt.column.prototype.translate.apply(this);var t,e,i,n,o,s,r=this.options,a=this.chart,l=this.points,h=l.length-1,c=r.onSeries,d=c&&a.get(c),p=d&&d.options.step,u=d&&d.points,f=u&&u.length,g=this.xAxis,m=g.getExtremes();if(d&&d.visible&&f)for(s=d.currentDataGrouping,n=u[f-1].x+(s?s.totalRange:0),l.sort(function(t,e){return t.x-e.x});f--&&l[h]&&(t=l[h],!((i=u[f]).x<=t.x&&i.plotY!==X&&(t.x<=n&&(t.plotY=i.plotY,i.x<t.x&&!p&&(o=u[f+1])&&o.plotY!==X&&(t.plotY+=(t.x-i.x)/(o.x-i.x)*(o.plotY-i.plotY))),f++,--h<0))););ee(l,function(t,i){var n;t.plotY===X&&(t.x>=m.min&&t.x<=m.max?t.plotY=a.chartHeight-g.bottom-(g.opposite?g.height:0)+g.offset-a.plotTop:t.shapeArgs={}),(e=l[i-1])&&e.plotX===t.plotX&&(e.stackIndex===X&&(e.stackIndex=0),n=e.stackIndex+1),t.stackIndex=n})},drawPoints:function(){var t,e,n,o,s,r,a,l,h,c,d,p=this.pointAttr[""],u=this.points,f=this.chart.renderer,g=this.options,m=g.y;for(s=u.length;s--;)d=(r=u[s]).plotX>this.xAxis.len,(e=r.plotX)>0&&(e-=pe(r.lineWidth,g.lineWidth)%2),l=r.stackIndex,o=r.options.shape||g.shape,(n=r.plotY)!==X&&(n=r.plotY+m-(l!==X&&l*g.stackDistance)),h=l?X:r.plotX,c=l?X:r.plotY,a=r.graphic,n!==X&&e>=0&&!d?(t=r.pointAttr[r.selected?"select":""]||p,a?a.attr({x:e,y:n,r:t.r,anchorX:h,anchorY:c}):a=r.graphic=f.label(r.options.title||g.title||"A",e,n,o,h,c,g.useHTML).css(i(g.style,r.style)).attr(t).attr({align:"flag"===o?"left":"center",width:g.width,height:g.height}).add(this.markerGroup).shadow(g.shadow),r.tooltipPos=[e,n]):a&&(r.graphic=a.destroy())},drawTracker:function(){var t=this.points;_e.drawTrackerPoint.apply(this),ee(t,function(e){var i=e.graphic;i&&se(i.element,"mouseover",function(){e.stackIndex>0&&!e.raised&&(e._y=i.y,i.attr({y:e._y-8}),e.raised=!0),ee(t,function(t){t!==e&&t.raised&&t.graphic&&(t.graphic.attr({y:t._y}),t.raised=!1)})})})},animate:Ht,buildKDTree:Ht,setClip:Ht}),ii.flag=function(t,e,i,n,o){return["M",o&&o.anchorX||t,o&&o.anchorY||e,"L",t,e+n,t,e,t+i,e,t+i,e+n,t,e+n,"Z"]},ee(["circle","square"],function(t){ii[t+"pin"]=function(e,i,n,o,s){var r,a,l=s&&s.anchorX,h=s&&s.anchorY;return"circle"===t&&o>n&&(e-=gt((o-n)/2),n=o),r=ii[t](e,i,n,o),l&&h&&(a=i>h?i:i+o,r.push("M",l,a,"L",l,h)),r}}),G===dt.VMLRenderer&&ee(["flag","circlepin","squarepin"],function(t){me.prototype.symbols[t]=ii[t]});var ni,oi=[].concat(Je),si=function(t){var e=ie(arguments,function(t){return"number"==typeof t});if(e.length)return Math[t].apply(0,e)};oi[4]=["day",[1,2,3,4]],oi[5]=["week",[1,2,3]],ni=Jt.areaspline===X?"line":"areaspline",de(N,{navigator:{handles:{backgroundColor:"#ebe7e8",borderColor:"#b2b1b6"},height:40,margin:25,maskFill:"rgba(128,179,236,0.3)",maskInside:!0,outlineColor:"#b2b1b6",outlineWidth:1,series:{type:ni,color:"#4572A7",compare:null,fillOpacity:.05,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:oi},dataLabels:{enabled:!1,zIndex:2},id:Vt+"navigator-series",lineColor:null,lineWidth:1,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{tickWidth:0,lineWidth:0,gridLineColor:"#EEE",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#888"},x:3,y:-4},crosshair:!1},yAxis:{gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickWidth:0}},scrollbar:{height:It?20:14,barBackgroundColor:"#bfc8d1",barBorderRadius:0,barBorderWidth:1,barBorderColor:"#bfc8d1",buttonArrowColor:"#666",buttonBackgroundColor:"#ebe7e8",buttonBorderColor:"#bbb",buttonBorderRadius:0,buttonBorderWidth:1,minWidth:6,rifleColor:"#666",trackBackgroundColor:"#eeeeee",trackBorderColor:"#eeeeee",trackBorderWidth:1,liveRedraw:Ot&&!It}}),W.prototype={drawHandle:function(t,e){var i,n=this.chart,o=n.renderer,s=this.elementsToDestroy,r=this.handles,a=this.navigatorOptions.handles,l={fill:a.backgroundColor,stroke:a.borderColor,"stroke-width":1};this.rendered||(r[e]=o.g("navigator-handle-"+["left","right"][e]).css({cursor:"ew-resize"}).attr({zIndex:10-e}).add(),i=o.rect(-4.5,0,9,16,0,1).attr(l).add(r[e]),s.push(i),i=o.path(["M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12]).attr(l).add(r[e]),s.push(i)),r[e][n.isResizing?"animate":"attr"]({translateX:this.scrollerLeft+this.scrollbarHeight+parseInt(t,10),translateY:this.top+this.height/2-8})},drawScrollbarButton:function(t){var e,i=this.chart.renderer,n=this.elementsToDestroy,o=this.scrollbarButtons,s=this.scrollbarHeight,r=this.scrollbarOptions;this.rendered||(o[t]=i.g().add(this.scrollbarGroup),e=i.rect(-.5,-.5,s+1,s+1,r.buttonBorderRadius,r.buttonBorderWidth).attr({stroke:r.buttonBorderColor,"stroke-width":r.buttonBorderWidth,fill:r.buttonBackgroundColor}).add(o[t]),n.push(e),e=i.path(["M",s/2+(t?-1:1),s/2-3,"L",s/2+(t?-1:1),s/2+3,s/2+(t?2:-2),s/2]).attr({fill:r.buttonArrowColor}).add(o[t]),n.push(e)),t&&o[t].attr({translateX:this.scrollerWidth-s})},render:function(t,e,i,n){var o,s,r,a,l,h,c,p,u,f,g,m,x,y=this.chart,v=y.renderer,b=this.scrollbarGroup,k=this.navigatorGroup,w=this.scrollbar,A=this.xAxis,S=this.scrollbarTrack,T=this.scrollbarHeight,P=this.scrollbarEnabled,C=this.navigatorOptions,M=this.scrollbarOptions,L=M.minWidth,D=this.height,I=this.top,B=this.navigatorEnabled,O=C.outlineWidth,z=O/2,R=0,E=this.outlineHeight,W=M.barBorderRadius,H=M.barBorderWidth,X=I+z;!d(t)||isNaN(t)||this.hasDragged&&!d(i)||(this.navigatorLeft=o=pe(A.left,y.plotLeft+T),this.navigatorWidth=s=pe(A.len,y.plotWidth-2*T),this.scrollerLeft=r=o-T,this.scrollerWidth=a=a=s+2*T,A.getExtremes&&(!(x=this.getUnionExtremes(!0))||x.dataMin===A.min&&x.dataMax===A.max||A.setExtremes(x.dataMin,x.dataMax,!0,!1)),i=pe(i,A.translate(t)),n=pe(n,A.translate(e)),(isNaN(i)||bt(i)===1/0)&&(i=0,n=a),A.translate(n,!0)-A.translate(i,!0)<y.xAxis[0].minRange||(this.zoomedMax=vt(yt(i,n,0),s),this.zoomedMin=yt(this.fixedWidth?this.zoomedMax-this.fixedWidth:vt(i,n),0),this.range=this.zoomedMax-this.zoomedMin,c=(h=gt(this.zoomedMax))-(l=gt(this.zoomedMin)),this.rendered||(B&&(this.navigatorGroup=k=v.g("navigator").attr({zIndex:3}).add(),this.leftShade=v.rect().attr({fill:C.maskFill}).add(k),C.maskInside?this.leftShade.css({cursor:"ew-resize"}):this.rightShade=v.rect().attr({fill:C.maskFill}).add(k),this.outline=v.path().attr({"stroke-width":O,stroke:C.outlineColor}).add(k)),P&&(this.scrollbarGroup=b=v.g("scrollbar").add(),f=M.trackBorderWidth,this.scrollbarTrack=S=v.rect().attr({x:0,y:-f%2/2,fill:M.trackBackgroundColor,stroke:M.trackBorderColor,"stroke-width":f,r:M.trackBorderRadius||0,height:T}).add(b),this.scrollbar=w=v.rect().attr({y:-H%2/2,height:T,fill:M.barBackgroundColor,stroke:M.barBorderColor,"stroke-width":H,r:W}).add(b),this.scrollbarRifles=v.path().attr({stroke:M.rifleColor,"stroke-width":1}).add(b))),m=y.isResizing?"animate":"attr",B&&(this.leftShade[m](C.maskInside?{x:o+l,y:I,width:h-l,height:D}:{x:o,y:I,width:l,height:D}),this.rightShade&&this.rightShade[m]({x:o+h,y:I,width:s-h,height:D}),this.outline[m]({d:[Zt,r,X,Kt,o+l-z,X,o+l-z,X+E,Kt,o+h-z,X+E,Kt,o+h-z,X,r+a,X].concat(C.maskInside?[Zt,o+l+z,X,Kt,o+h-z,X]:[])}),this.drawHandle(l+z,0),this.drawHandle(h+z,1)),P&&b&&(this.drawScrollbarButton(0),this.drawScrollbarButton(1),b[m]({translateX:r,translateY:gt(X+D)}),S[m]({width:a}),p=T+l,(u=c-H)<L&&(R=(L-u)/2,u=L,p-=R),this.scrollbarPad=R,w[m]({x:mt(p)+H%2/2,width:u}),g=T+l+c/2-.5,this.scrollbarRifles.attr({visibility:c>12?_t:Nt})[m]({d:[Zt,g-3,T/4,Kt,g-3,2*T/3,Zt,g,T/4,Kt,g,2*T/3,Zt,g+3,T/4,Kt,g+3,2*T/3]})),this.scrollbarPad=R,this.rendered=!0))},addEvents:function(){var t,e=this.chart.container,i=this.mouseDownHandler,n=this.mouseMoveHandler,o=this.mouseUpHandler;t=[[e,"mousedown",i],[e,"mousemove",n],[document,"mouseup",o]],Y&&t.push([e,"touchstart",i],[e,"touchmove",n],[document,"touchend",o]),ee(t,function(t){se.apply(null,t)}),this._events=t},removeEvents:function(){ee(this._events,function(t){re.apply(null,t)}),this._events=X,this.navigatorEnabled&&this.baseSeries&&re(this.baseSeries,"updatedData",this.updatedDataHandler)},init:function(){var t,e,n,o=this,s=o.chart,r=o.scrollbarHeight,a=o.navigatorOptions,l=o.height,h=o.top,c=o.baseSeries;o.mouseDownHandler=function(e){e=s.pointer.normalize(e);var i,r,a,h,c=o.zoomedMin,d=o.zoomedMax,p=o.top,u=o.scrollbarHeight,f=o.scrollerLeft,g=o.scrollerWidth,m=o.navigatorLeft,x=o.navigatorWidth,y=o.scrollbarPad,v=o.range,b=e.chartX,k=e.chartY,w=s.xAxis[0],A=It?10:7;k>p&&k<p+l+u&&((h=!o.scrollbarEnabled||k<p+l)&&ft.abs(b-c-m)<A?(o.grabbedLeft=!0,o.otherHandlePos=d,o.fixedExtreme=w.max,s.fixedRange=null):h&&ft.abs(b-d-m)<A?(o.grabbedRight=!0,o.otherHandlePos=c,o.fixedExtreme=w.min,s.fixedRange=null):b>m+c-y&&b<m+d+y?(o.grabbedCenter=b,o.fixedWidth=v,n=b-c):b>f&&b<f+g&&((a=h?b-m-v/2:b<m?c-.2*v:b>f+g-u?c+.2*v:b<m+c?c-v:d)<0?a=0:a+v>=x&&(a=x-v,i=o.getUnionExtremes().dataMax),a!==c&&(o.fixedWidth=v,r=t.toFixedRange(a,a+v,null,i),w.setExtremes(r.min,r.max,!0,!1,{trigger:"navigator"}))))},o.mouseMoveHandler=function(t){var e,i,r=o.scrollbarHeight,a=o.navigatorLeft,l=o.navigatorWidth,h=o.scrollerLeft,c=o.scrollerWidth,d=o.range;t.touches&&0===t.touches[0].pageX||((e=(t=s.pointer.normalize(t)).chartX)<a?e=a:e>h+c-r&&(e=h+c-r),o.grabbedLeft?(i=!0,o.render(0,0,e-a,o.otherHandlePos)):o.grabbedRight?(i=!0,o.render(0,0,o.otherHandlePos,e-a)):o.grabbedCenter&&(i=!0,e<n?e=n:e>l+n-d&&(e=l+n-d),o.render(0,0,e-n,e-n+d)),i&&o.scrollbarOptions.liveRedraw&&setTimeout(function(){o.mouseUpHandler(t)},0),o.hasDragged=i)},o.mouseUpHandler=function(e){var i,r,a;o.hasDragged&&(o.zoomedMin===o.otherHandlePos?r=o.fixedExtreme:o.zoomedMax===o.otherHandlePos&&(a=o.fixedExtreme),d((i=t.toFixedRange(o.zoomedMin,o.zoomedMax,r,a)).min)&&s.xAxis[0].setExtremes(i.min,i.max,!0,!1,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:e})),"mousemove"!==e.type&&(o.grabbedLeft=o.grabbedRight=o.grabbedCenter=o.fixedWidth=o.fixedExtreme=o.otherHandlePos=o.hasDragged=n=null)};var p=s.xAxis.length,u=s.yAxis.length;s.extraBottomMargin=o.outlineHeight+a.margin,o.navigatorEnabled?(o.xAxis=t=new we(s,i({breaks:c&&c.xAxis.options.breaks,ordinal:c&&c.xAxis.options.ordinal},a.xAxis,{id:"navigator-x-axis",isX:!0,type:"datetime",index:p,height:l,offset:0,offsetLeft:r,offsetRight:-r,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1})),o.yAxis=e=new we(s,i(a.yAxis,{id:"navigator-y-axis",alignTicks:!1,height:l,offset:0,index:u,zoomEnabled:!1})),c||a.series.data?o.addBaseSeries():0===s.series.length&&ue(s,"redraw",function(t,e){s.series.length>0&&!o.series&&(o.setBaseSeries(),s.redraw=t),t.call(s,e)})):o.xAxis=t={translate:function(t,e){var i=s.xAxis[0],n=i.getExtremes(),o=s.plotWidth-2*r,a=si("min",i.options.min,n.dataMin),l=si("max",i.options.max,n.dataMax)-a;return e?t*l/o+a:o*(t-a)/l},toFixedRange:we.prototype.toFixedRange},ue(s,"getMargins",function(i){var n=this.legend,s=n.options;i.apply(this,[].slice.call(arguments,1)),o.top=h=o.navigatorOptions.top||this.chartHeight-o.height-o.scrollbarHeight-this.spacing[2]-("bottom"===s.verticalAlign&&s.enabled&&!s.floating?n.legendHeight+pe(s.margin,10):0),t&&e&&(t.options.top=e.options.top=h,t.setAxisSize(),e.setAxisSize())}),o.addEvents()},getUnionExtremes:function(t){var e,i=this.chart.xAxis[0],n=this.xAxis,o=n.options,s=i.options;return t&&null===i.dataMin||(e={dataMin:pe(o&&o.min,si("min",s.min,i.dataMin,n.dataMin)),dataMax:pe(o&&o.max,si("max",s.max,i.dataMax,n.dataMax))}),e},setBaseSeries:function(t){var e=this.chart;t=t||e.options.navigator.baseSeries,this.series&&this.series.remove(),this.baseSeries=e.series[t]||"string"==typeof t&&e.get(t)||e.series[0],this.xAxis&&this.addBaseSeries()},addBaseSeries:function(){var t,e,n=this.baseSeries,o=n?n.options:{},s=o.data,r=this.navigatorOptions.series;e=r.data,this.hasNavigatorData=!!e,(t=i(o,r,{enableMouseTracking:!1,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",name:"Navigator",showInLegend:!1,isInternal:!0,visible:!0})).data=e||s,this.series=this.chart.initSeries(t),n&&!1!==this.navigatorOptions.adaptToUpdatedData&&(se(n,"updatedData",this.updatedDataHandler),n.userOptions.events=de(n.userOptions.event,{updatedData:this.updatedDataHandler}))},updatedDataHandler:function(){var t,e,i,n,o,s=this.chart.scroller,r=s.baseSeries,a=r.xAxis,l=a.getExtremes(),h=l.min,c=l.max,d=l.dataMin,p=l.dataMax,u=c-h,f=s.series,g=f.xData,m=!!a.setExtremes;e=c>=g[g.length-1]-(this.closestPointRange||0),t=h<=d,s.hasNavigatorData||(f.options.pointStart=r.xData[0],f.setData(r.options.data,!1),o=!0),t&&(i=(n=d)+u),e&&(i=p,t||(n=yt(i-u,f.xData[0]))),m&&(t||e)?isNaN(n)||a.setExtremes(n,i,!0,!1,{trigger:"updatedData"}):(o&&this.chart.redraw(!1),s.render(yt(h,d),vt(c,p)))},destroy:function(){this.removeEvents(),ee([this.xAxis,this.yAxis,this.leftShade,this.rightShade,this.outline,this.scrollbarTrack,this.scrollbarRifles,this.scrollbarGroup,this.scrollbar],function(t){t&&t.destroy&&t.destroy()}),this.xAxis=this.yAxis=this.leftShade=this.rightShade=this.outline=this.scrollbarTrack=this.scrollbarRifles=this.scrollbarGroup=this.scrollbar=null,ee([this.scrollbarButtons,this.handles,this.elementsToDestroy],function(t){M(t)})}},dt.Scroller=W,ue(we.prototype,"zoom",function(t,e,i){var n,o,s=this.chart,r=s.options,a=r.chart.zoomType,l=r.navigator,h=r.rangeSelector;return this.isXAxis&&(l&&l.enabled||h&&h.enabled)&&("x"===a?s.resetZoomButton="blocked":"y"===a?o=!1:"xy"===a&&(n=this.previousZoom,d(e)?this.previousZoom=[this.min,this.max]:n&&(e=n[0],i=n[1],delete this.previousZoom))),o!==X?o:t.call(this,e,i)}),ue(Ie.prototype,"init",function(t,e,i){se(this,"beforeRender",function(){var t=this.options;(t.navigator.enabled||t.scrollbar.enabled)&&(this.scroller=new W(this))}),t.call(this,e,i)}),ue(ze.prototype,"addPoint",function(t,i,n,o,a){var l=this.options.turboThreshold;l&&this.xData.length>l&&s(i)&&!r(i)&&this.chart.scroller&&e(20,!0),t.call(this,i,n,o,a)}),de(N,{rangeSelector:{buttonTheme:{width:28,height:18,fill:"#f7f7f7",padding:2,r:0,"stroke-width":0,style:{color:"#444",cursor:"pointer",fontWeight:"normal"},zIndex:7,states:{hover:{fill:"#e7e7e7"},select:{fill:"#e7f0f9",style:{color:"black",fontWeight:"bold"}}}},height:35,inputPosition:{align:"right"},labelStyle:{color:"#666"}}}),N.lang=i(N.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"}),H.prototype={clickButton:function(t,e){var i,n,o,s,r,a,l,h,c=this,d=c.selected,p=c.chart,u=c.buttons,f=c.buttonOptions[t],g=p.xAxis[0],m=p.scroller&&p.scroller.getUnionExtremes()||g||{},x=m.dataMin,y=m.dataMax,v=g&&gt(vt(g.max,pe(y,g.max))),b=f.type,k=f._range,w=f.dataGrouping;if(null!==x&&null!==y&&t!==c.selected){if(p.fixedRange=k,w&&(this.forcedDataGrouping=!0,we.prototype.setDataGrouping.call(g||{chart:this.chart},w,!1)),"month"===b||"year"===b)g?(h={range:f,max:v,dataMin:x,dataMax:y},i=g.minFromRange.call(h),"number"==typeof h.newMax&&(v=h.newMax)):k=f;else if(k)i=yt(v-k,x),v=vt(i+k,y);else if("ytd"===b){if(!g)return void se(p,"beforeRender",function(){c.clickButton(t)});y===X&&(x=Number.MAX_VALUE,y=Number.MIN_VALUE,ee(p.series,function(t){var e=t.xData;x=vt(e[0],x),y=yt(e[e.length-1],y)}),e=!1),r=(n=new Z(y)).getFullYear(),i=s=yt(x||0,Z.UTC(r,0,1)),n=n.getTime(),v=vt(y||n,n)}else"all"===b&&g&&(i=x,v=y);u[d]&&u[d].setState(0),u[t]&&(u[t].setState(2),c.lastSelected=t),g?(g.setExtremes(i,v,pe(e,1),0,{trigger:"rangeSelectorButton",rangeSelectorButton:f}),c.setSelected(t)):(o=p.options.xAxis[0],l=o.range,o.range=k,a=o.min,o.min=s,c.setSelected(t),se(p,"load",function(){o.range=l,o.min=a}))}},setSelected:function(t){this.selected=this.options.selected=t},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(t){var e=this,i=t.options.rangeSelector,n=i.buttons||[].concat(e.defaultButtons),o=i.selected,s=e.blurInputs=function(){var t=e.minInput,i=e.maxInput;t&&t.blur&&ae(t,"blur"),i&&i.blur&&ae(i,"blur")};e.chart=t,e.options=i,e.buttons=[],t.extraTopMargin=i.height,e.buttonOptions=n,se(t.container,"mousedown",s),se(t,"resize",s),ee(n,e.computeButtonRange),o!==X&&n[o]&&this.clickButton(o,!1),se(t,"load",function(){se(t.xAxis[0],"setExtremes",function(i){this.max-this.min!==t.fixedRange&&"rangeSelectorButton"!==i.trigger&&"updatedData"!==i.trigger&&e.forcedDataGrouping&&this.setDataGrouping(!1,!1)}),se(t.xAxis[0],"afterSetExtremes",function(){e.updateButtonStates(!0)})})},updateButtonStates:function(t){var e=this,i=this.chart,n=i.xAxis[0],o=i.scroller&&i.scroller.getUnionExtremes()||n,s=o.dataMin,r=o.dataMax,a=e.selected,l=e.options.allButtonsEnabled,h=e.buttons;t&&i.fixedRange!==gt(n.max-n.min)&&(h[a]&&h[a].setState(0),e.setSelected(null)),ee(e.buttonOptions,function(t,o){var c=gt(n.max-n.min),d=t._range,p=t.type,u=t.count||1,f=d>r-s,g=d<n.minRange,m="all"===t.type&&n.max-n.min>=r-s&&2!==h[o].state,x="ytd"===t.type&&V("%Y",s)===V("%Y",r),y=i.renderer.forExport&&o===a,v=d===c,b=!n.hasVisibleSeries;("month"===p||"year"===p)&&c>=24*{month:28,year:365}[p]*36e5*u&&c<=24*{month:31,year:366}[p]*36e5*u&&(v=!0),y||v&&o!==a&&o===e.lastSelected?(e.setSelected(o),h[o].setState(2)):!l&&(f||g||m||x||b)?h[o].setState(3):3===h[o].state&&h[o].setState(0)})},computeButtonRange:function(t){var e=t.type,i=t.count||1,n={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5};n[e]?t._range=n[e]*i:"month"!==e&&"year"!==e||(t._range=24*{month:30,year:365}[e]*36e5*i)},setInputValue:function(t,e){var i=this.chart.options.rangeSelector;d(e)&&(this[t+"Input"].HCTime=e),this[t+"Input"].value=V(i.inputEditDateFormat||"%Y-%m-%d",this[t+"Input"].HCTime),this[t+"DateBox"].attr({text:V(i.inputDateFormat||"%b %e, %Y",this[t+"Input"].HCTime)})},showInput:function(t){var e=this.inputGroup,i=this[t+"DateBox"];g(this[t+"Input"],{left:e.translateX+i.x+Ut,top:e.translateY+Ut,width:i.width-2+Ut,height:i.height-2+Ut,border:"2px solid silver"})},hideInput:function(t){g(this[t+"Input"],{border:0,width:"1px",height:"1px"}),this.setInputValue(t)},drawInput:function(t){var e,o,s,r=this,a=r.chart,l=a.renderer.style,h=a.renderer,c=a.options.rangeSelector,d=N.lang,p=r.div,u="min"===t,f=this.inputGroup;this[t+"Label"]=o=h.label(d[u?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).attr({padding:2}).css(i(l,c.labelStyle)).add(f),f.offset+=o.width+5,this[t+"DateBox"]=s=h.label("",f.offset).attr({padding:2,width:c.inputBoxWidth||90,height:c.inputBoxHeight||17,stroke:c.inputBoxBorderColor||"silver","stroke-width":1}).css(i({textAlign:"center",color:"#444"},l,c.inputStyle)).on("click",function(){r.showInput(t),r[t+"Input"].focus()}).add(f),f.offset+=s.width+(u?10:0),this[t+"Input"]=e=m("input",{name:t,className:Vt+"range-selector",type:"text"},de({position:Ft,border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:l.fontSize,fontFamily:l.fontFamily,top:a.plotTop+Ut},c.inputStyle),p),e.onfocus=function(){r.showInput(t)},e.onblur=function(){r.hideInput(t)},e.onchange=function(){var t=e.value,i=(c.inputDateParser||Z.parse)(t),o=a.xAxis[0],s=o.dataMin,l=o.dataMax;isNaN(i)&&(i=t.split("-"),i=Z.UTC(n(i[0]),n(i[1])-1,n(i[2]))),isNaN(i)||(N.global.useUTC||(i+=60*(new Z).getTimezoneOffset()*1e3),u?i>r.maxInput.HCTime?i=X:i<s&&(i=s):i<r.minInput.HCTime?i=X:i>l&&(i=l),i!==X&&a.xAxis[0].setExtremes(u?i:o.min,u?o.max:i,X,X,{trigger:"rangeSelectorInput"}))}},getPosition:function(){var t=this.chart,e=t.options.rangeSelector,i=pe((e.buttonPosition||{}).y,t.plotTop-t.axisOffset[0]-e.height);return{buttonTop:i,inputTop:i-10}},render:function(t,e){var i,n,o=this,s=o.chart,r=s.renderer,a=s.container,l=s.options,h=l.exporting&&l.navigation&&l.navigation.buttonOptions,c=l.rangeSelector,p=o.buttons,u=N.lang,f=o.div,g=o.inputGroup,x=c.buttonTheme,y=c.buttonPosition||{},v=c.inputEnabled,b=x&&x.states,k=s.plotLeft,w=this.getPosition(),A=o.group,S=o.rendered;S||(o.group=A=r.g("range-selector-buttons").add(),o.zoomText=r.text(u.rangeSelectorZoom,pe(y.x,k),15).css(c.labelStyle).add(A),i=pe(y.x,k)+o.zoomText.getBBox().width+5,ee(o.buttonOptions,function(t,e){p[e]=r.button(t.text,i,0,function(){o.clickButton(e),o.isActive=!0},x,b&&b.hover,b&&b.select,b&&b.disabled).css({textAlign:"center"}).add(A),i+=p[e].width+pe(c.buttonSpacing,5),o.selected===e&&p[e].setState(2)}),o.updateButtonStates(),!1!==v&&(o.div=f=m("div",null,{position:"relative",height:0,zIndex:1}),a.parentNode.insertBefore(f,a),o.inputGroup=g=r.g("input-group").add(),g.offset=0,o.drawInput("min"),o.drawInput("max"))),A[S?"animate":"attr"]({translateY:w.buttonTop}),!1!==v&&(g.align(de({y:w.inputTop,width:g.offset,x:h&&w.inputTop<(h.y||0)+h.height-s.spacing[0]?-40:0},c.inputPosition),!0,s.spacingBox),d(v)||(n=A.getBBox(),g[g.translateX<n.x+n.width+10?"hide":"show"]()),o.setInputValue("min",t),o.setInputValue("max",e)),o.rendered=!0},destroy:function(){var t,e=this.minInput,i=this.maxInput,n=this.chart,o=this.blurInputs;for(t in re(n.container,"mousedown",o),re(n,"resize",o),M(this.buttons),e&&(e.onfocus=e.onblur=e.onchange=null),i&&(i.onfocus=i.onblur=i.onchange=null),this)this[t]&&"chart"!==t&&(this[t].destroy?this[t].destroy():this[t].nodeType&&L(this[t])),this[t]=null}},we.prototype.toFixedRange=function(t,e,i,n){var o=this.chart&&this.chart.fixedRange,s=pe(i,this.translate(t,!0)),r=pe(n,this.translate(e,!0)),a=o&&(r-s)/o;return a>.7&&a<1.3&&(n?s=r-o:r=s+o),isNaN(s)&&(s=r=void 0),{min:s,max:r}},we.prototype.minFromRange=function(){var t,e,i,n=this.range,o={month:"Month",year:"FullYear"}[n.type],s=this.max,r=function(t,e){var i=new Z(t);return i["set"+o](i["get"+o]()+e),i.getTime()-t};return"number"==typeof n?(t=this.max-n,i=n):t=s+r(s,-n.count),e=pe(this.dataMin,Number.MIN_VALUE),isNaN(t)&&(t=e),t<=e&&(t=e,void 0===i&&(i=r(t,n.count)),this.newMax=vt(t+i,this.dataMax)),isNaN(s)&&(t=void 0),t},ue(Ie.prototype,"init",function(t,e,i){se(this,"init",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new H(this))}),t.call(this,e,i)}),dt.RangeSelector=H,Ie.prototype.callbacks.push(function(t){function e(){s=t.xAxis[0].getExtremes(),r.render(s.min,s.max)}function i(){s=t.xAxis[0].getExtremes(),isNaN(s.min)||a.render(s.min,s.max)}function n(t){"navigator-drag"!==t.triggerOp&&r.render(t.min,t.max)}function o(t){a.render(t.min,t.max)}var s,r=t.scroller,a=t.rangeSelector;r&&(se(t.xAxis[0],"afterSetExtremes",n),ue(t,"drawChartBox",function(t){var i=this.isDirtyBox;t.call(this),i&&e()}),e()),a&&(se(t.xAxis[0],"afterSetExtremes",o),se(t,"resize",i),i()),se(t,"destroy",function(){r&&re(t.xAxis[0],"afterSetExtremes",n),a&&(re(t,"resize",i),re(t.xAxis[0],"afterSetExtremes",o))})}),dt.StockChart=function(t,e){var n=t.series,o=pe(t.navigator&&t.navigator.enabled,!0)?{startOnTick:!1,endOnTick:!1}:null,s={marker:{enabled:!1,radius:2}},r={shadow:!1,borderWidth:0};return t.xAxis=oe(u(t.xAxis||{}),function(t){return i({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},t,{type:"datetime",categories:null},o)}),t.yAxis=oe(u(t.yAxis||{}),function(t){return i({labels:{y:-2},opposite:pe(t.opposite,!0),showLastLabel:!1,title:{text:null}},t)}),t.series=null,(t=i({chart:{panning:!0,pinchType:"x"},navigator:{enabled:!0},scrollbar:{enabled:!0},rangeSelector:{enabled:!0},title:{text:null,style:{fontSize:"16px"}},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:s,spline:s,area:s,areaspline:s,arearange:s,areasplinerange:s,column:r,columnrange:r,candlestick:r,ohlc:r}},t,{_stock:!0,chart:{inverted:!1}})).series=n,new Ie(t,e)},ue(Te.prototype,"init",function(t,e,i){var n=i.chart.pinchType||"";t.call(this,e,i),this.pinchX=this.pinchHor=-1!==n.indexOf("x"),this.pinchY=this.pinchVert=-1!==n.indexOf("y"),this.hasZoom=this.hasZoom||this.pinchHor||this.pinchVert}),ue(we.prototype,"autoLabelAlign",function(t){var e,i=this.chart,n=this.options,o=i._labelPanes=i._labelPanes||{},s=this.options.labels;return this.chart.options._stock&&"yAxis"===this.coll&&!o[e=n.top+","+n.height]&&s.enabled?(15===s.x&&(s.x=0),void 0===s.align&&(s.align="right"),o[e]=1,"right"):t.call(this,[].slice.call(arguments,1))}),ue(we.prototype,"getPlotLinePath",function(t,e,i,n,o,s){var r,a,l,h,c,p,u,f=this,g=this.isLinked&&!this.series?this.linkedParent.series:this.series,m=f.chart,x=m.renderer,y=f.left,v=f.top,b=[],k=[];return"colorAxis"===f.coll?t.apply(this,[].slice.call(arguments,1)):(k=f.isXAxis?d(f.options.yAxis)?[m.yAxis[f.options.yAxis]]:oe(g,function(t){return t.yAxis}):d(f.options.xAxis)?[m.xAxis[f.options.xAxis]]:oe(g,function(t){return t.xAxis}),c=f.isXAxis?m.yAxis:m.xAxis,ee(c,function(t){if(!d(t.options.id)||-1===t.options.id.indexOf("navigator")){var e=t.isXAxis?"yAxis":"xAxis",i=d(t.options[e])?m[e][t.options[e]]:m[e][0];f===i&&k.push(t)}}),p=k.length?[]:[f.isXAxis?m.yAxis[0]:m.xAxis[0]],ee(k,function(t){-1===te(t,p)&&p.push(t)}),u=pe(s,f.translate(e,null,null,n)),isNaN(u)||(f.horiz?ee(p,function(t){var e;a=t.pos,h=a+t.len,((r=l=gt(u+f.transB))<y||r>y+f.width)&&(o?r=l=vt(yt(y,r),y+f.width):e=!0),e||b.push("M",r,a,"L",l,h)}):ee(p,function(t){var e;r=t.pos,l=r+t.len,((a=h=gt(v+f.height-u))<v||a>v+f.height)&&(o?a=h=vt(yt(v,a),f.top+f.height):e=!0),e||b.push("M",r,a,"L",l,h)})),b.length>0?x.crispPolyLine(b,i||1):null)}),we.prototype.getPlotBandPath=function(t,e){var i,n=this.getPlotLinePath(e,null,null,!0),o=this.getPlotLinePath(t,null,null,!0),s=[];if(o&&n&&o.toString()!==n.toString())for(i=0;i<o.length;i+=6)s.push("M",o[i+1],o[i+2],"L",o[i+4],o[i+5],n[i+4],n[i+5],n[i+1],n[i+2]);else s=null;return s},be.prototype.crispPolyLine=function(t,e){var i;for(i=0;i<t.length;i+=6)t[i+1]===t[i+4]&&(t[i+1]=t[i+4]=gt(t[i+1])-e%2/2),t[i+2]===t[i+5]&&(t[i+2]=t[i+5]=gt(t[i+2])+e%2/2);return t},G===dt.VMLRenderer&&(me.prototype.crispPolyLine=be.prototype.crispPolyLine),ue(we.prototype,"hideCrosshair",function(t,e){t.call(this,e),this.crossLabel&&(this.crossLabel=this.crossLabel.hide())}),ue(we.prototype,"drawCrosshair",function(t,e,i){if(t.call(this,e,i),d(this.crosshair.label)&&this.crosshair.label.enabled){var n,o,s,r,a,l,h=this.chart,c=this.options.crosshair.label,p=this.horiz,u=this.opposite,f=this.left,g=this.top,m=this.crossLabel,x=c.format,y="",v="inside"===this.options.tickPosition,b=!1!==this.crosshair.snap;a=p?"center":u?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center",m||(m=this.crossLabel=h.renderer.label(null,null,null,c.shape||"callout").attr({align:c.align||a,zIndex:12,fill:c.backgroundColor||this.series[0]&&this.series[0].color||"gray",padding:pe(c.padding,8),stroke:c.borderColor||"","stroke-width":c.borderWidth||0,r:pe(c.borderRadius,3)}).css(de({color:"white",fontWeight:"normal",fontSize:"11px",textAlign:"center"},c.style)).add()),p?(n=b?i.plotX+f:e.chartX,o=g+(u?0:this.height)):(n=u?this.width+f:0,o=b?i.plotY+g:e.chartY),x||c.formatter||(this.isDatetimeAxis&&(y="%b %d, %Y"),x="{value"+(y?":"+y:"")+"}"),l=b?i[this.isXAxis?"x":"y"]:this.toValue(p?e.chartX:e.chartY),m.attr({text:x?w(x,{value:l}):c.formatter.call(this,l),anchorX:p?n:this.opposite?0:h.chartWidth,anchorY:p?this.opposite?h.chartHeight:0:o,x:n,y:o,visibility:_t}),s=m.getBBox(),p?(v&&!u||!v&&u)&&(o=m.y-s.height):o=m.y-s.height/2,r=p?{left:f-s.x,right:f+this.width-s.x}:{left:"left"===this.labelAlign?f:0,right:"right"===this.labelAlign?f+this.width:h.chartWidth},m.translateX<r.left&&(n+=r.left-m.translateX),m.translateX+s.width>=r.right&&(n-=m.translateX+s.width-r.right),m.attr({x:n,y:o,visibility:"visible"})}});var ri=Ue.init,ai=Ue.processData,li=Oe.prototype.tooltipFormatter;return Ue.init=function(){ri.apply(this,arguments),this.setCompare(this.options.compare)},Ue.setCompare=function(t){this.modifyValue="value"===t||"percent"===t?function(e,i){var n=this.compareValue;return e!==X&&(e="value"===t?e-n:e=e/n*100-100,i&&(i.change=e)),e}:null,this.chart.hasRendered&&(this.isDirty=!0)},Ue.processData=function(){var t,e,i,n;if(ai.apply(this,arguments),this.xAxis&&this.processedYData)for(e=this.processedXData,n=(i=this.processedYData).length,t=0;t<n;t++)if("number"==typeof i[t]&&e[t]>=this.xAxis.min){this.compareValue=i[t];break}},ue(Ue,"getExtremes",function(t){var e;t.apply(this,[].slice.call(arguments,1)),this.modifyValue&&(e=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)],this.dataMin=P(e),this.dataMax=C(e))}),we.prototype.setCompare=function(t,e){this.isXAxis||(ee(this.series,function(e){e.setCompare(t)}),pe(e,!0)&&this.chart.redraw())},Oe.prototype.tooltipFormatter=function(t){return t=t.replace("{point.change}",(this.change>0?"+":"")+dt.numberFormat(this.change,pe(this.series.tooltipOptions.changeDecimals,2))),li.apply(this,[t])},ue(ze.prototype,"render",function(t){this.chart.options._stock&&this.xAxis&&(!this.clipBox&&this.animate?(this.clipBox=i(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]&&(ce(this.chart[this.sharedClipKey]),this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len}))),t.call(this)}),de(dt,{Color:O,Point:Oe,Tick:R,Renderer:G,SVGElement:z,SVGRenderer:be,arrayMin:P,arrayMax:C,charts:Xt,dateFormat:V,error:e,format:w,pathAnim:_,getOptions:function(){return N},hasBidiBug:zt,isTouchDevice:It,setOptions:function(t){return N=i(!0,N,t),B(),N},addEvent:se,removeEvent:re,createElement:m,discardElement:L,css:g,each:ee,map:oe,merge:i,splat:u,stableSort:T,extendClass:x,pInt:n,svg:Ot,canvas:Rt,vml:!Ot&&!Rt,product:"Highstock",version:"2.1.10"}),dt});
;Dependency._js['lib/highcharts/highstock']=true;

;
!function(t){"object"==typeof module&&module.exports?module.exports=t:t(Highcharts)}(function(t){function i(t,i,a){this.init(t,i,a)}var a=t.arrayMin,e=t.arrayMax,o=t.each,n=t.extend,r=t.merge,s=t.map,l=t.pick,h=t.pInt,p=t.getOptions().plotOptions,c=t.seriesTypes,d=t.extendClass,u=t.splat,g=t.wrap,m=t.Axis,f=t.Tick,y=t.Point,b=t.Pointer,x=t.CenteredSeriesMixin,P=t.TrackerMixin,A=t.Series,w=Math,v=w.round,M=w.floor,L=w.max,k=t.Color,C=function(){};n(i.prototype,{init:function(t,i,a){var e,n=this,s=n.defaultOptions;n.chart=i,n.options=t=r(s,i.angular?{background:{}}:void 0,t),(e=t.background)&&o([].concat(u(e)).reverse(),function(t){var i=t.backgroundColor,e=a.userOptions;t=r(n.defaultBackgroundOptions,t),i&&(t.backgroundColor=i),t.color=t.backgroundColor,a.options.plotBands.unshift(t),e.plotBands=e.plotBands||[],e.plotBands!==a.options.plotBands&&e.plotBands.unshift(t)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{shape:"circle",borderWidth:1,borderColor:"silver",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FFF"],[1,"#DDD"]]},from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});var S,T=m.prototype,Y=f.prototype,X={getOffset:C,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=!1},setScale:C,setCategories:C,setTitle:C},R={isRadial:!0,defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(t){var i=this.options=r(this.defaultOptions,this.defaultRadialOptions,t);i.plotBands||(i.plotBands=[])},getOffset:function(){T.getOffset.call(this),this.chart.axisOffset[this.side]=0,this.center=this.pane.center=x.getCenter.call(this.pane)},getLinePath:function(t,i){var a=this.center;return i=l(i,a[2]/2-this.offset),this.chart.renderer.symbols.arc(this.left+a[0],this.top+a[1],i,i,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0})},setAxisTranslation:function(){T.setAxisTranslation.call(this),this.center&&(this.isCircular?this.transA=(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.transA=this.center[2]/2/(this.max-this.min||1),this.isXAxis?this.minPixelPadding=this.transA*this.minPointOffset:this.minPixelPadding=0)},beforeSetTickPositions:function(){this.autoConnect&&(this.max+=(this.categories?1:this.pointRange)||this.closestPointRange||0)},setAxisSize:function(){T.setAxisSize.call(this),this.isRadial&&(this.center=this.pane.center=t.CenteredSeriesMixin.getCenter.call(this.pane),this.isCircular&&(this.sector=this.endAngleRad-this.startAngleRad),this.len=this.width=this.height=this.center[2]*l(this.sector,1)/2)},getPosition:function(t,i){return this.postTranslate(this.isCircular?this.translate(t):0,l(this.isCircular?i:this.translate(t),this.center[2]/2)-this.offset)},postTranslate:function(t,i){var a=this.chart,e=this.center;return t=this.startAngleRad+t,{x:a.plotLeft+e[0]+Math.cos(t)*i,y:a.plotTop+e[1]+Math.sin(t)*i}},getPlotBandPath:function(t,i,a){var e,o,n,r,p=this.center,c=this.startAngleRad,d=p[2]/2,u=[l(a.outerRadius,"100%"),a.innerRadius,l(a.thickness,10)],g=/%$/,m=this.isCircular;return"polygon"===this.options.gridLineInterpolation?r=this.getPlotLinePath(t).concat(this.getPlotLinePath(i,!0)):(t=Math.max(t,this.min),i=Math.min(i,this.max),m||(u[0]=this.translate(t),u[1]=this.translate(i)),u=s(u,function(t){return g.test(t)&&(t=h(t,10)*d/100),t}),"circle"!==a.shape&&m?(e=c+this.translate(t),o=c+this.translate(i)):(e=-Math.PI/2,o=1.5*Math.PI,n=!0),r=this.chart.renderer.symbols.arc(this.left+p[0],this.top+p[1],u[0],u[0],{start:Math.min(e,o),end:Math.max(e,o),innerR:l(u[1],u[0]-u[2]),open:n})),r},getPlotLinePath:function(t,i){var a,e,n,r,s=this,l=s.center,h=s.chart,p=s.getPosition(t);return s.isCircular?r=["M",l[0]+h.plotLeft,l[1]+h.plotTop,"L",p.x,p.y]:"circle"===s.options.gridLineInterpolation?(t=s.translate(t))&&(r=s.getLinePath(0,t)):(o(h.xAxis,function(t){t.pane===s.pane&&(a=t)}),r=[],t=s.translate(t),n=a.tickPositions,a.autoConnect&&(n=n.concat([n[0]])),i&&(n=[].concat(n).reverse()),o(n,function(i,o){e=a.getPosition(i,t),r.push(o?"L":"M",e.x,e.y)})),r},getTitlePosition:function(){var t=this.center,i=this.chart,a=this.options.title;return{x:i.plotLeft+t[0]+(a.x||0),y:i.plotTop+t[1]-{high:.5,middle:.25,low:0}[a.align]*t[2]+(a.y||0)}}};g(T,"init",function(t,a,e){var o,s,h,p,c,d,g=a.angular,m=a.polar,f=e.isX,y=g&&f,b=a.options,x=e.pane||0;g?(n(this,y?X:R),(o=!f)&&(this.defaultRadialOptions=this.defaultRadialGaugeOptions)):m&&(n(this,R),o=f,this.defaultRadialOptions=f?this.defaultRadialXOptions:r(this.defaultYAxisOptions,this.defaultRadialYOptions)),t.call(this,a,e),y||!g&&!m||(p=this.options,a.panes||(a.panes=[]),this.pane=c=a.panes[x]=a.panes[x]||new i(u(b.pane)[x],a,this),d=c.options,a.inverted=!1,b.chart.zoomType=null,this.startAngleRad=s=(d.startAngle-90)*Math.PI/180,this.endAngleRad=h=(l(d.endAngle,d.startAngle+360)-90)*Math.PI/180,this.offset=p.offset||0,this.isCircular=o,o&&void 0===e.max&&h-s==2*Math.PI&&(this.autoConnect=!0))}),g(Y,"getPosition",function(t,i,a,e,o){var n=this.axis;return n.getPosition?n.getPosition(a):t.call(this,i,a,e,o)}),g(Y,"getLabelPosition",function(t,i,a,e,o,n,r,s,h){var p,c=this.axis,d=n.y,u=20,g=n.align,m=(c.translate(this.pos)+c.startAngleRad+Math.PI/2)/Math.PI*180%360;return c.isRadial?(p=c.getPosition(this.pos,c.center[2]/2+l(n.distance,-25)),"auto"===n.rotation?e.attr({rotation:m}):null===d&&(d=c.chart.renderer.fontMetrics(e.styles.fontSize).b-e.getBBox().height/2),null===g&&(c.isCircular?(this.label.getBBox().width>c.len*c.tickInterval/(c.max-c.min)&&(u=0),g=m>u&&m<180-u?"left":m>180+u&&m<360-u?"right":"center"):g="center",e.attr({align:g})),p.x+=n.x,p.y+=d):p=t.call(this,i,a,e,o,n,r,s,h),p}),g(Y,"getMarkPath",function(t,i,a,e,o,n,r){var s,l=this.axis;return l.isRadial?["M",i,a,"L",(s=l.getPosition(this.pos,l.center[2]/2+e)).x,s.y]:t.call(this,i,a,e,o,n,r)}),p.arearange=r(p.area,{lineWidth:1,marker:null,threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},trackByArea:!0,dataLabels:{align:null,verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}}),c.arearange=d(c.area,{type:"arearange",pointArrayMap:["low","high"],dataLabelCollections:["dataLabel","dataLabelUpper"],toYData:function(t){return[t.low,t.high]},pointValKey:"low",deferTranslatePolar:!0,highToXY:function(t){var i=this.chart,a=this.xAxis.postTranslate(t.rectPlotX,this.yAxis.len-t.plotHigh);t.plotHighX=a.x-i.plotLeft,t.plotHigh=a.y-i.plotTop},getSegments:function(){var t=this;o(t.points,function(i){t.options.connectNulls||null!==i.low&&null!==i.high?null===i.low&&null!==i.high&&(i.y=i.high):i.y=null}),A.prototype.getSegments.call(this)},translate:function(){var t=this,i=t.yAxis;c.area.prototype.translate.apply(t),o(t.points,function(t){var a=t.low,e=t.high,o=t.plotY;null===e&&null===a?t.y=null:null===a?(t.plotLow=t.plotY=null,t.plotHigh=i.translate(e,0,1,0,1)):null===e?(t.plotLow=o,t.plotHigh=null):(t.plotLow=o,t.plotHigh=i.translate(e,0,1,0,1))}),this.chart.polar&&o(this.points,function(i){t.highToXY(i)})},getSegmentPath:function(i){var a,e,o,n,r,s=[],l=i.length,h=A.prototype.getSegmentPath,p=this.options,c=p.step;for(a=t.grep(i,function(t){return null!==t.plotLow});l--;)null!==(e=i[l]).plotHigh&&s.push({plotX:e.plotHighX||e.plotX,plotY:e.plotHigh});return n=h.call(this,a),c&&(!0===c&&(c="left"),p.step={left:"right",center:"center",right:"left"}[c]),r=h.call(this,s),p.step=c,o=[].concat(n,r),this.chart.polar||(r[0]="L"),this.areaPath=this.areaPath.concat(n,r),o},drawDataLabels:function(){var t,i,a,e=this.data,o=e.length,n=[],r=A.prototype,s=this.options.dataLabels,l=s.align,h=s.verticalAlign,p=s.inside,c=this.chart.inverted;if(s.enabled||this._hasPointLabels){for(t=o;t--;)(i=e[t])&&(a=p?i.plotHigh<i.plotLow:i.plotHigh>i.plotLow,i.y=i.high,i._plotY=i.plotY,i.plotY=i.plotHigh,n[t]=i.dataLabel,i.dataLabel=i.dataLabelUpper,i.below=a,c?l||(s.align=a?"right":"left"):h||(s.verticalAlign=a?"top":"bottom"),s.x=s.xHigh,s.y=s.yHigh);for(r.drawDataLabels&&r.drawDataLabels.apply(this,arguments),t=o;t--;)(i=e[t])&&(a=p?i.plotHigh<i.plotLow:i.plotHigh>i.plotLow,i.dataLabelUpper=i.dataLabel,i.dataLabel=n[t],i.y=i.low,i.plotY=i._plotY,i.below=!a,c?l||(s.align=a?"left":"right"):h||(s.verticalAlign=a?"bottom":"top"),s.x=s.xLow,s.y=s.yLow);r.drawDataLabels&&r.drawDataLabels.apply(this,arguments)}s.align=l,s.verticalAlign=h},alignDataLabel:function(){c.column.prototype.alignDataLabel.apply(this,arguments)},setStackedPoints:C,getSymbol:C,drawPoints:C}),p.areasplinerange=r(p.arearange),c.areasplinerange=d(c.arearange,{type:"areasplinerange",getPointSpline:c.spline.prototype.getPointSpline}),S=c.column.prototype,p.columnrange=r(p.column,p.arearange,{lineWidth:1,pointRange:null}),c.columnrange=d(c.arearange,{type:"columnrange",translate:function(){var t,i=this,a=i.yAxis;S.translate.apply(i),o(i.points,function(e){var o,n,r,s=e.shapeArgs,l=i.options.minPointLength;e.tooltipPos=null,e.plotHigh=t=a.translate(e.high,0,1,0,1),e.plotLow=e.plotY,r=t,n=e.plotY-t,Math.abs(n)<l?(n+=o=l-n,r-=o/2):n<0&&(r-=n*=-1),s.height=n,s.y=r})},directTouch:!0,trackerGroups:["group","dataLabelsGroup"],drawGraph:C,crispCol:S.crispCol,pointAttrToOptions:S.pointAttrToOptions,drawPoints:S.drawPoints,drawTracker:S.drawTracker,animate:S.animate,getColumnMetrics:S.getColumnMetrics}),p.gauge=r(p.line,{dataLabels:{enabled:!0,defer:!1,y:15,borderWidth:1,borderColor:"silver",borderRadius:3,crop:!1,verticalAlign:"top",zIndex:2},dial:{},pivot:{},tooltip:{headerFormat:""},showInLegend:!1});var z={type:"gauge",pointClass:d(y,{setState:function(t){this.state=t}}),angular:!0,drawGraph:C,fixedBox:!0,forceDL:!0,trackerGroups:["group","dataLabelsGroup"],translate:function(){var t=this.yAxis,i=this.options,a=t.center;this.generatePoints(),o(this.points,function(e){var o=r(i.dial,e.dial),n=h(l(o.radius,80))*a[2]/200,s=h(l(o.baseLength,70))*n/100,p=h(l(o.rearLength,10))*n/100,c=o.baseWidth||3,d=o.topWidth||1,u=i.overshoot,g=t.startAngleRad+t.translate(e.y,null,null,null,!0);u&&"number"==typeof u?(u=u/180*Math.PI,g=Math.max(t.startAngleRad-u,Math.min(t.endAngleRad+u,g))):!1===i.wrap&&(g=Math.max(t.startAngleRad,Math.min(t.endAngleRad,g))),g=180*g/Math.PI,e.shapeType="path",e.shapeArgs={d:o.path||["M",-p,-c/2,"L",s,-c/2,n,-d/2,n,d/2,s,c/2,-p,c/2,"z"],translateX:a[0],translateY:a[1],rotation:g},e.plotX=a[0],e.plotY=a[1]})},drawPoints:function(){var t=this,i=t.yAxis.center,a=t.pivot,e=t.options,n=e.pivot,s=t.chart.renderer;o(t.points,function(i){var a=i.graphic,o=i.shapeArgs,n=o.d,l=r(e.dial,i.dial);a?(a.animate(o),o.d=n):i.graphic=s[i.shapeType](o).attr({stroke:l.borderColor||"none","stroke-width":l.borderWidth||0,fill:l.backgroundColor||"black",rotation:o.rotation,zIndex:1}).add(t.group)}),a?a.animate({translateX:i[0],translateY:i[1]}):t.pivot=s.circle(0,0,l(n.radius,5)).attr({"stroke-width":n.borderWidth||0,stroke:n.borderColor||"silver",fill:n.backgroundColor||"black",zIndex:2}).translate(i[0],i[1]).add(t.group)},animate:function(t){var i=this;t||(o(i.points,function(t){var a=t.graphic;a&&(a.attr({rotation:180*i.yAxis.startAngleRad/Math.PI}),a.animate({rotation:t.shapeArgs.rotation},i.options.animation))}),i.animate=null)},render:function(){this.group=this.plotGroup("group","series",this.visible?"visible":"hidden",this.options.zIndex,this.chart.seriesGroup),A.prototype.render.call(this),this.group.clip(this.chart.clipRect)},setData:function(t,i){A.prototype.setData.call(this,t,!1),this.processData(),this.generatePoints(),l(i,!0)&&this.chart.redraw()},drawTracker:P&&P.drawTrackerPoint};c.gauge=d(c.line,z),p.boxplot=r(p.column,{fillColor:"#FFFFFF",lineWidth:1,medianWidth:2,states:{hover:{brightness:-.3}},threshold:null,tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},whiskerLength:"50%",whiskerWidth:2}),c.boxplot=d(c.column,{type:"boxplot",pointArrayMap:["low","q1","median","q3","high"],toYData:function(t){return[t.low,t.q1,t.median,t.q3,t.high]},pointValKey:"high",pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth"},drawDataLabels:C,translate:function(){var t=this.yAxis,i=this.pointArrayMap;c.column.prototype.translate.apply(this),o(this.points,function(a){o(i,function(i){null!==a[i]&&(a[i+"Plot"]=t.translate(a[i],0,1,0,1))})})},drawPoints:function(){var t,i,a,e,n,r,s,h,p,c,d,u,g,m,f,y,b,x,P,A,w,L,k,C=this,S=C.points,T=C.options,Y=C.chart.renderer,X=!1!==C.doQuartiles,R=C.options.whiskerLength;o(S,function(o){p=o.graphic,w=o.shapeArgs,d={},m={},y={},L=o.color||C.color,void 0!==o.plotY&&(t=o.pointAttr[o.selected?"selected":""],b=w.width,x=M(w.x),P=x+b,A=v(b/2),i=M(X?o.q1Plot:o.lowPlot),a=M(X?o.q3Plot:o.lowPlot),e=M(o.highPlot),n=M(o.lowPlot),d.stroke=o.stemColor||T.stemColor||L,d["stroke-width"]=l(o.stemWidth,T.stemWidth,T.lineWidth),d.dashstyle=o.stemDashStyle||T.stemDashStyle,m.stroke=o.whiskerColor||T.whiskerColor||L,m["stroke-width"]=l(o.whiskerWidth,T.whiskerWidth,T.lineWidth),y.stroke=o.medianColor||T.medianColor||L,y["stroke-width"]=l(o.medianWidth,T.medianWidth,T.lineWidth),s=d["stroke-width"]%2/2,c=["M",h=x+A+s,a,"L",h,e,"M",h,i,"L",h,n],X&&(s=t["stroke-width"]%2/2,h=M(h)+s,i=M(i)+s,a=M(a)+s,u=["M",x+=s,a,"L",x,i,"L",P+=s,i,"L",P,a,"L",x,a,"z"]),R&&(s=m["stroke-width"]%2/2,e+=s,n+=s,k=/%$/.test(R)?A*parseFloat(R)/100:R/2,g=["M",h-k,e,"L",h+k,e,"M",h-k,n,"L",h+k,n]),s=y["stroke-width"]%2/2,r=v(o.medianPlot)+s,f=["M",x,r,"L",P,r],p?(o.stem.animate({d:c}),R&&o.whiskers.animate({d:g}),X&&o.box.animate({d:u}),o.medianShape.animate({d:f})):(o.graphic=p=Y.g().add(C.group),o.stem=Y.path(c).attr(d).add(p),R&&(o.whiskers=Y.path(g).attr(m).add(p)),X&&(o.box=Y.path(u).attr(t).add(p)),o.medianShape=Y.path(f).attr(y).add(p)))})},setStackedPoints:C}),p.errorbar=r(p.boxplot,{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},whiskerWidth:null}),c.errorbar=d(c.boxplot,{type:"errorbar",pointArrayMap:["low","high"],toYData:function(t){return[t.low,t.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:c.arearange?c.arearange.prototype.drawDataLabels:C,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||c.column.prototype.getColumnMetrics.call(this)}}),p.waterfall=r(p.column,{lineWidth:1,lineColor:"#333",dashStyle:"dot",borderColor:"#333",dataLabels:{inside:!0},states:{hover:{lineWidthPlus:0}}}),c.waterfall=d(c.column,{type:"waterfall",upColorProp:"fill",pointValKey:"y",translate:function(){var t,i,a,e,o,n,r,s,l,h,p,d,u=this.options,g=this.yAxis,m=u.threshold,f=u.stacking;for(c.column.prototype.translate.apply(this),l=h=m,i=0,t=(a=this.points).length;i<t;i++)e=a[i],s=this.processedYData[i],o=e.shapeArgs,p=(n=f&&g.stacks[(this.negStacks&&s<m?"-":"")+this.stackKey])?n[e.x].points[this.index+","+i]:[0,s],e.isSum?e.y=s:e.isIntermediateSum&&(e.y=s-h),r=L(l,l+e.y)+p[0],o.y=g.translate(r,0,1),e.isSum?(o.y=g.translate(p[1],0,1),o.height=Math.min(g.translate(p[0],0,1),g.len)-o.y):e.isIntermediateSum?(o.y=g.translate(p[1],0,1),o.height=Math.min(g.translate(h,0,1),g.len)-o.y,h=p[1]):(0!==l&&(o.height=s>0?g.translate(l,0,1)-o.y:g.translate(l,0,1)-g.translate(l-s,0,1)),l+=s),o.height<0&&(o.y+=o.height,o.height*=-1),e.plotY=o.y=v(o.y)-this.borderWidth%2/2,o.height=L(v(o.height),.001),e.yBottom=o.y+o.height,d=e.plotY+(e.negative?o.height:0),this.chart.inverted?e.tooltipPos[0]=g.len-d:e.tooltipPos[1]=d},processData:function(t){var i,a,e,o,n,r,s,l=this.options,h=this.yData,p=this.options.data,c=h.length;for(e=a=o=n=l.threshold||0,s=0;s<c;s++)r=h[s],i=p&&p[s]?p[s]:{},"sum"===r||i.isSum?h[s]=e:"intermediateSum"===r||i.isIntermediateSum?h[s]=a:(e+=r,a+=r),o=Math.min(e,o),n=Math.max(e,n);A.prototype.processData.call(this,t),this.dataMin=o,this.dataMax=n},toYData:function(t){return t.isSum?0===t.x?null:"sum":t.isIntermediateSum?0===t.x?null:"intermediateSum":t.y},getAttribs:function(){c.column.prototype.getAttribs.apply(this,arguments);var i=this,a=i.options,e=a.states,n=a.upColor||i.color,s=t.Color(n).brighten(.1).get(),l=r(i.pointAttr),h=i.upColorProp;l[""][h]=n,l.hover[h]=e.hover.upColor||s,l.select[h]=e.select.upColor||n,o(i.points,function(t){t.options.color||(t.y>0?(t.pointAttr=l,t.color=n):t.pointAttr=i.pointAttr)})},getGraphPath:function(){var t,i,a,e,o=this.data,n=o.length,r=this.options.lineWidth+this.borderWidth,s=v(r)%2/2,l=[];for(a=1;a<n;a++)i=o[a].shapeArgs,e=["M",(t=o[a-1].shapeArgs).x+t.width,t.y+s,"L",i.x,t.y+s],o[a-1].y<0&&(e[2]+=t.height,e[5]+=t.height),l=l.concat(e);return l},getExtremes:C,drawGraph:A.prototype.drawGraph}),p.polygon=r(p.scatter,{marker:{enabled:!1}}),c.polygon=d(c.scatter,{type:"polygon",fillGraph:!0,getSegmentPath:function(t){return A.prototype.getSegmentPath.call(this,t).concat("z")},drawGraph:A.prototype.drawGraph,drawLegendSymbol:t.LegendSymbolMixin.drawRectangle}),p.bubble=r(p.scatter,{dataLabels:{formatter:function(){return this.point.z},inside:!0,verticalAlign:"middle"},marker:{lineColor:null,lineWidth:1},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"});var D=d(y,{haloPath:function(){return y.prototype.haloPath.call(this,this.shapeArgs.r+this.series.options.states.hover.halo.size)},ttBelow:!1});c.bubble=d(c.scatter,{type:"bubble",pointClass:D,pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,zoneAxis:"z",pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor"},applyOpacity:function(t){var i=this.options.marker,a=l(i.fillOpacity,.5);return t=t||i.fillColor||this.color,1!==a&&(t=k(t).setOpacity(a).get("rgba")),t},convertAttribs:function(){var t=A.prototype.convertAttribs.apply(this,arguments);return t.fill=this.applyOpacity(t.fill),t},getRadii:function(t,i,a,e){var o,n,r,s,l,h=this.zData,p=[],c=this.options,d="width"!==c.sizeBy,u=c.zThreshold,g=i-t;for(n=0,o=h.length;n<o;n++)s=h[n],c.sizeByAbsoluteValue&&null!==s&&(s=Math.abs(s-u),i=Math.max(i-u,Math.abs(t-u)),t=0),null===s?l=null:s<t?l=a/2-1:(r=g>0?(s-t)/g:.5,d&&r>=0&&(r=Math.sqrt(r)),l=w.ceil(a+r*(e-a))/2),p.push(l);this.radii=p},animate:function(t){var i=this.options.animation;t||(o(this.points,function(t){var a=t.graphic,e=t.shapeArgs;a&&e&&(a.attr("r",1),a.animate({r:e.r},i))}),this.animate=null)},translate:function(){var t,i,a,e=this.data,o=this.radii;for(c.scatter.prototype.translate.call(this),t=e.length;t--;)i=e[t],"number"==typeof(a=o?o[t]:0)&&a>=this.minPxSize/2?(i.shapeType="circle",i.shapeArgs={x:i.plotX,y:i.plotY,r:a},i.dlBox={x:i.plotX-a,y:i.plotY-a,width:2*a,height:2*a}):i.shapeArgs=i.plotY=i.dlBox=void 0},drawLegendSymbol:function(t,i){var a=this.chart.renderer,e=a.fontMetrics(t.itemStyle.fontSize).f/2;i.legendSymbol=a.circle(e,t.baseline-e,e).attr({zIndex:3}).add(i.legendGroup),i.legendSymbol.isMarker=!0},drawPoints:c.column.prototype.drawPoints,alignDataLabel:c.column.prototype.alignDataLabel,buildKDTree:C,applyZones:C}),m.prototype.beforePadding=function(){var t=this,i=this.len,n=this.chart,r=0,s=i,p=this.isXAxis,c=p?"xData":"yData",d=this.min,u={},g=w.min(n.plotWidth,n.plotHeight),m=Number.MAX_VALUE,f=-Number.MAX_VALUE,y=this.max-d,b=i/y,x=[];o(this.series,function(i){var r,s=i.options;!i.bubblePadding||!i.visible&&n.options.chart.ignoreHiddenSeries||(t.allowZoomOutside=!0,x.push(i),p&&(o(["minSize","maxSize"],function(t){var i=s[t],a=/%$/.test(i);i=h(i),u[t]=a?g*i/100:i}),i.minPxSize=u.minSize,i.maxPxSize=u.maxSize,(r=i.zData).length&&(m=l(s.zMin,w.min(m,w.max(a(r),!1===s.displayNegative?s.zThreshold:-Number.MAX_VALUE))),f=l(s.zMax,w.max(f,e(r))))))}),o(x,function(t){var i,a=t[c],e=a.length;if(p&&t.getRadii(m,f,t.minPxSize,t.maxPxSize),y>0)for(;e--;)"number"==typeof a[e]&&(i=t.radii[e],r=Math.min((a[e]-d)*b-i,r),s=Math.max((a[e]-d)*b+i,s))}),x.length&&y>0&&!this.isLog&&(b*=(i+r-(s-=i))/i,o([["min","userMin",r],["max","userMax",s]],function(i){void 0===l(t.options[i[0]],t[i[1]])&&(t[i[0]]+=i[2]/b)}))},function(){function t(t,i,a){t.call(this,i,a),this.chart.polar&&(this.closeSegment=function(t){var i=this.xAxis.center;t.push("L",i[0],i[1])},this.closedStacks=!0)}function i(t,i){var a,e=this.chart,o=this.options.animation,n=this.group,r=this.markerGroup,s=this.xAxis.center,l=e.plotLeft,h=e.plotTop;e.polar?e.renderer.isSVG&&(!0===o&&(o={}),i?(a={translateX:s[0]+l,translateY:s[1]+h,scaleX:.001,scaleY:.001},n.attr(a),r&&r.attr(a)):(a={translateX:l,translateY:h,scaleX:1,scaleY:1},n.animate(a,o),r&&r.animate(a,o),this.animate=null)):t.call(this,i)}var a,e=A.prototype,n=b.prototype;e.searchPointByAngle=function(t){var i=this.chart,a=this.xAxis.pane.center,e=t.chartX-a[0]-i.plotLeft,o=t.chartY-a[1]-i.plotTop;return this.searchKDTree({clientX:180+Math.atan2(e,o)*(-180/Math.PI)})},g(e,"buildKDTree",function(t){this.chart.polar&&(this.kdByAngle?this.searchPoint=this.searchPointByAngle:this.kdDimensions=2),t.apply(this)}),e.toXY=function(t){var i,a,e=this.chart,o=t.plotX,n=t.plotY;t.rectPlotX=o,t.rectPlotY=n,i=this.xAxis.postTranslate(t.plotX,this.yAxis.len-n),t.plotX=t.polarPlotX=i.x-e.plotLeft,t.plotY=t.polarPlotY=i.y-e.plotTop,this.kdByAngle?((a=(o/Math.PI*180+this.xAxis.pane.options.startAngle)%360)<0&&(a+=360),t.clientX=a):t.clientX=t.plotX},c.area&&g(c.area.prototype,"init",t),c.areaspline&&g(c.areaspline.prototype,"init",t),c.spline&&g(c.spline.prototype,"getPointSpline",function(t,i,a,e){var o,n,r,s,l,h,p,c,d,u,g,m,f,y;return this.chart.polar?(n=a.plotX,r=a.plotY,s=i[e-1],l=i[e+1],this.connectEnds&&(s||(s=i[i.length-2]),l||(l=i[1])),s&&l&&(h=(1.5*n+s.plotX)/2.5,p=(1.5*r+s.plotY)/2.5,c=(1.5*n+l.plotX)/2.5,d=(1.5*r+l.plotY)/2.5,u=Math.sqrt(Math.pow(h-n,2)+Math.pow(p-r,2)),g=Math.sqrt(Math.pow(c-n,2)+Math.pow(d-r,2)),m=Math.atan2(p-r,h-n),f=Math.atan2(d-r,c-n),y=Math.PI/2+(m+f)/2,Math.abs(m-y)>Math.PI/2&&(y-=Math.PI),h=n+Math.cos(y)*u,p=r+Math.sin(y)*u,c=n+Math.cos(Math.PI+y)*g,d=r+Math.sin(Math.PI+y)*g,a.rightContX=c,a.rightContY=d),e?(o=["C",s.rightContX||s.plotX,s.rightContY||s.plotY,h||n,p||r,n,r],s.rightContX=s.rightContY=null):o=["M",n,r]):o=t.call(this,i,a,e),o}),g(e,"translate",function(t){var i,a,e=this.chart;if(t.call(this),e.polar&&(this.kdByAngle=e.tooltip&&e.tooltip.shared,!this.preventPostTranslate))for(a=(i=this.points).length;a--;)this.toXY(i[a])}),g(e,"getSegmentPath",function(t,i){var a=this.points;return this.chart.polar&&!1!==this.options.connectEnds&&i[i.length-1]===a[a.length-1]&&null!==a[0].y&&(this.connectEnds=!0,i=[].concat(i,[a[0]])),t.call(this,i)}),g(e,"animate",i),c.column&&(a=c.column.prototype,g(a,"animate",i),g(a,"translate",function(t){var i,a,e,o,n=this.xAxis,r=this.yAxis.len,s=n.center,h=n.startAngleRad,p=this.chart.renderer;if(this.preventPostTranslate=!0,t.call(this),n.isRadial)for(o=(a=this.points).length;o--;)i=(e=a[o]).barX+h,e.shapeType="path",e.shapeArgs={d:p.symbols.arc(s[0],s[1],r-e.plotY,null,{start:i,end:i+e.pointWidth,innerR:r-l(e.yBottom,r)})},this.toXY(e),e.tooltipPos=[e.plotX,e.plotY],e.ttBelow=e.plotY>s[1]}),g(a,"alignDataLabel",function(t,i,a,o,n,r){if(this.chart.polar){var s,l,h=i.rectPlotX/Math.PI*180;null===o.align&&(s=h>20&&h<160?"left":h>200&&h<340?"right":"center",o.align=s),null===o.verticalAlign&&(l=h<45||h>315?"bottom":h>135&&h<225?"top":"middle",o.verticalAlign=l),e.alignDataLabel.call(this,i,a,o,n,r)}else t.call(this,i,a,o,n,r)})),g(n,"getCoordinates",function(t,i){var a=this.chart,e={xAxis:[],yAxis:[]};return a.polar?o(a.axes,function(t){var o=t.isXAxis,n=t.center,r=i.chartX-n[0]-a.plotLeft,s=i.chartY-n[1]-a.plotTop;e[o?"xAxis":"yAxis"].push({axis:t,value:t.translate(o?Math.PI-Math.atan2(r,s):Math.sqrt(Math.pow(r,2)+Math.pow(s,2)),!0)})}):e=t.call(this,i),e})}()});
;Dependency._js['lib/highcharts/highcharts-more']=true;

;
"undefined"!=typeof Dependency&&(Dependency.addJS("httpreq"),Dependency.addJS("main")),function(){var e=XPLAN.namespace("format2");e.SETTING_DEFAULTS={dp:2,pospre:"",negpre:"-",pospost:"",negpost:"",comma:!0,divide100:!1,decimal:".",grouper:","},e.zero_fills=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000"],e.get_zeros=function(t){var r=e.zero_fills[-1===t?0:t];return void 0!==r?r:new Array(t+1).join("0")};var t={},r=null,n=function(e,t){var r=(new HttpRequest).callJSON("format.getMultiSettings",t?[[e],t]:[[e]]);for(var n in r)break;return r[n]},i=function(i,u){var a=i+((u=u||null)?"."+u:""),f=t[a];return f||(f=function(){if(null==r){if("function"!=typeof HttpRequest)throw new Error("XPLAN.format2 settings fetcher has not been initialised. Either include main.js or specify a custom fetcher using XPLAN.format2.register_settings_fetcher");e.register_settings_fetcher(n)}return r}()(i,u),f=o(f),t[a]=f,f)},o=function(t){for(var r in e.SETTING_DEFAULTS)null==t[r]&&(t[r]=e.SETTING_DEFAULTS[r]);return t},u={format_maxdp:function(t,r,n){if(0===t)return["0",e.get_zeros(n)];var i=parseFloat(t.toPrecision(15)).toString(),o=i.split("."),u=2===o.length&&""!==o[1]?o[1].length:0,a=Math.max(u,n);return r>=0&&(a=Math.min(a,r)),(i=t.toFixed(a)).split(".")},format:function(e,t){return e.toFixed(t).split(".")}},a={format_maxdp:function(t,r,n){if(t.isZero())return["0",e.get_zeros(n)];var i=t.dp(),o=Math.max(i,n);return r>=0&&(o=Math.min(o,r)),t.toFixed(o,Decimal.ROUND_HALF_UP).split(".")},format:function(e,t){return e.toFixed(t,Decimal.ROUND_HALF_UP).toString().split(".")}};e.OfflineSettingsFetcher=function(e){this.elements=e.elements,this.DEFAULT_DISPLAY=e.DEFAULT_DISPLAY,this.DEFAULT_ELEMENT="numeric"},e.OfflineSettingsFetcher.prototype.fetch=function(e,t){t=t||this.DEFAULT_DISPLAY;var r=this.elements[e];void 0===r&&(r=this.elements[this.DEFAULT_ELEMENT]);var n=r[t];return void 0===n&&(n=r[this.DEFAULT_DISPLAY]),n},e.register_settings_fetcher=function(e){r=e},e.initialise_offline_settings=function(t){e._offline_fetcher=new e.OfflineSettingsFetcher(t);e.register_settings_fetcher(function(t,r){return e._offline_fetcher.fetch(t,r)})},e.get_setting=function(e,t){return i(e,t)};var f=function(e,t,r,n,o,u,a){var f=i(r,n),c=f;o&&(c=function(e,t){if(null==t)return e;var r={};for(var n in e)null!=t[n]?r[n]=t[n]:r[n]=e[n];return r}(f,o));var s,l,p,m=c.dp,d=c.maxdp;e?(s=c.negpre,l=c.negpost):(s=c.pospre,l=c.pospost);var _=[l];2===(p=-1===m?a.format_maxdp(t,d,f.dp):a.format(t,m)).length&&""!==p[1]&&_.push(p[1],c.decimal);var g=p[0];if(c.comma){for(var h=g.length;h>3;)h-=3,_.push(g.substr(h,3),c.grouper);_.push(g.substr(0,h))}else _.push(g);_.push(s),_.reverse();var v=_.join("");return u&&(v=v.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e&&(v='<span class="formatted-negative-number">'+v+"</span>")),v};e.write_float=function(e,t,r,n,i){var o,a=t<0;return o=a?Math.abs(t):t,n&&n.divide100&&(o/=100),f(a,o,e,i,n,r,u)},e.write_D=function(t,r,n,i,o){if(0===r)return e.write_float(t,r,n,i,o);var u,c=-1===r.s;return u=c?r.abs():r,i&&i.divide100&&(u=u.dividedBy(Decimal.HUNDRED)),f(c,u,t,o,i,n,a)},e.writeMoneyInCents=function(t){return e.write_float("money",t,!1,{divide100:!0})},e.writeMoney=function(t){return e.write_float("money",t,!1)},e.writeNumeric=function(t){return e.write_float("numeric",t,!1)},e.writePercent=function(t){return e.write_float("percent",t,!1)},e.writePercentReport=function(t){return e.write_float("percent",t,!1,!1,"reporting")},e.writeMoneyInCentsD=function(t){return e.write_D("money",t,!1,{divide100:!0})},e.writeMoneyD=function(t){return e.write_D("money",t,!1)},e.writeNumericD=function(t){return e.write_D("numeric",t,!1)},e.writePercentD=function(t){return e.write_D("percent",t,!1)},e.input_overrides={negpre:"-",pospre:"",negpost:"",pospost:"",comma:!1,dp:-1,maxdp:-1},e.writeInputFloat=function(t,r,n){return XPLAN.format2.write_float(r,t,!1,e.input_overrides,n)},e.writeInputD=function(t,r,n){return XPLAN.format2.write_D(r,t,!1,e.input_overrides,n)},e.htmlMoneyInCents=function(t){return e.write_float("money",t,!0,{divide100:!0})},e.htmlMoney=function(t){return e.write_float("money",t,!0)},e.htmlNumeric=function(t){return e.write_float("numeric",t,!0)},e.htmlPercent=function(t){return e.write_float("percent",t,!0)},e.htmlMoneyInCentsD=function(t){return e.write_D("money",t,!0,{divide100:!0})},e.htmlMoneyD=function(t){return e.write_D("money",t,!0)},e.htmlNumericD=function(t){return e.write_D("numeric",t,!0)},e.htmlPercentD=function(t){return e.write_D("percent",t,!0)};var c=/\(/,s=/[^-.eE\d]/g;e.sanitizeNumber=function(t){var r="string"!=typeof t?t.toString():t,n=r.match(c),i=e.get_setting("numeric","general");return r=r.replace(/-(\(.*\))/,"$1").replace(i.grouper,"").replace(i.decimal,".").replace(s,""),n&&(r="-"+r),r},e.readMoneyFloat=function(t){return parseFloat(e.sanitizeNumber(t))},e.get_float=function(t,r,n,i){var o=parseFloat(r),u=e.get_setting(t,i);(n&&n.divide100||u.divide100)&&(o/=100);var a=o.toString().split(".");return u.dp>=0?o=parseFloat(o.toFixed(u.dp)):-1!=u.maxdp&&2==a.length&&a[1].length>u.maxdp&&(o=parseFloat(o.toFixed(u.dp))),o}}();
;Dependency._js['format2']=true;

;
XPLAN.namespace("charting.donut_chart"),XPLAN.charting.donut_chart.mouseOverEvent=function(t,r){var e=XPLAN.charting.charts[t];XPLAN.charting.donut_chart.reCenterText(e,e,"title",r.currentTarget.name,24,0),XPLAN.charting.donut_chart.reCenterText(e,e,"subtitle",r.currentTarget.y,36,60)},XPLAN.charting.donut_chart.mouseOutEvent=function(t){var r=XPLAN.charting.charts[t],e=XPLAN.charting.chart_data[t];XPLAN.charting.donut_chart.reCenterText(r,r,"title",e.chartTitle,24,0),XPLAN.charting.donut_chart.reCenterText(r,r,"subtitle",XPLAN.charting.donut_chart.getCount(r.series[0]),36,60)},XPLAN.charting.donut_chart.getCount=function(t){for(var r=0,e=0;e<t.data.length;e++)r+=t.data[e].y;return XPLAN.format2.writeNumeric(r)},XPLAN.charting.donut_chart.reCenterText=function(t,r,e,a,n,c){var h=Math.min(t.plotWidth,t.plotHeight);h*=.6,h-=20,(void 0===c||isNaN(parseFloat(c)))&&(c=0);for(var i=!1,o=r[e].element;!i;){jQuery(o).css("font-size",n+"px"),r[e].attr({text:a});var u=o.getBBox();u.width<=h||n<=12?i=!0:n-=4}var g=t.plotLeft+.5*t.plotWidth,d=t.plotTop+.5*t.plotHeight-.5*u.height+c;r[e].attr({x:g,y:d})};
;Dependency._js['charting/donut']=true;

;
function adjustChartImgSize(e,t,i,r){var a=(e=jQuery(e)).attr("id");if("undefined"!=typeof t&&null!==t||(t=e.width()),"undefined"!=typeof i&&null!==i||(i=e.height()),i<=0&&(i=350),t<=0&&(t=350),e.is("object")||e.is("img")){var n=e.is("img")?"src":"data",s=e.attr(n);s=(s=s.search("&h=")>0?s.replace(/&h=\d*/gi,"&h="+i):s+"&h="+i).search("&w=")>0?s.replace(/&w=\d*/gi,"&w="+t):s+"&w="+t,e[0].contentDocument&&e[0].contentDocument.location&&(e[0].contentDocument.location.href=s),e.attr(n,s),e.css("height",i+"px"),e.css("width",t+"px")}else{var o=XPLAN.charting.charts[a];o&&o.setSize(t,i,!1)}}function downloadChart(e,t,i,r,a,n){i||(i=window),r||(r=800),a||(a=600);var s=stripIconsFromChart(i.XPLAN.charting.chart_data[e]);(s={desc:XPLAN.json.encode(s)}).download=1,s.w=r,s.h=a,null!=n&&(s.chart_file_name=n),XPLAN.postToHiddenFrame(getBaseURL()+"/chart/"+t,s)}function stripIconsFromChart(e){if(!e.Series)return e;for(var t=jQuery.extend(!0,{},e),i=0;i<t.Series.length;i++)t.Series[i].DataPointSet&&delete t.Series[i].DataPointSet.Icons;return t}function downloadChartOldEngine(e,t,i,r){var a="img"==e[0].tagName.toLowerCase()?"src":"data";i||(i=800),r||(r=600);var n=e.attr(a).replace(/&w=\d+/,"&w="+i).replace(/&h=\d+/,"&h="+r).replace(/\/chart\/[a-z]{3}\?/,"/chart/"+t+"?")+"&download=1";getHiddenFrame(n)}function browserSupportsSVG(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}function getChartElem(e){return document.getElementById(e)}function asset_alloc_pie_label_formatter(){var e=this.point.name+" "+XPLAN.format2.writePercent(this.percentage);return this.series.data.length>0&&!0===this.series.data[0].sliced&&(e=this.point.name+"<br/>"+XPLAN.format2.writePercent(this.percentage)),e}function asset_alloc_pie_label_report_formatter(){var e=this.point.name+" "+XPLAN.format2.writePercentReport(this.percentage);return this.series.data.length>0&&!0===this.series.data[0].sliced&&(e=this.point.name+"<br/>"+XPLAN.format2.writePercentReport(this.percentage)),e}function default_columnrange_formatter(){var e=parseFloat(this.point.high)-parseFloat(this.point.low);return this.x+"<br/>"+this.series.name+": "+XPLAN.format2.writeMoney(e)}function gauge_label_format_percentage(){return this.value.toString()+" %"}window.Dependency&&(Dependency.addJS("lib/highcharts/highstock",function(){Dependency.addJS("lib/highcharts/highcharts-more")}),Dependency.addJS("lib/backbone/underscore"),Dependency.addJS("datefield"),Dependency.addJS("commonutils"),Dependency.addJS("format2"),Dependency.addJS("charting/donut"),Dependency.addJS("template")),XPLAN.namespace("charting"),XPLAN.charting.CHART_TYPES=["area","bar","","","column","donut","line","pie","","","spline","stacked_area","stacked_bar","stacked_column","stacked_line","stacked_spline","scatter","boxplot","","","scatter","stacked_column","pie","","percentile","pod","exploded_pie","columnrange","gauge","spiderweb","donutpie","waterfall","errorbar"],XPLAN.charting.AXIS_TYPES=["X","Y","X2","Y2","Z","Z2","pie"],XPLAN.charting.INTERVAL_TYPE=["auto","number","years","months","weeks","days","hours","minutes","seconds","milliseconds","notset"],XPLAN.charting.charts={},XPLAN.charting.chart_data={},XPLAN.charting.ICON_IMAGE_WIDTH=33,XPLAN.charting.ICON_IMAGE_HEIGHT=40,XPLAN.charting.ensurePropertyExists=function(e,t){t=t.split(".");for(var i=0;i<t.length;i++)e=e[t[i]]=e[t[i]]||{};return e},XPLAN.charting.renderChart=function(e,t){var i=XPLAN.charting.translateChartData(e,t),r=i[0],a=i[1];Highcharts.setOptions({lang:{numericSymbols:["k","m","b","000b","000,000b","000,000,000b"],thousandsSep:","}}),XPLAN.charting.ensurePropertyExists(r,"plotOptions.series.events"),_("Benchmark does not exist!")===t.Title&&PopupMsgBox.show_error_text(_("Benchmark does not exist!"),null);var n="";t.Series.length&&(n=XPLAN.charting.CHART_TYPES[t.Series[0].SeriesType]),"pie"==n?(XPLAN.charting.ensurePropertyExists(r,"plotOptions.series.point.events"),r.plotOptions.series.point.events.legendItemClick=function(e){return XPLAN.event.send("chart_legend_click",this,e),!0}):r.plotOptions.series.events.legendItemClick=function(t){var i=XPLAN.charting.chart_data[e],r=underscore.findWhere(i.Series,{SeriesId:this.options.xplan_series_id});return r.Invisible=!r.Invisible,XPLAN.event.send("chart_legend_click",this,t),!0},XPLAN.charting.charts[e]=XPLAN.charting.renderHighChart(e,r,a,t.onload),XPLAN.charting.chart_data[e]=t},XPLAN.charting.getIconUrl=function(e){var t=3==e.length?e[2]:null,i=e[0];return t?"data:image/png;base64,"+t:getBaseURL()+"/img/"+i+".png"},XPLAN.charting.icons=[],XPLAN.charting.drawIcons=function(e,t){for(var i=e.get("icon-point-"+t).series_zIndex||999,r=0;r<=t;r++){var a=e.get("icon-point-"+r);if(a.series.visible)for(var n=XPLAN.charting.ICON_IMAGE_HEIGHT+5,s=Math.floor((a.plotY+5)/n),o=Math.floor((e.plotHeight-a.plotY)/n),l=Math.min(s+o,a.icons.length),c=s-l>=0?0:s-l,d=0;d<l;d++){var h=a.icons[d],p=(c+d+(c+d>=0?1:.75))*-n,u=e.renderer.image(XPLAN.charting.getIconUrl(h),a.plotX+e.plotLeft-XPLAN.charting.ICON_IMAGE_WIDTH/2,a.plotY+e.plotTop+p,XPLAN.charting.ICON_IMAGE_WIDTH,XPLAN.charting.ICON_IMAGE_HEIGHT);u.on("click",jQuery.proxy(function(){XPLAN.event.send("chart_point_click",this)},h)).css({cursor:"hand"}).attr({zIndex:i}),u.add(),XPLAN.charting.icons.push(u)}}},XPLAN.charting.translateChartData=function(e,t){var i=0,r=function(e){var i=jQuery.inArray(e,XPLAN.charting.AXIS_TYPES);if(t.AxisData)for(var r=0;r<t.AxisData.length;r++)if(t.AxisData[r].AxisName===i)return t.AxisData[r];return null},a=function(e){var t=e.split("T"),i=XPLAN.DateTimeUtil.intToDate(t[0],t[1]);return Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())},n=function(e,t){var i={},r=null;return null===t?r=e:XPLAN.json.keyExists(e,t)&&(r=e[t]),r&&r.FontSize&&(i.fontSize=r.FontSize),r&&r.FontFamily&&(i.fontFamily=r.FontFamily),r&&r.FontWeight&&(i.fontWeight=r.FontWeight),r&&r.Legend&&(i.legend=r.Legend),r&&r.Label&&(i.label=r.Label),i},s=function(e,t,r,n){for(var s,o=[],l=0;l<e.Values.length;l++)if(s=e.Values[l],jQuery.isNumeric(s)?s=Number(s):s&&s.hasOwnProperty("y")&&jQuery.isNumeric(s.y)&&(s.y=Number(s.y)),!("pie"===t&&s<0))if(e.XValues){var c=e.marker||null;c instanceof Array&&(c=c[l]);var d=e.color||null;d instanceof Array&&(d=d[l]),o.push({name:e.Labels[l],x:e.XValues[l],y:s,marker:c,color:d})}else if(e.StartDateTimes)o.push([a(e.StartDateTimes[l]),s]);else if(e.Ranges)o.push({y:e.Ranges[l][1],low:e.Ranges[l][0],name:e.Labels[l]});else{var h=null;if(e.ExtraLabels&&void 0!==e.ExtraLabels[l]?h=e.ExtraLabels[l]:e.Labels&&void 0!==e.Labels[l]&&(h=e.Labels[l]),s&&"columnrange"==t&&(h=void 0,s[0]=jQuery.isNumeric(s[0])?parseFloat(Number(s[0]))/100:s[0],s[1]=jQuery.isNumeric(s[1])?parseFloat(Number(s[1]))/100:s[1]),"spiderweb"!=t&&"boxplot"!==t||(h=void 0),e.Colours||e.Icons||e.Invisible){var p={y:s};null!==h&&(p.name=h),e.Colours&&(p.color=e.Colours[l]||null),e.Icons&&null!==e.Icons[l]&&(p.id="icon-point-"+i,i++,p.icons=e.Icons[l],p.series_zIndex=n),e.Invisible&&(p.xplan_series_id=e.PointIds[l],p.visible=!e.Invisible[l]),o.push(p)}else h&&!jQuery.isPlainObject(s)?o.push([h,s]):o.push(s)}if(!0===r){var u=[];for(idx=0;idx<o.length;idx++){var g=o[idx];if(jQuery.isPlainObject(g))var m=g;else if(g.length>1)m={name:g[0],y:g[1]};else m={name:"",y:g[0]};m.sliced=!0,u.push(m)}o=u}return o},o=function(e){var i,r=jQuery.extend({},e);(3==r.AxisName&&(r.opposite=!0,t.TitleLeft=t.TitleRight),i=r.AxisIntervalType,jQuery.inArray(i,[2,3,4,5,6,7,8,9])>-1?r.type="datetime":r.type="linear",r.AxisInterval)&&("datetime"!==r.type&&(0==r.AxisName&&(r.labels=jQuery.extend(r.labels,{step:r.AxisInterval})),r.tickInterval=r.AxisInterval,delete r.AxisInterval),"datetime"==r.type&&"weeks"==XPLAN.charting.INTERVAL_TYPE[r.AxisIntervalType]&&1==r.AxisInterval&&(r.labels=jQuery.extend(r.labels,{step:2})));return"undefined"!=typeof r.AxisMin&&("string"==typeof r.AxisMin&&"datetime"==r.type?r.min=a(r.AxisMin):r.min=r.AxisMin,delete r.AxisMin),"undefined"!=typeof r.AxisMax&&("string"==typeof r.AxisMax&&"datetime"==r.type?r.max=a(r.AxisMax):r.max=r.AxisMax,delete r.AxisMax),"P"===r.AxisLabelFormat?r.labels=jQuery.extend(r.labels,{formatter:function(){return(100*this.value).toFixed(2)+"%"}}):"P0"===r.AxisLabelFormat?r.labels=jQuery.extend(r.labels,{formatter:function(){return(100*this.value).toFixed(0)+"%"}}):"NS"===r.AxisLabelFormat&&(r.labels=jQuery.extend(r.labels,{formatter:function(){var e,t,i,r=this.chart.options.lang.numericSymbols,a=Math.abs(this.value),n=r&&r.length;if(n&&a>1e3)for(;n--&&void 0===e;)t=Math.pow(1e3,n+1),i=r[n],a>=t&&null!==i&&(e=this.value/t+i);return void 0===e&&(e=XPLAN.charting.write_float_safe(this.value)),e}})),r.AxisLabelRotation&&(r.labels=jQuery.extend(r.labels,{rotation:r.AxisLabelRotation}),delete r.AxisLabelRotation),r.AxisLabelAlign&&(r.labels=jQuery.extend(r.labels,{align:r.AxisLabelAlign}),delete r.AxisLabelAlign),r.AxisLabelStaggerLines&&(r.labels=jQuery.extend(r.labels,{staggerLines:r.AxisLabelStaggerLines}),delete r.AxisLabelStaggerLines),r.TickInterval&&delete(r=jQuery.extend(r,{tickInterval:r.TickInterval})).TickInterval,r.LabelStep&&(r.labels=jQuery.extend(r.labels,{step:r.LabelStep}),delete r.LabelStep),"undefined"!=typeof r.AxisCrossing&&(r.plotLines=[{color:"#444444",width:2,value:r.AxisCrossing}],delete r.AxisCrossing),r.Formatter&&"function"==typeof window[r.Formatter]&&(r.labels={formatter:window[r.Formatter]}),r.max_label_length&&(r.labels=r.labels||{},r.labels.useHTML=!0,r.labels.formatter=function(){var e=jQuery("<div>").html(this.value).text(),t=e;return e.length>r.max_label_length&&(t=e.slice(0,r.max_label_length-7)+"..."+e.slice(e.length-4)),'<div class="xlabel" title="'+XPLAN.util.escape(e)+'">'+XPLAN.util.escape(t)+"</div>"}),r},l=o(r("X")||r("X2")),c=o(r("Y")||r("Y2"));if(l.title={text:void 0===t.TitleBottom?null:t.TitleBottom},c.title={text:void 0===t.TitleLeft?null:t.TitleLeft},t.isLeftTitleHigh&&(c.title.align="high",c.title.offset=10,c.title.rotation=0,c.title.y=-10),XPLAN.json.keyExists(t,"PlotOptions.series.dataLabels.formatter")){var d=window[t.PlotOptions.series.dataLabels.formatter];"function"==typeof d?t.PlotOptions.series.dataLabels.formatter=d:(console.log("PlotOptions.series.dataLabels.formatter is invalid. Falling back to default formatter"),delete t.PlotOptions.series.dataLabels.formatter)}var h=2;XPLAN.json.keyExists(t,"decimal_places")&&(h=t.decimal_places),"P"===c.AxisLabelFormat&&(c.labels.formatter=function(){return this.percentage?this.percentage.toFixed(h)+"%":this.value?(100*this.value).toFixed(h)+"%":void 0}),XPLAN.json.keyExists(t,"tooltip.formatter")?underscore.isFunction(t.tooltip.formatter)||(t.tooltip.formatter=XPLAN.util.lookup_function(t.tooltip.formatter)):"P"===c.AxisLabelFormat&&17!=t.Series[0].SeriesType?t.tooltip={formatter:function(){var e=0;void 0!=this.percentage?e=this.percentage.toFixed(h)+"%":void 0!=this.y&&(e=(100*this.y).toFixed(h)+"%");var t=this.point.name,i="<strong>"+(t=void 0===t?this.point.category:t)+"</strong>";return void 0==e||t.endsWith(e)||(i+=": "+e),i}}:t.Series.length&&XPLAN.json.keyExists(t.Series[0],"ItemFormatString")&&("%"===t.Series[0].ItemFormatString?t.tooltip={formatter:function(){var e=0;this.percentage?e=this.percentage.toFixed(h)+"%":this.y&&(e=(100*this.y).toFixed(h)+"%");var t=this.point.name,i="<strong>"+(t=void 0===t?this.point.category:t)+"</strong>";return e&&!t.endsWith(e)&&(i+=": "+e),i}}:"data"===t.Series[0].ItemFormatString&&(t.tooltip={formatter:function(){var e=this.point.name,t="<strong>"+(e=void 0===e?this.point.category:e)+"</strong>";return this.y&&!e.endsWith(this.y)&&(t+=": "+this.y),t}})),t.tooltip_data&&(t.tooltip={formatter:function(){return XPLAN.charting.extraTooltip(this,t.tooltip_data)},useHTML:!0}),"return_scatter"===t.chart_model_type?t.tooltip={formatter:XPLAN.charting.formatReturnScatterTooltip}:"security_returns"===t.chart_model_type&&(t.tooltip={formatter:XPLAN.charting.formatSecurityReturnTooltip}),jQuery.extend(!0,t,{tooltip:{valueDecimals:2}});var p=[],u=!1,g=!1,m=!1,f=!1,x=!1,y=n(t.chartskin,"Label"),A={fontSize:""};"fontSize"in y&&(A.fontSize=y.fontSize);for(var b=0;b<t.Series.length;b++){var L=t.Series[b];L.SeriesId||(L.SeriesId=b);var v=XPLAN.charting.CHART_TYPES[L.SeriesType],P=!1;if(void 0===v||""===v)throw"Unknown series type "+L.SeriesType;if(!L.hidden){v.indexOf("stacked_")>-1&&(v=v.replace("stacked_",""),jQuery.extend(!0,t,{PlotOptions:{series:{stacking:"normal"}}})),v.indexOf("exploded_")>-1&&(v=v.replace("exploded_",""),P=!0);var k=L.DataPointSet,N=b;"line"!==v&&"spline"!==v||(N+=t.Series.length);var X=0;if(L.PointStart&&L.PointStart.length>0&&(X=isNaN(L.PointStart)?0:parseInt(L.PointStart)),"pod"===v){u=!0;var _=t.Series[2].PointStart-t.Series[0].PointStart;X=L.PointStart-_/2}var I=void 0===L.zIndex?N:L.zIndex,S={name:void 0===L.TranslatedLabel?L.Label:L.TranslatedLabel,id:L.Label,code:L.Label,type:v,data:s(k,v,P,I),zIndex:I,pointStart:X,borderWidth:void 0!==L.borderWidth?L.borderWidth:1};if(void 0!==L.index&&(S.index=L.index),void 0!==L.legendIndex&&(S.legendIndex=L.legendIndex),1===S.data.length&&S.data[0].marker&&(S.marker=S.data[0].marker),S.xplan_series_id=L.SeriesId,S.visible=!L.Invisible,""!=A.fontSize&&(S.dataLabels={style:{fontSize:A.fontSize}}),"undefined"!=typeof L.Code&&(S.code=L.Code),"columnrange"===v&&(g=!0,delete S.type,delete l.type,delete c.type,XPLAN.json.keyExists(t,"tooltip.formatter")||(t.tooltip={formatter:XPLAN.util.lookup_function("default_columnrange_formatter")})),"gauge"===v&&(m=!0,delete c.type,delete c.title,c=[c],S.yAxis=0),"spiderweb"===v&&(f=!0,delete S.type),"donutpie"===v&&(x=!0),L.StackGroupName&&(S.stack=L.StackGroupName),2===L.YAxis&&3!=c.AxisName&&(S.yAxis=1,!(c instanceof Array))){var w=c;c=[w];var T=null;"MaxPadding"in L&&(T=L.MaxPadding);var j={title:{text:void 0===t.TitleRight?null:t.TitleRight},opposite:!0,minPadding:null,maxPadding:T};"undefined"!=typeof L.ForceAxisMin&&""!=L.ForceAxisMin&&(j.min=L.ForceAxisMin),"undefined"!=typeof L.ForceAxisMax&&""!=L.ForceAxisMax&&(j.max=L.ForceAxisMax),w.labels&&w.labels.formatter&&(j.labels=jQuery.extend(j.labels,{formatter:w.labels.formatter})),c.push(j)}if("errorbar"==v&&(void 0!==L.WhiskerColor&&(S.color=L.WhiskerColor),void 0!==L.WhiskerLength&&(S.whiskerLength=L.WhiskerLength),void 0!==L.WhiskerWidth&&(S.whiskerWidth=L.WhiskerWidth)),p.push(S),k.Markers)for(var E=0;E<k.Markers.length;E++){var C={name:k.Markers[E].name,type:"scatter",data:[],marker:{symbol:"diamond",radius:10}},M=0;for(b=0;b<k.Markers[E].data.length;b++)M=b+1,void 0!=k.Ids&&(M=k.Ids[b]),C.data.push({x:b,y:k.Markers[E].data[b],name:k.Labels[b],id:M});p.push(C)}"Marker"in L&&(p[b].marker={enabled:L.Marker})}}var O=XPLAN.charting.processPercentileChart(p,t),F=(XPLAN.charting.processScatterChart(p,t),jQuery.extend({},t.Legend||t.legend));if(F.itemStyle=n(t.chartskin,"Legend"),F.borderWidth=0,XPLAN.json.keyExists(t.chartskin,"Legend.Layout")&&(F.layout=t.chartskin.Legend.Layout),XPLAN.json.keyExists(t.chartskin,"Legend.Width")&&(F.width=t.chartskin.Legend.Width),XPLAN.json.keyExists(t.chartskin,"Legend.ItemWidth")&&(F.itemWidth=t.chartskin.Legend.ItemWidth),XPLAN.json.keyExists(t.chartskin,"Legend.maxHeight")&&(F.maxHeight=t.chartskin.Legend.maxHeight),XPLAN.json.keyExists(t.chartskin,"Legend.itemStyle")&&(F.itemStyle=t.chartskin.Legend.itemStyle),XPLAN.json.keyExists(t.chartskin,"Legend.ItemDistance")&&(F.itemDistance=t.chartskin.Legend.ItemDistance),XPLAN.json.keyExists(t.chartskin,"Series")){var D={PlotOptions:{series:{dataLabels:{style:n(t.chartskin.Series[0],null)}}}};jQuery.extend(!0,t,D)}if(XPLAN.json.keyExists(t,"chartskin.Axis")&&t.chartskin.Axis.length&&XPLAN.json.keyExists(t.chartskin.Axis[0],"LineWidth")){var Q={PlotOptions:{line:{lineWidth:t.chartskin.Axis[0].LineWidth}}};jQuery.extend(!0,t,Q)}if(t.enablePointEvents){var W={PlotOptions:{series:{point:{events:{click:function(){XPLAN.event.send("chart_series_point_click",this)}}}}}};jQuery.extend(!0,t,W)}"boxplot"===v&&("undefined"==typeof t.PlotOptions&&(t.PlotOptions={}),t.PlotOptions.series={grouping:!1});var R={chart:{renderTo:e,zoomType:t.ZoomType,plotBorderWidth:t.plotBorderWidth||0},colors:function(e){var t=[];if(XPLAN.json.keyExists(e,"PaletteCustomColors"))for(var i=e.PaletteCustomColors,r=0;r<i.length;r++){var a=i[r];t.push(XPLAN.commonutil.RGBtoHex([a.Red,a.Green,a.Blue]))}return t}(t.chartskin),title:{text:void 0===t.Title?null:t.Title,style:n(t.chartskin,"Title")},subtitle:{text:void 0===t.Subtitle?null:t.Subtitle.text},xAxis:{categories:""},yAxis:c,plotOptions:t.PlotOptions,series:p,tooltip:t.tooltip,legend:F,credits:{enabled:!1}};if(XPLAN.json.keyExists(t,"PlotOptions.pie.point.events"))for(var b in t.PlotOptions.pie.point.events)R.plotOptions.pie.point.events[b]=XPLAN.util.lookup_function(t.PlotOptions.pie.point.events[b]).bind(window,e);if(!t.isLeftTitleHigh||void 0!==t.Title&&""!==jQuery.trim(t.Title)||(R.chart.marginTop=20),XPLAN.json.keyExists(t,"Legend.Enabled")&&0==t.Legend.Enabled&&(R.legend.enabled=!1),t.chart_width&&(R.chart.width=t.chart_width),XPLAN.json.keyExists(t,"chartskin.Axis")){if(t.chartskin.Axis.length>0&&(XPLAN.json.keyExists(t.chartskin.Axis[0],"FontSize")||XPLAN.json.keyExists(t.chartskin.Axis[0],"FontFamily"))){var z={labels:{style:n(t.chartskin.Axis[0],null)}};jQuery.extend(!0,l,z)}if(t.chartskin.Axis.length>1&&(XPLAN.json.keyExists(t.chartskin.Axis[1],"FontSize")||XPLAN.json.keyExists(t.chartskin.Axis[1],"FontFamily"))){var Y={labels:{style:n(t.chartskin.Axis[1],null)}};jQuery.extend(!0,c,Y)}}0!=t.spacingBottom&&(R.chart.spacingBottom=t.spacingBottom),0!=t.spacingTop&&(R.chart.spacingTop=t.spacingTop),0!=t.spacingLeft&&(R.chart.spacingLeft=t.spacingLeft),0!=t.spacingRight&&(R.chart.spacingRight=t.spacingRight),-1!=t.marginBottom&&(R.chart.marginBottom=t.marginBottom),-1!=t.marginTop&&(R.chart.marginTop=t.marginTop),-1!=t.marginLeft&&(R.chart.marginLeft=t.marginLeft),-1!=t.marginRight&&(R.chart.marginRight=t.marginRight),jQuery.extend(!0,R.xAxis,function(e,i){var r={};if(e.length>0&&e[0].DataPointSet.Labels&&e[0].DataPointSet.Labels.length>0){r.categories=e[0].DataPointSet.Labels;var a=underscore.unique(r.categories);1==a.length&&null===a[0]&&(r.categories=null),""!=r.categories&&" "!=r.categories&&17!==e[0].SeriesType||jQuery.extend(!0,t,{tooltip:{headerFormat:""}}),i&&(r.labels={enabled:!1})}else e.length>0?i?r.labels={enabled:!1}:r.categories=null:r.labels={enabled:!1};return r}(t.Series,t.hideXLabel)),jQuery.extend(!0,R.xAxis,l),XPLAN.json.keyExists(t,"hideYLabel")&&jQuery.extend(!0,R.yAxis,{labels:{enabled:!t.hideYLabel}}),O&&(R.chart.type="area"),u&&(R.chart.type="area",R=XPLAN.charting.processPodChart(R,_)),g&&(R.chart.type="columnrange",R.chart.inverted=!1),m&&(R.chart.type="gauge",R.chart.height=t.height,R.chart.plotBackgroundImage=null,delete R.xAxis,R.pane=[{startAngle:-90,endAngle:90,background:null,center:["50%","80%"],size:.8*t.height}],R.yAxis[0].min=t.min,R.yAxis[0].max=t.max,R.yAxis[0].pane=0,R.yAxis[0].minorTickPosition="outside",R.yAxis[0].tickPosition="outside",R.yAxis[0].labels={rotation:"auto",distance:20},R.yAxis[0].plotBands=t.plotbands,XPLAN.json.keyExists(t,"labelformatter")&&(R.yAxis[0].labels.formatter=XPLAN.util.lookup_function(t.labelformatter))),f&&(R.chart.polar=!0,R.chart.type="line",R.yAxis={gridLineInterpolation:"polygon",lineWidth:0,min:0},delete R.xAxis.type,R.xAxis.tickmarkPacement="on",R.xAxis.lineWidth=0),x&&(R.chart.type="pie",R=XPLAN.charting.processDonutPieChart(R)),R.chart.xplan_TitleInner1=t.TitleInner1||"",R.chart.xplan_TitleInner2=t.TitleInner2||"";for(var H=0;H<R.series.length;H++)if("undefined"!=typeof R.series[H].code&&null!=R.series[H].code)switch(R.series[H].code.toLowerCase()){case"initial investment":"plotLines"in R.yAxis||(R.yAxis.plotLines=[]),R.yAxis.plotLines.push({value:R.series[H].data[0],color:"red",dashStyle:"Solid",width:2,label:{},zIndex:100}),R.series[H].color="red",R.series[H].data=[]}"undefined"==typeof R.plotOptions&&(R.plotOptions={}),"undefined"==typeof R.plotOptions.pie&&(R.plotOptions.pie={});var B=n(t.chartskin,"Pie");"legend"in B&&"Enabled"in B.legend&&(R.plotOptions.pie.showInLegend=B.legend.Enabled),"label"in B&&"Enabled"in B.label&&("undefined"==typeof R.plotOptions.pie.dataLabels&&(R.plotOptions.pie.dataLabels={}),R.plotOptions.pie.dataLabels.enabled=B.label.Enabled);var G=n(t.chartskin,"Title");return"fontSize"in G&&("style"in R.title||(R.title.style={}),R.title.style.fontSize=G.fontSize),[R,i-1]},XPLAN.charting.processScatterChart=function(e,t){for(var i=0,r=1e3,a=0;a<e.length;a++)"scatter"==e[a].type&&(i++,e[a].data.length>r&&(r=e[a].data.length));return 0!=i&&(!!t.PlotOptions&&(t.PlotOptions.scatter={turboThreshold:r,dataLabels:{formatter:function(){return this.point.name},enabled:!!t.DataLabels}},!0))},XPLAN.charting.processPodChart=function(e,t){e.tooltip.enabled=!0,e.xAxis.labels={enabled:!1},e.chart.events={load:function(e){var t=this.options,i=this.series;if(!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect)for(var r=0;r<i.length;r+=2)if(0!=i[r].data.length){for(var a=i[r].data[79],n=i[r+1].data[79],s=a.plotY-n.plotY,o=[0,15,31,47,63,79],l=[],c=0;c<6;c++){var d=XPLAN.commonutil.colourLighter(t.colors[r],Math.pow(1-.1*c,3));l.push([(a.plotY-i[r].data[o[c]].plotY)/s,d]),l.push([(a.plotY-i[r+1].data[o[c]].plotY)/s,d])}l.sort(function(e,t){return e[0]>t[0]?1:-1}),t.series[r].fillColor={linearGradient:[a.plotX,a.plotY,n.plotX,n.plotY],stops:l}}t.chart.events.load=null,this.destroy(),XPLAN.charting.charts[t.chart.renderTo]=new Highcharts.Chart(t)}};var i=0;for(var r in e.series)if(e.series.hasOwnProperty(r)){if(i%2==0)e.series[r].hover_name=e.series[r].name;else{var a=e.series[i-1];e.series[r].hover_name=a.name,e.colors[r]=e.colors[i-1]}switch(e.series[r].marker={symbol:"diamond",radius:2},i++,delete e.series[r].type,e.series[r].lineWidth=0,e.series[r].code.toLowerCase()){case"hidden":e.series[r].colour="#fffffe",e.series[r].fillOpacity=.001,e.series[r].showInLegend=!1;break;case"target":e.yAxis.plotLines=[{value:e.series[r].data[0],color:"red",dashStyle:"shortdash",width:2,label:{text:"Target"},zIndex:100}],e.series.splice(r,1)}}return e.plotOptions={series:{stacking:"normal",marker:{enabled:!1},shadow:!1,pointInterval:t/180,events:{legendItemClick:function(e){return!1}}}},e.tooltip.formatter=function(){var e=this.point.options.y;return e=XPLAN.charting.write_float_safe(e,2),"<span>"+XPLAN.util.escape(this.series.options.hover_name)+"</span>: <b>"+e+"</b><br/>"},e},XPLAN.charting.processPercentileChart=function(e,t){for(var i,r,a=!1,n=0,s=e.length,o=0;o<s;o++)"percentile"==e[o].type&&n++;if(0==n)return!1;8==n&&(i=["rgba(210, 210, 255, 0.1)","rgba(190, 190, 255, 0.5)","rgba(50, 50, 255, 0.5)","rgba(0, 0, 200, 0.5)","rgba(50, 50, 255, 0.5)","rgba(190, 190, 255, 0.5)","rgba(210, 210, 255, 0.1)"],r=["rgba(220, 220, 255, 1.0)","rgba(170, 170, 255, 1.0)","rgba(150, 150, 255, 1.0)","rgba(110, 110, 255, 1.0)","rgba(110, 110, 255, 1.0)","rgba(150, 150, 255, 1.0)","rgba(170, 170, 255, 1.0)","rgba(220, 220, 255, 1.0)"]);var l=[],c=Math.floor((n+1)/2),d=0,h=!1;for(o=e.length-1;o>=0;o--){if("hidden"===(f=e[o]).name.toLowerCase()){h=!0;break}}for(o=e.length-1;o>=0;o--){if("percentile"==(f=e[o]).type){if(d<c&&h){var p=e[d];f.hover_name=p.name}else f.hover_name=f.name;d++,l.unshift(f),a?(i&&(f.fillColor=i[o]),r&&(f.lineColor=r[o],f.lineWidth=1,f.color=r[o])):(a=!0,t.PlotOptions||(t.PlotOptions={}),t.PlotOptions.series||(t.PlotOptions.series={}),t.PlotOptions.series.events||(t.PlotOptions.series.events={}),t.PlotOptions.series.shadow=!1,t.PlotOptions.series.stacking="normal",t.PlotOptions.series.events.legendItemClick=function(){return!1},f.fillOpacity=1e-4,r&&(f.lineColour=r[o],f.lineWidth=1,f.color=r[o])),f.marker={enabled:!1},"hidden"===f.name.toLowerCase()&&(f.showInLegend=!1),delete f.type}"target"==f.name.toLowerCase()&&(f.data=[f.data[0]],f.color="#BF0B23",f.marker={radius:8,symbol:"diamond"})}var u=[];for(o=0;o<l.length-1;o++){for(var g=l[o+1].data,m=[],f=l[o],x=0;x<f.data.length;x++){if(jQuery.isArray(g[x]))var y=g[x][1];else y=g[x];if(jQuery.isArray(f.data[x])){var A=f.data[x][1];m.push([f.data[x][0],A-y])}else{A=f.data[x];m.push(A-y)}}u.push(m)}var b=[];for(o=0;o<l.length;o++){var L=[];for(x=0;x<l[o].data.length;x++){var v=l[o].data[x];jQuery.isArray(v)?L.push(v[1]):L.push(v),o!=l.length-1&&(l[o].data[x]=u[o][x])}b.push(L)}return t.tooltip.formatter=function(){var e=this.x,t=parseInt(l[0].data[0][0]),i=b[this.series.index][e-t];return i=XPLAN.charting.write_float_safe(i,2),"<p style='color:"+this.series.color+"'>"+l[this.series.index].hover_name+"</p>: <b>"+i+"</b><br/>"},!0},XPLAN.charting.processDonutPieChart=function(e){delete e.tooltip.valueDecimals,delete e.series[0].type,delete e.series[0].zIndex,delete e.series[0].pointStart,e.series.push({name:"Total",size:"60%",data:[]},{name:"Item",innerSize:"60%",data:[],dataLabels:{formatter:function(){return null}},tooltip:{headerFormat:"{point.key}:",pointFormat:"<b>{point.y}</b>"}});var t=e.colors,i=e.series[1],r=e.series[2];for(var a in e.series[0].data){var n=e.series[0].data[a],s=t[a%t.length];i.data.push({name:n[0],y:underscore.reduce(n[1],function(e,t){return e+t[1]},0),color:s});var o=underscore.map(n[1],function(e){return e[0]});for(var l in n[1]){var c=.2-l/n[1].length/5;r.data.push({name:o[l],y:n[1][l][1],color:Highcharts.Color(s).brighten(c).get()})}}return delete e.series[0].data,e},XPLAN.charting.extraTooltip=function(e,t){"use strict";var i=e.point,r=i.series.options.xplan_series_id;if(!t.series)return null;var a=t.series[r],n=t.types[r];if(void 0===a)return null;var s=a[i.category],o=n[i.category];if(void 0===s)return null;var l={Y:i.y,X:i.category,breakdown:s,breakdown_types:o,title:i.series.name};return XPLAN.Template.get("xtools/table_tooltips/%a".replace("%a",t.properties.ToolTipTemplateName||"default_template")).render({tooltip_data:t,series_id:r,point_data:l,formatElement:XPLAN.charting.formatElementClosure(l,t)})},XPLAN.charting.formatReturnScatterTooltip=function(){return"<b>%a</b><br/>".replace("%a",this.series.name)+_("Return:")+" "+XPLAN.format2.write_float("percent",this.y||0,!1,null,"portfolio")+"<br/>"+_("Std Dev: ")+" "+XPLAN.format2.write_float("percent",this.x||0,!1,null,"portfolio")},XPLAN.charting.formatSecurityReturnTooltip=function(){return"<b>%a</b><br/>".replace("%a",this.series.name)+"<b>%a</b>: %b".replace("%a",this.x).replace("%b",XPLAN.format2.write_float("percent",100*this.y||0,!1,null,"portfolio"))},XPLAN.charting.formatBarChartReturnTooltip=function(){return"%a<br/>".replace("%a",this.key)+"%a: <strong>%b</strong><br/>".replace("%a",this.series.name).replace("%b",this.y)},XPLAN.charting.write_float_safe=function(e,t){return t=t||0,!isNaN(parseFloat(e))&&isFinite(e)?XPLAN.format2.write_float("numeric",parseFloat(e),!1,{dp:t}):e},XPLAN.charting.formatElementClosure=function(e,t){var i=parseInt(t.ToolTipDecimalPrecision,10);return i=isNaN(i)?2:i,function(t,r){"use strict";if(void 0===t)return"";var a;switch(r){case"percent":a=XPLAN.format2.writePercent(100*t);break;case"number":a=XPLAN.charting.write_float_safe(t,i);break;case"string":a=t.replace("{Title}",e.title).replace("{X}",e.X).replace("{Y}",XPLAN.charting.write_float_safe(e.Y,i));break;case"currency":a=XPLAN.format2.writeMoney(t);break;case"date":a=_("Date type is not supported here");break;default:a=_("UNKNOWN TYPE")}return XPLAN.util.escape(a,"xml")}},XPLAN.charting.alignZerosForMultiYaxis=function(e){if(!((e.yAxis?e.yAxis.length:0)<=1)){for(var t=[{},{}],i=0;i<t.length;i++){if(t[i].min=e.yAxis[i].min,t[i].max=e.yAxis[i].max,null==t[i].min||null==t[i].max)return;if(t[i].min*t[i].max>0)return;t[i].tickInterval=e.yAxis[i].tickInterval,(t[i].min+t[i].max)%t[i].tickInterval!=0&&(t[i].min=Math.ceil(t[i].min/t[i].tickInterval)*t[i].tickInterval,t[i].max=Math.ceil(t[i].max/t[i].tickInterval)*t[i].tickInterval),t[i].ratio=this.getRatio(t[i].min,t[i].max)}var r=!1;if(0===t[0].ratio&&0===t[1].ratio){if(0===t[0].min&&0===t[1].min||0===t[0].max&&0===t[1].max)return;for(i=0;i<t.length;i++)t[i].max=Math.abs(t[i].min+t[i].max),t[i].min=-t[i].max,t[i].ratio=1,t[i].tickInterval*=2;r=!0}var a=t[0].ratio>=t[1].ratio?0:1,n=1-a;t[n]=this.alignAxisToOther(t[a],t[n]),e.yAxis[n].update({min:t[n].min,max:t[n].max,tickInterval:t[n].tickInterval}),r&&(t[a]=this.alignAxisToOther(t[a],t[a]),e.yAxis[a].update({min:t[a].min,max:t[a].max,tickInterval:t[a].tickInterval}))}},XPLAN.charting.alignAxisToOther=function(e,t){var i=Math.ceil(e.max/e.tickInterval),r=Math.floor(e.min/e.tickInterval),a=Math.ceil(t.max/i),n=Math.ceil(t.min/r);t.tickInterval=a>n?a:n;var s=Math.floor(Math.log(t.tickInterval)/Math.LN10),o=Math.pow(10,s);return t.tickInterval=Math.ceil(t.tickInterval/o)*o,t.max=t.tickInterval*i,t.min=t.tickInterval*r,t},XPLAN.charting.getRatio=function(e,t){return(e=Math.abs(e))>(t=Math.abs(t))?t/e:e/t},XPLAN.charting.renderHighChart=function(e,t,i,r){return t.chart=jQuery.extend({},{renderTo:e},t.chart),t.credits={enabled:!1},new Highcharts.Chart(t,function(t){XPLAN.charting.alignZerosForMultiYaxis(t),window.setTimeout(function(){i>=0&&(XPLAN.charting.drawIcons(t,i),jQuery(window).resize(function(){window.chartIconsTimeout&&window.clearTimeout(window.chartIconsTimeout),window.chartIconsTimeout=window.setTimeout(function(){for(var e=0;e<XPLAN.charting.icons.length;e++)XPLAN.charting.icons[e].destroy();XPLAN.charting.icons=[],XPLAN.charting.drawIcons(t,i)},700)})),r&&XPLAN.util.lookup_function(r)(e)},0)})};
;Dependency._js['chart']=true;

;
function loadDialog(e,t,n,a){EggTimer.show();var i=jQuery(e);i.empty(),i.load(getBaseURL()+t,function(){i.dialog({modal:!0,height:"auto",width:800,resizable:!1,title:n}),EggTimer.hide(),a&&a(i)})}"undefined"!=typeof Dependency&&(Dependency.addJS("factfind"),Dependency.addJS("ajax/ajax"),Dependency.addJS("ajax/item_dialog"),Dependency.addJS("ajax/item_list"),Dependency.addJS("chart"),Dependency.addJS("popup"),Dependency.addJS("ajax/dependency"));var Benchmark={category:-1,gotoCategory:function(e){window.location.href=getBaseURL()+"/servicebenchmarks/benchmarks?current_category="+e,Benchmark.category=e},remove:function(e){return confirm(_("This deletion will impact benchmark tracking for any client associated with this service benchmark set. Are you sure you wish to delete?"))&&(window.location.href=getBaseURL()+"/servicebenchmarks/benchmarks?action=remove_benchmark&id="+e),!1},editBenchmark:function(e,t){var n="/servicebenchmarks/edit_benchmark/"+(e=e||-1).toString();t&&(n+="?category="+t),loadDialog("#benchmark_edit",n,_("Edit Benchmark"))},editVisibility:function(e){var t={caption:_("Edit Visibility Settings"),width:600,height:500,onclose:function(e,t){t===_("Save")?jQuery("iframe.PopupURL2",e.div)[0].contentWindow.jQuery('form[name="visibility_form"]').submit():(e.hide(),window.location=window.location.href)},oncancel:function(){return!1},button:[["save",_("Save")],["close",_("Close")]]},n="/servicebenchmarks/edit_benchmark_visibility/"+e;PopupURL3.show(n,t)},save:function(){var e=jQuery("#form_edit");(parseInt(jQuery('input[name="id"]',e).val(),10)<=0||confirm(_("This could impact benchmark tracking for any client associated with this service benchmark set. Are you sure you wish to save your changes?")))&&e.submit()},init:function(e){Benchmark.initType(),Benchmark.initDocnoteDependency(e.docnote_subtype_dep_options)},initType:function(){var e=jQuery('select[name="benchmark_type"]');e.change(function(){Benchmark.onchangeBenchmarkType(e.val())}).change()},initDocnoteDependency:function(e){e.child_selector=jQuery('select[name="note_subtype"]'),jQuery('select[name="note_type"]').xplan_dependency(e)},onchangeBenchmarkType:function(e){jQuery('#benchmark_table tr[id^="row_"]').each(function(){var t=jQuery(this);t.attr("id").match("^row_"+e)?t.show():t.hide()});var t=jQuery("#tr_cost");"thread"===e?t.hide():t.show()}},BenchmarkSet={gotoStatus:function(e){var t=getBaseURL()+"/servicebenchmarks/index?status_filter="+e;window.location.href=t},edit:function(e){var t="/servicebenchmarks/edit_benchmarkset/"+e.toString()+"?status_filter=";loadDialog("#benchmarkset_edit",t+=jQuery('select[name="status_filter"]').val(),_("Edit Benchmark Set"),function(e){BenchmarkSet.init(e)})},view:function(e){var t="/servicebenchmarks/view_benchmarkset/"+e.toString(),n=jQuery("<div></div>").appendTo(jQuery("body"));n.load(getBaseURL()+t,function(){n.dialog({modal:!0,height:"auto",width:"auto",resizable:!1,title:_("Benchmark Set Details"),close:function(){jQuery(this).empty().remove()}})})},init:function(e){jQuery("#form_edit",e).submit(function(){var t=XPLAN.util.elem2object(e);return BenchmarkSet.checkDuplicate(t.xmerge_id,t.id)}),jQuery('select[name="benchmark_datetype"]',e).change(function(){var t=jQuery(this).val();""!==t&&jQuery('select[name$="_datetype"]',e).each(function(){var e=jQuery(this);"benchmark_datetype"===e.attr("name")||e.attr("name")===t+"_datetype"?e.parent().show():e.parent().hide()})}).change(),jQuery('input[name="name"]',e).on("change",function(e){BenchmarkSet.setDefaultId()})},setDefaultId:function(){var e=jQuery("#benchmarkset_edit"),t=jQuery('input[name="xmerge_id"]',e);""===t.val()&&t.val(jQuery('input[name="name"]',e).val())},changeStatus:function(e){e.prop("disabled",!0);var t=e.prop("checked"),n=parseInt(e.parents("tr:first").find('input[type="hidden"][name="id"]').val(),10);BenchmarkSet.handleChangeStatus(n,t),e.prop("disabled",!1)},handleChangeStatus:function(e,t){EggTimer.show({modal:!0}),XMLRPC.call("servicebenchmarks.change_benchmarkset_status",[e,t],function(e){EggTimer.hide(),window.location.reload()},function(e){EggTimer.hide(),XPLAN.framemain.alert_text(_("Error: %a").replace("%a",e.msg),!0)})},editVisibility:function(e){var t={caption:_("Edit Visibility Settings"),width:600,height:500,onclose:function(e,t){t===_("Save")?jQuery("iframe.PopupURL2",e.div).contents().find('form[name="visibility_form"]').submit():(e.hide(),window.location=window.location.href)},oncancel:function(){return!1},button:[["save",_("Save")],["close",_("Close")]]},n="/servicebenchmarks/edit_benchmarkset_visibility/"+e;PopupURL3.show(n,t)},checkDuplicate:function(e,t){return!XMLRPC.call("servicebenchmarks.check_duplicate_benchmarkset",[t,e])||(PopupMsgBox.show_info_text(_("ID is already in use. Please specify a unique ID")),!1)},save:function(){BenchmarkSet.setDefaultId();var e=jQuery("#form_edit");(parseInt(jQuery('input[name="id"]',e).val(),10)<=0||confirm(_("This could impact benchmark tracking for any client associated with this service benchmark set. Are you sure you wish to save your changes?")))&&e.submit()},handleLoadCategory:function(e){for(var t=jQuery("#form_edit select[name='select_benchmark']"),n="",a=0;a<e.length;a++){var i=e[a];n+='<option value="'+i[0]+'">'+i[1]+"</option>"}t.html(n)},loadCategory:function(e){XMLRPC.call("servicebenchmarks.get_benchmarks",[e],BenchmarkSet.handleLoadCategory)},handleLoadBenchmarkSet:function(e){jQuery.each(e,function(e,t){jQuery("td.field_"+e+"_td")[0]&&jQuery("td.field_"+e+"_td").html(t)})},loadBenchmarkSet:function(e){e=parseInt(e,10),XMLRPC.call("servicebenchmarks.get_benchmarkset_by_id",[e],BenchmarkSet.handleLoadBenchmarkSet)},handleAddBenchmark:function(e){if(e[0]){var t=e[1],n=document.getElementById("benchmark_table"),a=document.createElement("TR"),i="tr_benchmark_"+t.id;a.id=i;var r=document.createElement("TD");r.innerHTML='<a href="javascript:BenchmarkSet.removeBenchmark('+t.id+');"><span class="icon icon-remove"></span></a>',a.appendChild(r),(r=document.createElement("TD")).innerHTML=t.description+'<input type="hidden" name="benchmark_'+t.id+'" value="1">',a.appendChild(r),(r=document.createElement("TD")).innerHTML=t.category,a.appendChild(r),(r=document.createElement("TD")).innerHTML=t.type,a.appendChild(r),n.appendChild(a)}},downloadPDF:function(e){XMLRPC.call("servicebenchmarks.download_benchmark_set_pdf",[e]),PopupMsgBox.show_bgtask_notification(_("Benchmark Set PDF generated asynchronously in the background."))},addBenchmark:function(){for(var e=jQuery("#form_edit select[name='select_benchmark']").val(),t=document.getElementById("benchmark_table").rows,n=0;n<t.length;n++){if(t[n].id==="tr_benchmark_"+e)return void alert(_("Benchmark has already been added"))}XMLRPC.call("servicebenchmarks.get_benchmark",[e],BenchmarkSet.handleAddBenchmark)},removeBenchmark:function(e){for(var t=document.getElementById("benchmark_table"),n=t.rows,a=0;a<n.length;a++){var i=n[a];jQuery(i).attr("id")==="tr_benchmark_"+e&&t.deleteRow(a)}},remove:function(e){return confirm(_("This deletion will impact benchmark tracking for any client associated with this service benchmark set. Are you sure you wish to delete?"))&&(window.location.href=getBaseURL()+"/servicebenchmarks/index?action=remove_benchmark_set&id="+e),!1}};(function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_client_service_benchmark_graph",create:function(e){this.panel=e,this._load(e)},_load:function(e){var t=this;EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.html,[this.options.data],function(n){EggTimer.hide(),t.panel.html(n.html),t.reportDialog=jQuery("div.service-report-dialog",t.panel),t._initEvents(e,n.show_enddate_type),t.options.afterload&&t.options.afterload(e)},function(e){EggTimer.hide();var t=_("Error: %a").replace("%a",e.message);alert(t,!0)})},_initEvents:function(e,t){var n=this;jQuery('select[name="service_benchmark"]',n.panel).bind("change",function(t){var a=parseInt(jQuery(t.target).val(),10);n.options.data.service_benchmark=a,n._load(e)}),jQuery('select[name="compare_year"]',n.panel).bind("change",function(t){var a=parseInt(jQuery(t.target).val(),10);n.options.data.compare_year=a,n._load(e)}),jQuery("div.benchmark-charts",n.panel).tabs(),n._buildReportDialog(e,t),jQuery("a.button.service-report-button",n.panel).bind("click",function(){n._generateServiceDeliveryReport(e)}),jQuery("a.button.fee-disclosure-button",n.panel).bind("click",function(){n._feeDisclosureReport(e)})},_generateServiceDeliveryReport:function(e){""===jQuery('select[name="service_benchmark"]',this.panel).val()?PopupMsgBox.show_info_text(_("Client service benchmark has not been set")):this.reportDialog.dialog("open")},_feeDisclosureReport:function(e){XMLRPC.call(this.options.ajax_rpcs.generate_disclosure_fee_report,[this.options.data],function(e){e.success?PopupMsgBox.show_bgtask_notification(_("Disclosure Fee Report is being generated asynchronously in the background.")):e.dup_job_id?PopupMsgBox.show_bgtask_already_running_notification(e.dup_job_id):alert(e.error)},function(e){EggTimer.hide();var t=_("Error: %a").replace("%a",e.message);alert(t,!0)})},_buildReportDialog:function(e,t){var n=this;t?jQuery('select[name="reportenddatetype"]',n.reportDialog).bind("change",function(){0===parseInt(jQuery(this).val(),10)?jQuery(this).siblings("span").show():jQuery(this).siblings("span").hide()}).trigger("change"):(jQuery('select[name="reportenddatetype"]',n.reportDialog).siblings("span").show(),jQuery('select[name="reportenddatetype"]',n.reportDialog).hide());var a=[];a.push({text:_("Close"),click:function(){n.reportDialog.dialog("close")}}),a.push({text:"^"+_("Ok"),click:function(){var t,a,i;try{t=XPLAN.DateTimeUtil.dateToInt(XPLAN.DateField.getDate(jQuery('input[name="reportenddate"]',n.reportDialog))),a=parseInt(jQuery('select[name="reporttype"]',n.reportDialog).val(),10),i=parseInt(jQuery('select[name="reportenddatetype"]',n.reportDialog).val(),10)}catch(e){return void alert(e)}n._handleDoPrintReport(e,t,a,i),n.reportDialog.dialog("close")}}),n.reportDialog.dialog({autoOpen:!1,title:_("Service Delivery Report"),modal:!0,width:t?450:280,buttons:a})},_handleDoPrintReport:function(e,t,n,a){XMLRPC.call(this.options.ajax_rpcs.generate_service_report,[this.options.data,{reportenddate:t,reporttype:n,reportenddatetype:a}],function(e){e.ok?PopupMsgBox.show_bgtask_notification(_("Service delivery report are being generated asynchronously in the background.")):e.dup_job_id&&PopupMsgBox.show_bgtask_already_running_notification(e.dup_job_id)},function(e){EggTimer.hide();var t=_("Error: %a").replace("%a",e.message);alert(t,!0)})}};XPLAN.namespace("XplanAjax").createClass(t)})(jQuery),function(e){var t={parent_plugin_name:"xplan_ajax",plugin_name:"xplan_client_service_benchmark",create:function(e){this.panel=e,this._load(e)},_load:function(e){var t=this;EggTimer.show(),XMLRPC.call(this.options.ajax_rpcs.html,[this.options.data],function(n){EggTimer.hide(),t.panel.html(n.html),t.options.service_benchmark_list_options=n.service_benchmark_list_options,t.options.service_benchmark_list_options.afterload=function(e){jQuery("div.service-benchmark-graph-div").xplan_client_service_benchmark_graph("_load")},t.options.service_benchmark_graph_options=n.service_benchmark_graph_options,t._initEvents(e),t.options.afterload&&t.options.afterload(e)},function(e){EggTimer.hide();var t=_("Error: %a").replace("%a",e.message);alert(t,!0)})},_initEvents:function(e){jQuery("div.service-benchmark-graph-div",this.panel).xplan_client_service_benchmark_graph(this.options.service_benchmark_graph_options),jQuery("div.service-benchmark-list-div",this.panel).xplan_client_service_benchmark_list(this.options.service_benchmark_list_options)}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery),function(e){var t={parent_plugin_name:"xplan_item_dialog",plugin_name:"xplan_client_service_benchmark_item",_initEvents:function(e){var t=this;jQuery('input:checkbox[name$="f=use_fds_date"]',t.panel).click(function(){var e=jQuery('input[name$="f=enddate"]',t.panel),n=jQuery('input[type="hidden"][name$="f=fds_date"]',t.panel);jQuery(this).is(":checked")?XPLAN.DateField.setDate(e,XPLAN.DateTimeUtil.intToDate(n.val())):XPLAN.DateField.setDate(e,"")}),jQuery('input:checkbox[name$="f=use_12m_prior_fds_date"]',t.panel).click(function(){var e=jQuery('input[name$="f=startdate"]',t.panel),n=jQuery('input[type="hidden"][name$="f=12m_prior_fds_date"]',t.panel);jQuery(this).is(":checked")?XPLAN.DateField.setDate(e,XPLAN.DateTimeUtil.intToDate(n.val())):XPLAN.DateField.setDate(e,"")})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery),function(e){var t={parent_plugin_name:"xplan_item_dialog",plugin_name:"xplan_client_service_benchmark_item_dialog",_initEvents:function(e){this.connection.auto_eggtimer=!0;var t=this;this.parent_prototype()._initEvents.apply(this),e.dialog({title:_("Service Benchmark"),width:500,close:function(n,a){e.dialog("destroy"),t.options.onclose&&t.options.onclose()},buttons:[{text:_("^Save"),click:function(){t.save(e,function(){e.dialog("close")})}},{text:_("Cancel"),click:function(){e.dialog("close")}}]})}},n=XPLAN.namespace("XplanAjax"),a=XPLAN.util.get_html_random_id();n.createClass(t),n.getClass(t.plugin_name).showDialog=function(e){XPLAN.ui.Popup.get_dialog(a).xplan_client_service_benchmark_item_dialog(e)}}(jQuery),function(e){var t={parent_plugin_name:"xplan_item_list",plugin_name:"xplan_client_service_benchmark_list",_initExtraEvents:function(e){var t=this;jQuery('select[name="status_filter"]',t.panel).change(function(){t.options.data.status_filter=jQuery(this).val(),t._load()}),jQuery("td.benchmark-set-cell",t.panel).click(function(){var e=jQuery(this).parents("tr:first").find('input[type="hidden"][name="benchmark_set_id"]').val();return BenchmarkSet.view(e),!1})},_resize_for_dialog:function(){this.editItemDialog.dialog({height:"auto",position:["middle",100]})}};XPLAN.namespace("XplanAjax").createClass(t)}(jQuery);
;Dependency._js['benchmarks']=true;

;
!function(){function e(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function t(e){return"keypress"==e.type?String.fromCharCode(e.which):h[e.which]?h[e.which]:p[e.which]?p[e.which]:String.fromCharCode(e.which).toLowerCase()}function n(e,t){e=e||{};var n,r=!1;for(n in k)e[n]&&k[n]>t?r=!0:k[n]=0;r||(v=!1)}function r(e,t,n,r,o){var i,c,s,u,f=[],l=n.type;if(!y[e])return[];for("keyup"==l&&a(e)&&(t=[e]),i=0;i<y[e].length;++i)(c=y[e][i]).seq&&k[c.seq]!=c.level||l==c.action&&(("keypress"!=l||n.metaKey||n.ctrlKey)&&(s=t,u=c.modifiers,s.sort().join(",")!==u.sort().join(","))||(r&&c.combo==o&&y[e].splice(i,1),f.push(c)));return f}function o(e,t,n){E.stopCallback(t,t.target||t.srcElement,n)||!1===e(t,n)&&(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.returnValue=!1,t.cancelBubble=!0)}function i(e){"number"!=typeof e.which&&(e.which=e.keyCode);var i=t(e);i&&("keyup"!=e.type||b!=i?function(e,t){var i,c=r(e,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(t),t),s={},u=0,f=!1;for(i=0;i<c.length;++i)c[i].seq?(f=!0,u=Math.max(u,c[i].level),s[c[i].seq]=1,o(c[i].callback,t,c[i].combo)):f||v||o(c[i].callback,t,c[i].combo);t.type!=v||a(e)||n(s,u)}(i,e):b=!1)}function a(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function c(e,t,n){return n||(n=function(){if(!f)for(var e in f={},h)e>95&&e<112||h.hasOwnProperty(e)&&(f[h[e]]=e);return f}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function s(e,r,i,a){k[e]=0,a||(a=c(r[0],[]));var s,f=function(t){v=a,++k[e],clearTimeout(l),l=setTimeout(n,1e3)},h=function(r){o(i,r,e),"keyup"!==a&&(b=t(r)),setTimeout(n,10)};for(s=0;s<r.length;++s)u(r[s],s<r.length-1?f:h,a,e,s)}function u(e,t,n,o,i){var u,f,l,h=(e=e.replace(/\s+/g," ")).split(" "),p=[];if(h.length>1)s(e,h,t,n);else{for(l="+"===e?["+"]:e.split("+"),u=0;u<l.length;++u)f=l[u],d[f]&&(f=d[f]),n&&"keypress"!=n&&m[f]&&(f=m[f],p.push("shift")),a(f)&&p.push(f);n=c(f,p,n),y[f]||(y[f]=[]),r(f,p,{type:n},!o,e),y[f][o?"unshift":"push"]({callback:t,modifiers:p,action:n,seq:o,level:i,combo:e})}}for(var f,l,h={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},m={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta",return:"enter",escape:"esc"},y={},g={},k={},b=!1,v=!1,w=1;w<20;++w)h[111+w]="f"+w;for(w=0;w<=9;++w)h[w+96]=w;e(document,"keypress",i),e(document,"keydown",i),e(document,"keyup",i);var E={bind:function(e,t,n){return function(e,t,n){for(var r=0;r<e.length;++r)u(e[r],t,n)}(e instanceof Array?e:[e],t,n),g[e+":"+n]=t,this},unbind:function(e,t){return g[e+":"+t]&&(delete g[e+":"+t],this.bind(e,function(){},t)),this},trigger:function(e,t){return g[e+":"+t](),this},reset:function(){return y={},g={},this},stopCallback:function(e,t,n){return!((" "+t.className+" ").indexOf(" mousetrap ")>-1)&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.contentEditable&&"true"==t.contentEditable)}};window.Mousetrap=E,"function"==typeof define&&define.amd&&define(E)}();
;Dependency._js['lib/mousetrap']=true;

;
XPLAN.namespace("instasearch"),function($){var instaDATA=[],currentQuery=null,showTip,showSearch=function(e){e.preventDefault&&e.preventDefault();var t="keydown"==e.type;showTip(t),XPLAN.instasearch.indexMenus(),$(".instasearch.overlay").show(),$(".smoothener").addClass("fromhide"),window.setTimeout(function(){$(".smoothener").removeClass("fromhide")},0),window.setTimeout(function(){$("#queryselect2").select2("focus")},1),$("#queryselect2").select2("enable",!0),$("#queryselect2").select2("focus")},hideSearch=function(){currentQuery=null,$(".instasearch.overlay").hide(),$("#queryselect2").select2("close"),$("#queryselect2").select2("enable",!1),$("#queryselect2").select2("val",[]),$(".instasearch.overlay").hide()};showTip=function(e){var t=["Type a function name, e.g. <span class=example>Add client</span> or <span class=example>Diary</span> and press <span class=key>Enter</span>","Type what you want to do, e.g. <span class=example>Risk</span> or <span class=example>Super</span>","Type your Client's name and see what happens. (Only works for recent clients)"];e?t.push("You are using keyboard shortcuts. You are awesome!"):(t.push("You can close Instant Search (this white window) by pressing <span class=key>Esc</span>"),t.push("Make Captain Productivity proud - use hotkey: <span class=key>Ctrl</span> + <span class=key>Shift</span> + <span class=key>F</span>"));var n=t[Math.floor(t.length*Math.random())];$(".instasearch .instatip").html(n)};var hilite=function(e,t){var n=e.toLowerCase(),s=t.toLowerCase().split(" "),a=new Array(n.length);underscore.each(s,function(e){var t=n.indexOf(e);if(e.length>0&&t>=0)for(var s=0;s<e.length;s++)a[t+s]=!0});for(var i="",r=0;r<n.length;r++)a[r]?i+='<span class="select2-match">'+XPLAN.util.escape(e[r])+"</span>":i+=XPLAN.util.escape(e[r]);return i},updateResults=function(){currentQuery&&queryFn(currentQuery)},queryFn=function(e){if(currentQuery=e,""!==e.term){var t,n="",s={results:[]},a=s.results;for(t=0;t<instaDATA.length;t++){var i=instaDATA[t];itemMatch(i,e.term)&&(i.category!=n&&(n=i.category,a.push({iscat:1,catname:n,text:"<strong>"+hilite(n,e.term)+"</strong>"})),a.push({id:i.id,name:i.name,text:"<span class=subbullet></span>"+hilite(i.name,e.term)}))}var r=0;for(underscore.each(a,function(e){e.iscat&&r++}),t=0;t<a.length&&r>3;t++){var l;if(a[t].iscat&&(t+1>=a.length||t+2>=a.length||a[t+2].iscat)){!0;var c=a[t].catname;for(l=t+1;l<a.length&&!a[l].iscat;l++)a[l].text=hilite(c,e.term)+" > <strong>"+hilite(a[l].name,e.term)+"</strong>";for(l=t+1;l<a.length;l++)a[l-1]=a[l];a=a.slice(0,a.length-1)}}s.results=a,e.callback(s)}else{e.callback({results:[{id:1,text:"Type in a command or a client name"}]})}},instaPUT=function(e,t,n){n=n||0;var s={id:instaDATA.length,searchstr:e.join(" > "),name:e.slice(n,1e4).join(" > "),category:e.slice(0,n).join(" > "),url:t,hint:"",path:e.slice(0)};return instaDATA.push(s),s},itemMatch=function(e,t){t=t.toLowerCase();var n=e.searchstr.toLowerCase(),s=!0,a=0,i=0;return underscore.each(t.split(" "),function(e){a++,n.indexOf(e)<0&&(e.length<3?i++:s=!1)}),2*i<a&&s};XPLAN.instasearch.addSideMenu=function(e,t){var n=[];e.title&&""!==e.title&&n.push(e.title);for(var s=0;s<t.length;s++)findSideItems(t[s],n)};var findSideItems=function(e,t,n){var s=sumArs(t,e[0]);"#"!=e[1]&&instaPUT(s,e[1],s.length-1);var a=e[3];if(a&&a.length)for(var i=0;i<a.length;i++)findSideItems(a[i],s,n)},instaTaken=function(e){if(e.val&&0!==e.val.length){var url=instaDATA[e.val[0]].url,jsregex=/^javascript:/;if(url.search(jsregex)>=0){var evalstr=url.replace(jsregex,"");eval(evalstr)}else XPLAN.util.form_redirect(XPLAN.util.getURL(url,[],!0));hideSearch()}},sumArs=function(e,t){var n=e.slice(0);if("string"==typeof t||0!==t.length&&!t[0])n.push(t);else for(var s=0;s<t.length;s++)n.push(t[s]);return n},indexHomeMenu=function(e){var t=["XPLAN"];instaPUT(sumArs(t,"Dashboard"),getBaseURL()+"/dashboard/mainhtml",1);for(var n=0;n<e.length;n++)processMenuItem(t,e[n],2)},processMenuItem=function(e,t,n){var s=sumArs(e,[t.title]);if(t.script&&!t.url&&(t.url="javascript:(function(){"+t.script+";})();"),t.url&&(0!==t.url.indexOf("javascript:")&&(t.url=getBaseURL()+t.url),instaPUT(s,t.url,n)),t.functions&&t.functions.length)for(var a=0;a<t.functions.length;a++)processMenuItem(s,t.functions[a],n)};XPLAN.instasearch.menusIndexed=!1,XPLAN.instasearch.indexMenus=function(){if(!XPLAN.instasearch.menusIndexed){XPLAN.instasearch.menusIndexed=!0;var e=top.location.href;endswith=function(t){return e.length==e.indexOf(t)+t.length};var t=getBaseURL();endswith(t+"/home")||endswith(t+"/home/")||endswith(t+"/home/logoff")||endswith(t+"/home/login")||window.XPLAN&&XPLAN.login_role&&""!==XPLAN.login_role&&(XMLRPC.call("today.getBlocks",[],function(e){indexHomeMenu(e),updateResults()}),XMLRPC.call("today.get_add_links",[],function(e){indexAddMenu(e),updateResults()}),XMLRPC.call("today.get_quicklinks",[],function(e){indexAddQuicklinks(e),updateResults()}),XMLRPC.call("factfind.getRecentEntities",["client"],function(e){indexRecentClients(e)}))}};var indexAddMenu=function(e){for(var t=["Add"],n=0;n<e.length;n++){e[n].title&&0===e[n].title.indexOf("Add ")&&(e[n].title=e[n].title.substr("Add ".length)),processMenuItem(t,e[n],1)}},indexAddQuicklinks=function(e){for(var t=["Quicklinks"],n=0;n<e.length;n++)processMenuItem(t,e[n],1);instaPUT(sumArs(t,"Edit Quicklinks"),"javascript:XPLAN.framemain.editQuicklinks()",1)},indexRecentClients=function(e){for(var t=["Recent Clients"],n=0;n<e.length;n++){var s=e[n];if(s.visible)!function(e,t){XMLRPC.call("factfind.getPageMenu",["client",s.entityid],function(n){if(s.email){var a=getBaseURL()+"/email/edit?new=client&add_to_note=1&client="+t+"&no_egg_timer=1";instaPUT(sumArs(e,"Send Email"),a,2)}underscore.each(n,function(n){addSubUserEntry(e,t,n,2)}),updateResults()})}(sumArs(t,s.name),s.entityid)}},addSubUserEntry=function(e,t,n,s){var a,i=sumArs(e,n.title);n.page&&""!=n.page&&(a=0===n.page.indexOf("/")?getBaseURL()+n.page:getBaseURL()+"/factfind/view/"+t+"?role=client&refresh=1&page="+n.page,instaPUT(i,a,s));n.submenu&&n.submenu.length&&underscore.each(n.submenu,function(e){addSubUserEntry(i,t,e,s)})};$(function(){var e=$("#queryselect2");e&&e.select2&&(e.select2({placeholder:"",multiple:!0,query:queryFn,formatResult:function(e,t,n){return e.text},formatSelection:function(e,t){return e.text},initSelection:function(e,t){t(null)}}).on("change",instaTaken),$("#ta-instasearch a").click(showSearch),$(".instasearch.overlay").click(hideSearch),Mousetrap.bind(["ctrl+shift+f","command+shift+f"],showSearch),Mousetrap.bind("esc",hideSearch),Mousetrap.stopCallback=function(e,t,n){return!1})})}(jQuery);
;Dependency._js['instasearch']=true;
