1/*! jQuery UI - v1.13.3 - 2026-05-07 2* https://jqueryui.com 3* Includes: widget.js 4* Copyright OpenJS Foundation and other contributors; Licensed MIT */ 5function mountFileUploader(e){var t=$(e);t.find("input[type=file]").length>0&&!0!==t.data("file-uploader-mounted")&&(t.find("input[type=file]").each(initFileUpload),t.off("click.fileUploader",".remove-file").on("click.fileUploader",".remove-file",removeFile),t.off("click.fileUploader",".rename-custom-file").on("click.fileUploader",".rename-custom-file",renameCustomFile),t.off("click.fileUploader",".remove-custom-file").on("click.fileUploader",".remove-custom-file",removeCustomFile),t.off("click.fileUploader",".replace-custom-file").on("click.fileUploader",".replace-custom-file",replaceCustomFile),t.off("click.fileUploader",".select-from-files").on("click.fileUploader",".select-from-files",selectFile),t.off("click.fileUploader",".edit-crop").on("click.fileUploader",".edit-crop",editCrop),t.off("click.fileUploader",".save-crop").on("click.fileUploader",".save-crop",saveCrop),handleCensusSubmitBtn(e),t.find("input[type=file]").each(disableFileInputs),t.data("file-uploader-mounted",!0))}function resetFileUploader(e,t){e.find(".file-uploader-img").attr("src")!=baseFileUrl+t&&(FileAdded(t,e,t),e.find('[name$="_Original"]').val(t))}function initFileUpload(e,t){$(this).fileupload({url:uploadFileUrl,dataType:"json",maxFileSize:2e7,formData:{__RequestVerificationToken:$("[name='__RequestVerificationToken']").val()},dropZone:$(this).parents(".file-uploader"),processalways:function(e,t){var i=t.index,n=t.files[i];n.error&&ShowErrorMessage($(this),n.error)},submit:function(e,i){i.formData||(i.formData={}),i.formData.TargetFolder=$(this).parents(".file-uploader").data("target-folder"),i.formData.__RequestVerificationToken=$("[name='__RequestVerificationToken']").val(),i.formData.ReturnBase64=$(t).data("return-base64"),i.formData.ContainerType=$(t).data("container-type")},send:function(e,t){var i=$(this).parents(".file-uploader");i.find(".progress-bar").css("width",0),i.find(".progress").show(),i.find(".error-message").remove(),$("[type='submit']").prop("disabled",!0),$(".save-and-continue-button").prop("disabled",!0)},done:function(e,i){if(i.result.error)ShowErrorMessage($(this),i.result.error);else{var n=i.result,o=$(this).parents(".file-uploader"),r=$(t).data("custom-field-id"),a="True"==$(t).data("is-parent-customer")||1==$(t).data("is-parent-customer"),s="True"==$(t).data("is-customer-image"),l=$(t).data("field-prefix"),p=$(t).data("name-prefix"),u=$(t).data("file-limit");FileAdded(n.name,o,n.fullPath,n.type,n.size,r,a,s,u,l,p),$(this).trigger("file-upload-done",[n]),$("[type='submit']").prop("disabled",!1),$(".save-and-continue-button").prop("disabled",!1)}},progressall:function(e,t){var i=parseInt(t.loaded/t.total*100,10);$(this).parents(".file-uploader").find(".progress-bar").css("width",i+"%")}})}function removeFile(e){var t=$(e.target).parents(".file-uploader");updateFileName(t.find("[type=hidden]:first"),"");var i=t.find(".file-uploader-img-container"),n=t.find("img"),o=t.find(".file-uploader-croppie"),r=t.find(".edit-crop"),a=t.find(".save-crop");i.addClass("hidden"),a.addClass("hidden"),r.addClass("hidden"),n.addClass("hidden"),o.croppie("destroy"),t.find(".file-link").remove(),$(e.target).addClass("hidden");var s=$(e.target).parent().find("a.fileinput-button");return s.length>0&&s.find("span").html(s.find("span").html().replace("Replace","Upload")),!1}function deleteFile(e){var t=$(e).parents(".file-list"),i=t.parents(".file-uploader").find("input[type='file']"),n=i.data("custom-field-id"),o=i.data("field-prefix"),r=i.data("name-prefix"),a="True"==i.data("is-parent-customer");$(e).parent().remove();var s=t.find(".custom-field-file"),l=t.parents(".file-uploader").find("[type=hidden]:first"),p=e.getAttribute("data-file-name"),u=JSON.parse(l.attr("value"));if(u=u.filter((e=>e.FileName!=p)),updateFileName(l,JSON.stringify(u)),0==s.length){let e="";o&&(o.includes("Order")||o.includes("Cart"))?(e=`${o}CustomField_${n}`,customFieldInput=t.parents(".file-uploader").siblings(`input[name="${e}"]`),customFieldInput.attr("value","")):e=`${r||""}${a?"Parent":""}CustomFieldFile_${n}`,t.append(`<input id="empty-custom-field-file" name="${e}" class="hidden" type="text" value=""/>`);var d=t.parents(".file-uploader").find("span.file-input-label-single");d.html("Upload File"),(d=t.parents(".file-uploader").find("span.file-input-label-multiple")).html("Upload File(s)")}(s=t.find(".custom-field-file")).length<t.parents(".file-uploader").find("input[type='file']").data("file-limit")&&(t.parents(".file-uploader").find(".fileinput-button").removeClass("disabled"),t.parents(".file-uploader").find(".fileinput-button input[type='file']").prop("disabled",!1))}function renameCustomFile(e){var t=$(e.target).data("file-name"),i=$(e.target).data("full-path"),n=t.split(".").pop();ShowRenameModal(t,(function(o){$.ajax({url:renameFileUrl,type:"POST",data:{fullPath:i,newName:o},success:function(r){if(r&&"OK"==r.status){o=`${o}.${n}`,ShowSavedPopup(`${t} renamed to ${o}`,"");var a=`${customFieldFileBaseUrl}/${i.split("/").pop()}?fileName=${o}`,s=$(e.target).first();s.siblings(".file-name").text(o),s.attr("data-file-name",o),s.siblings("a").attr("href",a),s.siblings(".remove-custom-file").attr("data-file-name",o),s.siblings(".replace-custom-file").attr("data-file-name",o).attr("href",a);var l=s.siblings("input"),p=JSON.parse(decodeURIComponent(l.val()));p.fileName=o,l.attr("value",encodeURIComponent(JSON.stringify(p))),filesViewModel&&filesViewModel.TriggerReload(new Date)}}})}))}function removeCustomFile(e){var t=$(e.target).data("file-name");ShowConfirmationModal(`Are you sure you want to delete ${t}?`,(function(){deleteFile(e.target)}))}function replaceCustomFile(e){var t=$(e.target).data("file-name");ShowConfirmationModal(`Are you sure you want to replace ${t}?`,(function(){deleteFile(e.target)}),null,null,null,null,null,(function(){const t=e.target.parentElement.nextElementSibling;if(t){deleteFile(t.querySelector(".remove-custom-file"))}}))}function selectFile(e){var t=$(e.target).parents(".file-uploader").find("input[type=file]"),i={title:"Novi Files",multiple:!1,extensions:$(e.target).data("extensions"),oninsert:function(e){srcToFile(e.focusedFile.url,e.focusedFile.name).then((function(e){t.fileupload("add",{files:[e]})}))}};if("undefined"==typeof moxman){$("<script>").attr("type","text/javascript").attr("src",moxieManagerScriptUrl).appendTo("body");var n=setInterval((function(){"undefined"!=typeof moxman&&(moxman.browse(i),clearInterval(n))}),100)}else moxman.browse(i);return!1}function editCrop(e){initCroppie($(e.target))}function saveCrop(e){var t=$(e.target).parents(".file-uploader"),i=t.find("input[type=file]"),n=(t.find(".file-uploader-img-container"),t.find(".file-uploader-croppie"));t.find("img");t.data("saving-crop",!0);var o=n.data("file-name"),r=o.endsWith(".jpg")||o.endsWith(".jpeg")?"jpeg":"png";o.endsWith(".png")||"png"!=r||(o=o.replace(/\.[^/.]+$/,"")+".png");var a={type:"blob",circle:!1,size:"original",format:r};"jpeg"==r&&(a.backgroundColor="#FFFFFF"),n.croppie("result",a).then((function(e){i.fileupload("add",{files:[new File([e],o,{type:e.type})]})}))}function initCroppie(e){var t=$(e).parents(".file-uploader"),i=t.find(".file-uploader-img-container"),n=t.find(".file-uploader-croppie"),o=t.find("img"),r=t.find(".edit-crop"),a=t.find(".save-crop"),s=$(t).data("width"),l=$(t).data("height")/s,p=Math.ceil(Math.min(t.width(),s)),u=Math.ceil(p*l);r.addClass("hidden"),o.addClass("hidden"),i.removeClass("hidden"),a.removeClass("hidden");var d=$(t).data("crop-type").toLowerCase();$(n).croppie({viewport:{width:p-2,height:u-2,type:d},mouseWheelZoom:!1,boundary:{width:p,height:u},enforceBoundary:!1});$(t).find(".cr-slider").addClass("ignore"),n.data("file-name",o.attr("alt")),n.croppie("bind",{url:o.attr("src")})}function FileAdded(e,t,i,n,o,r=0,a=!1,s=!1,l=1,p="",u=""){$("[type='submit']").prop("disabled",!0);var d=e.toLowerCase(),c=d.indexOf(".jpg")>0||d.indexOf(".jpeg")>0||d.indexOf(".gif")>0||d.indexOf(".png")>0||d.indexOf(".bmp")>0||d.indexOf(".ico")>0||d.indexOf(".svg")>0;let f=!0;if(t.data("hide-link")&&(f=!1),c){var h=baseFileUrl+i,m=t.find(".file-uploader-croppie");if(1==m.is(":visible")&&1!=t.data("saving-crop"))m.data("file-name",e),m.croppie("bind",{url:h});else{var g=t.find(".file-uploader-img-container"),v=t.find("img"),y=t.find(".edit-crop"),b=t.find(".save-crop");t.find("img"),t.data("width"),t.data("height");v.attr("alt",e).attr("src",h+"?t="+Math.floor(new Date/1e3)),1==t.data("saving-crop")?(g.addClass("hidden"),b.addClass("hidden"),y.removeClass("hidden"),v.removeClass("hidden"),t.data("saving-crop",!1),m.croppie("destroy")):t.data("crop-type")?initCroppie(y):v.removeClass("hidden"),(g.length>0||v.length>0)&&(f=!1)}}if(f)if(r>0){t.find("#empty-custom-field-file").remove();var _=t.find(".custom-field-file"),w=t.find(".file-list"),x=_.length+1;t.find("input[type=file]").attr("multiple")||t.find(".replace-custom-file").click();var C=t.find("span.file-input-label-multiple");if(l>1&&x>l)t.find(".fileinput-button").addClass("disabled"),t.find(".fileinput-button input[type='file']").prop("disabled",!0);else{C.html("Upload Additional File(s)"),w.append(`<span class='custom-field-file' id='${x}'><span class='file-name'>${e}</span> <a href='' target='_blank'><i class='fa-solid fa-cloud-arrow-down'></i></a>
5 <i class="fa-solid fa-trash-can remove-custom-file" data-file-name='${e}'></i><a class="replace-custom-file" data-file-name='${e}' data-custom-field-id='${r}'></a></span>`);var F=t.find(`#${x} a`);F.attr("href",customFieldFileBaseUrl+"/temp?fileName="+i.substring(i.indexOf("/temp")+6));var E={fileName:e,contentType:n,fullPath:i,size:o},S=JSON.stringify(E);let s="";s=p&&(p.includes("Order")||p.includes("Cart"))?`${p}CustomField_${r}`:`${u||""}${a?"Parent":""}CustomFieldFile_${r}`;var D=t.find(`input[name="${s}"]`);D.length<x?F.parent().append(`<input name="${s}" value="${encodeURIComponent(S)}" class="hidden nested-input"/>`):D.attr("value",`${encodeURIComponent(S)}`),t.find("span.file-input-label-single").html("Replace File")}}else{var O=t.find(".file-link");0==O.length&&(t.prepend('<a class="file-link" target="_blank" />'),O=t.find(".file-link")),O.attr("href",baseFileUrl+i).html(e)}t.find(".remove-file").removeClass("hidden"),updateFileName(t.find("[type=hidden]:first"),i),t.find(".progress").fadeOut(5e3);const I=new CustomEvent("fileAdded",{detail:{fileName:e}});if(t[0].dispatchEvent(I),s){E={fileName:e,contentType:n,fullPath:i,size:o},S=JSON.stringify(E);var j=t.find("[type=hidden]:first"),T=encodeURIComponent(S);j.attr("value",T)}$("[type='submit']").prop("disabled",!1)}function updateFileName(e,t){e.val(t),e[0]&&e[0].dispatchEvent(new CustomEvent("updateFileName",{detail:t}))}function srcToFile(e,t){return fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],t)}))}function ShowErrorMessage(e,t){var i=e.parents(".file-uploader"),n=i.find(".error-message");0==n.length&&(i.append('<div class="alert alert-danger text-danger error-message" style="margin-top:5px;"> </div>'),n=i.find(".error-message")),n.html("<span class='novicon novicon-warning' style='margin-right:5px;'></span> "+t)}function disableFileInputs(e,t){if($(t).data("file-limit")){var i=$(t).parents(".file-uploader").find(".file-list");i.find(".custom-field-file").length>=i.parents(".file-uploader").find("input[type='file']").data("file-limit")&&($(t).parents(".file-uploader").find(".fileinput-button").addClass("disabled"),$(t).prop("disabled",!0))}}function handleCensusSubmitBtn(e){$("#censusForm #census-form-submit-btn").length&&(e.addEventListener("fileAdded",(function(){$("#censusForm #census-form-submit-btn").val("Save")})),$(e).on("click",".fileinput-button, .remove-file, .save-crop",(function(){$("#censusForm #census-form-submit-btn").val("Save")})))}!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}((function(e){"use strict";e.ui=e.ui||{};e.ui.version="1.13.3"; 6/*! 7 * jQuery UI Widget 1.13.3 8 * https://jqueryui.com 9 * 10 * Copyright OpenJS Foundation and other contributors 11 * Released under the MIT license. 12 * https://jquery.org/license 13 */var t,i=0,n=Array.prototype.hasOwnProperty,o=Array.prototype.slice;e.cleanData=(t=e.cleanData,function(i){var n,o,r;for(r=0;null!=(o=i[r]);r++)(n=e._data(o,"events"))&&n.remove&&e(o).triggerHandler("remove");t(i)}),e.widget=function(t,i,n){var o,r,a,s={},l=t.split(".")[0],p=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[p.toLowerCase()]=function(t){return!!e.data(t,p)},e[l]=e[l]||{},o=e[l][t],r=e[l][t]=function(e,t){if(!this||!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(a=new i).options=e.widget.extend({},a.options),e.each(n,(function(e,t){s[e]="function"==typeof t?function(){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,r=this._superApply;return this._super=n,this._superApply=o,e=t.apply(this,arguments),this._super=i,this._superApply=r,e}}():t})),r.prototype=e.widget.extend(a,{widgetEventPrefix:o&&a.widgetEventPrefix||t},s,{constructor:r,namespace:l,widgetName:t,widgetFullName:p}),o?(e.each(o._childConstructors,(function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,r,i._proto)})),delete o._childConstructors):i._childConstructors.push(r),e.widget.bridge(t,r),r}
13,e.widget.extend=function(t){for(var i,r,a=o.call(arguments,1),s=0,l=a.length;s<l;s++)for(i in a[s])r=a[s][i],n.call(a[s],i)&&void 0!==r&&(e.isPlainObject(r)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],r):e.widget.extend({},r):t[i]=r);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(r){var a="string"==typeof r,s=o.call(arguments,1),l=this;return a?this.length||"instance"!==r?this.each((function(){var i,o=e.data(this,n);return"instance"===r?(l=o,!1):o?"function"!=typeof o[r]||"_"===r.charAt(0)?e.error("no such method '"+r+"' for "+t+" widget instance"):(i=o[r].apply(o,s))!==o&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")})):l=void 0:(s.length&&(r=e.widget.extend.apply(null,[r].concat(s))),this.each((function(){var t=e.data(this,n);t?(t.option(r||{}),t._init&&t._init()):e.data(this,n,new i(r,this))}))),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},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.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==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.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,i){t._removeClass(i,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,o,r,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(a={},n=t.split("."),t=n.shift(),n.length){for(o=a[t]=e.widget.extend({},this.options[t]),r=0;r<n.length-1;r++)o[n[r]]=o[n[r]]||{},o=o[n[r]];if(t=n.pop(),1===arguments.length)return void 0===o[t]?null:o[t];o[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=i}return this._setOptions(a),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,n,o;for(i in t)o=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&o&&o.length&&(n=e(o.get()),this._removeClass(o,i),n.addClass(this._classes({element:n,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var i=[],n=this;function o(){var i=[];t.element.each((function(t,o){e.map(n.classesElementLookup,(function(e){return e})).some((function(e){return e.is(o)}))||i.push(o)})),n._on(e(i),{remove:"_untrackClassesElement"})}function r(r,a){var s,l;for(l=0;l<r.length;l++)s=n.classesElementLookup[r[l]]||e(),t.add?(o(),s=e(e.uniqueSort(s.get().concat(t.element.get())))):s=e(s.not(t.element).get()),n.classesElementLookup[r[l]]=s,i.push(r[l]),a&&t.classes[r[l]]&&i.push(t.classes[r[l]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&r(t.keys.match(/\S+/g)||[],!0),t.extra&&r(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,(function(n,o){-1!==e.inArray(t.target,o)&&(i.classesElementLookup[n]=e(o.not(t.target).get()))})),this._off(e(t.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){n="boolean"==typeof n?n:i;var o="string"==typeof e||null===e,r={extra:o?t:i,keys:o?e:t,element:o?this.element:e,add:n};return r.element.toggleClass(this._classes(r),n),this},_on:function(t,i,n){var o,r=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=o=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,o=this.widget()),e.each(n,(function(n,a){function s(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof a?r[a]:a).apply(r,arguments)}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),p=l[1]+r.eventNamespace,u=l[2];u?o.on(p,u,s):i.on(p,s)}))},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var i=this;return setTimeout((function(){return("string"==typeof e?i[e]:e).apply(i,arguments)}),t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,n){var o,r,a=this.options[t];if(n=n||{},(i=e.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],r=i.originalEvent)for(o in r)o in i||(i[o]=r[o]);return this.element.trigger(i,n),!("function"==typeof a&&!1===a.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,i){e.Widget.prototype["_"+t]=function(n,o,r){var a;"string"==typeof o&&(o={effect:o});var s=o?!0===o||"number"==typeof o?i:o.effect||i:t;"number"==typeof(o=o||{})?o={duration:o}:!0===o&&(o={}),a=!e.isEmptyObject(o),o.complete=r,o.delay&&n.delay(o.delay),a&&e.effects&&e.effects.effect[s]?n[t](o):s!==t&&n[s]?n[s](o.duration,o.easing,r):n.queue((function(i){e(this)[t](),r&&r.call(n[0]),i()}))}}));e.widget})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0;e.ajaxTransport("iframe",(function(i){if(i.async){var n,o,r,a=i.initialIframeSrc||"javascript:false;";return{send:function(s,l){(n=e('<form style="display:none;"></form>')).attr("accept-charset",i.formAcceptCharset),r=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+r+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+r+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+r+"_method=PATCH",i.type="POST"),o=e('<iframe src="'+a+'" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",(function(){var t,r=e.isArray(i.paramName)?i.paramName:[i.paramName];o.unbind("load").bind("load",(function(){var t;try{if(!(t=o.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('<iframe src="'+a+'"></iframe>').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",o.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",r[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var o=e(t[i]);e(n).prop("name",o.prop("name")).attr("form",o.attr("form")),o.replaceWith(n)}))})),n.append(o).appendTo(document.body)},abort:function(){o&&o.unbind("load").prop("src",a),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery.ui.widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var o=n.dataTransfer;o&&-1!==e.inArray("Files",o.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:n}))&&(n.preventDefault(),i&&(o.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('<input type="file">').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)}
13)),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,o=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&o-i._time<i.progressInterval&&t.loaded!==t.total)return;i._time=o,n=Math.floor(t.loaded/t.total*(i.chunkSize||i._progress.total))+(i.uploadedBytes||0),this._progress.loaded+=n-i._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(o,this._progress.loaded,i.bitrateInterval),i._progress.loaded=i.loaded=n,i._progress.bitrate=i.bitrate=i._bitrateTimer.getBitrate(o,n,i.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),i),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var i=this,n=t.xhr?t.xhr():e.ajaxSettings.xhr();n.upload&&(e(n.upload).bind("progress",(function(e){var n=e.originalEvent;e.lengthComputable=n.lengthComputable,e.loaded=n.loaded,e.total=n.total,i._onProgress(e,t)})),t.xhr=function(){return n})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var i,n=this,o=t.files[0],r=t.multipart||!e.support.xhrFileUpload,a="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),r&&!t.blob&&this._isInstanceOf("File",o)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(o.name)+'"'),r?e.support.xhrFormDataFileUpload&&(t.postMessage?(i=this._getFormData(t),t.blob?i.push({name:a,value:t.blob}):e.each(t.files,(function(n,o){i.push({name:"array"===e.type(t.paramName)&&t.paramName[n]||a,value:o})}))):(n._isInstanceOf("FormData",t.formData)?i=t.formData:(i=new FormData,e.each(this._getFormData(t),(function(e,t){i.append(t.name,t.value)}))),t.blob?i.append(a,t.blob,o.name):e.each(t.files,(function(o,r){(n._isInstanceOf("File",r)||n._isInstanceOf("Blob",r))&&i.append("array"===e.type(t.paramName)&&t.paramName[o]||a,r,r.uploadName||r.name)}))),t.data=i):(t.contentType=o.type||"application/octet-stream",t.data=t.blob||o),t.blob=null},_initIframeSettings:function(t){var i=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",o=(t.prop("files")||[1]).length;o;)n.push(i),o-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var o=e.Deferred(),r=o.promise();return i=i||this.options.context||r,!0===t?o.resolveWith(i,n):!1===t&&o.rejectWith(i,n),r.abort=o.promise,this._enhancePromise(r)},_addConvenienceMethods:function(t,i){var n=this,o=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,r){return(t||r)&&(i._processQueue=this._processQueue=(this._processQueue||o([this])).pipe((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():o(arguments)})).pipe(t,r)),this._processQueue||o([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,o,r=this,a=t.files[0],s=a.size,l=t.uploadedBytes,p=t.maxChunkSize||s,u=this._blobSlice,d=e.Deferred(),c=d.promise();return!(!(this._isXHRUpload(t)&&u&&(l||p<s))||t.data)&&(!!i||(l>=s?(a.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",a.error])):(o=function(){var i=e.extend({},t),c=i._progress.loaded;i.blob=u.call(a,l,l+p,a.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,r._initXHRData(i),r._initProgressListener(i),n=(!1!==r._trigger("chunkse
13nd",null,i)&&e.ajax(i)||r._getXHRPromise(!1,i.context)).done((function(n,a,p){l=r._getUploadedBytes(p)||l+i.chunkSize,c+i.chunkSize-i._progress.loaded&&r._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=a,i.jqXHR=p,r._trigger("chunkdone",null,i),r._trigger("chunkalways",null,i),l<s?o():d.resolveWith(i.context,[n,a,p])})).fail((function(e,t,n){i.jqXHR=e,i.textStatus=t,i.errorThrown=n,r._trigger("chunkfail",null,i),r._trigger("chunkalways",null,i),d.rejectWith(i.context,[e,t,n])}))},this._enhancePromise(c),c.abort=function(){return n.abort()},o(),c)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(t,i,n,o){var r=o._progress.total,a=o._response;o._progress.loaded<r&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:r,total:r}),o),a.result=o.result=t,a.textStatus=o.textStatus=i,a.jqXHR=o.jqXHR=n,this._trigger("done",null,o)},_onFail:function(e,t,i,n){var o=n._response;n.recalculateProgress&&(this._progress.loaded-=n._progress.loaded,this._progress.total-=n._progress.total),o.jqXHR=n.jqXHR=e,o.textStatus=n.textStatus=t,o.errorThrown=n.errorThrown=i,this._trigger("fail",null,n)},_onAlways:function(e,t,i,n){this._trigger("always",null,n)},_onSend:function(t,i){i.submit||this._addConvenienceMethods(t,i);var n,o,r,a,s=this,l=s._getAJAXSettings(i),p=function(){return s._sending+=1,l._bitrateTimer=new s._BitrateTimer,n=n||((o||!1===s._trigger("send",e.Event("send",{delegatedEvent:t}),l))&&s._getXHRPromise(!1,l.context,o)||s._chunkedUpload(l)||e.ajax(l)).done((function(e,t,i){s._onDone(e,t,i,l)})).fail((function(e,t,i){s._onFail(e,t,i,l)})).always((function(e,t,i){if(s._onAlways(e,t,i,l),s._sending-=1,s._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>s._sending)for(var n=s._slots.shift();n;){if("pending"===s._getDeferredState(n)){n.resolve();break}n=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(r=e.Deferred(),this._slots.push(r),a=r.pipe(p)):(this._sequence=this._sequence.pipe(p,p),a=this._sequence),a.abort=function(){return o=[void 0,"abort","abort"],n?n.abort():(r&&r.rejectWith(l.context,o),p())},this._enhancePromise(a)):p()},_onAdd:function(t,i){var n,o,r,a,s=this,l=!0,p=e.extend({},this.options,i),u=i.files,d=u.length,c=p.limitMultiFileUploads,f=p.limitMultiFileUploadSize,h=p.limitMultiFileUploadSizeOverhead,m=0,g=this._getParamName(p),v=0;if(!d)return!1;if(f&&void 0===u[0].size&&(f=void 0),(p.singleFileUploads||c||f)&&this._isXHRUpload(p))if(p.singleFileUploads||f||!c)if(!p.singleFileUploads&&f)for(r=[],n=[],a=0;a<d;a+=1)m+=u[a].size+h,(a+1===d||m+u[a+1].size+h>f||c&&a+1-v>=c)&&(r.push(u.slice(v,a+1)),(o=g.slice(v,a+1)).length||(o=g),n.push(o),v=a+1,m=0);else n=g;else for(r=[],n=[],a=0;a<d;a+=c)r.push(u.slice(a,a+c)),(o=g.slice(a,a+c)).length||(o=g),n.push(o);else r=[u],n=[g];return i.originalFiles=u,e.each(r||u,(function(o,a){var p=e.extend({},i);return p.files=r?a:[a],p.paramName=n[o],s._initResponseObject(p),s._initProgressObject(p),s._addConvenienceMethods(t,p),l=s._trigger("add",e.Event("add",{delegatedEvent:t}),p)})),l},_replaceFileInput:function(t){var i=t.fileInput,n=i.clone(!0),o=i.is(document.activeElement);t.fileInputClone=n,e("<form></form>").append(n)[0].reset(),i.after(n).detach(),o&&n.focus(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,o=this,r=e.Deferred(),a=function(e){e&&!e.entry&&(e.entry=t),r.resolve([e])},s=function(){n.readEntries((function(e){e.length?(l=l.concat(e),s()):function(e){o._handleFileTreeEntries(e,i+t.name+"/").done((function(e){r.resolve(e)})).fail(a)}(l)}),a)},l=[];return i=i||"",t.isFile?t._file?(t._file.relativePath=i,r.resolve(t._file)):t.file((function(e){e.relativePath=i,r.resolve(e)}),a):t.isDirectory?(n=t.createReader(),s()):r.resolve([]),r.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)}))).pipe((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,o=(t=e(t)).prop("webkitEntries")||t.prop("entr
13ies");if(o&&o.length)return this._handleFileTreeEntries(o);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).pipe((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(o){n.files=o,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,o={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){o.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),o)&&i._onAdd(t,o)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,o){var r,a=o.name.toLowerCase();/^data-/.test(a)&&(a=a.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),r=n[a],t._isRegExpOption(a,r)&&(r=t._getRegExp(r)),i[a]=r)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,o=this,r=e.Deferred(),a=r.promise();return a.abort=function(){return n=!0,i?i.abort():(r.reject(null,"abort","abort"),a)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=o._onSend(null,t)).then((function(e,t,i){r.resolve(e,t,i)}),(function(e,t,i){r.reject(e,t,i)}))):r.reject())})),this._enhancePromise(a)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(i,n){var o=e(this);n.process((function(){return o.fileupload("process",n)})),t.call(this,i,n)}},processActions:{},_processFile:function(t,i){var n=this,o=e.Deferred().resolveWith(n,[t]).promise();return this._trigger("process",null,t),e.each(t.processQueue,(function(t,r){var a=function(t){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():n.processActions[r.action].call(n,t,r)};o=o.pipe(a,r.always&&a)})),o.done((function(){n._trigger("processdone",null,t),n._trigger("processalways",null,t)})).fail((function(){n._trigger("processfail",null,t),n._trigger("processalways",null,t)})),o},_transformProcessQueue:function(t){var i=[];e.each(t.processQueue,(function(){var n={},o=this.action,r=!0===this.prefix?o:this.prefix;e.each(this,(function(i,o){"string"===e.type(o)&&"@"===o.charAt(0)?n[i]=t[o.slice(1)||(r?r+i.charAt(0).toUpperCase()+i.slice(1):i)]:n[i]=o})),i.push(n)})),t.processQueue=i},processing:function(){return this._processing},process:function(t){var i=this,n=e.extend({},this.options,t);return n.processQueue&&n.processQueue.length&&(this._transformProcessQueue(n),0===this._processing&&this._trigger("processstart"),e.each(t.files,(function(o){var r=o?e.extend({},n):n,a=function(){return t.errorThrown?e.Deferred().rejectWith(i,[t]).promise():i._processFile(r,t)};r.index=o,i._processing+=1,i._processingQueue=i._processingQueue.pipe(a,a).always((function(){i._processing-=1,0===i._processing&&i._trigger("processstop")}))}
13))),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";e.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{getNumberOfFiles:e.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(t,i){if(i.disabled)return t;var n,o=e.Deferred(),r=this.options,a=t.files[t.index];return(i.minFileSize||i.maxFileSize)&&(n=a.size),"number"===e.type(i.maxNumberOfFiles)&&(r.getNumberOfFiles()||0)+t.files.length>i.maxNumberOfFiles?a.error=r.i18n("maxNumberOfFiles"):!i.acceptFileTypes||i.acceptFileTypes.test(a.type)||i.acceptFileTypes.test(a.name)?n>i.maxFileSize?a.error=r.i18n("maxFileSize"):"number"===e.type(n)&&n<i.minFileSize?a.error=r.i18n("minFileSize"):delete a.error:a.error=r.i18n("acceptFileTypes"),a.error||t.files.error?(t.files.error=!0,o.rejectWith(this,[t])):o.resolveWith(this,[t]),o.promise()}}})})),$((function(){$(".file-uploader").each((function(){mountFileUploader(this)}));new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.length>0&&e.addedNodes.forEach((t=>{let i=t.parentNode;for(;i;){if(i.id&&(i.id.includes("editable-fields")||i.id.includes("order-add-form")||i.id.includes("attendee-add-form"))){mountFileUploader(e.addedNodes[0].parentNode);break}i=i.parentNode}}))}))})).observe(document.body,{childList:!0,subtree:!0}),$(".fileinput-button")&&$(".fileinput-button")[0]&&$(".fileinput-button")[0].addEventListener("keydown",(function(e){"enter"===e.key.toLowerCase()&&$(".fileinput-button")[0].children[2].click()}))})),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports&&"string"!=typeof exports.nodeName?module.exports=t():e.Croppie=t()}("undefined"!=typeof self?self:this,(function(){"function"!=typeof Promise&&function(e){function t(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,t(o,this),t(r,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void u((function(){var i=t._state?e.onFulfilled:e.onRejected;if(null!==i){var n;try{n=i(t._value)}catch(t){return void e.reject(t)}e.resolve(n)}else(t._state?e.resolve:e.reject)(t._value)}))}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var i=e.then;if("function"==typeof i)return void l(t(i,e),t(o,this),t(r,this))}this._state=!0,this._value=e,a.call(this)}catch(e){r.call(this,e)}}function r(e){this._state=!1,this._value=e,a.call(this)}function a(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function s(e,t,i,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=i,this.reject=n}function l(e,t,i){var n=!1;try{e((function(e){n||(n=!0,t(e))}),(function(e){n||(n=!0,i(e))}))}catch(e){if(n)return;n=!0,i(e)}}var p=setTimeout,u="function"==typeof setImmediate&&setImmediate||function(e){p(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var o=this;return new i((function(i,r){n.call(o,new s(e,t,i,r))}))},i.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);
13return new i((function(t,i){function n(r,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){n(r,e)}),i)}e[r]=a,0==--o&&t(e)}catch(e){i(e)}}if(0===e.length)return t([]);for(var o=e.length,r=0;r<e.length;r++)n(r,e[r])}))},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i((function(t){t(e)}))},i.reject=function(e){return new i((function(t,i){i(e)}))},i.race=function(e){return new i((function(t,i){for(var n=0,o=e.length;o>n;n++)e[n].then(t,i)}))},i._setImmediateFn=function(e){u=e},"undefined"!=typeof module&&module.exports?module.exports=i:e.Promise||(e.Promise=i)}(this),"function"!=typeof window.CustomEvent&&function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}e.prototype=window.Event.prototype,window.CustomEvent=e}(),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){for(var n=atob(this.toDataURL(t,i).split(",")[1]),o=n.length,r=new Uint8Array(o),a=0;a<o;a++)r[a]=n.charCodeAt(a);e(new Blob([r],{type:t||"image/png"}))}});var e,t,i,n=["Webkit","Moz","ms"],o=document.createElement("div").style,r=[1,8,3,6],a=[2,7,4,5];function s(e){if(e in o)return e;for(var t=e[0].toUpperCase()+e.slice(1),i=n.length;i--;)if((e=n[i]+t)in o)return e}function l(e,t){for(var i in e=e||{},t)t[i]&&t[i].constructor&&t[i].constructor===Object?(e[i]=e[i]||{},l(e[i],t[i])):e[i]=t[i];return e}function p(e){return l({},e)}function u(e){if("createEvent"in document){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),e.dispatchEvent(t)}else e.fireEvent("onchange")}function d(e,t,i){if("string"==typeof t){var n=t;(t={})[n]=i}for(var o in t)e.style[o]=t[o]}function c(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function f(e,t){for(var i in t)e.setAttribute(i,t[i])}function h(e){return parseInt(e,10)}function m(e,t){var i=e.naturalWidth,n=e.naturalHeight,o=t||b(e);if(o&&o>=5){var r=i;i=n,n=r}return{width:i,height:n}}t=s("transform"),e=s("transformOrigin"),i=s("userSelect");var g={translate3d:{suffix:", 0px"},translate:{suffix:""}},v=function(e,t,i){this.x=parseFloat(e),this.y=parseFloat(t),this.scale=parseFloat(i)};v.parse=function(e){return e.style?v.parse(e.style[t]):e.indexOf("matrix")>-1||e.indexOf("none")>-1?v.fromMatrix(e):v.fromString(e)},v.fromMatrix=function(e){var t=e.substring(7).split(",");return t.length&&"none"!==e||(t=[1,0,0,1,0,0]),new v(h(t[4]),h(t[5]),parseFloat(t[0]))},v.fromString=function(e){var t=e.split(") "),i=t[0].substring(oe.globals.translate.length+1).split(","),n=t.length>1?t[1].substring(6):1,o=i.length>
131?i[0]:0,r=i.length>1?i[1]:0;return new v(o,r,n)},v.prototype.toString=function(){var e=g[oe.globals.translate].suffix||"";return oe.globals.translate+"("+this.x+"px, "+this.y+"px"+e+") scale("+this.scale+")"};var y=function(t){if(!t||!t.style[e])return this.x=0,void(this.y=0);var i=t.style[e].split(" ");this.x=parseFloat(i[0]),this.y=parseFloat(i[1])};function b(e){return e.exifdata&&e.exifdata.Orientation?h(e.exifdata.Orientation):1}function _(e,t,i){var n=t.width,o=t.height,r=e.getContext("2d");switch(e.width=t.width,e.height=t.height,r.save(),i){case 2:r.translate(n,0),r.scale(-1,1);break;case 3:r.translate(n,o),r.rotate(180*Math.PI/180);break;case 4:r.translate(0,o),r.scale(1,-1);break;case 5:e.width=o,e.height=n,r.rotate(90*Math.PI/180),r.scale(1,-1);break;case 6:e.width=o,e.height=n,r.rotate(90*Math.PI/180),r.translate(0,-o);break;case 7:e.width=o,e.height=n,r.rotate(-90*Math.PI/180),r.translate(-n,o),r.scale(1,-1);break;case 8:e.width=o,e.height=n,r.translate(0,n),r.rotate(-90*Math.PI/180)}r.drawImage(t,0,0,n,o),r.restore()}function w(){var e,t,i,n,o,r,a=this,s=a.options.viewport.type?"cr-vp-"+a.options.viewport.type:null;a.options.useCanvas=a.options.enableOrientation||x.call(a),a.data={},a.elements={},e=a.elements.boundary=document.createElement("div"),i=a.elements.viewport=document.createElement("div"),t=a.elements.img=document.createElement("img"),n=a.elements.overlay=document.createElement("div"),a.options.useCanvas?(a.elements.canvas=document.createElement("canvas"),a.elements.preview=a.elements.canvas):a.elements.preview=t,c(e,"cr-boundary"),e.setAttribute("aria-dropeffect","none"),o=a.options.boundary.width,r=a.options.boundary.height,d(e,{width:o+(isNaN(o)?"":"px"),height:r+(isNaN(r)?"":"px")}),c(i,"cr-viewport"),s&&c(i,s),d(i,{width:a.options.viewport.width+"px",height:a.options.viewport.height+"px"}),i.setAttribute("tabindex",0),c(a.elements.preview,"cr-image"),f(a.elements.preview,{alt:"preview","aria-grabbed":"false"}),c(n,"cr-overlay"),a.element.appendChild(e),e.appendChild(a.elements.preview),e.appendChild(i),e.appendChild(n),c(a.element,"croppie-container"),a.options.customClass&&c(a.element,a.options.customClass),I.call(this),a.options.enableZoom&&E.call(a),a.options.enableResize&&C.call(a)}function x(){return this.options.enableExif&&window.EXIF}function C(){var e,t,n,o,r,a,s,l=this,p=document.createElement("div"),u=!1;function f(a){if((void 0===a.button||0===a.button)&&(a.preventDefault(),!u)){var s=l.elements.overlay.getBoundingClientRect();if(u=!0,t=a.pageX,n=a.pageY,e=-1!==a.currentTarget.className.indexOf("vertical")?"v":"h",o=s.width,r=s.height,a.touches){var p=a.touches[0];t=p.pageX,n=p.pageY}window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),window.addEventListener("mouseup",m),window.addEventListener("touchend",m),document.body.style[i]="none"}}function h(i){var a=i.pageX,s=i.pageY;if(i.preventDefault(),i.touches){var u=i.touches[0];a=u.pageX,s=u.pageY}
13var c=a-t,f=s-n,h=l.options.viewport.height+f,m=l.options.viewport.width+c;"v"===e&&h>=50&&h<=r?(d(p,{height:h+"px"}),l.options.boundary.height+=f,d(l.elements.boundary,{height:l.options.boundary.height+"px"}),l.options.viewport.height+=f,d(l.elements.viewport,{height:l.options.viewport.height+"px"})):"h"===e&&m>=50&&m<=o&&(d(p,{width:m+"px"}),l.options.boundary.width+=c,d(l.elements.boundary,{width:l.options.boundary.width+"px"}),l.options.viewport.width+=c,d(l.elements.viewport,{width:l.options.viewport.width+"px"})),j.call(l),z.call(l),O.call(l),P.call(l),n=s,t=a}function m(){u=!1,window.removeEventListener("mousemove",h),window.removeEventListener("touchmove",h),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),document.body.style[i]=""}c(p,"cr-resizer"),d(p,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),this.options.resizeControls.height&&(c(a=document.createElement("div"),"cr-resizer-vertical"),p.appendChild(a)),this.options.resizeControls.width&&(c(s=document.createElement("div"),"cr-resizer-horisontal"),p.appendChild(s)),a&&(a.addEventListener("mousedown",f),a.addEventListener("touchstart",f)),s&&(s.addEventListener("mousedown",f),s.addEventListener("touchstart",f)),this.elements.boundary.appendChild(p)}function F(e){if(this.options.enableZoom){var t=this.elements.zoomer,i=Y(e,4);t.value=Math.max(parseFloat(t.min),Math.min(parseFloat(t.max),i)).toString()}}function E(){var e=this,t=e.elements.zoomerWrap=document.createElement("div"),i=e.elements.zoomer=document.createElement("input");function n(){S.call(e,{value:parseFloat(i.value),origin:new y(e.elements.preview),viewportRect:e.elements.viewport.getBoundingClientRect(),transform:v.parse(e.elements.preview)})}function o(t){var i,o;if("ctrl"===e.options.mouseWheelZoom&&!0!==t.ctrlKey)return 0;i=t.wheelDelta?t.wheelDelta/1200:t.deltaY?t.deltaY/1060:t.detail?t.detail/-60:0,o=e._currentZoom+i*e._currentZoom,t.preventDefault(),F.call(e,o),n.call(e)}c(t,"cr-slider-wrap"),c(i,"cr-slider"),i.type="range",i.step="0.0001",i.value="1",i.style.display=e.options.showZoomer?"":"none",i.setAttribute("aria-label","zoom"),e.element.appendChild(t),t.appendChild(i),e._currentZoom=1,e.elements.zoomer.addEventListener("input",n),e.elements.zoomer.addEventListener("change",n),e.options.mouseWheelZoom&&(e.elements.boundary.addEventListener("mousewheel",o),e.elements.boundary.addEventListener("DOMMouseScroll",o))}function S(i){var n=this,o=i?i.transform:v.parse(n.elements.preview),r=i?i.viewportRect:n.elements.viewport.getBoundingClientRect(),a=i?i.origin:new y(n.elements.preview);function s(){var i={};i[t]=o.toString(),i[e]=a.toString(),d(n.elements.preview,i)}if(n._currentZoom=i?i.value:n._currentZoom,o.scale=n._currentZoom,n.elements.zoomer.setAttribute("aria-valuenow",n._currentZoom),s(),n.options.enforceBoundary){var l=D.call(n,r),p=l.translate,u=l.origin;o.x>=p.maxX&&(a.x=u.minX,o.x=p.maxX),o.x<=p.minX&&(a.x=u.maxX,o.x=p.minX),o.y>=p.maxY&&(a.y=u.minY,o.y=p.maxY),o.y<=p.minY&&(a.y=u.maxY,o.y=p.minY)}s(),N.call(n),P.call(n)}function D(e){var t=this,i=t._currentZoom,n=e.width,o=e.height,r=t.elements.boundary.clientWidth/2,a=t.elements.boundary.clientHeight/2,s=t.elements.preview.getBoundingClientRect(),l=s.width,p=s.height,u=n/2,d=o/2,c=-1*(u/i-r),f=-1*(d/i-a),h=1/i*u,m=1/i*d;return{translate:{maxX:c,minX:c-(l*(1/i)-n*(1/i)),maxY:f,minY:f-(p*(1/i)-o*(1/i))},origin:{maxX:l*(1/i)-h,minX:h,maxY:p*(1/i)-m,minY:m}}}function O(i){var n=this,o=n._currentZoom,r=n.elements.preview.getBoundingClientRect(),a=n.elements.viewport.getBoundingClientRect(),s=v.parse(n.elements.preview.style[t]),l=new y(n.elements.preview),p=a.top-r.top+a.height/2,u=a.left-r.left+a.width/2,c={},f={};if(i){var h=l.x,m=l.y,g=s.x,b=s.y;c.y=h,c.x=m,s.y=g,s.x=b}else c.y=p/o,c.x=u/o,f.y=(c.y-l.y)*(1-o),f.x=(c.x-l.x)*(1-o),s.x-=f.x,s.y-=f.y;var _={};_[e]=c.x+"px "+c.y+"px",_[t]=s.toString(),d(n.elements.preview,_)}function I(){var e,n,o,r,a,s=this,l=!1;function p(e,t){var i=s.elements.preview.getBoundingClientRect(),n=a.y+t,o=a.x+e;s.options.enforceBoundary?(r.top>i.top+t&&r.bottom<i.bottom+t&&(a.y=n),r.left>i.left+e&&r.right<i.right+e&&(a.x=o)):(a.y=n,a.x=o)}function c(e){s.elements.preview.setAttribute("aria-grabbed",e),s.elements.boundary.setAttribute("aria-dropeffect",e?"move":"none")}function f(t){if((void 0===t.button||0===t.button)&&(t.preventDefault(),!l)){if(l=!0,e=t.pageX,n=t.pageY,t.touches){var o=t.touches[0];e=o.pageX,n=o.pageY}c(l),a=v.parse(s.elements.preview),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),window.addEventListener("mouseup",m),window.addEventListener("touchend",m),document.body.style[i]="none",r=s.elements.viewport.getBoundingClientRect()}}function h(i){i.preventDefault();var r=i.pageX,l=i.pageY;if(i.touches){var c=i.touches[0];r=c.pageX,l=c.pageY}var f=r-e,h=l-n,m={};if("touchmove"===i.type&&i.touches.length>1){var g=i.touches[0],v=i.touches[1],y=Math.sqrt((g.pageX-v.pageX)*(g.pageX-v.pageX)+(g.pageY-v.pageY)*(g.pageY-v.pageY));o||(o=y/s._currentZoom);var b=y/o;return F.call(s,b),void u(s.elements.zoomer)}p(f,h),m[t]=a.toString(),d(s.elements.preview,m),j.call(s),n=l,e=r}function m(){c(l=!1),window.removeEventListener("mousemove",h),window.removeEventListener("touchmove",h),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),document.body.style[i]="",O.call(s),P.call(s),o=0}s.elements.overlay.addEventListener("mousedown",f),s.elements.viewport.addEventListener("keydown",(function(e){var n;
13if(!e.shiftKey||38!==e.keyCode&&40!==e.keyCode){if(s.options.enableKeyMovement&&e.keyCode>=37&&e.keyCode<=40){e.preventDefault();var l=function(e){switch(e){case 37:return[1,0];case 38:return[0,1];case 39:return[-1,0];case 40:return[0,-1]}}(e.keyCode);a=v.parse(s.elements.preview),document.body.style[i]="none",r=s.elements.viewport.getBoundingClientRect(),function(e){var n=e[0],r=e[1],l={};p(n,r),l[t]=a.toString(),d(s.elements.preview,l),j.call(s),document.body.style[i]="",O.call(s),P.call(s),o=0}(l)}}else n=38===e.keyCode?parseFloat(s.elements.zoomer.value)+parseFloat(s.elements.zoomer.step):parseFloat(s.elements.zoomer.value)-parseFloat(s.elements.zoomer.step),s.setZoom(n)})),s.elements.overlay.addEventListener("touchstart",f)}function j(){if(this.elements){var e=this,t=e.elements.boundary.getBoundingClientRect(),i=e.elements.preview.getBoundingClientRect();d(e.elements.overlay,{width:i.width+"px",height:i.height+"px",top:i.top-t.top+"px",left:i.left-t.left+"px"})}}y.prototype.toString=function(){return this.x+"px "+this.y+"px"};var $,T,R,k,N=($=j,T=500,function(){var e=this,t=arguments,i=function(){k=null,R||$.apply(e,t)},n=R&&!k;clearTimeout(k),k=setTimeout(i,T),n&&$.apply(e,t)});function P(){var e,t=this,i=t.get();A.call(t)&&(t.options.update.call(t,i),t.$&&"undefined"==typeof Prototype?t.$(t.element).trigger("update.croppie",i):(window.CustomEvent?e=new CustomEvent("update",{detail:i}):(e=document.createEvent("CustomEvent")).initCustomEvent("update",!0,!0,i),t.element.dispatchEvent(e)))}function A(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function U(){var i,n=this,o={},r=n.elements.preview,a=new v(0,0,1),s=new y;A.call(n)&&!n.data.bound&&(n.data.bound=!0,o[t]=a.toString(),o[e]=s.toString(),o.opacity=1,d(r,o),i=n.elements.preview.getBoundingClientRect(),n._originalImageWidth=i.width,n._originalImageHeight=i.height,n.data.orientation=b(n.elements.img),n.options.enableZoom?z.call(n,!0):n._currentZoom=1,a.scale=n._currentZoom,o[t]=a.toString(),d(r,o),n.data.points.length?L.call(n,n.data.points):B.call(n),O.call(n),j.call(n))}function z(e){var t,i,n,o,r=this,a=Math.max(r.options.minZoom,0)||0,s=r.options.maxZoom||1.5,l=r.elements.zoomer,p=parseFloat(l.value),d=r.elements.boundary.getBoundingClientRect(),c=m(r.elements.img,r.data.orientation),f=r.elements.viewport.getBoundingClientRect();r.options.enforceBoundary&&(n=f.width/c.width,o=f.height/c.height,a=Math.max(n,o)),a>=s&&(s=a+1),l.min=Y(a,4),l.max=Y(s,4),!e&&(p<l.min||p>l.max)?F.call(r,p<l.min?l.min:l.max):e&&(i=Math.max(d.width/c.width,d.height/c.height),t=null!==r.data.boundZoom?r.data.boundZoom:i,F.call(r,t)),u(l)}function L(i){if(4!==i.length)throw"Croppie - Invalid number of points supplied: "+i;var n=this,o=i[2]-i[0],r=n.elements.viewport.getBoundingClientRect(),a=n.elements.boundary.getBoundingClientRect(),s=r.left-a.left,l=r.top-a.top,p=r.width/o,u=i[1],c=i[0],f=-1*i[1]+l,h=-1*i[0]+s,m={};m[e]=c+"px "+u+"px",m[t]=new v(h,f,p).toString(),d(n.elements.preview,m),F.call(n,p),n._currentZoom=p}function B(){var e=this,i=e.elements.preview.getBoundingClientRect(),n=e.elements.viewport.getBoundingClientRect(),o=e.elements.boundary.getBoundingClientRect(),r=n.left-o.left,a=n.top-o.top,s=r-(i.width-n.width)/2,l=a-(i.height-n.height)/2,p=new v(s,l,e._currentZoom);d(e.elements.preview,t,p.toString())}function X(e){var t=this,i=t.elements.canvas,n=t.elements.img;i.getContext("2d").clearRect(0,0,i.width,i.height),i.width=n.width,i.height=n.height,_(i,n,t.options.enableOrientation&&e||b(n))}function H(e){var t=this,i=e.points,n=h(i[0]),o=h(i[1]),r=h(i[2])-n,a=h(i[3])-o,s=e.circle,l=document.createElement("canvas"),p=l.getContext("2d"),u=e.outputWidth||r,d=e.outputHeight||a;l.width=u,l.height=d,e.backgroundColor&&(p.fillStyle=e.backgroundColor,p.fillRect(0,0,u,d));var c=n,f=o,m=r,g=a,v=0,y=0,b=u,_=d;return n<0&&(c=0,v=Math.abs(n)/r*u),m+c>t._originalImageWidth&&(b=(m=t._originalImageWidth-c)/r*u),o<0&&(f=0,y=Math.abs(o)/a*d),g+f>t._originalImageHeight&&(_=(g=t._originalImageHeight-f)/a*d),p.drawImage(this.elements.preview,c,f,m,g,v,y,b,_),s&&(p.fillStyle="#fff",p.globalCompositeOperation="destination-in",p.beginPath(),p.arc(l.width/2,l.height/2,l.width/2,0,2*Math.PI,!0),p.closePath(),p.fill()),l}function M(e){var t=e.points,i=document.createElement("div"),n=document.createElement("img"),o=t[2]-t[0],r=t[3]-t[1];return c(i,"croppie-result"),i.appendChild(n),d(n,{left:-1*t[0]+"px",top:-1*t[1]+"px"}),n.src=e.url,d(i,{width:o+"px",height:r+"px"}),i}function W(e){return H.call(this,e).toDataURL(e.format,e.quality)}function q(e){var t=this;return new Promise((function(i){H.call(t,e).toBlob((function(e){i(e)}),e.format,e.quality)}))}function Z(e){this.elements.img.parentNode&&(Array.prototype.forEach.call(this.elements.img.classList,(function(t){e.classList.add(t)})),this.elements.img.parentNode.replaceChild(e,this.elements.img),this.elements.preview=e),this.elements.img=e}function Q(e,t){var i,n,o,r,a=this,s=[],l=null,p=x.call(a);if("string"==typeof e)i=e,e={};else if(Array.isArray(e))s=e.slice();else{if(void 0===e&&a.data.url)return U.call(a),P.call(a),null;i=e.url,s=e.points||[],l=void 0===e.zoom?null:e.zoom}return a.data.bound=!1,a.data.url=i||a.data.url,a.data.boundZoom=l,(n=i,o=p,r=new Image,r.style.opacity="0",new Promise((function(e,t){function i(){r.style.opacity="1",setTimeout((function(){e(r)}),1)}r.removeAttribute("crossOrigin"),n.match(/^https?:\/\/|^\/\//)&&r.setAttribute("crossOrigin","anonymous"),r.onload=function(){o?EXIF.getData(r,(function(){i()})):i()},r.onerror=function(e){r.style.opacity=1,setTimeout((function(){t(e)}),1)},r.src=n}))).then((function(i){if(Z.call(a,i),s.length)a.options.relative&&(s=[s[0]*i.naturalWi
13dth/100,s[1]*i.naturalHeight/100,s[2]*i.naturalWidth/100,s[3]*i.naturalHeight/100]);else{var n,o,r=m(i),l=a.elements.viewport.getBoundingClientRect(),p=l.width/l.height;r.width/r.height>p?n=(o=r.height)*p:(n=r.width,o=r.height/p);var u=(r.width-n)/2,d=(r.height-o)/2,c=u+n,f=d+o;a.data.points=[u,d,c,f]}a.data.points=s.map((function(e){return parseFloat(e)})),a.options.useCanvas&&X.call(a,e.orientation),U.call(a),P.call(a),t&&t()}))}function Y(e,t){return parseFloat(e).toFixed(t||0)}function J(){var e=this,t=e.elements.preview.getBoundingClientRect(),i=e.elements.viewport.getBoundingClientRect(),n=i.left-t.left,o=i.top-t.top,r=(i.width-e.elements.viewport.offsetWidth)/2,a=(i.height-e.elements.viewport.offsetHeight)/2,s=n+e.elements.viewport.offsetWidth+r,l=o+e.elements.viewport.offsetHeight+a,p=e._currentZoom;(p===1/0||isNaN(p))&&(p=1);var u=e.options.enforceBoundary?0:Number.NEGATIVE_INFINITY;return n=Math.max(u,n/p),o=Math.max(u,o/p),s=Math.max(u,s/p),l=Math.max(u,l/p),{points:[Y(n),Y(o),Y(s),Y(l)],zoom:p,orientation:e.data.orientation}}var V={type:"canvas",format:"png",quality:1},K=["jpeg","webp","png"];function G(e){var t=this,i=J.call(t),n=l(p(V),p(e)),o="string"==typeof e?e:n.type||"base64",r=n.size||"viewport",a=n.format,s=n.quality,u=n.backgroundColor,d="boolean"==typeof n.circle?n.circle:"circle"===t.options.viewport.type,c=t.elements.viewport.getBoundingClientRect(),f=c.width/c.height;return"viewport"===r?(i.outputWidth=c.width,i.outputHeight=c.height):"object"==typeof r&&(r.width&&r.height?(i.outputWidth=r.width,i.outputHeight=r.height):r.width?(i.outputWidth=r.width,i.outputHeight=r.width/f):r.height&&(i.outputWidth=r.height*f,i.outputHeight=r.height)),K.indexOf(a)>-1&&(i.format="image/"+a,i.quality=s),i.circle=d,i.url=t.data.url,i.backgroundColor=u,new Promise((function(e){switch(o.toLowerCase()){case"rawcanvas":e(H.call(t,i));break;case"canvas":case"base64":e(W.call(t,i));break;case"blob":q.call(t,i).then(e);break;default:e(M.call(t,i))}}))}function ee(){U.call(this)}function te(e){if(!this.options.useCanvas||!this.options.enableOrientation)throw"Croppie: Cannot rotate without enableOrientation && EXIF.js included";var t,i,n,o,s,l=this,p=l.elements.canvas;l.data.orientation=(t=l.data.orientation,i=e,n=r.indexOf(t)>-1?r:a,o=n.indexOf(t),s=i/90%n.length,n[(n.length+o+s%n.length)%n.length]),_(p,l.elements.img,l.data.orientation),O.call(l,!0),z.call(l)}function ie(){var e,t,i=this;i.element.removeChild(i.elements.boundary),e=i.element,t="croppie-container",e.classList?e.classList.remove(t):e.className=e.className.replace(t,""),i.options.enableZoom&&i.element.removeChild(i.elements.zoomerWrap),delete i.elements}if(window.jQuery){var ne=window.jQuery;ne.fn.croppie=function(e){var t=typeof e;if("string"===t){var i=Array.prototype.slice.call(arguments,1),n=ne(this).data("croppie");return"get"===e?n.get():"result"===e?n.result.apply(n,i):"bind"===e?n.bind.apply(n,i):this.each((function(){var t=ne(this).data("croppie");if(t){var n=t[e];if(!ne.isFunction(n))throw"Croppie "+e+" method not found";n.apply(t,i),"destroy"===e&&ne(this).removeData("croppie")}}))}return this.each((function(){var t=new oe(this,e);t.$=ne,ne(this).data("croppie",t)}))}}function oe(e,t){if(e.className.indexOf("croppie-container")>-1)throw new Error("Croppie: Can't initialize croppie more than once");if(this.element=e,this.options=l(p(oe.defaults),t),"img"===this.element.tagName.toLowerCase()){var i=this.element;c(i,"cr-original-image"),f(i,{"aria-hidden":"true",alt:""});var n=document.createElement("div");this.element.parentNode.appendChild(n),n.appendChild(i),this.element=n,this.options.url=this.options.url||i.src}if(w.call(this),this.options.url){var o={url:this.options.url,points:this.options.points};delete this.options.url,delete this.options.points,Q.call(this,o)}}return oe.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},resizeControls:{width:!0,height:!0},customClass:"",showZoomer:!0,enableZoom:!0,enableResize:!1,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,enableKeyMovement:!0,update:function(){}},oe.globals={translate:"translate3d"},l(oe.prototype,{bind:function(e,t){return Q.call(this,e,t)},get:function(){var e=J.call(this),t=e.points;return this.options.relative&&(t[0]/=this.elements.img.naturalWi
13dth/100,t[1]/=this.elements.img.naturalHeight/100,t[2]/=this.elements.img.naturalWidth/100,t[3]/=this.elements.img.naturalHeight/100),e},result:function(e){return G.call(this,e)},refresh:function(){return ee.call(this)},setZoom:function(e){F.call(this,e),u(this.elements.zoomer)},rotate:function(e){te.call(this,e)},destroy:function(){return ie.call(this)}}),oe})); 14//# sourceMappingURL=fileupload-bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.