!function(c){function e(e){for(var a,t,n=e[0],r=e[1],o=e[2],i=0,s=[];i'):"');return this.isValueOnly()?e+='\n
\n \n '.concat(a,"\n "):e+='\n
\n \n \n ').concat(a,"\n "),e+='\n \n \n
'}}]),a}(),u=function(){function e(){var t=this;o(this,e),l.on("input",'[data-grav-array-type="key"], [data-grav-array-type="value"]',function(e){return t.actionInput(e)}),l.on("click touch",'[data-grav-array-action]:not([data-grav-array-action="sort"])',function(e){return t.actionEvent(e)}),this.arrays=c()(),c()('[data-grav-field="array"]').each(function(e,a){return t.addArray(a)}),c()("body").on("mutation._grav",this._onAddedNodes.bind(this))}return s(e,[{key:"addArray",value:function(e){(e=c()(e)).find('[data-grav-array-type="container"]').each(function(e,a){(a=c()(a)).data("array-sort")||a[0].hasAttribute("data-array-nosort")||a.data("array-sort",new r.default(a.get(0),{handle:".fa-bars",animation:150}))})}},{key:"actionInput",value:function(e){var a=c()(e.target),t=a.data("grav-array-type");this._setTemplate(a);var n=a.data("array-template"),r="key"===t?a:a.siblings('[data-grav-array-type="key"]:first'),o="value"===t?a:a.siblings('[data-grav-array-type="value"]:first'),i=n.isValueOnly()?this.getIndexFor(a):r.val();i=i.toString().replace(/\[/g,"%5B").replace(/]/g,"%5D");var s="".concat(n.getName(),"[").concat(i,"]");n.isValueOnly()||r.val()||o.val()?o.attr("name",s):o.attr("name",""),this.refreshNames(n)}},{key:"actionEvent",value:function(e){e&&e.preventDefault();var a=c()(e.target),t=a.data("grav-array-action"),n=a.parents('[data-grav-array-type="container"]');this._setTemplate(a),this["".concat(t,"Action")](a);var r=n.find("> div");n[1 div > [data-grav-array-type="row"]'),t=a.find('[name]:not([name=""])');t.each(function(e,a){var t=(a=c()(a)).attr("name");t=t.replace(/\[\d+\]$/,"[".concat(e,"]")),a.attr("name",t)}),t.length||a.find('[data-grav-array-type="value"]').attr("name",e.getName())}}},{key:"getIndexFor",value:function(e){var a=e.data("array-template"),t=e.closest('[data-grav-array-type="row"]');return a.container.find("".concat(a.isValueOnly()?"> div ":"",' > [data-grav-array-type="row"]')).index(t)}},{key:"_setTemplate",value:function(e){e.data("array-template")||e.data("array-template",new d(e.closest("[data-grav-array-name]")))}},{key:"_onAddedNodes",value:function(e,a){var t=this,n=c()(a).find('[data-grav-field="array"]');n.length&&n.each(function(e,a){a=c()(a),~t.arrays.index(a)||t.addArray(a)})}}]),e}(),p=new u},"./app/fields/file.js": /*!****************************!*\ !*** ./app/fields/file.js ***! \****************************/ /*! exports provided: default, Instances */function(e,v,h){"use strict";h.r(v),function(s){h.d(v,"default",function(){return r}),h.d(v,"Instances",function(){return m});var e=h(/*! jquery */"jquery"),c=h.n(e),a=h(/*! dropzone */"./node_modules/dropzone/dist/dropzone.js"),i=h.n(a),l=h(/*! grav-form */"grav-form");function n(e,a){for(var t=0;t".concat(l.translations.PLUGIN_FORM.FILE_ERROR_UPLOAD," ").concat(e.name,"

\n
").concat(a.message,"
")})}},{key:"onDropzoneComplete",value:function(e){if(!e.accepted&&!e.rejected){var a={status:"error",message:"".concat(l.translations.PLUGIN_FORM.FILE_UNSUPPORTED,": ").concat(e.name.match(/\..+/).join(""))};return this.handleError({file:e,data:a,mode:"removeFile",msg:"

".concat(l.translations.PLUGIN_FORM.FILE_ERROR_ADD," ").concat(e.name,"

\n
").concat(a.message,"
")})}this.options.reloadPage&&s.location.reload()}},{key:"onDropzoneRemovedFile",value:function(e){var t=this;if(e.accepted&&!e.rejected){var a=this.container.closest("form"),n=a.find('[name="__unique_form_id__"]'),r=e.removeUrl||this.urls.delete||"".concat(location.href,".json"),o=(r||"").match(/path:(.*)\//),i=new FormData;i.append("filename",e.name),i.append("__form-name__",a.find('[name="__form-name__"]').val()),i.append("name",this.options.dotNotation),i.append("form-nonce",l.config.form_nonce),i.append("uri",this.getURI()),e.sessionParams&&(i.append("__form-file-remover__","1"),i.append("session",e.sessionParams)),n.length&&i.append("__unique_form_id__",n.val()),c.a.ajax({url:r,data:i,method:"POST",contentType:!1,processData:!1,success:function(){if(o){o=s.atob(o[1]);var e=t.container.find('[name][type="hidden"]'),a=JSON.parse(e.val()||"{}");delete a[o],e.val(JSON.stringify(a))}}})}}},{key:"onDropzoneError",value:function(e,a,t){var n=t&&a.error?a.error.message:a;return c()(e.previewElement).find("[data-dz-errormessage]").html(n),this.handleError({file:e,data:{status:"error"},msg:"
".concat(n,"
")})}},{key:"handleError",value:function(){return!0}}])&&n(e.prototype,a),t&&n(e,t),o}(),p=[],f=c()(),o=function(e){var a=(e=c()(e)).find('input[type="file"]'),o=e.data("grav-file-settings")||{};o.accept&&~o.accept.indexOf("*")&&(o.accept=[""]);var t={url:e.data("file-url-add")||(e.closest("form").attr("action")||l.config.current_url)+".json",paramName:o.paramName||"file",dotNotation:o.name||"file",acceptedFiles:o.accept?o.accept.join(","):a.attr("accept")||e.data("media-types"),maxFilesize:o.filesize||256,maxFiles:o.limit||null,resizeWidth:o.resizeWidth||null,resizeHeight:o.resizeHeight||null,resizeQuality:o.resizeQuality||null,accept:function(e,t){var n=o.resolution,r="";if(!n)return t();if(null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles)return t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e);var a=new FileReader;if(!n.min&&(o.resizeWidth||o.resizeHeight||!n.max))return t(r);a.onload=function(e){var a=new Image;a.src=e.target.result,a.onload=function(){var a=this;n.min&&Object.keys(n.min).forEach(function(e){a[e]n.max[e]&&(r+=l.translations.PLUGIN_FORM.RESOLUTION_MAX.replace(/{{attr}}/g,e).replace(/{{max}}/g,n.max[e]))}),t(r)}},a.readAsDataURL(e)}};f=f.add(e),e=e[0],p.push(new r({container:e,options:t}))},m=(c()(document).ready(function(){c()(".dropzone.files-upload").each(function(e,a){return o(a)}),c()("body").on("mutation._grav",t)}),p)}.call(this,h(/*! ./../../node_modules/webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"))},"./app/fields/form.js": /*!****************************!*\ !*** ./app/fields/form.js ***! \****************************/ /*! no exports provided */function(e,a,t){"use strict";t.r(a);var n=t(/*! jquery */"jquery"),s=t.n(n);s()(document).ready(function(){var e=s()("form").filter(function(e){return s()(e).find('[name="__form-name__"]')});e.length&&e.each(function(e,a){var t,n;t=a,n='[data-grav-field="toggleable"] input[type="checkbox"]',(t=s()(t)).on("change",n,function(e){var a=s()(e.target),n=a.is(":checked"),t=a.closest(".form-field"),r=t.find("label.toggleable"),o=t.find(".form-data"),i=o.find("input, select, textarea, button");r.add(o).css("opacity",n?"":.7),i.map(function(e,a){var t=a.selectize;a=s()(a),t?t[n?"enable":"disable"]():a.prop("disabled",!n)})}),t.find(n).trigger("change"),function(e){e=s()(e);var a=[];["input","select","label[for]","textarea",".selectize-control"].forEach(function(e){a.push("".concat(".form-field-toggleable .form-data"," ").concat(e))}),e.on("mousedown",a.join(", "),function(e){var a=s()(e.target),t=a.prop("for"),n=(a.hasClass("selectize-control")||a.parents(".selectize-control")).length;if(t&&(a=s()('[id="'.concat(t,'"]'))),n&&(a=a.closest(".selectize-control").siblings("select[name]")),!a.prop("disabled"))return!0;a.closest(".form-field").find('[data-grav-field="toggleable"] input[type="checkbox"]').trigger("click")})}(a)})})},"./app/fields/index.js": /*!*****************************!*\ !*** ./app/fields/index.js ***! \*****************************/ /*! exports provided: default */function(e,a,t){"use strict";t.r(a);t(/*! ./form */"./app/fields/form.js");var n=t(/*! ./file */"./app/fields/file.js"),r=t(/*! ./array */"./app/fields/array.js"),o=t(/*! ./media */"./app/fields/media.js");t(/*! ./tabs */"./app/fields/tabs.js");a.default={FileInstances:n.default,ArrayInstances:r.default,Media:{PageMedia:o.default,PageMediaInstances:o.Instance}}},"./app/fields/media.js": /*!*****************************!*\ !*** ./app/fields/media.js ***! \*****************************/ /*! exports provided: default, Instance */function(e,l,y){"use strict";y.r(l),function(s){y.d(l,"default",function(){return a}),y.d(l,"Instance",function(){return c});var e=y(/*! jquery */"jquery"),d=y.n(e),n=y(/*! ./file */"./app/fields/file.js"),u=y(/*! grav-form */"grav-form"),p=y(/*! sortablejs */"./node_modules/sortablejs/modular/sortable.esm.js");function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,a){for(var t=0;t').concat(u.translations.PLUGIN_FORM.DELETE,"\n
").trim(),a=function(){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&v(e,a)}(l,n["default"]);var e,a,t,c=i(l);function l(){var t,e=0