var FILE_TYPE_TO_ICON_NAME={"image/gif":"rmzfa-file-image","image/jpeg":"rmzfa-file-image","image/png":"rmzfa-file-image","application/pdf":"rmzfa-file-pdf","application/msword":"rmzfa-file-word","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"rmzfa-file-word","application/mspowerpoint":"rmzfa-file-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation":"rmzfa-file-powerpoint","application/msexcel":"rmzfa-file-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"rmzfa-file-excel","text/csv":"rmzfa-file-excel","audio/aac":"rmzfa-file-audio","audio/wav":"rmzfa-file-audio","audio/mpeg":"rmzfa-file-audio","audio/mp4":"rmzfa-file-audio","audio/ogg":"rmzfa-file-audio","video/x-msvideo":"rmzfa-file-video","video/mpeg":"rmzfa-file-video","video/mp4":"rmzfa-file-video","video/ogg":"rmzfa-file-video","video/quicktime":"rmzfa-file-video","video/webm":"rmzfa-file-video","application/gzip":"rmzfa-file-archive","application/zip":"rmzfa-file-archive","text/css":"rmzfa-file-code","text/html":"rmzfa-file-code","text/javascript":"rmzfa-file-code","application/javascript":"rmzfa-file-code","text/plain":"rmzfa-file-text","text/richtext":"rmzfa-file-text","text/rtf":"rmzfa-file-text"},AttachmentUtilities={fileTypeToIcon:function(e){return FILE_TYPE_TO_ICON_NAME[e]||"rmzfa-file"}};!function(e){var t=e;e((function(){e(document).bind("dragover",(function(t){var n=e(t.target).closest(".upload-attachments");if(0!=n.length&&n.data("dzEle")){var a=n.data("dzEle"),o=window.dropZoneTimeout;o?clearTimeout(o):a.addClass("in");var i=!1,r=t.target;do{if(r===a[0]){i=!0;break}r=r.parentNode}while(null!=r);a.toggleClass("hover",i),window.dropZoneTimeout=setTimeout((function(){window.dropZoneTimeout=null,a.removeClass("in hover")}),100)}}));var n=function(e){t(document).find(".upload-attachments .attachment-count").text(e),t(document).find(".upload-attachments .attachment-view").toggle(e>0)};t(document).on("attachments:remove",".upload-attachments",(function(e,t){n(t.num)})),t(document).on("attachments:add",".upload-attachments",(function(e,t){t.$li.find(".delete").prop("tabindex",1),n(t.num)}));var a=function(){t(document).find(".upload-attachments.popup .attachment-box").addClass("in"),e(document.body).addClass("has-attachments-modal"),setTimeout((function(){var e=Math.min(t(document.body).outerHeight()-55,270);t(document).find(".upload-attachments.popup .attachments-list-wrap").css({"max-height":e+"px"}),t(document).find(".upload-attachments.popup #attachments-list").css({"max-height":e-20+"px"}),t(document).find(".upload-attachments.popup .attachment-box").addClass("fade")}),10)},o=function(){t(document).find(".upload-attachments.popup .attachment-box").removeClass("fade"),setTimeout((function(){t(document).find(".upload-attachments.popup .attachment-box").removeClass("in")}),10),t(document).find(".upload-attachments.popup textarea").focus(),e(document.body).removeClass("has-attachments-modal")};t(document).on("click",".upload-attachments.popup .attachment-box, .attachments-list-wrap .close",o),t(document).on("click",".upload-attachments.popup .attachments-list-wrap",(function(e){return!!t(e.target).is("input.fileupload")&&(e.stopPropagation(),!0)})),t(document).on("attachments:remove",".upload-attachments.popup",(function(e,t){0==t.num&&o()})),t(document).on("click",".upload-attachments .attachment-view",(function(){e(this).closest(".popup").length?a():(t(document).find(".upload-attachments .attachment-box").toggle(),t(document.body).trigger("reamaze:manualresize"))}));var i=function(t){var n=function(e,n){var a=t.find("#progress"),o=t.find("#progress .bar");if(n.loaded==n.total)a.css("display","none");else{var i=parseInt(n.loaded/n.total*100,10);a.css("display","block"),o.css("width",i+"%")}},a=function(n){var a=t.closest("form").find(":submit");n?e.each(a,(function(t,n){var a=e(n),o=a.hasClass("disabled")||a.prop("disabled");a.data("isInitiallyDisabled",o)})):a=a.filter((function(t,n){return!e(n).data("isInitiallyDisabled")})),a.prop("disabled",n)},o=function(n,a){var o=e(document.createElement("li")),i=e(document.createElement("div")),r=e(document.createElement("span")),d=t.find("#attachments-list"),l="attachment-wrap";e(document.createElement("button")).addClass("delete btn-link").html("×").appendTo(o),i.addClass("preview-wrap spinner").appendTo(o),e(document.createElement("span")).addClass("rmzfa fas rmzfa-exclamation-circle attachment-error-indicator").appendTo(o),r.addClass("file-name").text("Uploading ...").appendTo(o),d.append(o.addClass(l));var s=d.children().not(".add-attachment").length;t.trigger("attachments:add",{$li:o,num:s}),t.closest("form").addClass("has-attachments"),e(document.body).addClass("has-attachments"),t.find("#fileupload").data("require-attachments")&&(fileupload.required=!1),a.context=o,a.submit()},i=function(n,a){console.log("Error uploading attachments"),console.log(n),console.log(a);var o=a.context,i=(o.find(".preview-wrap"),o.find(".file-name"));o.addClass("error"),t.closest("form").addClass("has-attachment-errors"),e(document.body).addClass("has-attachment-errors"),a.files&&a.files.length>0&&a.files[0]&&i.text(a.files[0].name).attr("title",a.files[0].name),t.trigger("attachments:fail",{$li:o})},r=function(n,a){var o=a.context,i=o.find(".preview-wrap"),r=o.find(".file-name"),d=a.result;Array.isArray(a.result)&&(d=a.result[0]);var l=d.file_file_name;i.removeClass("spinner"),1==d["image?"]?e(document.createElement("img")).attr("src",d.thumb_url).attr("title",l).addClass("preview").appendTo(i):e(document.createElement("i")).attr("title",l).addClass("preview icon rmzfa far "+AttachmentUtilities.fileTypeToIcon(d.file_content_type)).appendTo(i),r.text(l).attr("title",l),e(document.createElement("input")).attr({type:"hidden",name:t.data("attachment-input-name"),value:d.id}).appendTo(o)},d=function(){a(!0),t.trigger("attachments:start")},l=function(){a(!1),t.trigger("attachments:done")};t.on("click",".delete",(function(){var n=e(this),a=n.closest("#attachments-list"),o=n.closest(".has-attachments");n.closest(".attachment-wrap").remove();var i=a.children().not(".add-attachment").length,r=a.children().not(".add-attachment").filter(".error").length;return 0==i&&(e(document.body).removeClass("has-attachments"),o.removeClass("has-attachments"),t.find("#fileupload").data("require-attachments")&&(fileupload.required=!0)),0==r&&(e(document.body).removeClass("has-attachment-errors"),o.removeClass("has-attachment-errors")),t.trigger("attachments:remove",{num:i}),!1}));var s={dataType:"json",progressall:n,add:o,done:r,start:d,fail:i,stop:l,formData:[],dropZone:void 0,pasteZone:void 0,paste:function(e,t){if(e.delegatedEvent&&e.delegatedEvent.originalEvent&&e.delegatedEvent.originalEvent.clipboardData){for(var n=e.delegatedEvent.originalEvent.clipboardData.items,a=!1,o=0;!a&&o0&&(s.dropZone=u,t.data("dzEle",u));var f=t.data("pastezone"),p=e(document).find(f);p.length>0?s.pasteZone=p:s.pasteZone=t,t.find(".fileupload").each((function(t,n){e(n).fileupload(s),e(n).data("require-attachments")&&(n.required=!0),s.dropZone=null,s.pasteZone=null}))},r=function(){e(document).find(".upload-attachments").each((function(t,n){var a=e(n);a.data("skip-fileupload")||(a.data("skip-fileupload",!0),new i(a))}))};e(window).on("app:fileupload",r),e(window).bind("app:reinitjs",r),r()}))}(window.jQuery),function(e,t){function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function a(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return C[e.which]?C[e.which]:k[e.which]?k[e.which]:String.fromCharCode(e.which).toLowerCase()}function o(e,t){return e.sort().join(",")===t.sort().join(",")}function i(e){e=e||{};var t,n=!1;for(t in F)e[t]?n=!0:F[t]=0;n||(A=!1)}function r(e,t,n,a,i,r){var d,l,s=[],c=n.type;if(!L[e])return[];for("keyup"==c&&p(e)&&(t=[e]),d=0;d95&&e<112||C.hasOwnProperty(e)&&(x[C[e]]=e);return x}function v(e,t,n){return n||(n=h()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function g(e,t,n,o){function r(t){return function(){A=t,++F[e],m()}}function d(t){c(n,t,e),"keyup"!==o&&(O=a(t)),setTimeout(i,10)}F[e]=0;for(var l=0;l1?g(e,d,t,n):(i=w(e,n),L[i.key]=L[i.key]||[],r(i.key,i.modifiers,{type:i.action},a,e,o),L[i.key][a?"unshift":"push"]({callback:t,modifiers:i.modifiers,action:i.action,seq:a,level:o,combo:e}))}function z(e,t,n){for(var a=0;a":".","?":"/","|":"\\"},N={option:"alt",command:"meta",return:"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},L={},S={},F={},O=!1,q=!1,A=!1,_=1;_<20;++_)C[111+_]="f"+_;for(_=0;_<=9;++_)C[_+96]=_;n(t,"keypress",f),n(t,"keydown",f),n(t,"keyup",f);var I={bind:function(e,t,n){return z(e=e instanceof Array?e:[e],t,n),this},unbind:function(e,t){return I.bind(e,(function(){}),t)},trigger:function(e,t){return S[e+":"+t]&&S[e+":"+t]({},e),this},reset:function(){return L={},S={},this},stopCallback:function(e,t){return!((" "+t.className+" ").indexOf(" mousetrap ")>-1)&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable)},handleKey:u};e.Mousetrap=I,"function"==typeof define&&define.amd&&define(I)}(window,document),Mousetrap=function(e){var t,n=e,a=n.bind;return n.bind=function(){if("string"==typeof(t=arguments)[0]||t[0]instanceof Array)return a(t[0],t[1],t[2]);for(var e in t[0])t[0].hasOwnProperty(e)&&a(e,t[0][e],t[1])},n}(Mousetrap),function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,(function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),o()}function n(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function a(){if(0!==e.scrollHeight){var t=n(e),a=document.documentElement&&document.documentElement.scrollTop,o=i(e);e.style.height=o+"px",r=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),a&&(document.documentElement.scrollTop=a)}}function o(){a();Math.round(parseFloat(e.style.height));var t=window.getComputedStyle(e,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):e.offsetHeight;if(d!==n){d=n;var o=c("autosize:resized");try{e.dispatchEvent(o)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!s.has(e)){var r=null,d=null,l=function(){e.clientWidth!==r&&o()},u=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",o,!1),e.removeEventListener("keyup",o,!1),e.removeEventListener("autosize:destroy",u,!1),e.removeEventListener("autosize:update",o,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),s.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",u,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",o,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",o,!1),e.addEventListener("autosize:update",o,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",s.set(e,{destroy:u,update:o}),t()}}function a(e){var t=s.get(e);t&&t.destroy()}function o(e){var t=s.get(e);t&&t.update()}function i(e){null===h.parentNode&&document.body.appendChild(h);var t=r(e);if(null===t)return null;var n=t.paddingSize,a=t.borderSize,o=t.boxSizing,i=t.sizingStyle;Object.keys(i).forEach((function(e){h.style[e]=i[e]})),v(h),h.value=e.value||e.placeholder||"x";var d=h.scrollHeight;return"border-box"===o?d+=a:"content-box"===o&&(d-=n),d+2}function r(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=m.reduce((function(e,n){return e[n]=t.getPropertyValue(n),e}),{}),a=n["box-sizing"];return""===a?null:(f&&"border-box"===a&&(n.width=parseFloat(n.width)+parseFloat(t["border-right-width"])+parseFloat(t["border-left-width"])+parseFloat(t["padding-right"])+parseFloat(t["padding-left"])+"px"),{sizingStyle:n,paddingSize:parseFloat(n["padding-bottom"])+parseFloat(n["padding-top"]),borderSize:parseFloat(n["border-bottom-width"])+parseFloat(n["border-top-width"]),boxSizing:a})}var d,l,s="function"==typeof Map?new Map:(d=[],l=[],{has:function(e){return d.indexOf(e)>-1},get:function(e){return l[d.indexOf(e)]},set:function(e,t){-1===d.indexOf(e)&&(d.push(e),l.push(t))},delete:function(e){var t=d.indexOf(e);t>-1&&(d.splice(t,1),l.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var u=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((u=function(e){return e}).destroy=function(e){return e},u.update=function(e){return e}):((u=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return n(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},u.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e}),t.default=u,e.exports=t.default;var f=!!document.documentElement.currentStyle,p={"min-height":"0","max-height":"none",height:"0",visibility:"hidden","overflow-y":"scroll","overflow-x":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},m=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],h=document.createElement("textarea"),v=function(e){Object.keys(p).forEach((function(t){e.style.setProperty(t,p[t],"important")}))};v(h)})),window.frameId&&parent.Reamaze&&parent.Reamaze.Frames.Callbacks&&"function"==typeof parent.Reamaze.Frames.Callbacks[window.frameId]?parent.Reamaze.Frames.Callbacks[window.frameId]():jQuery(document).trigger("frameloaded");var version=1;