!function(){"use strict";var t=window.ctFrontend;const e=function(t){const e=new ClipboardEvent("").clipboardData||new DataTransfer;for(const n of t)e.items.add(n);return e.files};let n=[];(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_advanced_reviews",{mount:function(t,{event:r}){const c=t.closest("form");if(!c)return;c.enctype="multipart/form-data";const o=t.files,i=document.querySelector(".ct-review-upload-actions");i.querySelectorAll(".ct-media-container").forEach(function(t){t.remove()});const a=r.bubbles?[...n,...Array.from(o)]:n;n=a,t.files=e(a),a.length>0&&a.forEach(function(r,c){const o=URL.createObjectURL(r),s=document.createElement("figure");s.classList.add("ct-media-container"),s.innerHTML=`\n\t\t\t\t\t<img src="${o}" style="aspect-ratio: 1/1" alt="Review Image">\n\t\t\t\t\t<span class="ct-remove-image">\n\t\t\t\t\t\t<svg width="10" height="10" viewBox="0 0 15 15" fill="currentColor">\n\t\t\t\t\t\t\t<path d="M8.5,7.5l4.5,4.5l-1,1L7.5,8.5L3,13l-1-1l4.5-4.5L2,3l1-1l4.5,4.5L12,2l1,1L8.5,7.5z"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t`,i.insertBefore(s,i.querySelector('[for="blc-review-images"]'));s.querySelector(".ct-remove-image").addEventListener("click",function(){s.remove();const r=a.filter(function(t,e){return e!==c});t.files=e(r),n=r,t.dispatchEvent(new Event("change"))})})}})}();