!function(){if($){const e=$('meta[name="csrf-token"]').attr("content");$.ajaxSetup({beforeSend:function(t){t.setRequestHeader("X-CSRF-Token",e)},cache:!0}),$.ajaxSettings.xhrFields=$.ajaxSettings.xhrFields||{},$.ajaxSettings.xhrFields.withCredentials=!0}}(),function(e,t){var r;(function(){var t=e._data(document,"events");return t&&t.click&&e.grep(t.click,function(e){return"rails"===e.namespace}).length})()&&e.error("jquery-ujs has already been loaded!"),e.rails=r={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var r=e('meta[name="csrf-token"]').attr("content");r&&t.setRequestHeader("X-CSRF-Token",r)},fire:function(t,r,n){var a=e.Event(r);return t.trigger(a,n),!1!==a.result},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(n){var a,i,o,s,u,c,l,d;if(r.fire(n,"ajax:before")){if(u=(s=n.data("cross-domain"))===t?null:s,c=n.data("with-credentials")||null,l=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,n.is("form")){a=n.attr("method"),i=n.attr("action"),o=n.serializeArray();var p=n.data("ujs:submit-button");p&&(o.push(p),n.data("ujs:submit-button",null))}else n.is(r.inputChangeSelector)?(a=n.data("method"),i=n.data("url"),o=n.serialize(),n.data("params")&&(o=o+"&"+n.data("params"))):(a=n.data("method"),i=r.href(n),o=n.data("params")||null);d={type:a||"GET",data:o,dataType:l,beforeSend:function(e,a){return a.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+a.accepts.script),r.fire(n,"ajax:beforeSend",[e,a])},success:function(e,t,r){n.trigger("ajax:success",[e,t,r])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,r){n.trigger("ajax:error",[e,t,r])},crossDomain:u},c&&(d.xhrFields={withCredentials:c}),i&&(d.url=i);var f=r.ajax(d);return n.trigger("ajax:send",f),f}return!1},handleMethod:function(n){var a=r.href(n),i=n.data("method"),o=n.attr("target"),s=e("meta[name=csrf-token]").attr("content"),u=e("meta[name=csrf-param]").attr("content"),c=e('
'),l='';u!==t&&s!==t&&(l+=''),o&&c.attr("target",o),c.hide().append(l).appendTo("body"),c.submit()},disableFormElements:function(t){t.find(r.disableSelector).each(function(){var t=e(this),r=t.is("button")?"html":"val";t.data("ujs:enable-with",t[r]()),t[r](t.data("disable-with")),t.prop("disabled",!0)})},enableFormElements:function(t){t.find(r.enableSelector).each(function(){var t=e(this),r=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[r](t.data("ujs:enable-with")),t.prop("disabled",!1)})},allowAction:function(e){var t,n=e.data("confirm"),a=!1;return!n||(r.fire(e,"confirm")&&(a=r.confirm(n),t=r.fire(e,"confirm:complete",[a])),a&&t)},blankInputs:function(t,r,n){var a,i=e(),o=r||"input,textarea",s=t.find(o);return s.each(function(){if(a=e(this),!(a.is("input[type=checkbox],input[type=radio]")?a.is(":checked"):a.val())==!n){if(a.is("input[type=radio]")&&s.filter('input[type=radio]:checked[name="'+a.attr("name")+'"]').length)return!0;i=i.add(a)}}),!!i.length&&i},nonBlankInputs:function(e,t){return r.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},callFormSubmitBindings:function(r,n){var a=r.data("events"),i=!0;return a!==t&&a.submit!==t&&e.each(a.submit,function(e,t){if("function"==typeof t.handler)return i=t.handler(n)}),i},disableElement:function(e){e.data("ujs:enable-with",e.html()),e.html(e.data("disable-with")),e.bind("click.railsDisable",function(e){return r.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.data("ujs:enable-with",!1)),e.unbind("click.railsDisable")}},r.fire(e(document),"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,n){e.crossDomain||r.CSRFProtection(n)}),e(document).delegate(r.linkDisableSelector,"ajax:complete",function(){r.enableElement(e(this))}),e(document).delegate(r.linkClickSelector,"click.rails",function(n){var a=e(this),i=a.data("method"),o=a.data("params");if(!r.allowAction(a))return r.stopEverything(n);if(a.is(r.linkDisableSelector)&&r.disableElement(a),a.data("remote")!==t){if((n.metaKey||n.ctrlKey)&&(!i||"GET"===i)&&!o)return!0;var s=r.handleRemote(a);return!1===s?r.enableElement(a):s.error(function(){r.enableElement(a)}),!1}return a.data("method")?(r.handleMethod(a),!1):void 0}),e(document).delegate(r.inputChangeSelector,"change.rails",function(t){var n=e(this);return r.allowAction(n)?(r.handleRemote(n),!1):r.stopEverything(t)}),e(document).delegate(r.formSubmitSelector,"submit.rails",function(n){var a=e(this),i=a.data("remote")!==t,o=r.blankInputs(a,r.requiredInputSelector),s=r.nonBlankInputs(a,r.fileInputSelector);if(!r.allowAction(a))return r.stopEverything(n);if(o&&a.attr("novalidate")==t&&r.fire(a,"ajax:aborted:required",[o]))return r.stopEverything(n);if(i){if(s){setTimeout(function(){r.disableFormElements(a)},13);var u=r.fire(a,"ajax:aborted:file",[s]);return u||setTimeout(function(){r.enableFormElements(a)},13),u}return!e.support.submitBubbles&&e().jquery<"1.7"&&!1===r.callFormSubmitBindings(a,n)?r.stopEverything(n):(r.handleRemote(a),!1)}setTimeout(function(){r.disableFormElements(a)},13)}),e(document).delegate(r.formInputClickSelector,"click.rails",function(t){var n=e(this);if(!r.allowAction(n))return r.stopEverything(t);var a=n.attr("name"),i=a?{name:a,value:n.val()}:null;n.closest("form").data("ujs:submit-button",i)}),e(document).delegate(r.formSubmitSelector,"ajax:beforeSend.rails",function(t){this==t.target&&r.disableFormElements(e(this))}),e(document).delegate(r.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&r.enableFormElements(e(this))}),e(function(){var t=e("meta[name=csrf-token]").attr("content"),r=e("meta[name=csrf-param]").attr("content");e('form input[name="'+r+'"]').val(t)}))}(jQuery), /*! jQuery Address v${version} | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */ function(e){e.address=function(){var t,r,n=function(t){var r=e.extend(e.Event(t),function(){for(var t={},r=e.address.parameterNames(),n=0,a=r.length;n