From 3673a5e14116b60601a3fce1eae9eb5c786a4e08 Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Wed, 9 Mar 2016 21:52:38 +1300 Subject: [PATCH] FIX Inserting a 'Download a file' without selecting an image In the html editor, when inserting a 'Download a file' link without selecting a file to link to, no link should be inserted. Currently is inserting a link to an undefined file id: [file_link,id=undefined] --- admin/javascript/dist/bundle-lib.js | 4 ++-- javascript/dist/HtmlEditorField.js | 3 ++- javascript/dist/i18n.js | 2 +- javascript/src/HtmlEditorField.js | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/admin/javascript/dist/bundle-lib.js b/admin/javascript/dist/bundle-lib.js index 043c11c5d..3e02da108 100644 --- a/admin/javascript/dist/bundle-lib.js +++ b/admin/javascript/dist/bundle-lib.js @@ -1,6 +1,6 @@ require=function e(t,i,n){function s(r,o){if(!i[r]){if(!t[r]){var l="function"==typeof require&&require;if(!o&&l)return l(r,!0);if(a)return a(r,!0);var h=new Error("Cannot find module '"+r+"'");throw h.code="MODULE_NOT_FOUND",h}var c=i[r]={exports:{}};t[r][0].call(c.exports,function(e){var i=t[r][1][e];return s(i?i:e)},c,c.exports,e,t,i,n)}return i[r].exports}for(var a="function"==typeof require&&require,r=0;r"),this.options.alternate.text&&this.buttonElement.append(""+this.options.alternate.text+""),this._refreshAlternate()},refresh:function(){a["default"].ui.button.prototype.refresh.call(this),this._refreshAlternate()},destroy:function(){this.element.find(".ui-button-text-alternate").remove(),this.element.find(".ui-button-icon-alternate").remove(),a["default"].ui.button.prototype.destroy.call(this)}}),a["default"].widget("ssui.ssdialog",a["default"].ui.dialog,{options:{iframeUrl:"",reloadOnOpen:!0,dialogExtraClass:"",modal:!0,bgiframe:!0,autoOpen:!1,autoPosition:!0,minWidth:500,maxWidth:800,minHeight:300,maxHeight:700,widthRatio:.8,heightRatio:.8,resizable:!1},_create:function(){a["default"].ui.dialog.prototype._create.call(this);var e=this,t=(0,a["default"])('');t.bind("load",function(i){"about:blank"!=(0,a["default"])(this).attr("src")&&(t.addClass("loaded").show(),e._resizeIframe(),e.uiDialog.removeClass("loading"))}).hide(),this.options.dialogExtraClass&&this.uiDialog.addClass(this.options.dialogExtraClass),this.element.append(t),this.options.iframeUrl&&this.element.css("overflow","hidden")},open:function(){a["default"].ui.dialog.prototype.open.call(this);var e=this,t=this.element.children("iframe");!this.options.iframeUrl||t.hasClass("loaded")&&!this.options.reloadOnOpen||(t.hide(),t.attr("src",this.options.iframeUrl),this.uiDialog.addClass("loading")),(0,a["default"])(window).bind("resize.ssdialog",function(){e._resizeIframe()})},close:function(){a["default"].ui.dialog.prototype.close.call(this),this.uiDialog.unbind("resize.ssdialog"),(0,a["default"])(window).unbind("resize.ssdialog")},_resizeIframe:function(){var e,t,i={},n=this.element.children("iframe");this.options.widthRatio&&(e=(0,a["default"])(window).width()*this.options.widthRatio,this.options.minWidth&&ethis.options.maxWidth?i.width=this.options.maxWidth:i.width=e),this.options.heightRatio&&(t=(0,a["default"])(window).height()*this.options.heightRatio,this.options.minHeight&&tthis.options.maxHeight?i.height=this.options.maxHeight:i.height=t),jQuery.isEmptyObject(i)||(this._setOptions(i),n.attr("width",i.width-parseFloat(this.element.css("paddingLeft"))-parseFloat(this.element.css("paddingRight"))),n.attr("height",i.height-parseFloat(this.element.css("paddingTop"))-parseFloat(this.element.css("paddingBottom"))),this.options.autoPosition&&this._setOption("position",this.options.position))}}),a["default"].widget("ssui.titlebar",{_create:function(){this.originalTitle=this.element.attr("title");var e=this.options,t=e.title||this.originalTitle||" ",i=a["default"].ui.dialog.getTitleId(this.element);this.element.parent().addClass("ui-dialog");var n=this.element.addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix");if(e.closeButton){var s=(0,a["default"])('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){s.addClass("ui-state-hover")},function(){s.removeClass("ui-state-hover")}).focus(function(){s.addClass("ui-state-focus")}).blur(function(){s.removeClass("ui-state-focus")}).mousedown(function(e){e.stopPropagation()}).appendTo(n);(this.uiDialogTitlebarCloseText=(0,a["default"])("")).addClass("ui-icon ui-icon-closethick").text(e.closeText).appendTo(s)}(0,a["default"])("").addClass("ui-dialog-title").attr("id",i).html(t).prependTo(n);n.find("*").add(n).disableSelection()},destroy:function(){this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.originalTitle&&this.element.attr("title",this.originalTitle)}}),a["default"].extend(a["default"].ssui.titlebar,{version:"0.0.1",options:{title:"",closeButton:!1,closeText:"close"},uuid:0,getTitleId:function(e){return"ui-dialog-title-"+(e.attr("id")||++this.uuid)}})},{jQuery:"jQuery"}],4:[function(e,t,i){(function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.name="SelectParser",e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,i,n,s,a,r;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),a=e.childNodes,r=[],n=0,s=a.length;s>n;n++)i=a[n],r.push(this.add_option(i,t,e.disabled));return r},e.prototype.add_option=function(e,t,i){return"OPTION"===e.nodeName.toUpperCase()?(e.text.match(/^\s*$/g)?this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}):(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:i===!0?i:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})),this.options_index+=1):void 0},e}(),e.select_to_array=function(t){var i,n,s,a,r;for(n=new e,r=t.childNodes,s=0,a=r.length;a>s;s++)i=r[s],n.add_node(i);return n.parsed},this.SelectParser=e}).call(window),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=null!=t?t:{},this.set_default_values(),this.is_multiple=this.form_field.multiple,this.set_default_text(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.name="AbstractChosen",e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},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.match(/^\s*$/g)?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||1/0},e.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||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return t.blur_test()},100))},e.prototype.result_add_option=function(e){var t,i;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),i=""!==e.style.cssText?' style="'+e.style+'"':"",'
  • "+e.html+"
  • ")},e.prototype.results_update_field=function(){return this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,i;switch(t=null!=(i=e.which)?i:e.keyCode,this.search_field_scale(),t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(e.preventDefault(),this.results_showing)return this.result_select(e);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()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,i;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=Math.floor(Math.random()*e.length),t=e.substring(i,i+1)},e}(),t.AbstractChosen=e}.call(window),function(){var e,t,i,n,s={}.hasOwnProperty,a=function(e,t){function i(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};n=this,e=jQuery,e.fn.extend({chosen:function(i){return e.browser.msie&&("6.0"===e.browser.version||"7.0"===e.browser.version&&7===document.documentMode)?this:this.each(function(n){var s;return s=e(this),s.hasClass("chzn-done")?void 0:s.data("chosen",new t(this,i))})}}),t=function(t){function s(){return s.__super__.constructor.apply(this,arguments)}return a(s,t),s.prototype.name="Chosen",s.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},s.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},s.prototype.set_up_html=function(){var t,n,s,a,r;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,t=e("
    ",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+(this.options.width||this.f_width)+"px;"}),this.is_multiple?t.html('
      '):t.html('
      '+this.default_text+'
        '),this.form_field_jq.hide().after(t),this.container=e("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),a=this.rise_up(this.container,this.dropdown),n=a?-this.container.find(".chzn-drop").height():this.container.height(),s=this.container.width()-i(this.dropdown),this.dropdown.css({width:s+"px",top:n+"px"}),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(),r=s-i(this.search_container)-i(this.search_field),this.search_field.css({width:r+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},s.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){return e.container_mousedown(t)}),this.container.mouseup(function(t){return e.container_mouseup(t)}),this.container.mouseenter(function(t){return e.mouse_enter(t)}),this.container.mouseleave(function(t){return e.mouse_leave(t)}),this.search_results.mouseup(function(t){return e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){return e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){return e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){return e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){return e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){return e.container_mousedown(t)}),this.search_field.blur(function(t){return e.input_blur(t)}),this.search_field.keyup(function(t){return e.keyup_checker(t)}),this.search_field.keydown(function(t){return e.keydown_checker(t)}),this.search_field.focus(function(t){return e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){return e.choices_click(t)}):this.container.click(function(e){return e.preventDefault()})},s.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))},s.prototype.container_mousedown=function(t){var i;return this.is_disabled?void 0:(i=null!=t?e(t.target).hasClass("search-choice-close"):!1,t&&"mousedown"===t.type&&!this.results_showing&&t.stopPropagation(),this.pending_destroy_click||i?this.pending_destroy_click=!1:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chzn-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()))},s.prototype.container_mouseup=function(e){return"ABBR"!==e.target.nodeName||this.is_disabled?void 0:this.results_reset(e)},s.prototype.blur_test=function(e){return!this.active_field&&this.container.hasClass("chzn-container-active")?this.close_field():void 0},s.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),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()},s.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()},s.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},s.prototype.results_build=function(){var e,t,i,s,a;for(this.parsing=!0,this.results_data=n.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):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")),e="",a=this.results_data,i=0,s=a.length;s>i;i++)t=a[i],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.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(e),this.parsing=!1},s.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'
      • '+e("
        ").text(t.label).html()+"
      • ")},s.prototype.result_do_highlight=function(e){var t,i,n,s,a;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),n=parseInt(this.search_results.css("maxHeight"),10),a=this.search_results.scrollTop(),s=n+a,i=this.result_highlight.position().top+this.search_results.scrollTop(),t=i+this.result_highlight.outerHeight(),t>=s)return this.search_results.scrollTop(t-n>0?t-n:0);if(a>i)return this.search_results.scrollTop(i)}},s.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},s.prototype.results_show=function(){var e,t,n;return this.is_multiple||(this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected)),t=this.container.width()-i(this.dropdown),n=this.rise_up(this.container,this.dropdown),e=n?-this.container.find(".chzn-drop").height():this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.css("width",t-i(this.search_container)-i(this.search_field)+"px"),this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},s.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},s.prototype.set_tab_index=function(e){var t;return this.form_field_jq.attr("tabindex")?(t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)):void 0},s.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<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"))},s.prototype.search_results_mouseup=function(t){var i;return i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),i.length?(this.result_highlight=i,this.result_select(t),this.search_field.focus()):void 0},s.prototype.search_results_mouseover=function(t){var i;return i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),i?this.result_do_highlight(i):void 0},s.prototype.search_results_mouseout=function(t){return e(t.target).hasClass("active-result")?this.result_clear_highlight():void 0},s.prototype.choices_click=function(t){return t.preventDefault(),!this.active_field||e(t.target).hasClass("search-choice")||this.results_showing?void 0:this.results_show()},s.prototype.choice_build=function(t){var i,n,s,a=this;return i=this.container_id+"_c_"+t.array_index,this.choices+=1,n=t.disabled?'
      • '+t.html+"
      • ":'
      • '+t.html+'
      • ',this.search_container.before(n),s=e("#"+i).find("a").first(),s.click(function(e){return a.choice_destroy_link_click(e)})},s.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},s.prototype.choice_destroy=function(e){return this.result_deselect(e.attr("rel"))?(this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove()):void 0},s.prototype.results_reset=function(){return this.form_field.options[0].selected=!0,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?this.results_hide():void 0},s.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},s.prototype.result_select=function(e){var t,i,n,s;return this.result_highlight?(t=this.result_highlight,i=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),s=i.substr(i.lastIndexOf("_")+1),n=this.results_data[s],n.selected=!0,this.form_field.options[n.options_index].selected=!0,this.is_multiple?this.choice_build(n):(this.selected_item.find("span").first().text(n.text),this.allow_single_deselect&&this.single_deselect_control_build()),e.metaKey&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[n.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()):void 0},s.prototype.result_activate=function(e){return e.addClass("active-result")},s.prototype.result_deactivate=function(e){return e.removeClass("active-result")},s.prototype.result_deselect=function(t){var i,n;return n=this.results_data[t],this.form_field.options[n.options_index].disabled?!1:(n.selected=!1,this.form_field.options[n.options_index].selected=!1,i=e("#"+this.container_id+"_o_"+t),i.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[n.options_index].value}),this.search_field_scale(),!0)},s.prototype.single_deselect_control_build=function(){return this.allow_single_deselect&&this.selected_item.find("abbr").length<1?this.selected_item.find("span").first().after(''):void 0},s.prototype.winnow_results=function(){var t,i,n,s,a,r,o,l,h,c,d,u,p,f,g,m,v,_;for(this.no_results_clear(),h=0,c=this.search_field.val()===this.default_text?"":e("
        ").text(e.trim(this.search_field.val())).html(),r=this.search_contains?"":"^",a=new RegExp(r+c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),_=this.results_data,f=0,m=_.length;m>f;f++)if(i=_[f],!i.disabled&&!i.empty)if(i.group)e("#"+i.dom_id).css("display","none");else if(!this.is_multiple||!i.selected){if(t=!1,l=i.dom_id,o=e("#"+l),a.test(i.html))t=!0,h+=1;else if((i.html.indexOf(" ")>=0||0===i.html.indexOf("["))&&(s=i.html.replace(/\[|\]/g,"").split(" "),s.length))for(g=0,v=s.length;v>g;g++)n=s[g],a.test(n)&&(t=!0,h+=1);t?(c.length?(d=i.html.search(p),u=i.html.substr(0,d+c.length)+""+i.html.substr(d+c.length),u=u.substr(0,d)+""+u.substr(d)):u=i.html,o.html(u),this.result_activate(o),null!=i.group_array_index&&e("#"+this.results_data[i.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&l===this.result_highlight.attr("id")&&this.result_clear_highlight(), this.result_deactivate(o))}return 1>h&&c.length?this.no_results(c):this.winnow_results_set_highlight()},s.prototype.winnow_results_clear=function(){var t,i,n,s,a;for(this.search_field.val(""),i=this.search_results.find("li"),a=[],n=0,s=i.length;s>n;n++)t=i[n],t=e(t),t.hasClass("group-result")?a.push(t.css("display","auto")):this.is_multiple&&t.hasClass("result-selected")?a.push(void 0):a.push(this.result_activate(t));return a},s.prototype.winnow_results_set_highlight=function(){var e,t;return this.result_highlight||(t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first(),null==e)?void 0:this.result_do_highlight(e)},s.prototype.no_results=function(t){var i;return i=e('
      • '+this.results_none_found+' ""
      • '),i.find("span").first().html(t),this.search_results.append(i)},s.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},s.prototype.keydown_arrow=function(){var t,i;return this.result_highlight?this.results_showing&&(i=this.result_highlight.nextAll("li.active-result").first(),i&&this.result_do_highlight(i)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t))),this.results_showing?void 0:this.results_show()},s.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},s.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last(),e.length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},s.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},s.prototype.keydown_checker=function(e){var t,i;switch(t=null!=(i=e.which)?i:e.keyCode,this.search_field_scale(),8!==t&&this.pending_backstroke&&this.clear_backstroke(),t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},s.prototype.search_field_scale=function(){var t,i,n,s,a,r,o,l,h,c;if(this.is_multiple){for(n=0,l=0,r="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],h=0,c=o.length;c>h;h++)a=o[h],r+=a+":"+this.search_field.css(a)+";";return i=e("
        ",{style:r}),i.text(this.search_field.val()),e("body").append(i),l=i.width()+25,i.remove(),l>this.f_width-10&&(l=this.f_width-10),this.search_field.css({width:l+"px"}),s=this.rise_up(this.container,this.dropdown),t=s?-this.container.find(".chzn-drop").height():this.container.height(),this.dropdown.css({top:t+"px"})}},s.prototype.generate_random_id=function(){var t;for(t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();e("#"+t).length>0;)t+=this.generate_random_char();return t},s.prototype.rise_up=function(t,i){var n,s,a,r;return r=t.find("a.chzn-single"),r.length>0?(a=e(window).height()+e(document).scrollTop()-t.find("a").innerHeight(),s=r.offset().top,n=i.innerHeight(),s+n>a&&s-n>0?(t.addClass("chzn-with-rise"),!0):(t.removeClass("chzn-with-rise"),!1)):!1},s}(AbstractChosen),i=function(e){var t;return t=e.outerWidth()-e.width()},n.get_side_border_padding=i}.call(window)},{}],5:[function(e,t,i){!function(e,t){"use strict";var i=e.History=e.History||{},n=e.jQuery;if("undefined"!=typeof i.Adapter)throw new Error("History.js Adapter has already been loaded...");i.Adapter={bind:function(e,t,i){n(e).bind(t,i)},trigger:function(e,t,i){n(e).trigger(t,i)},extractEventData:function(e,i,n){var s=i&&i.originalEvent&&i.originalEvent[e]||n&&n[e]||t;return s},onDomLoad:function(e){n(e)}},"undefined"!=typeof i.init&&i.init()}(window)},{}],6:[function(e,t,i){!function(e,t){"use strict";var i=e.document,n=e.setTimeout||n,s=e.clearTimeout||s,a=e.setInterval||a,r=e.History=e.History||{};if("undefined"!=typeof r.initHtml4)throw new Error("History.js HTML4 Support has already been loaded...");r.initHtml4=function(){return"undefined"!=typeof r.initHtml4.initialized?!1:(r.initHtml4.initialized=!0,r.enabled=!0,r.savedHashes=[],r.isLastHash=function(e){var t,i=r.getHashByIndex();return t=e===i},r.isHashEqual=function(e,t){return e=encodeURIComponent(e).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),e===t},r.saveHash=function(e){return r.isLastHash(e)?!1:(r.savedHashes.push(e),!0)},r.getHashByIndex=function(e){var t=null;return t="undefined"==typeof e?r.savedHashes[r.savedHashes.length-1]:0>e?r.savedHashes[r.savedHashes.length+e]:r.savedHashes[e]},r.discardedHashes={},r.discardedStates={},r.discardState=function(e,t,i){var n,s=r.getHashByState(e);return n={discardedState:e,backState:i,forwardState:t},r.discardedStates[s]=n,!0},r.discardHash=function(e,t,i){var n={discardedHash:e,backState:i,forwardState:t};return r.discardedHashes[e]=n,!0},r.discardedState=function(e){var t,i=r.getHashByState(e);return t=r.discardedStates[i]||!1},r.discardedHash=function(e){var t=r.discardedHashes[e]||!1;return t},r.recycleState=function(e){var t=r.getHashByState(e);return r.discardedState(e)&&delete r.discardedStates[t],!0},r.emulated.hashChange&&(r.hashChangeInit=function(){r.checkerFunction=null;var t,n,s,o,l="",h=Boolean(r.getHash());return r.isInternetExplorer()?(t="historyjs-iframe",n=i.createElement("iframe"),n.setAttribute("id",t),n.setAttribute("src","#"),n.style.display="none",i.body.appendChild(n),n.contentWindow.document.open(),n.contentWindow.document.close(),s="",o=!1,r.checkerFunction=function(){if(o)return!1;o=!0;var t=r.getHash(),i=r.getHash(n.contentWindow.document.location);return t!==l?(l=t,i!==t&&(s=i=t,n.contentWindow.document.open(),n.contentWindow.document.close(),n.contentWindow.document.location.hash=r.escapeHash(t)),r.Adapter.trigger(e,"hashchange")):i!==s&&(s=i,h&&""===i?r.back():r.setHash(i,!1)),o=!1,!0}):r.checkerFunction=function(){var t=r.getHash()||"";return t!==l&&(l=t,r.Adapter.trigger(e,"hashchange")),!0},r.intervalList.push(a(r.checkerFunction,r.options.hashChangeInterval)),!0},r.Adapter.onDomLoad(r.hashChangeInit)),r.emulated.pushState&&(r.onHashChange=function(t){var i,n=t&&t.newURL||r.getLocationHref(),s=r.getHashByUrl(n),a=null,o=null;return r.isLastHash(s)?(r.busy(!1),!1):(r.doubleCheckComplete(),r.saveHash(s),s&&r.isTraditionalAnchor(s)?(r.Adapter.trigger(e,"anchorchange"),r.busy(!1),!1):(a=r.extractState(r.getFullUrl(s||r.getLocationHref()),!0),r.isLastSavedState(a)?(r.busy(!1),!1):(o=r.getHashByState(a),(i=r.discardedState(a))?(r.getHashByIndex(-2)===r.getHashByState(i.forwardState)?r.back(!1):r.forward(!1),!1):(r.pushState(a.data,a.title,encodeURI(a.url),!1),!0))))},r.Adapter.bind(e,"hashchange",r.onHashChange),r.pushState=function(t,i,n,s){if(n=encodeURI(n).replace(/%25/g,"%"),r.getHashByUrl(n))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(s!==!1&&r.busy())return r.pushQueue({scope:r,callback:r.pushState,args:arguments,queue:s}),!1;r.busy(!0);var a=r.createStateObject(t,i,n),o=r.getHashByState(a),l=r.getState(!1),h=r.getHashByState(l),c=r.getHash(),d=r.expectedStateId==a.id;return r.storeState(a),r.expectedStateId=a.id,r.recycleState(a),r.setTitle(a),o===h?(r.busy(!1),!1):(r.saveState(a),d||r.Adapter.trigger(e,"statechange"),r.isHashEqual(o,c)||r.isHashEqual(o,r.getShortUrl(r.getLocationHref()))||r.setHash(o,!1),r.busy(!1),!0)},r.replaceState=function(t,i,n,s){if(n=encodeURI(n).replace(/%25/g,"%"),r.getHashByUrl(n))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(s!==!1&&r.busy())return r.pushQueue({scope:r,callback:r.replaceState,args:arguments,queue:s}),!1;r.busy(!0);var a=r.createStateObject(t,i,n),o=r.getHashByState(a),l=r.getState(!1),h=r.getHashByState(l),c=r.getStateByIndex(-2);return r.discardState(l,a,c),o===h?(r.storeState(a),r.expectedStateId=a.id,r.recycleState(a),r.setTitle(a),r.saveState(a),r.Adapter.trigger(e,"statechange"),r.busy(!1)):r.pushState(a.data,a.title,a.url,!1),!0}),void(r.emulated.pushState&&r.getHash()&&!r.emulated.hashChange&&r.Adapter.onDomLoad(function(){r.Adapter.trigger(e,"hashchange")})))},"undefined"!=typeof r.init&&r.init()}(window)},{}],7:[function(e,t,i){!function(e,t){"use strict";var i=e.console||t,n=e.document,s=e.navigator,a=e.sessionStorage||!1,r=e.setTimeout,o=e.clearTimeout,l=e.setInterval,h=e.clearInterval,c=e.JSON,d=e.alert,u=e.History=e.History||{},p=e.history;try{a.setItem("TEST","1"),a.removeItem("TEST")}catch(f){a=!1}if(c.stringify=c.stringify||c.encode,c.parse=c.parse||c.decode,"undefined"!=typeof u.init)throw new Error("History.js Core has already been loaded...");u.init=function(e){return"undefined"==typeof u.Adapter?!1:("undefined"!=typeof u.initCore&&u.initCore(),"undefined"!=typeof u.initHtml4&&u.initHtml4(),!0)},u.initCore=function(f){if("undefined"!=typeof u.initCore.initialized)return!1;if(u.initCore.initialized=!0,u.options=u.options||{},u.options.hashChangeInterval=u.options.hashChangeInterval||100,u.options.safariPollInterval=u.options.safariPollInterval||500,u.options.doubleCheckInterval=u.options.doubleCheckInterval||500,u.options.disableSuid=u.options.disableSuid||!1,u.options.storeInterval=u.options.storeInterval||1e3,u.options.busyDelay=u.options.busyDelay||250,u.options.debug=u.options.debug||!1,u.options.initialTitle=u.options.initialTitle||n.title,u.options.html4Mode=u.options.html4Mode||!1,u.options.delayInit=u.options.delayInit||!1,u.intervalList=[],u.clearAllIntervals=function(){var e,t=u.intervalList;if("undefined"!=typeof t&&null!==t){for(e=0;et;++t){if(r=arguments[t],"object"==typeof r&&"undefined"!=typeof c)try{r=c.stringify(r)}catch(h){}e+="\n"+r+"\n"}return l?(l.value+=e+"\n-----\n",l.scrollTop=l.scrollHeight-l.clientHeight):o||d(e),!0},u.getInternetExplorerMajorVersion=function(){var e=u.getInternetExplorerMajorVersion.cached="undefined"!=typeof u.getInternetExplorerMajorVersion.cached?u.getInternetExplorerMajorVersion.cached:function(){for(var e=3,t=n.createElement("div"),i=t.getElementsByTagName("i");(t.innerHTML="")&&i[0];);return e>4?e:!1}();return e},u.isInternetExplorer=function(){var e=u.isInternetExplorer.cached="undefined"!=typeof u.isInternetExplorer.cached?u.isInternetExplorer.cached:Boolean(u.getInternetExplorerMajorVersion());return e},u.options.html4Mode?u.emulated={pushState:!0,hashChange:!0}:u.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(s.userAgent)||/AppleWebKit\/5([0-2]|3[0-2])/i.test(s.userAgent))),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in n)||u.isInternetExplorer()&&u.getInternetExplorerMajorVersion()<8)},u.enabled=!u.emulated.pushState,u.bugs={setHash:Boolean(!u.emulated.pushState&&"Apple Computer, Inc."===s.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(s.userAgent)),safariPoll:Boolean(!u.emulated.pushState&&"Apple Computer, Inc."===s.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(s.userAgent)),ieDoubleCheck:Boolean(u.isInternetExplorer()&&u.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(u.isInternetExplorer()&&u.getInternetExplorerMajorVersion()<7)},u.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},u.cloneObject=function(e){var t,i;return e?(t=c.stringify(e),i=c.parse(t)):i={},i},u.getRootUrl=function(){var e=n.location.protocol+"//"+(n.location.hostname||n.location.host);return n.location.port&&(e+=":"+n.location.port),e+="/"},u.getBaseHref=function(){var e=n.getElementsByTagName("base"),t=null,i="";return 1===e.length&&(t=e[0],i=t.href.replace(/[^\/]+$/,"")),i=i.replace(/\/+$/,""),i&&(i+="/"),i},u.getBaseUrl=function(){var e=u.getBaseHref()||u.getBasePageUrl()||u.getRootUrl();return e},u.getPageUrl=function(){var e,t=u.getState(!1,!1),i=(t||{}).url||u.getLocationHref();return e=i.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,i){return/\./.test(e)?e:e+"/"})},u.getBasePageUrl=function(){var e=u.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,i){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},u.getFullUrl=function(e,t){var i=e,n=e.substring(0,1);return t="undefined"==typeof t?!0:t,/[a-z]+\:\/\//.test(e)||(i="/"===n?u.getRootUrl()+e.replace(/^\/+/,""):"#"===n?u.getPageUrl().replace(/#.*/,"")+e:"?"===n?u.getPageUrl().replace(/[\?#].*/,"")+e:t?u.getBaseUrl()+e.replace(/^(\.\/)+/,""):u.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),i.replace(/\#$/,"")},u.getShortUrl=function(e){var t=e,i=u.getBaseUrl(),n=u.getRootUrl();return u.emulated.pushState&&(t=t.replace(i,"")),t=t.replace(n,"/"),u.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,"")},u.getLocationHref=function(e){return e=e||n,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:-1==e.URL.indexOf("#")&&-1!=e.location.href.indexOf("#")?e.location.href:e.URL||e.location.href},u.store={},u.idToState=u.idToState||{},u.stateToId=u.stateToId||{},u.urlToId=u.urlToId||{},u.storedStates=u.storedStates||[],u.savedStates=u.savedStates||[],u.normalizeStore=function(){u.store.idToState=u.store.idToState||{},u.store.urlToId=u.store.urlToId||{},u.store.stateToId=u.store.stateToId||{}},u.getState=function(e,t){"undefined"==typeof e&&(e=!0),"undefined"==typeof t&&(t=!0);var i=u.getLastSavedState();return!i&&t&&(i=u.createStateObject()),e&&(i=u.cloneObject(i),i.url=i.cleanUrl||i.url),i},u.getIdByState=function(e){var t,i=u.extractId(e.url);if(!i)if(t=u.getStateString(e),"undefined"!=typeof u.stateToId[t])i=u.stateToId[t];else if("undefined"!=typeof u.store.stateToId[t])i=u.store.stateToId[t];else{for(;;)if(i=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),"undefined"==typeof u.idToState[i]&&"undefined"==typeof u.store.idToState[i])break;u.stateToId[t]=i,u.idToState[i]=e}return i},u.normalizeState=function(e){var t,i;return e&&"object"==typeof e||(e={}),"undefined"!=typeof e.normalized?e:(e.data&&"object"==typeof e.data||(e.data={}),t={},t.normalized=!0,t.title=e.title||"",t.url=u.getFullUrl(e.url?decodeURIComponent(e.url):u.getLocationHref()),t.hash=u.getShortUrl(t.url),t.data=u.cloneObject(e.data),t.id=u.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,i=!u.isEmptyObject(t.data),(t.title||i)&&u.options.disableSuid!==!0&&(t.hash=u.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=u.getFullUrl(t.hash),(u.emulated.pushState||u.bugs.safariPoll)&&u.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t)},u.createStateObject=function(e,t,i){var n={data:e,title:t,url:i};return n=u.normalizeState(n)},u.getStateById=function(e){e=String(e);var i=u.idToState[e]||u.store.idToState[e]||t;return i},u.getStateString=function(e){var t,i,n;return t=u.normalizeState(e),i={data:t.data,title:e.title,url:e.url},n=c.stringify(i)},u.getStateId=function(e){var t,i;return t=u.normalizeState(e),i=t.id},u.getHashByState=function(e){var t,i;return t=u.normalizeState(e),i=t.hash},u.extractId=function(e){var t,i,n,s;return s=-1!=e.indexOf("#")?e.split("#")[0]:e,i=/(.*)\&_suid=([0-9]+)$/.exec(s),n=i?i[1]||e:e,t=i?String(i[2]||""):"",t||!1},u.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},u.extractState=function(e,t){var i,n,s=null;return t=t||!1,i=u.extractId(e),i&&(s=u.getStateById(i)),s||(n=u.getFullUrl(e),i=u.getIdByUrl(n)||!1,i&&(s=u.getStateById(i)),s||!t||u.isTraditionalAnchor(e)||(s=u.createStateObject(null,null,n))),s},u.getIdByUrl=function(e){var i=u.urlToId[e]||u.store.urlToId[e]||t;return i},u.getLastSavedState=function(){return u.savedStates[u.savedStates.length-1]||t},u.getLastStoredState=function(){return u.storedStates[u.storedStates.length-1]||t},u.hasUrlDuplicate=function(e){var t,i=!1;return t=u.extractState(e.url),i=t&&t.id!==e.id},u.storeState=function(e){return u.urlToId[e.url]=e.id,u.storedStates.push(u.cloneObject(e)),e},u.isLastSavedState=function(e){var t,i,n,s=!1;return u.savedStates.length&&(t=e.id,i=u.getLastSavedState(),n=i.id,s=t===n),s},u.saveState=function(e){return u.isLastSavedState(e)?!1:(u.savedStates.push(u.cloneObject(e)),!0)},u.getStateByIndex=function(e){var t=null;return t="undefined"==typeof e?u.savedStates[u.savedStates.length-1]:0>e?u.savedStates[u.savedStates.length+e]:u.savedStates[e]},u.getCurrentIndex=function(){var e=null;return e=u.savedStates.length<1?0:u.savedStates.length-1},u.getHash=function(e){var t,i=u.getLocationHref(e);return t=u.getHashByUrl(i)},u.unescapeHash=function(e){var t=u.normalizeHash(e);return t=decodeURIComponent(t)},u.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},u.setHash=function(e,t){var i,s;return t!==!1&&u.busy()?(u.pushQueue({scope:u,callback:u.setHash,args:arguments,queue:t}),!1):(u.busy(!0),i=u.extractState(e,!0),i&&!u.emulated.pushState?u.pushState(i.data,i.title,i.url,!1):u.getHash()!==e&&(u.bugs.setHash?(s=u.getPageUrl(),u.pushState(null,null,s+"#"+e,!1)):n.location.hash=e),u)},u.escapeHash=function(t){var i=u.normalizeHash(t);return i=e.encodeURIComponent(i),u.bugs.hashEscape||(i=i.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),i},u.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=u.unescapeHash(t)},u.setTitle=function(e){var t,i=e.title;i||(t=u.getStateByIndex(0),t&&t.url===e.url&&(i=t.title||u.options.initialTitle));try{n.getElementsByTagName("title")[0].innerHTML=i.replace("<","<").replace(">",">").replace(" & "," & ")}catch(s){}return n.title=i,u},u.queues=[],u.busy=function(e){if("undefined"!=typeof e?u.busy.flag=e:"undefined"==typeof u.busy.flag&&(u.busy.flag=!1),!u.busy.flag){o(u.busy.timeout);var t=function(){var e,i,n;if(!u.busy.flag)for(e=u.queues.length-1;e>=0;--e)i=u.queues[e],0!==i.length&&(n=i.shift(),u.fireQueueItem(n),u.busy.timeout=r(t,u.options.busyDelay))};u.busy.timeout=r(t,u.options.busyDelay)}return u.busy.flag},u.busy.flag=!1,u.fireQueueItem=function(e){return e.callback.apply(e.scope||u,e.args||[])},u.pushQueue=function(e){return u.queues[e.queue||0]=u.queues[e.queue||0]||[],u.queues[e.queue||0].push(e),u},u.queue=function(e,t){return"function"==typeof e&&(e={callback:e}),"undefined"!=typeof t&&(e.queue=t),u.busy()?u.pushQueue(e):u.fireQueueItem(e),u},u.clearQueue=function(){return u.busy.flag=!1,u.queues=[],u},u.stateChanged=!1,u.doubleChecker=!1,u.doubleCheckComplete=function(){return u.stateChanged=!0,u.doubleCheckClear(),u},u.doubleCheckClear=function(){return u.doubleChecker&&(o(u.doubleChecker),u.doubleChecker=!1),u},u.doubleCheck=function(e){return u.stateChanged=!1,u.doubleCheckClear(),u.bugs.ieDoubleCheck&&(u.doubleChecker=r(function(){return u.doubleCheckClear(),u.stateChanged||e(),!0},u.options.doubleCheckInterval)),u},u.safariStatePoll=function(){var t,i=u.extractState(u.getLocationHref());if(!u.isLastSavedState(i))return t=i,t||(t=u.createStateObject()),u.Adapter.trigger(e,"popstate"),u},u.back=function(e){return e!==!1&&u.busy()?(u.pushQueue({scope:u,callback:u.back,args:arguments,queue:e}),!1):(u.busy(!0),u.doubleCheck(function(){u.back(!1)}),p.go(-1),!0)},u.forward=function(e){return e!==!1&&u.busy()?(u.pushQueue({scope:u,callback:u.forward,args:arguments,queue:e}),!1):(u.busy(!0),u.doubleCheck(function(){u.forward(!1)}),p.go(1),!0)},u.go=function(e,t){var i;if(e>0)for(i=1;e>=i;++i)u.forward(t);else{if(!(0>e))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(i=-1;i>=e;--i)u.back(t)}return u},u.emulated.pushState){var g=function(){};u.pushState=u.pushState||g,u.replaceState=u.replaceState||g}else u.onPopState=function(t,i){var n,s,a=!1,r=!1;return u.doubleCheckComplete(),(n=u.getHash())?(s=u.extractState(n||u.getLocationHref(),!0),s?u.replaceState(s.data,s.title,s.url,!1):(u.Adapter.trigger(e,"anchorchange"),u.busy(!1)),u.expectedStateId=!1,!1):(a=u.Adapter.extractEventData("state",t,i)||!1,r=a?u.getStateById(a):u.expectedStateId?u.getStateById(u.expectedStateId):u.extractState(u.getLocationHref()),r||(r=u.createStateObject(null,null,u.getLocationHref())),u.expectedStateId=!1,u.isLastSavedState(r)?(u.busy(!1),!1):(u.storeState(r),u.saveState(r),u.setTitle(r),u.Adapter.trigger(e,"statechange"),u.busy(!1),!0))},u.Adapter.bind(e,"popstate",u.onPopState),u.pushState=function(t,i,n,s){if(u.getHashByUrl(n)&&u.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(s!==!1&&u.busy())return u.pushQueue({scope:u,callback:u.pushState,args:arguments,queue:s}),!1;u.busy(!0);var a=u.createStateObject(t,i,n);return u.isLastSavedState(a)?u.busy(!1):(u.storeState(a),u.expectedStateId=a.id,p.pushState(a.id,a.title,a.url),u.Adapter.trigger(e,"popstate")),!0},u.replaceState=function(t,i,n,s){if(u.getHashByUrl(n)&&u.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(s!==!1&&u.busy())return u.pushQueue({scope:u,callback:u.replaceState,args:arguments,queue:s}),!1;u.busy(!0);var a=u.createStateObject(t,i,n);return u.isLastSavedState(a)?u.busy(!1):(u.storeState(a),u.expectedStateId=a.id,p.replaceState(a.id,a.title,a.url),u.Adapter.trigger(e,"popstate")),!0};if(a){try{u.store=c.parse(a.getItem("History.store"))||{}}catch(m){u.store={}}u.normalizeStore()}else u.store={},u.normalizeStore();u.Adapter.bind(e,"unload",u.clearAllIntervals),u.saveState(u.storeState(u.extractState(u.getLocationHref(),!0))),a&&(u.onUnload=function(){var e,t,i;try{e=c.parse(a.getItem("History.store"))||{}}catch(n){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in u.idToState)u.idToState.hasOwnProperty(t)&&(e.idToState[t]=u.idToState[t]);for(t in u.urlToId)u.urlToId.hasOwnProperty(t)&&(e.urlToId[t]=u.urlToId[t]);for(t in u.stateToId)u.stateToId.hasOwnProperty(t)&&(e.stateToId[t]=u.stateToId[t]);u.store=e,u.normalizeStore(),i=c.stringify(e);try{a.setItem("History.store",i)}catch(s){if(!/QUOTA_EXCEEDED_ERR/.test(s.message))throw s;a.removeItem("History.store"),a.setItem("History.store",i)}},u.intervalList.push(l(u.onUnload,u.options.storeInterval)),u.Adapter.bind(e,"beforeunload",u.onUnload),u.Adapter.bind(e,"unload",u.onUnload)),u.emulated.pushState||(u.bugs.safariPoll&&u.intervalList.push(l(u.safariStatePoll,u.options.safariPollInterval)),"Apple Computer, Inc."!==s.vendor&&"Mozilla"!==(s.appCodeName||"")||(u.Adapter.bind(e,"hashchange",function(){u.Adapter.trigger(e,"popstate")}),u.getHash()&&u.Adapter.onDomLoad(function(){u.Adapter.trigger(e,"hashchange")})))},u.options&&u.options.delayInit||u.init()}(window)},{}],8:[function(e,t,i){!function(){window.jLayout="undefined"==typeof window.jLayout?{}:window.jLayout,jLayout.border=function(e){function t(e){return function(t){var n,h=t.insets(),c=0,d=0;return s&&s.isVisible()&&(n=s[e+"Size"](),c+=n.width+i.hgap,d=n.height),a&&a.isVisible()&&(n=a[e+"Size"](),c+=n.width+i.hgap,d=Math.max(n.height,d)),l&&l.isVisible()&&(n=l[e+"Size"](),c+=n.width,d=Math.max(n.height,d)),r&&r.isVisible()&&(n=r[e+"Size"](),c=Math.max(n.width,c),d+=n.height+i.vgap),o&&o.isVisible()&&(n=o[e+"Size"](),c=Math.max(n.width,c),d+=n.height+i.vgap),{width:c+h.left+h.right,height:d+h.top+h.bottom}}}var i={},n={},s=e.east,a=e.west,r=e.north,o=e.south,l=e.center;return i.hgap=e.hgap||0,i.vgap=e.vgap||0,n.items=function(){var e=[];return s&&e.push(s),a&&e.push(a),r&&e.push(r),o&&e.push(o),l&&e.push(l),e},n.layout=function(e){var t,n=e.bounds(),h=e.insets(),c=h.top,d=n.height-h.bottom,u=h.left,p=n.width-h.right;return r&&r.isVisible()&&(t=r.preferredSize(),r.bounds({x:u,y:c,width:p-u,height:t.height}),r.doLayout(),c+=t.height+i.vgap),o&&o.isVisible()&&(t=o.preferredSize(),o.bounds({x:u,y:d-t.height,width:p-u,height:t.height}),o.doLayout(),d-=t.height+i.vgap),s&&s.isVisible()&&(t=s.preferredSize(),s.bounds({x:p-t.width,y:c,width:t.width,height:d-c}),s.doLayout(),p-=t.width+i.hgap),a&&a.isVisible()&&(t=a.preferredSize(),a.bounds({x:u,y:c,width:t.width,height:d-c}),a.doLayout(),u+=t.width+i.hgap),l&&l.isVisible()&&(l.bounds({x:u,y:c,width:p-u,height:d-c}),l.doLayout()),e},n.preferred=t("preferred"),n.minimum=t("minimum"),n.maximum=t("maximum"),n}}()},{}],9:[function(e,t,i){var n=window.jQuery,s=window.jLayout;n&&s&&!function(e){var t=e.jLayoutWrap=function(t,i){var n={};return n.item=t,e.each(["min","max"],function(e,i){n[i+"imumSize"]=function(e){var s=t.data("jlayout");return s?s[i+"imum"](n):t[i+"Size"](e)}}),e.extend(n,{doLayout:function(){var e=t.data("jlayout");e?e.layout(n):t.is("[data-layout-type]")&&t.layout({resize:!1}),t.css({position:"absolute"})},isVisible:function(){return t.isVisible()},insets:function(){var e=t.padding(),i=t.border();return{top:e.top,bottom:e.bottom+i.bottom+i.top,left:e.left,right:e.right+i.right+i.left}},bounds:function(e){var i={};return e?("number"==typeof e.x&&(i.left=e.x),"number"==typeof e.y&&(i.top=e.y),"number"==typeof e.width&&(i.width=e.width-(t.outerWidth(!0)-t.width()),i.width=i.width>=0?i.width:0),"number"==typeof e.height&&(i.height=e.height-(t.outerHeight(!0)-t.height()),i.height=i.height>=0?i.height:0),t.css(i),t):(i=t.position(),{x:i.left,y:i.top,width:t.outerWidth(!1),height:t.outerHeight(!1)})},preferredSize:function(){var e,s,a=t.margin(),r={width:0,height:0},o=t.data("jlayout");return o&&i?(r=o.preferred(n),e=n.minimumSize(),s=n.maximumSize(),r.width+=a.left+a.right,r.height+=a.top+a.bottom,r.widths.width||r.height>s.height)&&(r.width=Math.min(r.width,s.width),r.height=Math.min(r.height,s.height))):(r=n.bounds(),r.width+=a.left+a.right,r.height+=a.top+a.bottom),r}}),n};e.fn.layout=function(i){var n=e.extend({},e.fn.layout.defaults,i);return e.each(this,function(){var i=e(this),a=e.metadata&&i.metadata().layout?e.extend(n,i.metadata().layout):n,a=i.data("layoutType")?e.extend(a,{type:i.data("layoutType")}):a,r=t(i,a.resize);"border"===a.type&&"undefined"!=typeof s.border?(e.each(["north","south","west","east","center"],function(e,n){i.children().hasClass(n)&&(a[n]=t(i.children("."+n+":first")))}),i.data("jlayout",s.border(a))):"grid"===a.type&&"undefined"!=typeof s.grid?(a.items=[],i.children().each(function(i){e(this).hasClass("ui-resizable-handle")||(a.items[i]=t(e(this)))}),i.data("jlayout",s.grid(a))):"flexGrid"===a.type&&"undefined"!=typeof s.flexGrid?(a.items=[],i.children().each(function(i){e(this).hasClass("ui-resizable-handle")||(a.items[i]=t(e(this)))}),i.data("jlayout",s.flexGrid(a))):"column"===a.type&&"undefined"!=typeof s.column?(a.items=[],i.children().each(function(i){e(this).hasClass("ui-resizable-handle")||(a.items[i]=t(e(this)))}),i.data("jlayout",s.column(a))):"flow"===a.type&&"undefined"!=typeof s.flow&&(a.items=[],i.children().each(function(i){e(this).hasClass("ui-resizable-handle")||(a.items[i]=t(e(this)))}),i.data("jlayout",s.flow(a))),a.resize&&r.bounds(r.preferredSize()),r.doLayout(),i.css({position:"relative"}),void 0!==e.ui&&i.addClass("ui-widget")})},e.fn.layout.defaults={resize:!0,type:"grid"}}(n)},{}],10:[function(e,t,i){!function(e){e.fn.hoverIntent=function(t,i){var n={sensitivity:7,interval:100,timeout:350};n=e.extend(n,i?{over:t,out:i}:t);var s,a,r,o,l=function(e){s=e.pageX,a=e.pageY},h=function(t,i){return i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(r-s)+Math.abs(o-a)
        ").addClass("notice-wrap").appendTo("body"),n=e("
        ").addClass("notice-item-wrapper"),s=e("
        ").hide().addClass("notice-item "+t.type).appendTo(i).html("

        "+t.text+"

        ").animate(t.inEffect,t.inEffectDuration).wrap(n),a=e("
        ").addClass("notice-item-close").prependTo(s).html("x").click(function(){e.noticeRemove(s)}),s.hover(function(){o=!0},function(){o=!1}),t.stay||setTimeout(function(){var t=setInterval(function(){o||(e.noticeRemove(s),clearInterval(t))},1e3)},t.stayTime)},noticeRemove:function(e){e.animate({opacity:"0"},600,function(){e.parent().animate({height:"0px"},300,function(){e.parent().remove()})})}})}(jQuery)},{}],12:[function(e,t,i){!function(e){"use strict";var t=function(e){return parseInt(e,10)||0};e.each(["min","max"],function(i,n){e.fn[n+"Size"]=function(e){var i,s;return e?(void 0!==e.width&&this.css(n+"-width",e.width),void 0!==e.height&&this.css(n+"-height",e.height),this):(i=this.css(n+"-width"),s=this.css(n+"-height"),{width:"max"===n&&(void 0===i||"none"===i||-1===t(i))&&Number.MAX_VALUE||t(i),height:"max"===n&&(void 0===s||"none"===s||-1===t(s))&&Number.MAX_VALUE||t(s)})}}),e.fn.isVisible=function(){return this.is(":visible")},e.each(["border","margin","padding"],function(i,n){e.fn[n]=function(e){return e?(void 0!==e.top&&this.css(n+"-top"+("border"===n?"-width":""),e.top),void 0!==e.bottom&&this.css(n+"-bottom"+("border"===n?"-width":""),e.bottom),void 0!==e.left&&this.css(n+"-left"+("border"===n?"-width":""),e.left),void 0!==e.right&&this.css(n+"-right"+("border"===n?"-width":""),e.right),this):{top:t(this.css(n+"-top"+("border"===n?"-width":""))),bottom:t(this.css(n+"-bottom"+("border"===n?"-width":""))),left:t(this.css(n+"-left"+("border"===n?"-width":""))),right:t(this.css(n+"-right"+("border"===n?"-width":"")))}}})}(jQuery)},{}],13:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s);a["default"].fn.extend({ssDatepicker:function(e){return(0,a["default"])(this).each(function(){if(!(0,a["default"])(this).data("datepicker")){(0,a["default"])(this).siblings("button").addClass("ui-icon ui-icon-calendar");var t=((0,a["default"])(this).parents(".field.date:first"),a["default"].extend(e||{},(0,a["default"])(this).data(),(0,a["default"])(this).data("jqueryuiconfig"),{}));t.showcalendar&&(t.locale&&a["default"].datepicker.regional[t.locale]&&(t=a["default"].extend(t,a["default"].datepicker.regional[t.locale],{})), -t.min&&(t.minDate=a["default"].datepicker.parseDate("yy-mm-dd",t.min)),t.max&&(t.maxDate=a["default"].datepicker.parseDate("yy-mm-dd",t.max)),t.dateFormat=t.jquerydateformat,(0,a["default"])(this).datepicker(t))}})}}),(0,a["default"])(document).on("click",".field.date input.text,input.text.date",function(){(0,a["default"])(this).ssDatepicker(),(0,a["default"])(this).data("datepicker")&&(0,a["default"])(this).datepicker("show")})},{"./jQuery":"jQuery"}],14:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s),r=e("./i18n"),o=n(r);a["default"].entwine("ss",function(e){e(".ss-gridfield").entwine({reload:function(t,i){var n=this,s=this.closest("form"),a=this.find(":input:focus").attr("name"),r=s.find(":input").serializeArray();t||(t={}),t.data||(t.data=[]),t.data=t.data.concat(r),window.location.search&&(t.data=window.location.search.replace(/^\?/,"")+"&"+e.param(t.data)),window.history&&window.history.pushState||window.location.hash&&-1!=window.location.hash.indexOf("?")&&(t.data=window.location.hash.substring(window.location.hash.indexOf("?")+1)+"&"+e.param(t.data)),s.addClass("loading"),e.ajax(e.extend({},{headers:{"X-Pjax":"CurrentField"},type:"POST",url:this.data("url"),dataType:"html",success:function(r){if(n.empty().append(e(r).children()),a&&n.find(':input[name="'+a+'"]').focus(),n.find(".filter-header").length){var o;"show"==t.data[0].filter?(o='',n.addClass("show-filter").find(".filter-header").show()):(o='',n.removeClass("show-filter").find(".filter-header").hide()),n.find(".sortable-header th:last").html(o)}s.removeClass("loading"),i&&i.apply(this,arguments),n.trigger("reload",n)},error:function(e){alert(o["default"]._t("GRIDFIELD.ERRORINTRANSACTION")),s.removeClass("loading")}},t))},showDetailView:function(e){window.location.href=e},getItems:function(){return this.find(".ss-gridfield-item")},setState:function(e,t){var i=this.getState();i[e]=t,this.find(':input[name="'+this.data("name")+'[GridState]"]').val(JSON.stringify(i))},getState:function(){return JSON.parse(this.find(':input[name="'+this.data("name")+'[GridState]"]').val())}}),e(".ss-gridfield *").entwine({getGridField:function(){return this.closest(".ss-gridfield")}}),e(".ss-gridfield :button[name=showFilter]").entwine({onclick:function(t){e(".filter-header").show("slow").find(":input:first").focus(),this.closest(".ss-gridfield").addClass("show-filter"),this.parent().html(''),t.preventDefault()}}),e(".ss-gridfield .ss-gridfield-item").entwine({onclick:function(t){if(e(t.target).closest(".action").length)return this._super(t),!1;var i=this.find(".edit-link");i.length&&this.getGridField().showDetailView(i.prop("href"))},onmouseover:function(){this.find(".edit-link").length&&this.css("cursor","pointer")},onmouseout:function(){this.css("cursor","default")}}),e(".ss-gridfield .action").entwine({onclick:function(e){var t="show";return this.button("option","disabled")?void e.preventDefault():(!this.hasClass("ss-gridfield-button-close")&&this.closest(".ss-gridfield").hasClass("show-filter")||(t="hidden"),this.getGridField().reload({data:[{name:this.attr("name"),value:this.val(),filter:t}]}),void e.preventDefault())},actionurl:function(){var t=this.closest(":button"),i=this.getGridField(),n=this.closest("form"),s=n.find(":input.gridstate").serialize(),a=n.find('input[name="SecurityID"]').val();s+="&"+encodeURIComponent(t.attr("name"))+"="+encodeURIComponent(t.val()),a&&(s+="&SecurityID="+encodeURIComponent(a)),window.location.search&&(s=window.location.search.replace(/^\?/,"")+"&"+s);var r=-1==i.data("url").indexOf("?")?"?":"&";return e.path.makeUrlAbsolute(i.data("url")+r+s,e("base").attr("href"))}}),e(".ss-gridfield .add-existing-autocompleter").entwine({onbuttoncreate:function(){var e=this;this.toggleDisabled(),this.find('input[type="text"]').on("keyup",function(){e.toggleDisabled()})},onunmatch:function(){this.find('input[type="text"]').off("keyup")},toggleDisabled:function(){var e=this.find(".ss-ui-button"),t=this.find('input[type="text"]'),i=""!==t.val(),n=e.is(":disabled");(i&&n||!i&&!n)&&e.button("option","disabled",!n)}}),e(".ss-gridfield .col-buttons .action.gridfield-button-delete, .cms-edit-form .Actions button.action.action-delete").entwine({onclick:function(e){return confirm(o["default"]._t("TABLEFIELD.DELETECONFIRMMESSAGE"))?void this._super(e):(e.preventDefault(),!1)}}),e(".ss-gridfield .action.gridfield-button-print").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(e){var t=this.actionurl();return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function(){this._super(),this.hide().bind("load",function(){this.focus();var e=this.contentWindow||this;e.print()})},onunmatch:function(){this._super()}}),e(".ss-gridfield .action.no-ajax").entwine({onclick:function(e){return window.location.href=this.actionurl(),e.preventDefault(),!1}}),e(".ss-gridfield .action-detail").entwine({onclick:function(){return this.getGridField().showDetailView(e(this).prop("href")),!1}}),e(".ss-gridfield[data-selectable]").entwine({getSelectedItems:function(){return this.find(".ss-gridfield-item.ui-selected")},getSelectedIDs:function(){return e.map(this.getSelectedItems(),function(t){return e(t).data("id")})}}),e(".ss-gridfield[data-selectable] .ss-gridfield-items").entwine({onadd:function(){this._super(),this.selectable()},onremove:function(){this._super(),this.data("selectable")&&this.selectable("destroy")}}),e(".ss-gridfield .filter-header :input").entwine({onmatch:function(){var e=this.closest(".fieldgroup").find(".ss-gridfield-button-filter"),t=this.closest(".fieldgroup").find(".ss-gridfield-button-reset");this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunmatch:function(){this._super()},onkeydown:function(e){if(!this.closest(".ss-gridfield-button-reset").length){var t=this.closest(".fieldgroup").find(".ss-gridfield-button-filter"),i=this.closest(".fieldgroup").find(".ss-gridfield-button-reset");if("13"==e.keyCode){var n=this.closest(".filter-header").find(".ss-gridfield-button-filter"),s="show";return!this.hasClass("ss-gridfield-button-close")&&this.closest(".ss-gridfield").hasClass("show-filter")||(s="hidden"),this.getGridField().reload({data:[{name:n.attr("name"),value:n.val(),filter:s}]}),!1}t.addClass("hover-alike"),i.addClass("hover-alike")}}}),e(".ss-gridfield .relation-search").entwine({onfocusin:function(t){this.autocomplete({source:function(t,i){var n=e(this.element);e(this.element).closest("form");e.ajax({headers:{"X-Pjax":"Partial"},type:"GET",url:e(n).data("searchUrl"),data:encodeURIComponent(n.attr("name"))+"="+encodeURIComponent(n.val()),success:function(t){i(e.map(JSON.parse(t),function(e,t){return{label:e,value:e,id:t}}))},error:function(e){alert(o["default"]._t("GRIDFIELD.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later."))}})},select:function(t,i){e(this).closest(".ss-gridfield").find("#action_gridfield_relationfind").replaceWith('');var n=e(this).closest(".ss-gridfield").find("#action_gridfield_relationadd");n.data("button")?n.button("enable"):n.removeAttr("disabled")}})}}),e(".ss-gridfield .pagination-page-number input").entwine({onkeydown:function(t){if(13==t.keyCode){var i=parseInt(e(this).val(),10),n=e(this).getGridField();return n.setState("GridFieldPaginator",{currentPage:i}),n.reload(),!1}}})})},{"./i18n":"i18n","./jQuery":"jQuery"}],15:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var _jQuery=require("./jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_i18n=require("./i18n"),_i18n2=_interopRequireDefault(_i18n),ss="undefined"!=typeof window.ss?window.ss:{};ss.editorWrappers={},ss.editorWrappers.tinyMCE=function(){var editorID;return{init:function(e){editorID=e,this.create()},destroy:function(){tinymce.EditorManager.execCommand("mceRemoveEditor",!1,editorID)},getInstance:function(){return tinymce.EditorManager.get(editorID)},onopen:function(){},onclose:function(){},getConfig:function(){var e="#"+editorID,t=(0,_jQuery2["default"])(e).data("config"),i=this;return t.selector=e,t.setup=function(e){e.on("change",function(){i.save()})},t},save:function(){var e=this.getInstance();e.save(),(0,_jQuery2["default"])(e.getElement()).trigger("change")},create:function(){var e=this.getConfig();"undefined"!=typeof e.baseURL&&(tinymce.EditorManager.baseURL=e.baseURL),tinymce.init(e)},repaint:function(){},isDirty:function(){return this.getInstance().isDirty()},getContent:function(){return this.getInstance().getContent()},getDOM:function(){return this.getInstance().getElement()},getContainer:function(){return this.getInstance().getContainer()},getSelectedNode:function(){return this.getInstance().selection.getNode()},selectNode:function(e){this.getInstance().selection.select(e)},setContent:function(e,t){this.getInstance().setContent(e,t)},insertContent:function(e,t){this.getInstance().insertContent(e,t)},replaceContent:function(e,t){this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function(e,t){this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function(){this.getInstance().execCommand("unlink",!1)},cleanLink:function cleanLink(href,node){var settings=this.getConfig,cb=settings.urlconverter_callback;return cb&&(href=eval(cb+"(href, node, true);")),href.match(new RegExp("^"+tinyMCE.settings.document_base_url+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function(){return this.getInstance().selection.getBookmark()},moveToBookmark:function(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function(){this.getInstance().selection.collapse()},addUndo:function(){this.getInstance().undoManager.add()}}},ss.editorWrappers["default"]=ss.editorWrappers.tinyMCE,_jQuery2["default"].entwine("ss",function(e){e("textarea.htmleditor").entwine({Editor:null,onadd:function(){var e=this.data("editor")||"default",t=ss.editorWrappers[e]();this.setEditor(t),t.init(this.attr("id")),this._super()},onremove:function(){this.getEditor().destroy(),this._super()},"from .cms-edit-form":{onbeforesubmitform:function(){this.getEditor().save(),this._super()}},openLinkDialog:function(){this.openDialog("link")},openMediaDialog:function(){this.openDialog("media")},openDialog:function(t){var i=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n=this,s=e("#cms-editor-dialogs").data("url"+i(t)+"form"),a=e(".htmleditorfield-"+t+"dialog");a.length?(a.getForm().setElement(this),a.html(""),a.addClass("loading"),a.open()):(a=e('
        '),e("body").append(a)),e.ajax({url:s,complete:function(){a.removeClass("loading")},success:function(e){a.html(e),a.getForm().setElement(n),a.trigger("ssdialogopen")}})}}),e(".htmleditorfield-dialog").entwine({onadd:function(){this.is(".ui-dialog-content")||this.ssdialog({autoOpen:!0,buttons:{insert:{text:_i18n2["default"]._t("HtmlEditorField.INSERT","Insert"),"data-icon":"accept","class":"ss-ui-action-constructive media-insert",click:function(){e(this).find("form").submit()}}}}),this._super()},getForm:function(){return this.find("form")},open:function(){this.ssdialog("open")},close:function(){this.ssdialog("close")},toggle:function(e){this.is(":visible")?this.close():this.open()},onscroll:function(){this.animate({scrollTop:this.find("form").height()},500)}}),e("form.htmleditorfield-form").entwine({Selection:null,Bookmark:null,Element:null,setSelection:function(t){return this._super(e(t))},onadd:function(){var e=this.find(":header:first");this.getDialog().attr("title",e.text()),this._super()},onremove:function(){this.setSelection(null),this.setBookmark(null),this.setElement(null),this._super()},getDialog:function(){return this.closest(".htmleditorfield-dialog")},fromDialog:{onssdialogopen:function(){var e=this.getEditor();this.setSelection(e.getSelectedNode()),this.setBookmark(e.createBookmark()),e.blur(),this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:enabled").eq(0).focus(),this.redraw(),this.updateFromEditor()},onssdialogclose:function(){var e=this.getEditor();e.moveToBookmark(this.getBookmark()),this.setSelection(null),this.setBookmark(null),this.resetFields()}},getEditor:function(){return this.getElement().getEditor()},modifySelection:function(e){var t=this.getEditor();t.moveToBookmark(this.getBookmark()),e.call(this,t),this.setSelection(t.getSelectedNode()),this.setBookmark(t.createBookmark()),t.blur()},updateFromEditor:function(){},redraw:function(){},resetFields:function(){this.find(".tree-holder").empty()}}),e("form.htmleditorfield-linkform").entwine({onsubmit:function(e){return this.insertLink(),this.getDialog().close(),!1},resetFields:function(){this._super(),this[0].reset()},redraw:function(){this._super();var e=this.find(":input[name=LinkType]:checked").val();this.addAnchorSelector(),this.resetFileField(),this.find("div.content .field").hide(),this.find('.field[id$="LinkType"]').show(),this.find('.field[id$="'+e+'_Holder"]').show(),"internal"!=e&&"anchor"!=e||this.find('.field[id$="Anchor_Holder"]').show(),"email"==e?this.find('.field[id$="Subject_Holder"]').show():this.find('.field[id$="TargetBlank_Holder"]').show(),"anchor"==e&&this.find('.field[id$="AnchorSelector_Holder"]').show(),this.find('.field[id$="Description_Holder"]').show()},getLinkAttributes:function(){var e,t=null,i=this.find(":input[name=Subject]").val(),n=this.find(":input[name=Anchor]").val();switch(this.find(":input[name=TargetBlank]").is(":checked")&&(t="_blank"),this.find(":input[name=LinkType]:checked").val()){case"internal":e="[sitetree_link,id="+this.find(":input[name=internal]").val()+"]",n&&(e+="#"+n);break;case"anchor":e="#"+n;break;case"file":e="[file_link,id="+this.find(".ss-uploadfield .ss-uploadfield-item").attr("data-fileid")+"]";break;case"email":e="mailto:"+this.find(":input[name=email]").val(),i&&(e+="?subject="+encodeURIComponent(i)),t=null;break;default:e=this.find(":input[name=external]").val(),-1==e.indexOf("://")&&(e="http://"+e)}return{href:e,target:t,title:this.find(":input[name=Description]").val()}},insertLink:function(){this.modifySelection(function(e){e.insertLink(this.getLinkAttributes())})},removeLink:function(){this.modifySelection(function(e){e.removeLink()}),this.resetFileField(),this.close()},resetFileField:function(){var e=this.find('.ss-uploadfield[id$="file_Holder"]'),t=e.data("fileupload"),i=e.find(".ss-uploadfield-item[data-fileid]");i.length&&(t._trigger("destroy",null,{context:i}),e.find(".ss-uploadfield-addfile").removeClass("borderTop"))},addAnchorSelector:function(){if(!this.find(":input[name=AnchorSelector]").length){var t=this,i=e('');this.find(":input[name=Anchor]").parent().append(i),this.updateAnchorSelector(),i.change(function(i){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function(){var t=this.find(":input[name=LinkType]:checked").val(),i=e.Deferred();switch(t){case"anchor":var n=[],s=this.getEditor();if(s){var a=s.getContent().match(/\s+(name|id)\s*=\s*(["'])([^\2\s>]*?)\2|\s+(name|id)\s*=\s*([^"']+)[\s +>]/gim);if(a&&a.length)for(var r=0;r'+_i18n2["default"]._t("HtmlEditorField.LOOKINGFORANCHORS","Looking for anchors...")+"")),i.done(function(i){if(t.empty(),t.append(e('")),i)for(var n=0;n'+i[n]+""))}).fail(function(i){t.empty(),t.append(e('"))}),e.browser.msie&&t.hide().show()},updateFromEditor:function(){var e,t=/<\S[^><]*>/g,i=this.getCurrentLink();if(i)for(e in i){var n=this.find(":input[name="+e+"]"),s=i[e];"string"==typeof s&&(s=s.replace(t,"")),n.is(":checkbox")?n.prop("checked",s).change():n.is(":radio")?n.val([s]).change():"file"==e?(n=this.find(':input[name="'+e+'[Uploads][]"]'),n=n.parents(".ss-uploadfield"),function a(e,t){e.getConfig()?e.attachFiles([t]):setTimeout(function(){a(e,t)},50)}(n,s)):n.val(s).change()}},getCurrentLink:function(){var e=this.getSelection(),t="",i="",n="",s="insert",a="",r=null;return e.length&&(r=e.is("a")?e:e=e.parents("a:first")),r&&r.length&&this.modifySelection(function(e){e.selectNode(r[0])}),r.attr("href")||(r=null),r&&(t=r.attr("href"),i=r.attr("target"),n=r.attr("title"),a=r.attr("class"),t=this.getEditor().cleanLink(t,r),s="update"),t.match(/^mailto:(.*)$/)?{LinkType:"email",email:RegExp.$1,Description:n}:t.match(/^(assets\/.*)$/)||t.match(/^\[file_link\s*(?:\s*|%20|,)?id=([0-9]+)\]?(#.*)?$/)?{LinkType:"file",file:RegExp.$1,Description:n,TargetBlank:!!i}:t.match(/^#(.*)$/)?{LinkType:"anchor",Anchor:RegExp.$1,Description:n,TargetBlank:!!i}:t.match(/^\[sitetree_link(?:\s*|%20|,)?id=([0-9]+)\]?(#.*)?$/i)?{LinkType:"internal",internal:RegExp.$1,Anchor:RegExp.$2?RegExp.$2.substr(1):"",Description:n,TargetBlank:!!i}:t?{LinkType:"external",external:t,Description:n,TargetBlank:!!i}:null}}),e("form.htmleditorfield-linkform input[name=LinkType]").entwine({onclick:function(e){this.parents("form:first").redraw(),this._super()},onchange:function(){this.parents("form:first").redraw();var e=this.parent().find(":checked").val();"anchor"!==e&&"internal"!==e||this.parents("form.htmleditorfield-linkform").updateAnchorSelector(),this._super()}}),e("form.htmleditorfield-linkform input[name=internal]").entwine({onvalueupdated:function(){this.parents("form.htmleditorfield-linkform").updateAnchorSelector(),this._super()}}),e("form.htmleditorfield-linkform :submit[name=action_remove]").entwine({onclick:function(e){return this.parents("form:first").removeLink(),this._super(),!1}}),e("form.htmleditorfield-mediaform").entwine({toggleCloseButton:function(){var e=Boolean(this.find(".ss-htmleditorfield-file").length);this.find(".overview .action-delete")[e?"hide":"show"]()},onsubmit:function(){return this.modifySelection(function(t){this.find(".ss-htmleditorfield-file").each(function(){e(this).insertHTML(t)})}),this.getDialog().close(),!1},updateFromEditor:function(){var e=this,t=this.getSelection();t.is("img")&&this.showFileView(t.data("url")||t.attr("src")).done(function(i){i.updateFromNode(t),e.toggleCloseButton(),e.redraw()}),this.redraw()},redraw:function(t){this._super();var i=this.getSelection(),n=Boolean(this.find(".ss-htmleditorfield-file").length),s=i.is("img"),a=this.hasClass("insertingURL"),r=this.find(".header-edit");r[n?"show":"hide"](),this.closest("ui-dialog").find("ui-dialog-buttonpane .media-insert").button(n?"enable":"disable").toggleClass("ui-state-disabled",!n),this.find(".htmleditorfield-default-panel")[s||a?"hide":"show"](),this.find(".htmleditorfield-web-panel")[s||!a?"hide":"show"]();var o=this.find(".htmleditorfield-mediaform-heading.insert");s?o.hide():a?(o.show().text(_i18n2["default"]._t("HtmlEditorField.INSERTURL")).prepend(''),this.find(".htmleditorfield-web-panel input.remoteurl").focus()):o.show().text(_i18n2["default"]._t("HtmlEditorField.INSERTFROM")).find(".back-button").remove(),this.find(".htmleditorfield-mediaform-heading.update")[s?"show":"hide"](),this.find(".ss-uploadfield-item-actions")[s?"hide":"show"](),this.find(".ss-uploadfield-item-name")[s?"hide":"show"](),this.find(".ss-uploadfield-item-preview")[s?"hide":"show"](),this.find(".Actions .media-update")[s?"show":"hide"](),this.find(".ss-uploadfield-item-editform").toggleEditForm(s),this.find(".htmleditorfield-from-cms .field.treedropdown").css("left",e(".htmleditorfield-mediaform-heading:visible").outerWidth()),this.closest(".ui-dialog").addClass("ss-uploadfield-dropzone"),this.closest(".ui-dialog").find(".ui-dialog-buttonpane .media-insert .ui-button-text").text([s?_i18n2["default"]._t("HtmlEditorField.UPDATE","Update"):_i18n2["default"]._t("HtmlEditorField.INSERT","Insert")])},resetFields:function(){this.find(".ss-htmleditorfield-file").remove(),this.find(".ss-gridfield-items .ui-selected").removeClass("ui-selected"),this.find("li.ss-uploadfield-item").remove(),this.redraw(),this._super()},getFileView:function(e){return this.find(".ss-htmleditorfield-file[data-id="+e+"]")},showFileView:function(t){var i=this,n=Number(t)==t?{ID:t}:{FileURL:t},s=e('
        ');this.find(".content-edit").prepend(s);var a=e.Deferred();return e.ajax({url:e.path.addSearchParams(this.attr("action").replace(/MediaForm/,"viewfile"),n),success:function(t,n,r){var o=e(t).filter(".ss-htmleditorfield-file");s.replaceWith(o),i.redraw(),a.resolve(o)},error:function(){s.remove(),a.reject()}}),a.promise()}}),e("form.htmleditorfield-mediaform div.ss-upload .upload-url").entwine({onclick:function(){var e=this.closest("form");e.addClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .htmleditorfield-mediaform-heading .back-button").entwine({onclick:function(){var e=this.closest("form");e.removeClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .ss-gridfield-items").entwine({onselectableselected:function(t,i){var n=this.closest("form"),s=e(i.selected);s.is(".ss-gridfield-item")&&(n.closest("form").showFileView(s.data("id")),n.redraw(),n.parent().trigger("scroll"))},onselectableunselected:function(t,i){var n=this.closest("form"),s=e(i.unselected);s.is(".ss-gridfield-item")&&(n.getFileView(s.data("id")).remove(),n.redraw())}}),e("form.htmleditorfield-form.htmleditorfield-mediaform div.ss-assetuploadfield").entwine({onfileuploadstop:function(t){var i=this.closest("form"),n=[];i.find("div.content-edit").find("div.ss-htmleditorfield-file").each(function(){n.push(e(this).data("id"))});var s=e(".ss-uploadfield-files",this).children(".ss-uploadfield-item");s.each(function(){var t=e(this).data("fileid");t&&-1==e.inArray(t,n)&&(e(this).remove(),i.showFileView(t))}),i.parent().trigger("scroll"),i.redraw()}}),e("form.htmleditorfield-form.htmleditorfield-mediaform input.remoteurl").entwine({onadd:function(){this._super(),this.validate()},onkeyup:function(){this.validate()},onchange:function(){this.validate()},getAddButton:function(){return this.closest(".CompositeField").find("button.add-url")},validate:function(){var t=this.val(),i=t;return t=e.trim(t),t=t.replace(/^https?:\/\//i,""),i!==t&&this.val(t),this.getAddButton().button(t?"enable":"disable"),!!t}}),e("form.htmleditorfield-form.htmleditorfield-mediaform .add-url").entwine({getURLField:function(){return this.closest(".CompositeField").find("input.remoteurl")},onclick:function(e){var t=this.getURLField(),i=this.closest(".CompositeField"),n=this.closest("form");return t.validate()&&(i.addClass("loading"),n.showFileView("http://"+t.val()).done(function(){i.removeClass("loading"),n.parent().trigger("scroll")}),n.redraw()),!1}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file").entwine({getAttributes:function(){},getExtraData:function(){},getHTML:function(){return e("
        ").append(e("").attr({href:this.data("url")}).text(this.find(".name").text())).html()},insertHTML:function(e){e.replaceContent(this.getHTML())},updateFromNode:function(e){},updateDimensions:function(e,t,i){var n,s=this.find(":input[name=Width]"),a=this.find(":input[name=Height]"),r=s.val(),o=a.val();r&&o&&(e?(n=a.getOrigVal()/s.getOrigVal(),"Width"==e?(t&&r>t&&(r=t),o=Math.floor(r*n)):"Height"==e&&(i&&o>i&&(o=i),r=Math.ceil(o/n))):(t&&r>t&&(r=t),i&&o>i&&(o=i)),s.val(r),a.val(o))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.image").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(":input[name=URL]").val(),alt:this.find(":input[name=AltText]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,title:this.find(":input[name=Title]").val(),"class":this.find(":input[name=CSSClass]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function(){return{CaptionText:this.find(":input[name=CaptionText]").val()}},getHTML:function(){},insertHTML:function(t){var i=this.closest("form"),n=i.getSelection();t||(t=i.getEditor());var s=this.getAttributes(),a=this.getExtraData(),r=n&&n.is("img")?n:null;r&&r.parent().is(".captionImage")&&(r=r.parent());var o=n&&n.is("img")?n:e("");o.attr(s);var l=o.parent(".captionImage"),h=l.find(".caption");a.CaptionText?(l.length||(l=e("
        ")),l.attr("class","captionImage "+s["class"]).css("width",s.width),h.length||(h=e('

        ').appendTo(l)),h.attr("class","caption "+s["class"]).text(a.CaptionText)):l=h=null;var c=l?l:o;r&&r.not(c).length&&r.replaceWith(c),l&&l.prepend(o),r||(t.repaint(),t.insertContent(e("
        ").append(c).html(),{skip_undo:1})),t.addUndo(),t.repaint()},updateFromNode:function(e){this.find(":input[name=AltText]").val(e.attr("alt")),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.attr("class")),this.find(":input[name=Width]").val(e.width()),this.find(":input[name=Height]").val(e.height()),this.find(":input[name=CaptionText]").val(e.siblings(".caption:first").text()),this.find(":input[name=FileID]").val(e.data("fileid"))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.flash").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(":input[name=URL]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"data-fileid":this.find(":input[name=FileID]").val()}},getHTML:function(){var t=this.getAttributes(),i=tinyMCE.activeEditor.plugins.media.dataToImg({type:"flash",width:t.width,height:t.height,params:{src:t.src},video:{sources:[]}});return e("
        ").append(i).html()},updateFromNode:function(e){}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.embed").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"class":this.find(":input[name=CSSClass]").val(),alt:this.find(":input[name=AltText]").val(),title:this.find(":input[name=Title]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{CaptionText:this.find(":input[name=CaptionText]").val(),Url:this.find(":input[name=URL]").val(),thumbnail:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,cssclass:this.find(":input[name=CSSClass]").val()}},getHTML:function(){var t,i=this.getAttributes(),n=this.getExtraData(),s=e("").attr(i).addClass("ss-htmleditorfield-file embed");return e.each(n,function(e,t){s.attr("data-"+e,t)}),t=n.CaptionText?e('

        '+n.CaptionText+"

        ").prepend(s):s,e("
        ").append(t).html()},updateFromNode:function(e){this.find(":input[name=AltText]").val(e.attr("alt")),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=Width]").val(e.width()),this.find(":input[name=Height]").val(e.height()),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.data("cssclass")),this.find(":input[name=FileID]").val(e.data("fileid"))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file .dimensions :input").entwine({OrigVal:null,onmatch:function(){this._super(),this.setOrigVal(parseInt(this.val(),10))},onunmatch:function(){this._super()},onfocusout:function(e){this.closest(".ss-htmleditorfield-file").updateDimensions(this.attr("name"))}}),e("form.htmleditorfield-mediaform .ss-uploadfield-item .ss-uploadfield-item-cancel").entwine({onclick:function(e){var t=this.closest("form"),i=this.closest("ss-uploadfield-item");t.find(".ss-gridfield-item[data-id="+i.data("id")+"]").removeClass("ui-selected"),this.closest(".ss-uploadfield-item").remove(),t.redraw(),e.preventDefault()}}),e("div.ss-assetuploadfield .ss-uploadfield-item-edit, div.ss-assetuploadfield .ss-uploadfield-item-name").entwine({getEditForm:function(){return this.closest(".ss-uploadfield-item").find(".ss-uploadfield-item-editform")},fromEditForm:{onchange:function(t){var i=e(t.target);i.removeClass("edited"),i.addClass("edited")}},onclick:function(e){var t=this.getEditForm();return this.closest(".ss-uploadfield-item").hasClass("ss-htmleditorfield-file")?(t.parent("ss-uploadfield-item").removeClass("ui-state-warning"),t.toggleEditForm(),e.preventDefault(),!1):void this._super(e)}}),e("div.ss-assetuploadfield .ss-uploadfield-item-editform").entwine({toggleEditForm:function(e){var t=this.prev(".ss-uploadfield-item-info"),i=t.find(".ss-uploadfield-item-status"),n="";e===!0||e!==!1&&0===this.height()?(n=_i18n2["default"]._t("UploadField.Editing","Editing ..."),this.height("auto"),t.find(".toggle-details-icon").addClass("opened"),i.removeClass("ui-state-success-text").removeClass("ui-state-warning-text")):(this.height(0),t.find(".toggle-details-icon").removeClass("opened"),this.hasClass("edited")?(n=_i18n2["default"]._t("UploadField.CHANGESSAVED","Changes Made"),this.removeClass("edited"),i.addClass("ui-state-success-text")):(n=_i18n2["default"]._t("UploadField.NOCHANGES","No Changes"),i.addClass("ui-state-success-text"))),i.attr("title",n).text(n)}}),e('form.htmleditorfield-mediaform .field[id$="ParentID_Holder"] .TreeDropdownField').entwine({onadd:function(){this._super();var e=this;this.bind("change",function(){var t=e.closest("form").find(".ss-gridfield");t.setState("ParentID",e.getValue()),t.reload()})}})})},{"./i18n":"i18n","./jQuery":"jQuery"}],16:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s);a["default"].entwine("ss",function(e){e(".ss-tabset").entwine({IgnoreTabState:!1,onadd:function(){var e=window.location.hash;this.redrawTabs(),""!==e&&this.openTabFromURL(e),this._super()},onremove:function(){this.data("tabs")&&this.tabs("destroy"),this._super()},redrawTabs:function(){this.rewriteHashlinks(),this.tabs()},openTabFromURL:function(t){var i;e.each(this.find(".cms-panel-link"),function(){return-1!==this.href.indexOf(t)&&1===e(t).length?(i=e(this),!1):void 0}),void 0!==i&&e(window).one("ajaxComplete",function(){i.click()})},rewriteHashlinks:function(){e(this).find("ul a").each(function(){if(e(this).attr("href")){var t=e(this).attr("href").match(/#.*/);t&&e(this).attr("href",document.location.href.replace(/#.*/,"")+t[0])}})}})})},{"./jQuery":"jQuery"}],17:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s),r=e("./i18n"),o=n(r);a["default"].entwine("ss",function(e){var t,i;e(window).bind("resize.treedropdownfield",function(){ +t.min&&(t.minDate=a["default"].datepicker.parseDate("yy-mm-dd",t.min)),t.max&&(t.maxDate=a["default"].datepicker.parseDate("yy-mm-dd",t.max)),t.dateFormat=t.jquerydateformat,(0,a["default"])(this).datepicker(t))}})}}),(0,a["default"])(document).on("click",".field.date input.text,input.text.date",function(){(0,a["default"])(this).ssDatepicker(),(0,a["default"])(this).data("datepicker")&&(0,a["default"])(this).datepicker("show")})},{"./jQuery":"jQuery"}],14:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s),r=e("./i18n"),o=n(r);a["default"].entwine("ss",function(e){e(".ss-gridfield").entwine({reload:function(t,i){var n=this,s=this.closest("form"),a=this.find(":input:focus").attr("name"),r=s.find(":input").serializeArray();t||(t={}),t.data||(t.data=[]),t.data=t.data.concat(r),window.location.search&&(t.data=window.location.search.replace(/^\?/,"")+"&"+e.param(t.data)),window.history&&window.history.pushState||window.location.hash&&-1!=window.location.hash.indexOf("?")&&(t.data=window.location.hash.substring(window.location.hash.indexOf("?")+1)+"&"+e.param(t.data)),s.addClass("loading"),e.ajax(e.extend({},{headers:{"X-Pjax":"CurrentField"},type:"POST",url:this.data("url"),dataType:"html",success:function(r){if(n.empty().append(e(r).children()),a&&n.find(':input[name="'+a+'"]').focus(),n.find(".filter-header").length){var o;"show"==t.data[0].filter?(o='',n.addClass("show-filter").find(".filter-header").show()):(o='',n.removeClass("show-filter").find(".filter-header").hide()),n.find(".sortable-header th:last").html(o)}s.removeClass("loading"),i&&i.apply(this,arguments),n.trigger("reload",n)},error:function(e){alert(o["default"]._t("GRIDFIELD.ERRORINTRANSACTION")),s.removeClass("loading")}},t))},showDetailView:function(e){window.location.href=e},getItems:function(){return this.find(".ss-gridfield-item")},setState:function(e,t){var i=this.getState();i[e]=t,this.find(':input[name="'+this.data("name")+'[GridState]"]').val(JSON.stringify(i))},getState:function(){return JSON.parse(this.find(':input[name="'+this.data("name")+'[GridState]"]').val())}}),e(".ss-gridfield *").entwine({getGridField:function(){return this.closest(".ss-gridfield")}}),e(".ss-gridfield :button[name=showFilter]").entwine({onclick:function(t){e(".filter-header").show("slow").find(":input:first").focus(),this.closest(".ss-gridfield").addClass("show-filter"),this.parent().html(''),t.preventDefault()}}),e(".ss-gridfield .ss-gridfield-item").entwine({onclick:function(t){if(e(t.target).closest(".action").length)return this._super(t),!1;var i=this.find(".edit-link");i.length&&this.getGridField().showDetailView(i.prop("href"))},onmouseover:function(){this.find(".edit-link").length&&this.css("cursor","pointer")},onmouseout:function(){this.css("cursor","default")}}),e(".ss-gridfield .action").entwine({onclick:function(e){var t="show";return this.button("option","disabled")?void e.preventDefault():(!this.hasClass("ss-gridfield-button-close")&&this.closest(".ss-gridfield").hasClass("show-filter")||(t="hidden"),this.getGridField().reload({data:[{name:this.attr("name"),value:this.val(),filter:t}]}),void e.preventDefault())},actionurl:function(){var t=this.closest(":button"),i=this.getGridField(),n=this.closest("form"),s=n.find(":input.gridstate").serialize(),a=n.find('input[name="SecurityID"]').val();s+="&"+encodeURIComponent(t.attr("name"))+"="+encodeURIComponent(t.val()),a&&(s+="&SecurityID="+encodeURIComponent(a)),window.location.search&&(s=window.location.search.replace(/^\?/,"")+"&"+s);var r=-1==i.data("url").indexOf("?")?"?":"&";return e.path.makeUrlAbsolute(i.data("url")+r+s,e("base").attr("href"))}}),e(".ss-gridfield .add-existing-autocompleter").entwine({onbuttoncreate:function(){var e=this;this.toggleDisabled(),this.find('input[type="text"]').on("keyup",function(){e.toggleDisabled()})},onunmatch:function(){this.find('input[type="text"]').off("keyup")},toggleDisabled:function(){var e=this.find(".ss-ui-button"),t=this.find('input[type="text"]'),i=""!==t.val(),n=e.is(":disabled");(i&&n||!i&&!n)&&e.button("option","disabled",!n)}}),e(".ss-gridfield .col-buttons .action.gridfield-button-delete, .cms-edit-form .Actions button.action.action-delete").entwine({onclick:function(e){return confirm(o["default"]._t("TABLEFIELD.DELETECONFIRMMESSAGE"))?void this._super(e):(e.preventDefault(),!1)}}),e(".ss-gridfield .action.gridfield-button-print").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(e){var t=this.actionurl();return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function(){this._super(),this.hide().bind("load",function(){this.focus();var e=this.contentWindow||this;e.print()})},onunmatch:function(){this._super()}}),e(".ss-gridfield .action.no-ajax").entwine({onclick:function(e){return window.location.href=this.actionurl(),e.preventDefault(),!1}}),e(".ss-gridfield .action-detail").entwine({onclick:function(){return this.getGridField().showDetailView(e(this).prop("href")),!1}}),e(".ss-gridfield[data-selectable]").entwine({getSelectedItems:function(){return this.find(".ss-gridfield-item.ui-selected")},getSelectedIDs:function(){return e.map(this.getSelectedItems(),function(t){return e(t).data("id")})}}),e(".ss-gridfield[data-selectable] .ss-gridfield-items").entwine({onadd:function(){this._super(),this.selectable()},onremove:function(){this._super(),this.data("selectable")&&this.selectable("destroy")}}),e(".ss-gridfield .filter-header :input").entwine({onmatch:function(){var e=this.closest(".fieldgroup").find(".ss-gridfield-button-filter"),t=this.closest(".fieldgroup").find(".ss-gridfield-button-reset");this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunmatch:function(){this._super()},onkeydown:function(e){if(!this.closest(".ss-gridfield-button-reset").length){var t=this.closest(".fieldgroup").find(".ss-gridfield-button-filter"),i=this.closest(".fieldgroup").find(".ss-gridfield-button-reset");if("13"==e.keyCode){var n=this.closest(".filter-header").find(".ss-gridfield-button-filter"),s="show";return!this.hasClass("ss-gridfield-button-close")&&this.closest(".ss-gridfield").hasClass("show-filter")||(s="hidden"),this.getGridField().reload({data:[{name:n.attr("name"),value:n.val(),filter:s}]}),!1}t.addClass("hover-alike"),i.addClass("hover-alike")}}}),e(".ss-gridfield .relation-search").entwine({onfocusin:function(t){this.autocomplete({source:function(t,i){var n=e(this.element);e(this.element).closest("form");e.ajax({headers:{"X-Pjax":"Partial"},type:"GET",url:e(n).data("searchUrl"),data:encodeURIComponent(n.attr("name"))+"="+encodeURIComponent(n.val()),success:function(t){i(e.map(JSON.parse(t),function(e,t){return{label:e,value:e,id:t}}))},error:function(e){alert(o["default"]._t("GRIDFIELD.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later."))}})},select:function(t,i){e(this).closest(".ss-gridfield").find("#action_gridfield_relationfind").replaceWith('');var n=e(this).closest(".ss-gridfield").find("#action_gridfield_relationadd");n.data("button")?n.button("enable"):n.removeAttr("disabled")}})}}),e(".ss-gridfield .pagination-page-number input").entwine({onkeydown:function(t){if(13==t.keyCode){var i=parseInt(e(this).val(),10),n=e(this).getGridField();return n.setState("GridFieldPaginator",{currentPage:i}),n.reload(),!1}}})})},{"./i18n":"i18n","./jQuery":"jQuery"}],15:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var _jQuery=require("./jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_i18n=require("./i18n"),_i18n2=_interopRequireDefault(_i18n),ss="undefined"!=typeof window.ss?window.ss:{};ss.editorWrappers={},ss.editorWrappers.tinyMCE=function(){var editorID;return{init:function(e){editorID=e,this.create()},destroy:function(){tinymce.EditorManager.execCommand("mceRemoveEditor",!1,editorID)},getInstance:function(){return tinymce.EditorManager.get(editorID)},onopen:function(){},onclose:function(){},getConfig:function(){var e="#"+editorID,t=(0,_jQuery2["default"])(e).data("config"),i=this;return t.selector=e,t.setup=function(e){e.on("change",function(){i.save()})},t},save:function(){var e=this.getInstance();e.save(),(0,_jQuery2["default"])(e.getElement()).trigger("change")},create:function(){var e=this.getConfig();"undefined"!=typeof e.baseURL&&(tinymce.EditorManager.baseURL=e.baseURL),tinymce.init(e)},repaint:function(){},isDirty:function(){return this.getInstance().isDirty()},getContent:function(){return this.getInstance().getContent()},getDOM:function(){return this.getInstance().getElement()},getContainer:function(){return this.getInstance().getContainer()},getSelectedNode:function(){return this.getInstance().selection.getNode()},selectNode:function(e){this.getInstance().selection.select(e)},setContent:function(e,t){this.getInstance().setContent(e,t)},insertContent:function(e,t){this.getInstance().insertContent(e,t)},replaceContent:function(e,t){this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function(e,t){this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function(){this.getInstance().execCommand("unlink",!1)},cleanLink:function cleanLink(href,node){var settings=this.getConfig,cb=settings.urlconverter_callback;return cb&&(href=eval(cb+"(href, node, true);")),href.match(new RegExp("^"+tinyMCE.settings.document_base_url+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function(){return this.getInstance().selection.getBookmark()},moveToBookmark:function(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function(){this.getInstance().selection.collapse()},addUndo:function(){this.getInstance().undoManager.add()}}},ss.editorWrappers["default"]=ss.editorWrappers.tinyMCE,_jQuery2["default"].entwine("ss",function(e){e("textarea.htmleditor").entwine({Editor:null,onadd:function(){var e=this.data("editor")||"default",t=ss.editorWrappers[e]();this.setEditor(t),t.init(this.attr("id")),this._super()},onremove:function(){this.getEditor().destroy(),this._super()},"from .cms-edit-form":{onbeforesubmitform:function(){this.getEditor().save(),this._super()}},openLinkDialog:function(){this.openDialog("link")},openMediaDialog:function(){this.openDialog("media")},openDialog:function(t){var i=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n=this,s=e("#cms-editor-dialogs").data("url"+i(t)+"form"),a=e(".htmleditorfield-"+t+"dialog");a.length?(a.getForm().setElement(this),a.html(""),a.addClass("loading"),a.open()):(a=e('
        '),e("body").append(a)),e.ajax({url:s,complete:function(){a.removeClass("loading")},success:function(e){a.html(e),a.getForm().setElement(n),a.trigger("ssdialogopen")}})}}),e(".htmleditorfield-dialog").entwine({onadd:function(){this.is(".ui-dialog-content")||this.ssdialog({autoOpen:!0,buttons:{insert:{text:_i18n2["default"]._t("HtmlEditorField.INSERT","Insert"),"data-icon":"accept","class":"ss-ui-action-constructive media-insert",click:function(){e(this).find("form").submit()}}}}),this._super()},getForm:function(){return this.find("form")},open:function(){this.ssdialog("open")},close:function(){this.ssdialog("close")},toggle:function(e){this.is(":visible")?this.close():this.open()},onscroll:function(){this.animate({scrollTop:this.find("form").height()},500)}}),e("form.htmleditorfield-form").entwine({Selection:null,Bookmark:null,Element:null,setSelection:function(t){return this._super(e(t))},onadd:function(){var e=this.find(":header:first");this.getDialog().attr("title",e.text()),this._super()},onremove:function(){this.setSelection(null),this.setBookmark(null),this.setElement(null),this._super()},getDialog:function(){return this.closest(".htmleditorfield-dialog")},fromDialog:{onssdialogopen:function(){var e=this.getEditor();this.setSelection(e.getSelectedNode()),this.setBookmark(e.createBookmark()),e.blur(),this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:enabled").eq(0).focus(),this.redraw(),this.updateFromEditor()},onssdialogclose:function(){var e=this.getEditor();e.moveToBookmark(this.getBookmark()),this.setSelection(null),this.setBookmark(null),this.resetFields()}},getEditor:function(){return this.getElement().getEditor()},modifySelection:function(e){var t=this.getEditor();t.moveToBookmark(this.getBookmark()),e.call(this,t),this.setSelection(t.getSelectedNode()),this.setBookmark(t.createBookmark()),t.blur()},updateFromEditor:function(){},redraw:function(){},resetFields:function(){this.find(".tree-holder").empty()}}),e("form.htmleditorfield-linkform").entwine({onsubmit:function(e){return this.insertLink(),this.getDialog().close(),!1},resetFields:function(){this._super(),this[0].reset()},redraw:function(){this._super();var e=this.find(":input[name=LinkType]:checked").val();this.addAnchorSelector(),this.resetFileField(),this.find("div.content .field").hide(),this.find('.field[id$="LinkType"]').show(),this.find('.field[id$="'+e+'_Holder"]').show(),"internal"!=e&&"anchor"!=e||this.find('.field[id$="Anchor_Holder"]').show(),"email"==e?this.find('.field[id$="Subject_Holder"]').show():this.find('.field[id$="TargetBlank_Holder"]').show(),"anchor"==e&&this.find('.field[id$="AnchorSelector_Holder"]').show(),this.find('.field[id$="Description_Holder"]').show()},getLinkAttributes:function(){var e,t=null,i=this.find(":input[name=Subject]").val(),n=this.find(":input[name=Anchor]").val();switch(this.find(":input[name=TargetBlank]").is(":checked")&&(t="_blank"),this.find(":input[name=LinkType]:checked").val()){case"internal":e="[sitetree_link,id="+this.find(":input[name=internal]").val()+"]",n&&(e+="#"+n);break;case"anchor":e="#"+n;break;case"file":var s=this.find(".ss-uploadfield .ss-uploadfield-item").attr("data-fileid");e=s?"[file_link,id="+s+"]":"";break;case"email":e="mailto:"+this.find(":input[name=email]").val(),i&&(e+="?subject="+encodeURIComponent(i)),t=null;break;default:e=this.find(":input[name=external]").val(),-1==e.indexOf("://")&&(e="http://"+e)}return{href:e,target:t,title:this.find(":input[name=Description]").val()}},insertLink:function(){this.modifySelection(function(e){e.insertLink(this.getLinkAttributes())})},removeLink:function(){this.modifySelection(function(e){e.removeLink()}),this.resetFileField(),this.close()},resetFileField:function(){var e=this.find('.ss-uploadfield[id$="file_Holder"]'),t=e.data("fileupload"),i=e.find(".ss-uploadfield-item[data-fileid]");i.length&&(t._trigger("destroy",null,{context:i}),e.find(".ss-uploadfield-addfile").removeClass("borderTop"))},addAnchorSelector:function(){if(!this.find(":input[name=AnchorSelector]").length){var t=this,i=e('');this.find(":input[name=Anchor]").parent().append(i),this.updateAnchorSelector(),i.change(function(i){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function(){var t=this.find(":input[name=LinkType]:checked").val(),i=e.Deferred();switch(t){case"anchor":var n=[],s=this.getEditor();if(s){var a=s.getContent().match(/\s+(name|id)\s*=\s*(["'])([^\2\s>]*?)\2|\s+(name|id)\s*=\s*([^"']+)[\s +>]/gim);if(a&&a.length)for(var r=0;r'+_i18n2["default"]._t("HtmlEditorField.LOOKINGFORANCHORS","Looking for anchors...")+"")),i.done(function(i){if(t.empty(),t.append(e('")),i)for(var n=0;n'+i[n]+""))}).fail(function(i){t.empty(),t.append(e('"))}),e.browser.msie&&t.hide().show()},updateFromEditor:function(){var e,t=/<\S[^><]*>/g,i=this.getCurrentLink();if(i)for(e in i){var n=this.find(":input[name="+e+"]"),s=i[e];"string"==typeof s&&(s=s.replace(t,"")),n.is(":checkbox")?n.prop("checked",s).change():n.is(":radio")?n.val([s]).change():"file"==e?(n=this.find(':input[name="'+e+'[Uploads][]"]'),n=n.parents(".ss-uploadfield"),function a(e,t){e.getConfig()?e.attachFiles([t]):setTimeout(function(){a(e,t)},50)}(n,s)):n.val(s).change()}},getCurrentLink:function(){var e=this.getSelection(),t="",i="",n="",s="insert",a="",r=null;return e.length&&(r=e.is("a")?e:e=e.parents("a:first")),r&&r.length&&this.modifySelection(function(e){e.selectNode(r[0])}),r.attr("href")||(r=null),r&&(t=r.attr("href"),i=r.attr("target"),n=r.attr("title"),a=r.attr("class"),t=this.getEditor().cleanLink(t,r),s="update"),t.match(/^mailto:(.*)$/)?{LinkType:"email",email:RegExp.$1,Description:n}:t.match(/^(assets\/.*)$/)||t.match(/^\[file_link\s*(?:\s*|%20|,)?id=([0-9]+)\]?(#.*)?$/)?{LinkType:"file",file:RegExp.$1,Description:n,TargetBlank:!!i}:t.match(/^#(.*)$/)?{LinkType:"anchor",Anchor:RegExp.$1,Description:n,TargetBlank:!!i}:t.match(/^\[sitetree_link(?:\s*|%20|,)?id=([0-9]+)\]?(#.*)?$/i)?{LinkType:"internal",internal:RegExp.$1,Anchor:RegExp.$2?RegExp.$2.substr(1):"",Description:n,TargetBlank:!!i}:t?{LinkType:"external",external:t,Description:n,TargetBlank:!!i}:null}}),e("form.htmleditorfield-linkform input[name=LinkType]").entwine({onclick:function(e){this.parents("form:first").redraw(),this._super()},onchange:function(){this.parents("form:first").redraw();var e=this.parent().find(":checked").val();"anchor"!==e&&"internal"!==e||this.parents("form.htmleditorfield-linkform").updateAnchorSelector(),this._super()}}),e("form.htmleditorfield-linkform input[name=internal]").entwine({onvalueupdated:function(){this.parents("form.htmleditorfield-linkform").updateAnchorSelector(),this._super()}}),e("form.htmleditorfield-linkform :submit[name=action_remove]").entwine({onclick:function(e){return this.parents("form:first").removeLink(),this._super(),!1}}),e("form.htmleditorfield-mediaform").entwine({toggleCloseButton:function(){var e=Boolean(this.find(".ss-htmleditorfield-file").length);this.find(".overview .action-delete")[e?"hide":"show"]()},onsubmit:function(){return this.modifySelection(function(t){this.find(".ss-htmleditorfield-file").each(function(){e(this).insertHTML(t)})}),this.getDialog().close(),!1},updateFromEditor:function(){var e=this,t=this.getSelection();t.is("img")&&this.showFileView(t.data("url")||t.attr("src")).done(function(i){i.updateFromNode(t),e.toggleCloseButton(),e.redraw()}),this.redraw()},redraw:function(t){this._super();var i=this.getSelection(),n=Boolean(this.find(".ss-htmleditorfield-file").length),s=i.is("img"),a=this.hasClass("insertingURL"),r=this.find(".header-edit");r[n?"show":"hide"](),this.closest("ui-dialog").find("ui-dialog-buttonpane .media-insert").button(n?"enable":"disable").toggleClass("ui-state-disabled",!n),this.find(".htmleditorfield-default-panel")[s||a?"hide":"show"](),this.find(".htmleditorfield-web-panel")[s||!a?"hide":"show"]();var o=this.find(".htmleditorfield-mediaform-heading.insert");s?o.hide():a?(o.show().text(_i18n2["default"]._t("HtmlEditorField.INSERTURL")).prepend(''),this.find(".htmleditorfield-web-panel input.remoteurl").focus()):o.show().text(_i18n2["default"]._t("HtmlEditorField.INSERTFROM")).find(".back-button").remove(),this.find(".htmleditorfield-mediaform-heading.update")[s?"show":"hide"](),this.find(".ss-uploadfield-item-actions")[s?"hide":"show"](),this.find(".ss-uploadfield-item-name")[s?"hide":"show"](),this.find(".ss-uploadfield-item-preview")[s?"hide":"show"](),this.find(".Actions .media-update")[s?"show":"hide"](),this.find(".ss-uploadfield-item-editform").toggleEditForm(s),this.find(".htmleditorfield-from-cms .field.treedropdown").css("left",e(".htmleditorfield-mediaform-heading:visible").outerWidth()),this.closest(".ui-dialog").addClass("ss-uploadfield-dropzone"),this.closest(".ui-dialog").find(".ui-dialog-buttonpane .media-insert .ui-button-text").text([s?_i18n2["default"]._t("HtmlEditorField.UPDATE","Update"):_i18n2["default"]._t("HtmlEditorField.INSERT","Insert")])},resetFields:function(){this.find(".ss-htmleditorfield-file").remove(),this.find(".ss-gridfield-items .ui-selected").removeClass("ui-selected"),this.find("li.ss-uploadfield-item").remove(),this.redraw(),this._super()},getFileView:function(e){return this.find(".ss-htmleditorfield-file[data-id="+e+"]")},showFileView:function(t){var i=this,n=Number(t)==t?{ID:t}:{FileURL:t},s=e('
        ');this.find(".content-edit").prepend(s);var a=e.Deferred();return e.ajax({url:e.path.addSearchParams(this.attr("action").replace(/MediaForm/,"viewfile"),n),success:function(t,n,r){var o=e(t).filter(".ss-htmleditorfield-file");s.replaceWith(o),i.redraw(),a.resolve(o)},error:function(){s.remove(),a.reject()}}),a.promise()}}),e("form.htmleditorfield-mediaform div.ss-upload .upload-url").entwine({onclick:function(){var e=this.closest("form");e.addClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .htmleditorfield-mediaform-heading .back-button").entwine({onclick:function(){var e=this.closest("form");e.removeClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .ss-gridfield-items").entwine({onselectableselected:function(t,i){var n=this.closest("form"),s=e(i.selected);s.is(".ss-gridfield-item")&&(n.closest("form").showFileView(s.data("id")),n.redraw(),n.parent().trigger("scroll"))},onselectableunselected:function(t,i){var n=this.closest("form"),s=e(i.unselected);s.is(".ss-gridfield-item")&&(n.getFileView(s.data("id")).remove(),n.redraw())}}),e("form.htmleditorfield-form.htmleditorfield-mediaform div.ss-assetuploadfield").entwine({onfileuploadstop:function(t){var i=this.closest("form"),n=[];i.find("div.content-edit").find("div.ss-htmleditorfield-file").each(function(){n.push(e(this).data("id"))});var s=e(".ss-uploadfield-files",this).children(".ss-uploadfield-item");s.each(function(){var t=e(this).data("fileid");t&&-1==e.inArray(t,n)&&(e(this).remove(),i.showFileView(t))}),i.parent().trigger("scroll"),i.redraw()}}),e("form.htmleditorfield-form.htmleditorfield-mediaform input.remoteurl").entwine({onadd:function(){this._super(),this.validate()},onkeyup:function(){this.validate()},onchange:function(){this.validate()},getAddButton:function(){return this.closest(".CompositeField").find("button.add-url")},validate:function(){var t=this.val(),i=t;return t=e.trim(t),t=t.replace(/^https?:\/\//i,""),i!==t&&this.val(t),this.getAddButton().button(t?"enable":"disable"),!!t}}),e("form.htmleditorfield-form.htmleditorfield-mediaform .add-url").entwine({getURLField:function(){return this.closest(".CompositeField").find("input.remoteurl")},onclick:function(e){var t=this.getURLField(),i=this.closest(".CompositeField"),n=this.closest("form");return t.validate()&&(i.addClass("loading"),n.showFileView("http://"+t.val()).done(function(){i.removeClass("loading"),n.parent().trigger("scroll")}),n.redraw()),!1}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file").entwine({getAttributes:function(){},getExtraData:function(){},getHTML:function(){return e("
        ").append(e("").attr({href:this.data("url")}).text(this.find(".name").text())).html()},insertHTML:function(e){e.replaceContent(this.getHTML())},updateFromNode:function(e){},updateDimensions:function(e,t,i){var n,s=this.find(":input[name=Width]"),a=this.find(":input[name=Height]"),r=s.val(),o=a.val();r&&o&&(e?(n=a.getOrigVal()/s.getOrigVal(),"Width"==e?(t&&r>t&&(r=t),o=Math.floor(r*n)):"Height"==e&&(i&&o>i&&(o=i),r=Math.ceil(o/n))):(t&&r>t&&(r=t),i&&o>i&&(o=i)),s.val(r),a.val(o))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.image").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(":input[name=URL]").val(),alt:this.find(":input[name=AltText]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,title:this.find(":input[name=Title]").val(),"class":this.find(":input[name=CSSClass]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function(){return{CaptionText:this.find(":input[name=CaptionText]").val()}},getHTML:function(){},insertHTML:function(t){var i=this.closest("form"),n=i.getSelection();t||(t=i.getEditor());var s=this.getAttributes(),a=this.getExtraData(),r=n&&n.is("img")?n:null;r&&r.parent().is(".captionImage")&&(r=r.parent());var o=n&&n.is("img")?n:e("");o.attr(s);var l=o.parent(".captionImage"),h=l.find(".caption");a.CaptionText?(l.length||(l=e("
        ")),l.attr("class","captionImage "+s["class"]).css("width",s.width),h.length||(h=e('

        ').appendTo(l)),h.attr("class","caption "+s["class"]).text(a.CaptionText)):l=h=null;var c=l?l:o;r&&r.not(c).length&&r.replaceWith(c),l&&l.prepend(o),r||(t.repaint(),t.insertContent(e("
        ").append(c).html(),{skip_undo:1})),t.addUndo(),t.repaint()},updateFromNode:function(e){this.find(":input[name=AltText]").val(e.attr("alt")),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.attr("class")),this.find(":input[name=Width]").val(e.width()),this.find(":input[name=Height]").val(e.height()),this.find(":input[name=CaptionText]").val(e.siblings(".caption:first").text()),this.find(":input[name=FileID]").val(e.data("fileid"))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.flash").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(":input[name=URL]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"data-fileid":this.find(":input[name=FileID]").val()}},getHTML:function(){var t=this.getAttributes(),i=tinyMCE.activeEditor.plugins.media.dataToImg({type:"flash",width:t.width,height:t.height,params:{src:t.src},video:{sources:[]}});return e("
        ").append(i).html()},updateFromNode:function(e){}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.embed").entwine({getAttributes:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{src:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"class":this.find(":input[name=CSSClass]").val(),alt:this.find(":input[name=AltText]").val(),title:this.find(":input[name=Title]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val();return{CaptionText:this.find(":input[name=CaptionText]").val(),Url:this.find(":input[name=URL]").val(),thumbnail:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,cssclass:this.find(":input[name=CSSClass]").val()}},getHTML:function(){var t,i=this.getAttributes(),n=this.getExtraData(),s=e("").attr(i).addClass("ss-htmleditorfield-file embed");return e.each(n,function(e,t){s.attr("data-"+e,t)}),t=n.CaptionText?e('

        '+n.CaptionText+"

        ").prepend(s):s,e("
        ").append(t).html()},updateFromNode:function(e){this.find(":input[name=AltText]").val(e.attr("alt")),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=Width]").val(e.width()),this.find(":input[name=Height]").val(e.height()),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.data("cssclass")),this.find(":input[name=FileID]").val(e.data("fileid"))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file .dimensions :input").entwine({OrigVal:null,onmatch:function(){this._super(),this.setOrigVal(parseInt(this.val(),10))},onunmatch:function(){this._super()},onfocusout:function(e){this.closest(".ss-htmleditorfield-file").updateDimensions(this.attr("name"))}}),e("form.htmleditorfield-mediaform .ss-uploadfield-item .ss-uploadfield-item-cancel").entwine({onclick:function(e){var t=this.closest("form"),i=this.closest("ss-uploadfield-item");t.find(".ss-gridfield-item[data-id="+i.data("id")+"]").removeClass("ui-selected"),this.closest(".ss-uploadfield-item").remove(),t.redraw(),e.preventDefault()}}),e("div.ss-assetuploadfield .ss-uploadfield-item-edit, div.ss-assetuploadfield .ss-uploadfield-item-name").entwine({getEditForm:function(){return this.closest(".ss-uploadfield-item").find(".ss-uploadfield-item-editform")},fromEditForm:{onchange:function(t){var i=e(t.target);i.removeClass("edited"),i.addClass("edited")}},onclick:function(e){var t=this.getEditForm();return this.closest(".ss-uploadfield-item").hasClass("ss-htmleditorfield-file")?(t.parent("ss-uploadfield-item").removeClass("ui-state-warning"),t.toggleEditForm(),e.preventDefault(),!1):void this._super(e)}}),e("div.ss-assetuploadfield .ss-uploadfield-item-editform").entwine({toggleEditForm:function(e){var t=this.prev(".ss-uploadfield-item-info"),i=t.find(".ss-uploadfield-item-status"),n="";e===!0||e!==!1&&0===this.height()?(n=_i18n2["default"]._t("UploadField.Editing","Editing ..."),this.height("auto"),t.find(".toggle-details-icon").addClass("opened"),i.removeClass("ui-state-success-text").removeClass("ui-state-warning-text")):(this.height(0),t.find(".toggle-details-icon").removeClass("opened"),this.hasClass("edited")?(n=_i18n2["default"]._t("UploadField.CHANGESSAVED","Changes Made"),this.removeClass("edited"),i.addClass("ui-state-success-text")):(n=_i18n2["default"]._t("UploadField.NOCHANGES","No Changes"),i.addClass("ui-state-success-text"))),i.attr("title",n).text(n)}}),e('form.htmleditorfield-mediaform .field[id$="ParentID_Holder"] .TreeDropdownField').entwine({onadd:function(){this._super();var e=this;this.bind("change",function(){var t=e.closest("form").find(".ss-gridfield");t.setState("ParentID",e.getValue()),t.reload()})}})})},{"./i18n":"i18n","./jQuery":"jQuery"}],16:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s);a["default"].entwine("ss",function(e){e(".ss-tabset").entwine({IgnoreTabState:!1,onadd:function(){var e=window.location.hash;this.redrawTabs(),""!==e&&this.openTabFromURL(e),this._super()},onremove:function(){this.data("tabs")&&this.tabs("destroy"),this._super()},redrawTabs:function(){this.rewriteHashlinks(),this.tabs()},openTabFromURL:function(t){var i;e.each(this.find(".cms-panel-link"),function(){return-1!==this.href.indexOf(t)&&1===e(t).length?(i=e(this),!1):void 0}),void 0!==i&&e(window).one("ajaxComplete",function(){i.click()})},rewriteHashlinks:function(){e(this).find("ul a").each(function(){if(e(this).attr("href")){var t=e(this).attr("href").match(/#.*/);t&&e(this).attr("href",document.location.href.replace(/#.*/,"")+t[0])}})}})})},{"./jQuery":"jQuery"}],17:[function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var s=e("./jQuery"),a=n(s),r=e("./i18n"),o=n(r);a["default"].entwine("ss",function(e){var t,i;e(window).bind("resize.treedropdownfield",function(){ var n=function(){e(".TreeDropdownField").closePanel()};if(e.browser.msie&&parseInt(e.browser.version,10)<9){var s=e(window).width(),a=e(window).height();s==t&&a==i||(t=s,i=a,n())}else n()});var n={openlink:o["default"]._t("TreeDropdownField.OpenLink"),fieldTitle:"("+o["default"]._t("TreeDropdownField.FieldTitle")+")",searchFieldTitle:"("+o["default"]._t("TreeDropdownField.SearchFieldTitle")+")"},s=function(t){e(t.target).parents(".TreeDropdownField").length||e(".TreeDropdownField").closePanel()};e(".TreeDropdownField").entwine({CurrentXhr:null,onadd:function(){this.append('
        ');var e=n.openLink;e&&this.find("treedropdownfield-toggle-panel-link a").attr("title",e),this.data("title")&&this.setTitle(this.data("title")),this.getPanel().hide(),this._super()},getPanel:function(){return this.find(".treedropdownfield-panel")},openPanel:function(){e(".TreeDropdownField").closePanel(),e("body").bind("click",s);var t=this.getPanel(),i=this.find(".tree-holder");t.css("width",this.width()),t.show();var n=this.find(".treedropdownfield-toggle-panel-link");n.addClass("treedropdownfield-open-tree"),this.addClass("treedropdownfield-open-tree"),n.find("a").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-n"),i.is(":empty")&&!t.hasClass("loading")?this.loadTree(null,this._riseUp):this._riseUp(),this.trigger("panelshow")},_riseUp:function(){var t,i,n,s=this,a=this.getPanel(),r=this.find(".treedropdownfield-toggle-panel-link"),o=r.innerHeight();r.length>0&&(n=e(window).height()+e(document).scrollTop()-r.innerHeight(),i=r.offset().top,t=a.innerHeight(),i+t>n&&i-t>0?(s.addClass("treedropdownfield-with-rise"),o=-a.outerHeight()):s.removeClass("treedropdownfield-with-rise")),a.css({top:o+"px"})},closePanel:function(){jQuery("body").unbind("click",s);var e=this.find(".treedropdownfield-toggle-panel-link");e.removeClass("treedropdownfield-open-tree"),this.removeClass("treedropdownfield-open-tree treedropdownfield-with-rise"),e.find("a").removeClass("ui-icon-triangle-1-n").addClass("ui-icon-triangle-1-s"),this.getPanel().hide(),this.trigger("panelhide")},togglePanel:function(){this[this.getPanel().is(":visible")?"closePanel":"openPanel"]()},setTitle:function(e){e=e||this.data("title")||n.fieldTitle,this.find(".treedropdownfield-title").html(e),this.data("title",e)},getTitle:function(){return this.find(".treedropdownfield-title").text()},updateTitle:function(){var e=this,t=e.find(".tree-holder"),i=this.getValue(),n=function(){var i=e.getValue();if(i){var n=t.find('*[data-id="'+i+'"]'),s=n.children("a").find("span.jstree_pageicon")?n.children("a").find("span.item").html():null;s||(s=n.length>0?t.jstree("get_text",n[0]):null),s&&(e.setTitle(s),e.data("title",s)),n&&t.jstree("select_node",n)}else e.setTitle(e.data("empty-title")),e.removeData("title")};t.is(":empty")&&i?this.loadTree({forceValue:i},n):n()},setValue:function(t){this.data("metadata",e.extend(this.data("metadata"),{id:t})),this.find(":input:hidden").val(t).trigger("valueupdated").trigger("change")},getValue:function(){return this.find(":input:hidden").val()},loadTree:function(t,i){var n,s=this,a=this.getPanel(),r=e(a).find(".tree-holder"),t=t?e.extend({},this.getRequestParams(),t):this.getRequestParams();this.getCurrentXhr()&&this.getCurrentXhr().abort(),a.addClass("loading"),n=e.ajax({url:this.data("urlTree"),data:t,complete:function(e,t){a.removeClass("loading")},success:function(t,n,a){r.html(t);var o=!0;r.jstree("destroy").bind("loaded.jstree",function(e,t){var n=s.getValue(),a=r.find('*[data-id="'+n+'"]'),l=t.inst.get_selected();n&&a!=l&&t.inst.select_node(a),o=!1,i&&i.apply(s)}).jstree(s.getTreeConfig()).bind("select_node.jstree",function(t,i){var n=i.rslt.obj,a=e(n).data("id");o||s.getValue()!=a?(s.data("metadata",e.extend({id:a},e(n).getMetaData())),s.setTitle(i.inst.get_text(n)),s.setValue(a)):(s.data("metadata",null),s.setTitle(null),s.setValue(null),i.inst.deselect_node(n)),o||s.closePanel(),o=!1}),s.setCurrentXhr(null)}}),this.setCurrentXhr(n)},getTreeConfig:function(){var t=this;return{core:{html_titles:!0,animation:0},html_data:{data:this.getPanel().find(".tree-holder").html(),ajax:{url:function i(n){var i=e.path.parseUrl(t.data("urlTree")).hrefNoSearch;return i+"/"+(e(n).data("id")?e(n).data("id"):0)},data:function(i){var n=e.query.load(t.data("urlTree")).keys,s=t.getRequestParams();return s=e.extend({},n,s,{ajax:1})}}},ui:{select_limit:1,initially_select:[this.getPanel().find(".current").attr("id")]},themes:{theme:"apple"},types:{types:{"default":{check_node:function(e){return!e.hasClass("disabled")},uncheck_node:function(e){return!e.hasClass("disabled")},select_node:function(e){return!e.hasClass("disabled")},deselect_node:function(e){return!e.hasClass("disabled")}}}},plugins:["html_data","ui","themes","types"]}},getRequestParams:function(){return{}}}),e(".TreeDropdownField .tree-holder li").entwine({getMetaData:function(){var e=this.attr("class").match(/class-([^\s]*)/i),t=e?e[1]:"";return{ClassName:t}}}),e(".TreeDropdownField *").entwine({getField:function(){return this.parents(".TreeDropdownField:first")}}),e(".TreeDropdownField").entwine({onclick:function(e){return this.togglePanel(),!1}}),e(".TreeDropdownField .treedropdownfield-panel").entwine({onclick:function(e){return!1}}),e(".TreeDropdownField.searchable").entwine({onadd:function(){this._super();var t=o["default"]._t("TreeDropdownField.ENTERTOSEARCH");this.find(".treedropdownfield-panel").prepend(e(''))},search:function(e,t){this.openPanel(),this.loadTree({search:e},t)},cancelSearch:function(){this.closePanel(),this.loadTree()}}),e(".TreeDropdownField.searchable input.search").entwine({onkeydown:function(e){var t=this.getField();return 13==e.keyCode?(t.search(this.val()),!1):void(27==e.keyCode&&t.cancelSearch())}}),e(".TreeDropdownField.multiple").entwine({getTreeConfig:function(){var e=this._super();return e.checkbox={override_ui:!0,two_state:!0},e.plugins.push("checkbox"),e.ui.select_limit=-1,e},loadTree:function(t,i){var n,s=this,a=this.getPanel(),r=e(a).find(".tree-holder"),t=t?e.extend({},this.getRequestParams(),t):this.getRequestParams();this.getCurrentXhr()&&this.getCurrentXhr().abort(),a.addClass("loading"),n=e.ajax({url:this.data("urlTree"),data:t,complete:function(e,t){a.removeClass("loading")},success:function(t,n,a){r.html(t);var o=!0;s.setCurrentXhr(null),r.jstree("destroy").bind("loaded.jstree",function(t,n){e.each(s.getValue(),function(e,t){n.inst.check_node(r.find("*[data-id="+t+"]"))}),o=!1,i&&i.apply(s)}).jstree(s.getTreeConfig()).bind("uncheck_node.jstree check_node.jstree",function(t,i){var n=i.inst.get_checked(null,!0);s.setValue(e.map(n,function(t,i){return e(t).data("id")})),s.setTitle(e.map(n,function(e,t){return i.inst.get_text(e)})),s.data("metadata",e.map(n,function(t,i){return{id:e(t).data("id"),metadata:e(t).getMetaData()}}))})}}),this.setCurrentXhr(n)},getValue:function(){var e=this._super();return e.split(/ *, */)},setValue:function(t){this._super(e.isArray(t)?t.join(","):t)},setTitle:function(t){this._super(e.isArray(t)?t.join(", "):t)},updateTitle:function(){}}),e(".TreeDropdownField input[type=hidden]").entwine({onadd:function(){this._super(),this.bind("change.TreeDropdownField",function(){e(this).getField().updateTitle()})},onremove:function(){this._super(),this.unbind(".TreeDropdownField")}})})},{"./i18n":"i18n","./jQuery":"jQuery"}],18:[function(e,t,i){!function(e){e.fn.changetracker=function(t){var i=this;if(this.length>1)return this.each(function(e,i){this.changetracker(t)}),this;this.defaults={fieldSelector:":input:not(:submit)",ignoreFieldSelector:"",changedCssClass:"changed"};var n=e.extend({},this.defaults,t);if(this.initialize=function(){e.meta&&(n=e.extend({},n,this.data()));var t,s=!1,a=function(t){var a,r=e(t.target),o=r.data("changetracker.origVal");a=r.is(":checkbox")?r.is(":checked")?1:0:r.val(),null===o||a!=o?(r.addClass(n.changedCssClass),i.addClass(n.changedCssClass)):(r.removeClass(n.changedCssClass),r.is(":radio")&&i.find(":radio[name="+r.attr("name")+"]").removeClass(n.changedCssClass),s||i.getFields().filter("."+n.changedCssClass).length||i.removeClass(n.changedCssClass))},r=this.getFields();r.filter(":radio,:checkbox").bind("click.changetracker",a),r.not(":radio,:checkbox").bind("change.changetracker",a),r.each(function(){t=e(this).is(":radio,:checkbox")?i.find(":input[name="+e(this).attr("name")+"]:checked").val():e(this).val(),e(this).data("changetracker.origVal",t)}),i.bind("dirty.changetracker",function(){s=!0,i.addClass(n.changedCssClass)}),this.data("changetracker",!0)},this.destroy=function(){this.getFields().unbind(".changetracker").removeClass(n.changedCssClass).removeData("changetracker.origVal"),this.unbind(".changetracker").removeData("changetracker")},this.reset=function(){this.getFields().each(function(){i.resetField(this)}),this.removeClass(n.changedCssClass)},this.resetField=function(t){return e(t).removeData("changetracker.origVal").removeClass("changed")},this.getFields=function(){return this.find(n.fieldSelector).not(n.ignoreFieldSelector)},"string"==typeof arguments[0]){var s=(arguments[1],Array.prototype.slice.call(arguments));return s.splice(0,1),this[arguments[0]].apply(this,s)}return this.initialize()}}(jQuery)},{}],19:[function(e,t,i){jQuery.cookie=function(e,t,i){if("undefined"==typeof t){var n=null;if(document.cookie&&""!=document.cookie)for(var s=document.cookie.split(";"),a=0;a)\s*|\s+/,comma:/\s*,\s*/,important:/\s+!important\s*$/},s=/[A-Z][A-Z0-9]+/;for(var a in i){for(var r,o=i[a].source;r=o.match(s);)o=o.replace(r[0],t[r[0]].source);i[a]=new RegExp(o,"gi")}var l=n.extend({init:function(e){this.str=e,this.pos=0},match:function(e){var t;return e.lastIndex=this.pos,(t=e.exec(this.str))&&t.index==this.pos?(this.pos=e.lastIndex?e.lastIndex:this.str.length,t):null},peek:function(e){var t;return e.lastIndex=this.pos,(t=e.exec(this.str))&&t.index==this.pos?t:null},showpos:function(){return this.str.slice(0,this.pos)+""+this.str.slice(this.pos)},done:function(){return this.pos==this.str.length}}),h=n.extend({}),c=h.extend({init:function(){this.tag=null,this.id=null,this.classes=[],this.attrs=[],this.nots=[],this.pseudo_classes=[],this.pseudo_els=[]},parse:function(e){var t;(t=e.match(i.tag))&&(this.tag=t[1]);do if(t=e.match(i.not)){if(this.nots[this.nots.length]=u().parse(e),!(t=e.match(i.not_end)))throw"Invalid :not term in selector"}else if(t=e.match(i.id))this.id=t[1];else if(t=e.match(i.cls))this.classes[this.classes.length]=t[1];else if(t=e.match(i.attr))this.attrs[this.attrs.length]=[t[1],t[2],t[3]];else if(t=e.match(i.pseudo_el))this.pseudo_els[this.pseudo_els.length]=t[1]||t[2];else if(t=e.match(i.pseudo_cls_nth)){if(t[3])var n=parseInt((t[1]||"")+(t[2]||"1")),s=parseInt((t[4]||"")+(t[5]||"0"));else var n=t[8]?2:0,s=t[8]?4-t[8].length:parseInt((t[6]||"")+t[7]);this.pseudo_classes[this.pseudo_classes.length]=["nth-child",[n,s]]}else(t=e.match(i.pseudo_cls))&&(this.pseudo_classes[this.pseudo_classes.length]=[t[1]]);while(t&&!e.done());return this}}),d=h.extend({init:function(){this.parts=[]},parse:function(e){for(this.parts[this.parts.length]=c().parse(e);!e.done()&&!e.peek(i.comma)&&(r=e.match(i.comb));)this.parts[this.parts.length]=r[1]||" ",this.parts[this.parts.length]=c().parse(e);return 1==this.parts.length?this.parts[0]:this}}),u=h.extend({init:function(){this.parts=[]},parse:function(e){for(this.parts[this.parts.length]=d().parse(e);!e.done()&&(r=e.match(i.comma));)this.parts[this.parts.length]=d().parse(e);return 1==this.parts.length?this.parts[0]:this}});e.selector=function(e){var t=l(e),i=u().parse(t);if(i.selector=e,t.done())return i;throw"Could not parse selector - "+t.showpos()},e.selector.SelectorBase=h,e.selector.SimpleSelector=c,e.selector.Selector=d,e.selector.SelectorsGroup=u}(jQuery),function(e){e.selector.SimpleSelector.addMethod("specifity",function(){if(this.spec)return this.spec;var t=[this.id?1:0,this.classes.length+this.attrs.length+this.pseudo_classes.length,(this.tag&&"*"!=this.tag?1:0)+this.pseudo_els.length];return e.each(this.nots,function(e,i){var n=i.specifity();t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}),this.spec=t}),e.selector.Selector.addMethod("specifity",function(){if(this.spec)return this.spec;var t=[0,0,0];return e.each(this.parts,function(e,i){if(!(e%2)){var n=i.specifity();t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}}),this.spec=t}),e.selector.SelectorsGroup.addMethod("specifity",function(){if(this.spec)return this.spec;var t=[0,0,0];return e.each(this.parts,function(e,i){var n=i.specifity();t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}),this.spec=t})}(jQuery),function(e){function t(e){return e.complex?c(["l"+ ++v+":{",e.replace(o,"break l"+v),"}"]):e.replace(o,"")}var i=document.createElement("div");i.innerHTML='
        ';var s,a="test"!==i.firstChild.getAttribute("id"),r=i.firstElementChild&&"FORM"==i.firstElementChild.tagName,o=(i.children&&"FORM"==i.children[0].tagName,/GOOD/g),l=/BAD/g,h=/^['"]/g,c=function(e){return e.join("\n")},d=function(e){var t=new String(e.join("\n"));return t.complex=!0,t},u=function(e){return"_"+e.replace(/^[^A-Za-z]|[^A-Za-z0-9]/g,function(e){return"_0x"+e.charCodeAt(0).toString(16)+"_"})};if(a){var p={"class":"className","for":"htmlFor"};s=function(e){var t=p[e]||e;return"var "+u(e)+' = el.getAttribute("'+t+'",2) || (el.getAttributeNode("'+e+'")||{}).nodeValue;'}}else s=function(e){return"var "+u(e)+' = el.getAttribute("'+e+'");'};var f={"-":"!K","=":'K != "V"',"!=":'K == "V"',"~=":'_WS_K.indexOf(" V ") == -1',"^=":'!K || K.indexOf("V") != 0',"*=":'!K || K.indexOf("V") == -1',"$=":'!K || K.substr(K.length-"V".length) != "V"'},g=e.selector.State=n.extend({init:function(){this.reset()},reset:function(){this.attrs={},this.wsattrs={}},prev:function(){return this.reset(),r?"el = el.previousElementSibling":"while((el = el.previousSibling) && el.nodeType != 1) {}"},next:function(){return this.reset(),r?"el = el.nextElementSibling":"while((el = el.nextSibling) && el.nodeType != 1) {}"},prevLoop:function(e){return this.reset(),c(r?["while(el = el.previousElementSibling){",e]:["while(el = el.previousSibling){","if (el.nodeType != 1) continue;",e])},parent:function(){return this.reset(),"el = el.parentNode;"},parentLoop:function(e){return this.reset(),c(["while((el = el.parentNode) && el.nodeType == 1){",e,"}"])},uses_attr:function(e){return this.attrs[e]?void 0:(this.attrs[e]=!0,s(e))},uses_wsattr:function(e){return this.wsattrs[e]?void 0:(this.wsattrs[e]=!0,c([this.uses_attr(e),"var _WS_"+u(e)+' = " "+'+u(e)+'+" ";']))},uses_jqueryFilters:function(){return this.jqueryFiltersAdded?void 0:(this.jqueryFiltersAdded=!0,"var _$filters = jQuery.find.selectors.filters;")},save:function(e){return"var el"+e+" = el;"},restore:function(e){return this.reset(),"el = el"+e+";"}}),m={"first-child":c(["var cel = el;","while(cel = cel.previousSibling){ if (cel.nodeType === 1) BAD; }"]),"last-child":c(["var cel = el;","while(cel = cel.nextSibling){ if (cel.nodeType === 1) BAD; }"]),"nth-child":function(e,t){var i=c(["var i = 1, cel = el;","while(cel = cel.previousSibling){","if (cel.nodeType === 1) i++;","}"]);return c(0==e?[i,"if (i- "+t+" != 0) BAD;"]:0==t&&e>=0?[i,"if (i%"+e+" != 0 || i/"+e+" < 0) BAD;"]:0==t&&0>e?["BAD;"]:[i,"if ((i- "+t+")%"+e+" != 0 || (i- "+t+")/"+e+" < 0) BAD;"])}};m["only-child"]=c([m["first-child"],m["last-child"]]),e.selector.SimpleSelector.addMethod("compile",function(t){var i=[];return this.tag&&"*"!=this.tag&&(i[i.length]='if (el.tagName != "'+this.tag.toUpperCase()+'") BAD;'),this.id&&(i[i.length]=t.uses_attr("id"),i[i.length]='if (_id !== "'+this.id+'") BAD;'),this.classes.length&&(i[i.length]=t.uses_wsattr("class"),e.each(this.classes,function(e,t){i[i.length]='if (_WS__class.indexOf(" '+t+' ") == -1) BAD;'})),e.each(this.attrs,function(e,n){i[i.length]="~="==n[1]?t.uses_wsattr(n[0]):t.uses_attr(n[0]);var s=f[n[1]||"-"];s=s.replace(/K/g,u(n[0])).replace(/V/g,n[2]&&n[2].match(h)?n[2].slice(1,-1):n[2]),i[i.length]="if ("+s+") BAD;"}),e.each(this.nots,function(n,s){var a=++v,r=c(["l"+a+":{",s.compile(t).replace(l,"break l"+a).replace(o,"BAD"),"}"]);s instanceof e.selector.SimpleSelector||(r=c([t.save(a),r,t.restore(a)])),i[i.length]=r}),e.each(this.pseudo_classes,function(n,s){var a=m[s[0]];a?i[i.length]="function"==typeof a?a.apply(this,s[1]):a:(a=e.find.selectors.filters[s[0]])&&(i[i.length]=t.uses_jqueryFilters(),i[i.length]="if (!_$filters."+s[0]+"(el)) BAD;")}),i[i.length]="GOOD",c(i)});var v=0,_={" ":function(e,t,i){return d([i,"while(true){",e.parent(),"if (!el || el.nodeType !== 1) BAD;",t.compile(e).replace(l,"continue"),"}"])},">":function(e,t,i){return c([i,e.parent(),"if (!el || el.nodeType !== 1) BAD;",t.compile(e)])},"~":function(e,t,i){return d([i,e.prevLoop(),t.compile(e).replace(l,"continue"),"}","BAD;"])},"+":function(e,t,i){return c([i,e.prev(),"if (!el) BAD;",t.compile(e)])}};e.selector.Selector.addMethod("compile",function(e){for(var i=this.parts.length,n=this.parts[--i].compile(e);i;){var s=this.parts[--i];n=_[s](e,this.parts[--i],t(n))}return n}),e.selector.SelectorsGroup.addMethod("compile",function(e){for(var t=[],i=++v,n=0;n=0;)t[t.length]=this.parts[i].ABC_compile().replace(n,"CONTEXT");return t.join("\n")}),e.selector.SelectorsGroup.addMethod("ABC_compile",function(){var t=[];return e.each(this.parts,function(e,i){t[t.length]=i.ABC_compile()}),t.join("\n")})}(jQuery),function(e){void 0===e.support.focusinBubbles&&(e.support.focusinBubbles=!!e.browser.msie),e.support.focusinBubbles||e.event.special.focusin||e.each({focus:"focusin",blur:"focusout"},function(t,i){e.event.special[i]={setup:function(){return this.addEventListener?void this.addEventListener(t,e.event.special[i].handler,!0):!1},teardown:function(){return this.removeEventListener?void this.removeEventListener(t,e.event.special[i].handler,!0):!1},handler:function(t){return arguments[0]=e.event.fix(t),arguments[0].type=i,e.event.handle.apply(this,arguments)}}}),function(){var t=null;e(document).bind("focusin",function(i){var n=i.realTarget||i.target;t&&t!==n&&(i.type="focusout",e(t).trigger(i),i.type="focusin",i.target=n),t=n}).bind("focusout",function(e){t=null})}()}(jQuery);try{console.log}catch(s){window.console=void 0}!function(e){var t=function(){function t(e,i){return new t.fn.init(e,i)}jQuery.extend(!0,t,e),t.superclass=e,t.fn=t.prototype=e(),t.fn.constructor=t,t.fn.init=function(e,n){return n&&n instanceof jQuery&&!(n instanceof t)&&(n=t(n)),jQuery.fn.init.call(this,e,n,i)},t.fn.init.prototype=t.fn;var i=t(document);return t},i={};e.entwine=function(){e.fn.entwine.apply(null,arguments)},e.extend(e.entwine,{namespaces:i,clear_all_rules:function(){for(var t in e.fn)e.fn[t].isentwinemethod&&delete e.fn[t];e(document).unbind(".entwine"),e(window).unbind(".entwine");for(var t in i)delete i[t];for(var t in e.entwine.capture_bindings)delete e.entwine.capture_bindings[t]},WARN_LEVEL_NONE:0,WARN_LEVEL_IMPORTANT:1,WARN_LEVEL_BESTPRACTISE:2,warningLevel:0,warn:function(t,i){i<=e.entwine.warningLevel&&console&&console.warn&&(console.warn(t),console.trace&&console.trace())},warn_exception:function(t,i,n){e.entwine.WARN_LEVEL_IMPORTANT<=e.entwine.warningLevel&&console&&console.warn&&(2==arguments.length&&(n=i,i=null),i?console.warn("Uncaught exception",n,"in",t,"on",i):console.warn("Uncaught exception",n,"in",t),n.stack&&console.warn("Stack Trace:\n"+n.stack))}});var s=0,a=n.extend({init:function(e,t){this.selector=e,this.specifity=e.specifity(),this.important=0,this.name=t,this.rulecount=s++}});a.compare=function(e,t){var i=e.specifity,n=t.specifity;return e.important-t.important||i[0]-n[0]||i[1]-n[1]||i[2]-n[2]||e.rulecount-t.rulecount},e.entwine.RuleList=function(){var e=[];return e.addRule=function(t,i){var n=a(t,i);return e[e.length]=n,e.sort(a.compare),n},e};var r=[];e.entwine.Namespace=n.extend({init:function(n){if(n&&!n.match(/^[A-Za-z0-9.]+$/)&&e.entwine.warn("Entwine namespace "+n+" is not formatted as period seperated identifiers",e.entwine.WARN_LEVEL_BESTPRACTISE),n=n||"__base",this.name=n,this.store={},i[n]=this,"__base"==n)this.injectee=e.fn,this.$=e;else{this.$=e.sub?e.sub():t(),this.$.cache=e.cache,this.injectee=this.$.prototype;var s=this.injectee.entwine=function(t){var i=arguments;return t&&"string"==typeof t?"."!=t.charAt(0)&&(i[0]=n+"."+t):(i=e.makeArray(i),i.unshift(n)),e.fn.entwine.apply(this,i)};this.$.entwine=function(){s.apply(null,arguments)};for(var a=0;a1||s[1]>=10?1:2,r=e.prototype.domManip;e.prototype.domManip=function(){return arguments[a].patched||(arguments[a]=n(arguments[a])),r.apply(this,arguments)};var o=e.prototype.html;e.prototype.html=function(n){if(void 0===n)return o.apply(this,arguments);i=!0;var s=o.apply(this,arguments);i=!1;for(var a=[],r=0,l=this.length;l>r;r++)t(a,this[r]);var h=e.Event("EntwineElementsAdded");return h.targets=a,e(document).triggerHandler(h),s};var l=!1,h=e.cleanData;e.cleanData=function(t){var i=t;if(l)for(var n=0,s=t.length,i=[],a=0;s>n;n++)for(var r=t[n],o=r;o=o.parentNode;)if(9==o.nodeType){i[a++]=r;break}if(i.length){var c=e.Event("EntwineElementsRemoved");c.targets=i,e(document).triggerHandler(c)}l||h.apply(this,arguments)};var c=e.prototype.remove;e.prototype.remove=function(e,t){l=t;var i=c.call(this,e);return l=!1,i},e(function(){var i=[];t(i,document);var n=e.Event("EntwineElementsAdded");n.targets=i,e(document).triggerHandler(n)})}(jQuery),function(e){var t=function(){var t=e.makeArray(arguments),i=t.pop();e.each(t,function(t,n){var s=e.fn[n];e.fn[n]=function(){var t=this,n=e.makeArray(arguments),a=s.apply(t,n);return i.apply(t,n),a}})},i=window.setTimeout,s=n.extend({init:function(){this.global=!1,this.attrs={},this.classes={}},triggerEvent:function(){a==this&&(this.check_id&&clearTimeout(this.check_id),a=new s,e(document).triggerHandler("EntwineSubtreeMaybeChanged",[this]))},changed:function(){if(!this.check_id){var e=this;this.check_id=i(function(){e.check_id=null,e.triggerEvent()},10)}},addAll:function(){return this.global?this:(this.global=!0,this.changed(),this)},addSubtree:function(e){return this.addAll()},addSubtreeFuture:function(t){return this.global?this:(this.subtree=this.subtree?this.subtree.add(t):e(t),this.changed(),this)},addAttr:function(t,i){return this.global?this:(this.attrs[t]=t in this.attrs?this.attrs[t].add(i):e(i),this.changed(),this)},addClass:function(t,i){return this.global?this:(this.classes[t]=t in this.classes?this.classes[t].add(i):e(i),this.changed(),this)}}),a=new s;e(document).bind("EntwineElementsAdded",function(e){a.addSubtree(e.targets)});var r=null;e(document).bind("EntwineElementsRemoved",function(e){r=e.targets}),t("remove","html","empty",function(){var e=r;r=null,e&&a.addSubtree(e)}),t("removeAttr",function(e){a.addAttr(e,this)}),t("addClass","removeClass","toggleClass",function(e){"string"==typeof e&&a.addClass(e,this)}),t("attr",function(e,t){if(void 0!==t&&"string"==typeof e)a.addAttr(e,this);else if("string"!=typeof e)for(var i in e)a.addAttr(i,this)}),e.extend(e.entwine,{synchronous_mode:function(){a&&a.check_id&&clearTimeout(a.check_id),a=new s,i=function(e,t){return e.call(this),null}},triggerMatching:function(){a.addAll()}})}(jQuery),function(e){if(void 0==e.support.changeBubbles){e.support.changeBubbles=!0;var t=document.createElement("div");if(eventName="onchange",t.attachEvent){var i=eventName in t;i||(t.setAttribute(eventName,"return;"),i="function"==typeof t[eventName]),e.support.changeBubbles=i}}if(document.compareDocumentPosition)var n=function(e,t){return e&&t&&(e==t||!!(16&e.compareDocumentPosition(t)))};else var n=function(e,t){return e&&t&&(e==t||(e.contains?e.contains(t):!0))};e.entwine.Namespace.addMethods({build_event_proxy:function(e){var t=this.one(e,"func"),i=function(e,i){e=e.delegatedEvent||e;for(var n=e.target;n&&1==n.nodeType&&!e.isPropagationStopped();){var s=t(n,arguments);void 0!==s&&(e.result=s),s===!1&&(e.preventDefault(),e.stopPropagation()),n=n.parentNode}};return i},build_mouseenterleave_proxy:function(e){var t=this.one(e,"func"),i=function(e){for(var i=e.target,s=e.relatedTarget;i&&1==i.nodeType&&!e.isPropagationStopped()&&!n(i,s);){var a=t(i,arguments);void 0!==a&&(e.result=a),a===!1&&(e.preventDefault(),e.stopPropagation()),i=i.parentNode}};return i},build_change_proxy:function(e){var t=this.one(e,"func"),i=function(e){var t=e.type,i=e.value;return"radio"===t||"checkbox"===t?i=e.checked:"select-multiple"===t?(i="",e.selectedIndex>-1&&(i=jQuery.map(e.options,function(e){return e.selected}).join("-"))):jQuery.nodeName(e,"select")&&(i=e.selectedIndex),i},n=/^(?:textarea|input|select)$/i,s=function(e){var s,a,r=e.target;if(n.test(r.nodeName)&&!r.readOnly&&(s=jQuery.data(r,"_entwine_change_data"),a=i(r),"focusout"===e.type&&"radio"===r.type||jQuery.data(r,"_entwine_change_data",a),void 0!==s&&a!==s&&(null!=s||a)))for(e.type="change";r&&1==r.nodeType&&!e.isPropagationStopped();){var o=t(r,arguments);void 0!==o&&(e.result=o),o===!1&&(e.preventDefault(),e.stopPropagation()),r=r.parentNode}},a=function(e){var t=e.type,n=e.target,a=jQuery.nodeName(n,"input")?n.type:"";switch(t){case"focusout":case"beforedeactivate":s.apply(this,arguments);break;case"click":("radio"===a||"checkbox"===a||jQuery.nodeName(n,"select"))&&s.apply(this,arguments); break;case"keydown":(13===e.keyCode&&!jQuery.nodeName(n,"textarea")||32===e.keyCode&&("checkbox"===a||"radio"===a)||"select-multiple"===a)&&s.apply(this,arguments);break;case"focusin":case"beforeactivate":jQuery.data(n,"_entwine_change_data",i(n))}};return a},bind_event:function(t,i,n,s){var a=this.store[i]||(this.store[i]=e.entwine.RuleList()),r=a.proxies||(a.proxies={}),o=a.addRule(t,i);if(o.func=n,!r[i]){switch(i){case"onmouseenter":r[i]=this.build_mouseenterleave_proxy(i),s="mouseover";break;case"onmouseleave":r[i]=this.build_mouseenterleave_proxy(i),s="mouseout";break;case"onchange":e.support.changeBubbles||(r[i]=this.build_change_proxy(i),s="click keydown focusin focusout beforeactivate beforedeactivate");break;case"onsubmit":s="delegatedSubmit";break;case"onfocus":case"onblur":e.entwine.warn("Event "+s+" not supported - using focusin / focusout instead",e.entwine.WARN_LEVEL_IMPORTANT)}r[i]||(r[i]=this.build_event_proxy(i)),e(document).bind(s.replace(/(\s+|$)/g,".entwine$1"),r[i])}}}),e.entwine.Namespace.addHandler({order:40,bind:function(t,i,n){var s,a;return e.isFunction(n)&&(s=i.match(/^on(.*)/))?(a=s[1],this.bind_event(t,i,n,a),!0):void 0}});var s=function(t,i){var n=e.Event("delegatedSubmit");return n.delegatedEvent=t,e(document).trigger(n,i)};e(document).bind("EntwineElementsAdded",function(t){var i=e(t.targets).filter("form");i.length&&i.bind("submit.entwine_delegate_submit",s)})}(jQuery),function(e){e.entwine.Namespace.addMethods({bind_capture:function(t,i,n,s){var a=this.captures||(this.captures={}),r=a[i]||(a[i]={}),o=r[n]||(r[n]=e.entwine.RuleList()),l=o.addRule(t,i);l.handler=n,this.bind_proxy(t,n,s)}});var t=e.entwine.capture_bindings={},i=function(t){return function(i){var n,s,a,r,o,l,h;for(var c in e.entwine.namespaces)if(n=e.entwine.namespaces[c],s=n.captures,s&&(a=s[t]))for(var c in a)for(var r=a[c],d=n.$([]),u=r.length;u--;){o=r[u],l=o.handler,h=o.selector.selector;var p=n.$(h).not(d);p[l].apply(p,arguments),d=d.add(p)}}},n=function(t,i,n){var s=e.selector(t);return function(e){return s.matches(e.target)?i.apply(this,arguments):void 0}},s=function(e,t,i){return function(e){return e.target===document?t.apply(this,arguments):void 0}},a=function(e,t,i){return function(e){return e.target===window?t.apply(this,arguments):void 0}},r=function(t,i,n){return function(n){var s=this["get"+t]();if("string"==typeof s){var a=a&&s==a.selector?a:e.selector(s);if(a.matches(n.target))return i.apply(this,arguments)}else if(-1!==e.inArray(n.target,s))return i.apply(this,arguments)}};e.entwine.Namespace.addHandler({order:10,bind:function(o,l,h){var c;if(e.isPlainObject(h)&&(c=l.match(/^from\s*(.*)/))){var d,u=c[1];d=u.match(/[^\w]/)?n:"Window"==u||"window"==u?a:"Document"==u||"document"==u?s:r;for(var p in h){var f=h[p];c=p.match(/^on(.*)/);var g=c[1];if(this.bind_capture(o,g,l+"_"+g,d(u,f)),!t[g]){var m=g.replace(/(\s+|$)/g,".entwine$1");t[g]=i(g),e(d==a?window:document).bind(m,t[g])}}return!0}}})}(jQuery),function(e){e.entwine.Namespace.addMethods({bind_condesc:function(t,i,n){for(var s,a=this.store.ctors||(this.store.ctors=e.entwine.RuleList()),r=0;rt;)(i=a[n].cache)&&(f=f.add(i))}},_=a.length;_--;){if(h=a[_],c=h.selector.selector,d=h.onmatch,u=h.onunmatch,l=null,p=!1,s.matchersDirty||i.global)p=!0;else{for(var n in i.attrs){p=!0;break}var y=h.selector.affectedBy(i);if(y.classes.context)p=!0;else for(var n in y.classes.direct){v(_);var b=i.classes[n].not(f);null===l&&(l=h.cache?h.cache.not(g).add(m.filter(c)):e([])),l=l.not(b).add(b.filter(c))}}p?(v(_),l=e(c).not(f)):l||(r=m.length&&m.filter(c),r&&r.length?l=h.cache?h.cache.not(g).add(r):r:(o=g.length&&h.cache&&h.cache.filter(g),o&&o.length&&(l=h.cache.not(o)))),null===l?f&&h.cache&&(f=f.add(h.cache)):(h.cache?(r=l.not(h.cache),o=h.cache.not(l)):(r=l,o=null),(r&&r.length||o&&o.length)&&(o&&o.length&&(m=m.add(o),u&&!h.onunmatchRunning&&(h.onunmatchRunning=!0,a.onunmatchproxy(o,_,u),h.onunmatchRunning=!1)),r&&r.length&&(g=g.add(r),m=m.not(r),d&&!h.onmatchRunning&&(h.onmatchRunning=!0,a.onmatchproxy(r,_,d),h.onmatchRunning=!1))),f&&(f=f.add(l)),h.cache=l)}s.matchersDirty=!1}}})}(jQuery),function(e){e.entwine.Namespace.addMethods({build_addrem_proxy:function(e){var t=this.one(e,"func");return function(){if(0!==this.length){if(this.length){for(var e,i=this.length;i--;)e=t(this[i],arguments);return e}return t(this,arguments)}}},bind_addrem_proxy:function(t,i,n){var s=this.store[i]||(this.store[i]=e.entwine.RuleList()),a=s.addRule(t,i);a.func=n,this.injectee.hasOwnProperty(i)||(this.injectee[i]=this.build_addrem_proxy(i),this.injectee[i].isentwinemethod=!0)}}),e.entwine.Namespace.addHandler({order:30,bind:function(t,i,n){return!e.isFunction(n)||"onadd"!=i&&"onremove"!=i?void 0:(this.bind_addrem_proxy(t,i,n),!0)}}),e(document).bind("EntwineElementsAdded",function(t){for(var i in e.entwine.namespaces){var n=e.entwine.namespaces[i];n.injectee.onadd&&n.injectee.onadd.call(t.targets)}}),e(document).bind("EntwineElementsRemoved",function(t){for(var i in e.entwine.namespaces){var n=e.entwine.namespaces[i];n.injectee.onremove&&n.injectee.onremove.call(t.targets)}})}(jQuery),function(e){var t="__entwine!",i=function(e,i,n){return e.data(t+i+"!"+n)},n=function(e,i,n,s){return e.data(t+i+"!"+n,s)},s=function(e,i){var n={},s=jQuery.data(e[0]),a=t+i+"!",r=a.length,o=jQuery.cache[s];for(var l in o)l.substr(0,r)==a&&(n[l.substr(r)]=o[l]);return n},a=function(e,t,i){for(var s in i)n(t,s,i[s])},r=function(e,t,r){switch(r.length){case 0:return s(e,t);case 1:return"string"==typeof r[0]?i(e,t,r[0]):a(e,t,r[0]);default:return n(e,t,r[0],r[1])}};e.extend(e.fn,{entwineData:function(){return r(this,"__base",arguments)}}),e.entwine.Namespace.addHandler({order:60,bind:function(t,i,n){i.charAt(0)!=i.charAt(0).toUpperCase()&&e.entwine.warn("Entwine property "+i+" does not start with a capital letter",e.entwine.WARN_LEVEL_BESTPRACTISE);var s="get"+i,a="set"+i;this.bind_proxy(t,s,function(){var e=this.entwineData(i);return void 0===e?n:e}),this.bind_proxy(t,a,function(e){return this.entwineData(i,e)});var r=this.injectee[s],o=this.injectee[a];return this.bind_proxy(t,i,function(e){return(1==arguments.length?o:r).call(this,e)}),!0},namespaceMethodOverrides:function(e){return{entwineData:function(){return r(this,e.name,arguments)}}}})}(jQuery),function(e){e.concrete=e.entwine,e.fn.concrete=e.fn.entwine,e.fn.concreteData=e.fn.entwineData,e.entwine.Namespace.addHandler({order:100,bind:function(e,t,i){return!1},namespaceMethodOverrides:function(e){return e.$.concrete=e.$.entwine,e.injectee.concrete=e.injectee.entwine,e.injectee.concreteData=e.injectee.entwineData,{}}})}(jQuery)},{}],21:[function(e,t,i){!function(e){function t(t){var i=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(this).ajaxSubmit(i))}function i(t){var i=t.target,n=e(i);if(!n.is(":submit,input:image")){var s=n.closest(":submit");if(0==s.length)return;i=s[0]}var a=this;if(a.clk=i,"image"==i.type)if(void 0!=t.offsetX)a.clk_x=t.offsetX,a.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var r=n.offset();a.clk_x=t.pageX-r.left,a.clk_y=t.pageY-r.top}else a.clk_x=t.pageX-i.offsetLeft,a.clk_y=t.pageY-i.offsetTop;setTimeout(function(){a.clk=a.clk_x=a.clk_y=null},100)}function n(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}e.fn.ajaxSubmit=function(t){function i(i){for(var n=new FormData,s=0;s').attr("value",d.extraData[c]).appendTo(x)[0]);d.iframeTarget||(f.appendTo("body"),g.attachEvent?g.attachEvent("onload",o):g.addEventListener("load",o,!1)),setTimeout(t,15),x.submit()}finally{x.setAttribute("action",r),i?x.setAttribute("target",i):l.removeAttr("target"),e(h).remove()}}function o(t){if(!m.aborted&&!I){try{D=s(g)}catch(i){n("cannot access response document: ",i),t=j}if(t===k&&m)return void m.abort("timeout");if(t==j&&m)return void m.abort("server abort");if(D&&D.location.href!=d.iframeSrc||y){g.detachEvent?g.detachEvent("onload",o):g.removeEventListener("load",o,!1);var a,r="success";try{if(y)throw"timeout";var l="xml"==d.dataType||D.XMLDocument||e.isXMLDoc(D);if(n("isXml="+l),!l&&window.opera&&(null==D.body||""==D.body.innerHTML)&&--A)return n("requeing onLoad callback, DOM not available"),void setTimeout(o,250);var h=D.body?D.body:D.documentElement;m.responseText=h?h.innerHTML:null,m.responseXML=D.XMLDocument?D.XMLDocument:D,l&&(d.dataType="xml"),m.getResponseHeader=function(e){var t={"content-type":d.dataType};return t[e]},h&&(m.status=Number(h.getAttribute("status"))||m.status,m.statusText=h.getAttribute("statusText")||m.statusText);var c=(d.dataType||"").toLowerCase(),p=/(json|script|text)/.test(c);if(p||d.textarea){var v=D.getElementsByTagName("textarea")[0];if(v)m.responseText=v.value,m.status=Number(v.getAttribute("status"))||m.status,m.statusText=v.getAttribute("statusText")||m.statusText;else if(p){var _=D.getElementsByTagName("pre")[0],x=D.getElementsByTagName("body")[0];_?m.responseText=_.textContent?_.textContent:_.innerText:x&&(m.responseText=x.textContent?x.textContent:x.innerText)}}else"xml"!=c||m.responseXML||null==m.responseText||(m.responseXML=E(m.responseText));try{S=M(m,c,d)}catch(t){r="parsererror",m.error=a=t||r}}catch(t){n("error caught: ",t),r="error",m.error=a=t||r}m.aborted&&(n("upload aborted"),r=null),m.status&&(r=m.status>=200&&m.status<300||304===m.status?"success":"error"),"success"===r?(d.success&&d.success.call(d.context,S,"success",m),u&&e.event.trigger("ajaxSuccess",[m,d])):r&&(void 0==a&&(a=m.statusText),d.error&&d.error.call(d.context,m,r,a),u&&e.event.trigger("ajaxError",[m,d,a])),u&&e.event.trigger("ajaxComplete",[m,d]),u&&!--e.active&&e.event.trigger("ajaxStop"),d.complete&&d.complete.call(d.context,m,r),I=!0,d.timeout&&clearTimeout(b),setTimeout(function(){d.iframeTarget||f.remove(),m.responseXML=null},100)}}}var h,c,d,u,p,f,g,m,v,_,y,b,x=l[0],w=!!e.fn.prop;if(i)if(w)for(c=0;c'),f.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=f[0],m={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var i="timeout"===t?"timeout":"aborted";n("aborting upload... "+i),this.aborted=1,f.attr("src",d.iframeSrc),m.error=i,d.error&&d.error.call(d.context,m,i,t),u&&e.event.trigger("ajaxError",[m,d,i]),d.complete&&d.complete.call(d.context,m,i)}},u=d.global,u&&!e.active++&&e.event.trigger("ajaxStart"),u&&e.event.trigger("ajaxSend",[m,d]),d.beforeSend&&d.beforeSend.call(d.context,m,d)===!1)return void(d.global&&e.active--);if(!m.aborted){v=x.clk,v&&(_=v.name,_&&!v.disabled&&(d.extraData=d.extraData||{},d.extraData[_]=v.value,"image"==v.type&&(d.extraData[_+".x"]=x.clk_x,d.extraData[_+".y"]=x.clk_y)));var k=1,j=2,C=e("meta[name=csrf-token]").attr("content"),T=e("meta[name=csrf-param]").attr("content");T&&C&&(d.extraData=d.extraData||{},d.extraData[T]=C),d.forceSync?r():setTimeout(r,10);var S,D,I,A=50,E=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},N=e.parseJSON||function(e){return window.eval("("+e+")")},M=function(t,i,n){var s=t.getResponseHeader("content-type")||"",a="xml"===i||!i&&s.indexOf("xml")>=0,r=a?t.responseXML:t.responseText;return a&&"parsererror"===r.documentElement.nodeName&&e.error&&e.error("parsererror"),n&&n.dataFilter&&(r=n.dataFilter(r,i)),"string"==typeof r&&("json"===i||!i&&s.indexOf("json")>=0?r=N(r):("script"===i||!i&&s.indexOf("javascript")>=0)&&e.globalEval(r)),r}}}if(!this.length)return n("ajaxSubmit: skipping submit process - no element selected"),this;var a,r,o,l=this;"function"==typeof t&&(t={success:t}),a=this.attr("method"),r=this.attr("action"),o="string"==typeof r?e.trim(r):"",o=o||window.location.href||"",o&&(o=(o.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:o,success:e.ajaxSettings.success,type:a||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var h={};if(this.trigger("form-pre-serialize",[this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var c=t.traditional;void 0===c&&(c=e.ajaxSettings.traditional);var d,u=this.formToArray(t.semantic);if(t.data&&(t.extraData=t.data,d=e.param(t.data,c)),t.beforeSubmit&&t.beforeSubmit(u,this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[u,this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var p=e.param(u,c);d&&(p=p?p+"&"+d:d),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+p,t.data=null):t.data=p;var f=[];if(t.resetForm&&f.push(function(){l.resetForm()}),t.clearForm&&f.push(function(){l.clearForm(t.includeHidden)}),!t.dataType&&t.target){var g=t.success||function(){};f.push(function(i){var n=t.replaceTarget?"replaceWith":"html";e(t.target)[n](i).each(g,arguments)})}else t.success&&f.push(t.success);t.success=function(e,i,n){for(var s=t.context||t,a=0,r=f.length;r>a;a++)f[a].apply(s,[e,i,n||l,l])};var m=e("input:file:enabled[value]",this),v=m.length>0,_="multipart/form-data",y=l.attr("enctype")==_||l.attr("encoding")==_,b=!!(v&&m.get(0).files&&window.FormData);n("fileAPI :"+b);var x=(v||y)&&!b;return t.iframe!==!1&&(t.iframe||x)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){s(u)}):s(u):(v||y)&&b?(t.progress=t.progress||e.noop,i(u)):e.ajax(t),this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(s){if(s=s||{},s.delegation=s.delegation&&e.isFunction(e.fn.on),!s.delegation&&0===this.length){var a={s:this.selector,c:this.context};return!e.isReady&&a.s?(n("DOM not ready, queuing ajaxForm"),e(function(){e(a.s,a.c).ajaxForm(s)}),this):(n("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return s.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,s,t).on("click.form-plugin",this.selector,s,i),this):this.ajaxFormUnbind().bind("submit.form-plugin",s,t).bind("click.form-plugin",s,i)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t){var i=[];if(0===this.length)return i;var n=this[0],s=t?n.getElementsByTagName("*"):n.elements;if(!s)return i;var a,r,o,l,h,c,d;for(a=0,c=s.length;c>a;a++)if(h=s[a],o=h.name)if(t&&n.clk&&"image"==h.type)h.disabled||n.clk!=h||(i.push({name:o,value:e(h).val(),type:h.type}),i.push({name:o+".x",value:n.clk_x},{name:o+".y",value:n.clk_y}));else if(l=e.fieldValue(h,!0),l&&l.constructor==Array)for(r=0,d=l.length;d>r;r++)i.push({name:o,value:l[r]});else null!==l&&"undefined"!=typeof l&&i.push({name:o,value:l,type:h.type});if(!t&&n.clk){var u=e(n.clk),p=u[0];o=p.name,o&&!p.disabled&&"image"==p.type&&(i.push({name:o,value:u.val()}),i.push({name:o+".x",value:n.clk_x},{name:o+".y",value:n.clk_y}))}return i},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var i=[];return this.each(function(){var n=this.name;if(n){var s=e.fieldValue(this,t);if(s&&s.constructor==Array)for(var a=0,r=s.length;r>a;a++)i.push({name:n,value:s[a]});else null!==s&&"undefined"!=typeof s&&i.push({name:this.name,value:s})}}),e.param(i)},e.fn.fieldValue=function(t){for(var i=[],n=0,s=this.length;s>n;n++){var a=this[n],r=e.fieldValue(a,t);null===r||"undefined"==typeof r||r.constructor==Array&&!r.length||(r.constructor==Array?e.merge(i,r):i.push(r))}return i},e.fieldValue=function(t,i){var n=t.name,s=t.type,a=t.tagName.toLowerCase();if(void 0===i&&(i=!0),i&&(!n||t.disabled||"reset"==s||"button"==s||("checkbox"==s||"radio"==s)&&!t.checked||("submit"==s||"image"==s)&&t.form&&t.form.clk!=t||"select"==a&&-1==t.selectedIndex))return null;if("select"==a){var r=t.selectedIndex;if(0>r)return null;for(var o=[],l=t.options,h="select-one"==s,c=h?r+1:l.length,d=h?r:0;c>d;d++){var u=l[d];if(u.selected){var p=u.value;if(p||(p=u.attributes&&u.attributes.value&&!u.attributes.value.specified?u.text:u.value),h)return p;o.push(p)}}return o}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(e){var t=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var i=this.type,n=this.tagName.toLowerCase();t.test(i)||"textarea"==n||e&&/hidden/.test(i)?this.value="":"checkbox"==i||"radio"==i?this.checked=!1:"select"==n&&(this.selectedIndex=-1)})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var i=this.type;if("checkbox"==i||"radio"==i)this.checked=t;else if("option"==this.tagName.toLowerCase()){var n=e(this).parent("select");t&&n[0]&&"select-one"==n[0].type&&n.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}(jQuery)},{}],22:[function(e,t,i){!function(e){var t=function(e){return e.replace(/%2C/g,",").replace(/\&/g,"&").replace(/^\s+|\s+$/g,"")};e.extend({_ondemand_loaded_list:null,isItemLoaded:function(i){var n,s=this;return null===this._ondemand_loaded_list&&(this._ondemand_loaded_list={},e("script").each(function(){n=e(this).attr("src"),n&&(s._ondemand_loaded_list[n]=1)}),e('link[rel="stylesheet"]').each(function(){n=e(this).attr("href"),n&&(s._ondemand_loaded_list[n]=1)})),void 0!==this._ondemand_loaded_list[t(i)]},requireCss:function(t,i){if(i||(i="all"),!e.isItemLoaded(t)){if(document.createStyleSheet){var n=document.createStyleSheet(t);n.media=i}else{var s=document.createElement("link");e(s).attr({href:t,type:"text/css",media:i,rel:"stylesheet"}).appendTo(e("head").get(0))}this._ondemand_loaded_list[t]=1}},processOnDemandHeaders:function(i,n,s){var a=this,r=new e.Deferred;if(s.getResponseHeader&&s.getResponseHeader("X-Include-CSS"))for(var o=s.getResponseHeader("X-Include-CSS").split(","),l=0;l0&&n.push(s),n.push(a.join(t)),n.join("")}},new o(location.search,location.hash)}}(jQuery.query||{})},{}],24:[function(require,module,exports){!function(e,t){function i(t,i){var s,a,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+a+"]")[0],!!r&&n(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.ui.version||(e.extend(e.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}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,i){return"number"==typeof t?this.each(function(){var n=this;setTimeout(function(){e(n).focus(),i&&i.call(n)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e(function(){var t=document.body,i=t.appendChild(i=document.createElement("div"));i.offsetHeight,e.extend(i.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=100===i.offsetHeight,e.support.selectstart="onselectstart"in i,t.removeChild(i).style.display="none"}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?o["inner"+n].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?o["outer"+n].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=!!t.length,e.ui.ie6=6===parseFloat(t[1],10)}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;n0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)},isOverAxis:function(e,t,i){return e>t&&t+i>e},isOver:function(t,i,n,s,a,r){return e.ui.isOverAxis(t,n,a)&&e.ui.isOverAxis(i,s,r)}}))}(jQuery),function(e,t){var i=0,n=Array.prototype.slice,s=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(a){}s(t)},e.widget=function(t,i,n){var s,a,r,o,l=t.split(".")[0];t=t.split(".")[1],s=l+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][s.toLowerCase()]=function(t){return!!e.data(t,s)},e[l]=e[l]||{},a=e[l][t],r=e[l][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new r(e,t)},e.extend(r,a,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),o=new i,o.options=e.widget.extend({},o.options),e.each(n,function(t,s){e.isFunction(s)&&(n[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}())}),r.prototype=e.widget.extend(o,{widgetEventPrefix:a?o.widgetEventPrefix:t},n,{constructor:r,namespace:l,widgetName:t,widgetBaseClass:s,widgetFullName:s}),a?(e.each(a._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,r,i._proto)}),delete a._childConstructors):i._childConstructors.push(r),e.widget.bridge(t,r)},e.widget.extend=function(i){for(var s,a,r=n.call(arguments,1),o=0,l=r.length;l>o;o++)for(s in r[o])a=r[o][s],r[o].hasOwnProperty(s)&&a!==t&&(e.isPlainObject(a)?i[s]=e.isPlainObject(i[s])?e.widget.extend({},i[s],a):e.widget.extend({},a):i[s]=a);return i},e.widget.bridge=function(i,s){var a=s.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,l=n.call(arguments,1),h=this;return r=!o&&l.length?e.widget.extend.apply(null,[r].concat(l)):r,o?this.each(function(){var n,s=e.data(this,a);return s?e.isFunction(s[r])&&"_"!==r.charAt(0)?(n=s[r].apply(s,l),n!==s&&n!==t?(h=n&&n.jquery?h.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new s(r,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
        ",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid, this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetName,this),e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.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:e.noop,widget:function(){return this.element},option:function(i,n){var s,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},s=i.split("."),i=s.shift(),s.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;r=9||t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){function i(e,t,i){return[parseInt(e[0],10)*(u.test(e[0])?t/100:1),parseInt(e[1],10)*(u.test(e[1])?i/100:1)]}function n(t,i){return parseInt(e.css(t,i),10)||0}e.ui=e.ui||{};var s,a=Math.max,r=Math.abs,o=Math.round,l=/left|center|right/,h=/top|center|bottom/,c=/[\+\-]\d+%?/,d=/^\w+/,u=/%$/,p=e.fn.position;e.position={scrollbarWidth:function(){if(s!==t)return s;var i,n,a=e("
        "),r=a.children()[0];return e("body").append(a),i=r.offsetWidth,a.css("overflow","scroll"),n=r.offsetWidth,i===n&&(n=a[0].clientWidth),a.remove(),s=i-n},getScrollInfo:function(t){var i=t.isWindow?"":t.element.css("overflow-x"),n=t.isWindow?"":t.element.css("overflow-y"),s="scroll"===i||"auto"===i&&t.widthn?"left":i>0?"right":"center",vertical:0>o?"top":s>0?"bottom":"middle"};d>u&&r(i+n)f&&r(s+o)a(r(s),r(o))?l.important="horizontal":l.important="vertical",t.using.call(this,e,l)}),c.offset(e.extend(T,{using:h}))})},e.ui.position={fit:{left:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,o=e.left-t.collisionPosition.marginLeft,l=s-o,h=o+t.collisionWidth-r-s;t.collisionWidth>r?l>0&&0>=h?(i=e.left+l+t.collisionWidth-r-s,e.left+=l-i):h>0&&0>=l?e.left=s:l>h?e.left=s+r-t.collisionWidth:e.left=s:l>0?e.left+=l:h>0?e.left-=h:e.left=a(e.left-o,e.left)},top:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollTop:n.offset.top,r=t.within.height,o=e.top-t.collisionPosition.marginTop,l=s-o,h=o+t.collisionHeight-r-s;t.collisionHeight>r?l>0&&0>=h?(i=e.top+l+t.collisionHeight-r-s,e.top+=l-i):h>0&&0>=l?e.top=s:l>h?e.top=s+r-t.collisionHeight:e.top=s:l>0?e.top+=l:h>0?e.top-=h:e.top=a(e.top-o,e.top)}},flip:{left:function(e,t){var i,n,s=t.within,a=s.offset.left+s.scrollLeft,o=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,h=e.left-t.collisionPosition.marginLeft,c=h-l,d=h+t.collisionWidth-o-l,u="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>c?(i=e.left+u+p+f+t.collisionWidth-o-a,(0>i||i0&&(n=e.left-t.collisionPosition.marginLeft+u+p+f-l,(n>0||r(n)c?(n=e.top+p+f+g+t.collisionHeight-o-a,e.top+p+f+g>c&&(0>n||n0&&(i=e.top-t.collisionPosition.marginTop+p+f+g-l,e.top+p+f+g>d&&(i>0||r(i)10&&11>s,t.innerHTML="",i.removeChild(t)}(),e.uiBackCompat!==!1&&!function(e){var i=e.fn.position;e.fn.position=function(n){if(!n||!n.offset)return i.call(this,n);var s=n.offset.split(" "),a=n.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===a.length&&(/left|center|right/.test(a[0])?a[1]="center":(a[1]=a[0],a[0]="center")),i.call(this,e.extend(n,{at:a[0]+s[0]+" "+a[1]+s[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){var i=0,n={},s={};n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",e.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 t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++i),n=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(n.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(),n.collapsible||n.active!==!1&&null!=n.active||(n.active=0),n.active<0&&(n.active+=this.headers.length),this.active=this._findActive(n.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 n=e(this),s=n.attr("id"),a=n.next(),r=a.attr("id");s||(s=t+"-header-"+i,n.attr("id",s)),r||(r=t+"-panel-"+i,a.attr("id",r)),n.attr("aria-controls",r),a.attr("aria-labelledby",s)}).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(n.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;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(),e=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&&e.css("height","")},_setOption:function(e,t){return"active"===e?void this._activate(t):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),void("disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)))},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,s=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(s+1)%n];break;case i.LEFT:case i.UP:a=this.headers[(s-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[n-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,i,n=this.options.heightStyle,s=this.element.parent();"fill"===n?(e.support.minHeight||(i=s.css("overflow"),s.css("overflow","hidden")),t=s.height(),this.element.siblings(":visible").each(function(){var i=e(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(t-=i.outerHeight(!0))}),i&&s.css("overflow",i),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===n&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={};t&&(e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._on(this.headers,i))},_eventHandler:function(t){var i=this.options,n=this.active,s=e(t.currentTarget),a=s[0]===n[0],r=a&&i.collapsible,o=r?e():s.next(),l=n.next(),h={oldHeader:n,oldPanel:l,newHeader:r?e():s,newPanel:o};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,h)===!1||(i.active=r?!1:this.headers.index(s),this.active=a?e():s,this._toggle(h),n.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-expanded":"false","aria-hidden":"true"}),n.prev().attr("aria-selected","false"),i.length&&n.length?n.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,i){var a,r,o,l=this,h=0,c=e.length&&(!t.length||e.index()",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 t,i,n;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(s){if(this.element.prop("readOnly"))return t=!0,n=!0,void(i=!0);t=!1,n=!1,i=!1;var a=e.ui.keyCode;switch(s.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",s);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",s);break;case a.UP:t=!0,this._keyEvent("previous",s);break;case a.DOWN:t=!0,this._keyEvent("next",s);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,s.preventDefault(),this.menu.select(s));break;case a.TAB:this.menu.active&&this.menu.select(s);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(n){if(t)return t=!1,void n.preventDefault();if(!i){var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:this._move("previousPage",n);break;case s.PAGE_DOWN:this._move("nextPage",n);break;case s.UP:this._keyEvent("previous",n);break;case s.DOWN:this._keyEvent("next",n)}}},input:function(e){return n?(n=!1,void e.preventDefault()):void this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(e),void this._change(e))}}),this._initSource(),this.menu=e("